Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem Paste this code into notepad and save it as IP-Lookup.bat
- rem Coded by @DDoS_Filter on instagram.
- rem http://ddosfilter.net/
- title IP Lookup
- color 0A
- mode con lines=13 cols=70
- setlocal ENABLEDELAYEDEXPANSION
- set webclient=webclient
- if exist "%temp%\%webclient%.vbs" del "%temp%\%webclient%.vbs" /f /q /s >nul
- if exist "%temp%\response.txt" del "%temp%\response.txt" /f /q /s >nul
- :menu
- cls
- echo Coded by @DDoS_Filter
- echo.
- echo.
- echo What would you like to do?
- echo.
- echo View your IP: (1)
- echo.
- echo Lookup an IP: (2)
- echo.
- echo.
- echo.
- goto action
- :input
- echo.
- echo Please enter a valid input option.
- echo.
- :action
- echo.
- set /p action=Type your choice. 1,2:
- if '%action%'=='1' echo sUrl = "http://ipinfo.io/json" > %temp%\%webclient%.vbs & goto localip
- if '%action%'=='2' goto iplookup
- goto input
- :iplookup
- cls
- echo.
- echo Type an IP to lookup
- echo.
- set ip=127.0.0.1
- set /p ip=IP:
- echo sUrl = "http://ipinfo.io/%ip%/json" > %temp%\%webclient%.vbs
- :localip
- cls
- echo set oHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0") >> %temp%\%webclient%.vbs
- echo oHTTP.open "GET", sUrl,false >> %temp%\%webclient%.vbs
- echo oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" >> %temp%\%webclient%.vbs
- echo oHTTP.setRequestHeader "Content-Length", Len(sRequest) >> %temp%\%webclient%.vbs
- echo oHTTP.send sRequest >> %temp%\%webclient%.vbs
- echo HTTPGET = oHTTP.responseText >> %temp%\%webclient%.vbs
- echo strDirectory = "%temp%\response.txt" >> %temp%\%webclient%.vbs
- echo set objFSO = CreateObject("Scripting.FileSystemObject") >> %temp%\%webclient%.vbs
- echo set objFile = objFSO.CreateTextFile(strDirectory) >> %temp%\%webclient%.vbs
- echo objFile.Write(HTTPGET) >> %temp%\%webclient%.vbs
- echo objFile.Close >> %temp%\%webclient%.vbs
- echo Wscript.Quit >> %temp%\%webclient%.vbs
- start %temp%\%webclient%.vbs
- set /a requests=0
- echo.
- rem echo Waiting for API response. . .
- echo Looking up IP Address. . .
- :checkresponseexists
- set /a requests=%requests% + 1
- if %requests% gtr 7 goto failed
- IF EXIST "%temp%\response.txt" (
- goto response_exist
- ) ELSE (
- ping 127.0.0.1 -n 2 -w 1000 >nul
- goto checkresponseexists
- )
- :failed
- taskkill /f /im wscript.exe >nul
- del "%temp%\%webclient%.vbs" /f /q /s >nul
- echo.
- echo Did not receive a response from the API.
- echo.
- pause
- goto menu
- :response_exist
- cls
- echo.
- for /f "delims= " %%i in ('findstr /i "," %temp%\response.txt') do (
- set data=%%i
- set data=!data:,=!
- set data=!data:""=Not Listed!
- set data=!data:"=!
- set data=!data:ip:=IP: !
- set data=!data:hostname:=Hostname: !
- set data=!data:org:=ISP: !
- set data=!data:city:=City: !
- set data=!data:region:=State: !
- set data=!data:country:=Country: !
- set data=!data:postal:=Postal: !
- set data=!data:loc:=Location: !
- set data=!data:timezone:=Timezone: !
- echo !data!
- )
- echo.
- del "%temp%\%webclient%.vbs" /f /q /s >nul
- del "%temp%\response.txt" /f /q /s >nul
- pause
- if '%ip%'=='' goto menu
- goto iplookup
- Rem Coded by DSTAT. Instagram: @DDoS_Filter
- Rem http://ddosfilter.net/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement