[Release] [Source] GeoIP Tools 09-29-2013, 09:05 PM
#1
Hello, I'll just briefly dump a module I wrote for my RAT. If you have any questions about this, just post them in this thread and I'll reply as fast as humanly possible. Use this piece of code however you want.
Pastebin: http://pastebin.com/VcJtUv5i
Here's a little bonus module: http://pastebin.com/WPc2Vn7i
Code:
'Credits:
' SQLi - The .NET Module
' FreeGeoIP.net - Public GeoIP API
' GeoJoe.co.uk - Flag hosting
Imports System.Net, System.Xml, System.IO
Public Module GeoTools
Private Source$ = "http://freegeoip.net/xml/"
Private Function DownloadData(ByVal URL$) As Byte()
Using Client As New WebClient
With Client
.Proxy = Nothing
Return .DownloadData(URL)
End With
End Using
End Function
Private Function DownloadString(ByVal URL$) As String
Using Client As New WebClient
With Client
.Proxy = Nothing
Return .DownloadString(URL)
End With
End Using
End Function
Private Function LoadXML(ByVal Str$) As XmlDocument
Dim XML As New XmlDocument()
XML.LoadXml(DownloadString(Str))
Return XML
End Function
Public Function GetFlag(ByVal IP$) As Image
Dim URL$ = "http://www.geojoe.co.uk/api/flag/?ip=" & IP
Using Stream As New IO.MemoryStream(DownloadData(URL))
Return Image.FromStream(Stream)
End Using
End Function
Public Function GetCountryCode(ByVal IP$) As String
Return LoadXML(Source & IP).SelectSingleNode("Response/CountryCode").InnerText
End Function
Public Function GetCountry(ByVal IP$) As String
Return LoadXML(Source & IP).SelectSingleNode("Response/CountryName").InnerText
End Function
Public Function GetRegionCode(ByVal IP$) As String
Return LoadXML(Source & IP).SelectSingleNode("Response/RegionCode").InnerText
End Function
Public Function GetRegionName(ByVal IP$) As String
Return LoadXML(Source & IP).SelectSingleNode("Response/RegionName").InnerText
End Function
Public Function GetCity(ByVal IP$) As String
Return LoadXML(Source & IP).SelectSingleNode("Response/City").InnerText
End Function
Public Function GetLatitude(ByVal IP$) As String
Return LoadXML(Source & IP).SelectSingleNode("Response/Latitude").InnerText
End Function
Public Function GetLongitude(ByVal IP$) As String
Return LoadXML(Source & IP).SelectSingleNode("Response/Longitude").InnerText
End Function
End ModulePastebin: http://pastebin.com/VcJtUv5i
Here's a little bonus module: http://pastebin.com/WPc2Vn7i
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)