From 73720e2623539c1966c5333cfa1ea767063b1cc6 Mon Sep 17 00:00:00 2001 From: karanS08 <66710785+karanS08@users.noreply.github.com> Date: Tue, 25 Jan 2022 10:26:48 +0530 Subject: [PATCH 1/3] locate ip --- .../IP-locator/Ip-locator.py | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 EthicalHackingScripts/IP-locator/Ip-locator.py 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) From ff7040c76bcd2c1a7839e0d7f459b7a55f758859 Mon Sep 17 00:00:00 2001 From: karanS08 <66710785+karanS08@users.noreply.github.com> Date: Tue, 25 Jan 2022 10:27:40 +0530 Subject: [PATCH 2/3] Add files via upload --- EthicalHackingScripts/IP-locator/ReadME.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 EthicalHackingScripts/IP-locator/ReadME.md diff --git a/EthicalHackingScripts/IP-locator/ReadME.md b/EthicalHackingScripts/IP-locator/ReadME.md new file mode 100644 index 000000000..412e76dea --- /dev/null +++ b/EthicalHackingScripts/IP-locator/ReadME.md @@ -0,0 +1 @@ +I 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. \ No newline at end of file From b2926f0cc2b37bfb4671afb06c6d2fa6d8fe3463 Mon Sep 17 00:00:00 2001 From: karanS08 <66710785+karanS08@users.noreply.github.com> Date: Tue, 25 Jan 2022 10:41:03 +0530 Subject: [PATCH 3/3] Update ReadME.md --- EthicalHackingScripts/IP-locator/ReadME.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/EthicalHackingScripts/IP-locator/ReadME.md b/EthicalHackingScripts/IP-locator/ReadME.md index 412e76dea..404745626 100644 --- a/EthicalHackingScripts/IP-locator/ReadME.md +++ b/EthicalHackingScripts/IP-locator/ReadME.md @@ -1 +1,17 @@ -I 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. \ No newline at end of file +#### 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