diff --git a/EthicalHackingScripts/IP-locator/Ip-locator.py b/EthicalHackingScripts/IP-locator/Ip-locator.py new file mode 100644 index 000000000..a31aa88d1 --- /dev/null +++ b/EthicalHackingScripts/IP-locator/Ip-locator.py @@ -0,0 +1,54 @@ +#usr/bin/env python + +import requests + + +user_in = input("Enter the ip Address : ") +url_gen = 'http://ip-api.com/json/'+ user_in + +print(url_gen) + +ip_data = None + +try: + ip_data = requests.get(url_gen) +except: + + print("Please! Check your internet connection") + +if (ip_data != None): + r = requests.get(url_gen) + file = r.json() + + country = file['country'] + countryCode = file['countryCode'] + region = file['region' ] + regionName = file['regionName'] + city = file['city'] + zip_ = file['zip'] + lat = file['lat'] + lon = file['lon'] + timezone = file['timezone'] + isp = file['isp'] + org = file['org'] + + print(''' + + + ................_script copyright Karan Sharma_................ + + + country = {0} \n + countryCode = {1} \n + region = {2} \n + regionName = {3}\n + city = {4}\n + zip = {5}\n + lat = {6}\n + lon = {7}\n + timezone = {8}\n + isp = {9}\n + '''.format(country,countryCode,region,regionName,city,zip_,lat,lon,timezone,isp) + ) + + print(url_gen) diff --git a/EthicalHackingScripts/IP-locator/ReadME.md b/EthicalHackingScripts/IP-locator/ReadME.md new file mode 100644 index 000000000..404745626 --- /dev/null +++ b/EthicalHackingScripts/IP-locator/ReadME.md @@ -0,0 +1,17 @@ +#### It is a simple IP locator which takes ip address from the user and makes an API call to ip-api.com and displays the information to you. +# Prerequisites +#### Python requests module + + +# HOW TO INSTALL + + +### Windows- +``` +pip install requests +``` + +### Linux - +``` +sudo pip install --upgrade pip +pip install requests