SHARE
TWEET

IP-Lookup

DSTAT Jul 24th, 2017 (edited) 1,006 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2. rem Paste this code into notepad and save it as IP-Lookup.bat
  3. Rem Coded by @DDoS_Filter on instagram.
  4. title IP Lookup
  5. color 34
  6. mode con lines=12 cols=70
  7. setlocal ENABLEDELAYEDEXPANSION
  8. set webclient=webclient
  9. del "%temp%\%webclient%.vbs" /f /q /s >nul
  10. del "%temp%\response.txt" /f /q /s >nul
  11. :menu
  12. cls
  13. echo Coded by @DDoS_Filter
  14. echo                       What would you like to do?
  15. echo.
  16. echo                            View your IP: (1)
  17. echo.
  18. echo                            Lookup an IP: (2)
  19. echo.
  20. goto action
  21. :input
  22. echo.
  23. echo Please enter a valid input option.
  24. echo.
  25. :action
  26. echo.
  27. set /p action=Type your choice. 1,2:
  28. if '%action%'=='1' echo sUrl = "http://ipinfo.io/json" > %temp%\%webclient%.vbs & goto localip
  29. if '%action%'=='2' goto iplookup
  30. goto input
  31. :iplookup
  32. cls
  33. echo.
  34. echo                          Type an IP to lookup
  35. echo.
  36. set ip=127.0.0.1
  37. set /p ip=IP:
  38. echo sUrl = "http://ipinfo.io/%ip%/json" > %temp%\%webclient%.vbs
  39. :localip
  40. cls
  41. echo set oHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0") >> %temp%\%webclient%.vbs
  42. echo oHTTP.open "GET", sUrl,false >> %temp%\%webclient%.vbs
  43. echo oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" >> %temp%\%webclient%.vbs
  44. echo oHTTP.setRequestHeader "Content-Length", Len(sRequest) >> %temp%\%webclient%.vbs
  45. echo oHTTP.send sRequest >> %temp%\%webclient%.vbs
  46. echo HTTPGET = oHTTP.responseText >> %temp%\%webclient%.vbs
  47. echo strDirectory = "%temp%\response.txt" >> %temp%\%webclient%.vbs
  48. echo set objFSO = CreateObject("Scripting.FileSystemObject") >> %temp%\%webclient%.vbs
  49. echo set objFile = objFSO.CreateTextFile(strDirectory) >> %temp%\%webclient%.vbs
  50. echo objFile.Write(HTTPGET) >> %temp%\%webclient%.vbs
  51. echo objFile.Close >> %temp%\%webclient%.vbs
  52. rem echo Msgbox HTTPGET,vbSystemModal+vbOKOnly+vbInformation, "IP Info" >> %temp%\%webclient%.vbs
  53. echo Wscript.Quit >> %temp%\%webclient%.vbs
  54. start %temp%\%webclient%.vbs
  55. set /a requests=0
  56. echo.
  57. rem echo Waiting for API response. . .
  58. echo  Looking up IP Address. . .
  59. :checkresponseexists
  60. set /a requests=%requests% + 1
  61. if %requests% gtr 7 goto failed
  62. IF EXIST "%temp%\response.txt" (
  63. goto response_exist
  64. ) ELSE (
  65. ping 127.0.0.1 -n 2 -w 1000 >nul
  66. goto checkresponseexists
  67. )
  68. :failed
  69. taskkill /f /im wscript.exe >nul
  70. del "%temp%\%webclient%.vbs" /f /q /s >nul
  71. echo.
  72. echo Did not receive a response from the API.
  73. echo.
  74. pause
  75. goto menu
  76. :response_exist
  77. cls
  78. echo.
  79. for /f "delims=     " %%i in ('findstr /i "ip hostname org city region country postal loc" %temp%\response.txt') do (
  80.     set data=%%i
  81.     set data=!data:,=!
  82.     set data=!data:""=Not Listed!
  83.     set data=!data:"=!
  84.     set data=!data:ip:=IP:      !
  85.     set data=!data:hostname:=Hostname:  !
  86.     set data=!data:org:=ISP:        !
  87.     set data=!data:city:=City:      !
  88.     set data=!data:region:=State:   !
  89.     set data=!data:country:=Country:    !
  90.     set data=!data:postal:=Postal:  !
  91.     set data=!data:loc:=Location:   !
  92.     set data=!data:readme: https://ipinfo.io/missingauth=. . .!
  93.     echo !data!
  94. )
  95. echo.
  96. del "%temp%\%webclient%.vbs" /f /q /s >nul
  97. del "%temp%\response.txt" /f /q /s >nul
  98. pause
  99. if '%ip%'=='' goto menu
  100. goto iplookup
  101. exit
  102. Rem Coded by DSTAT. Instagram: @DDoS_Filter
  103. Rem http://ddosfilter.net/
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top