Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a new python script #1084

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions EthicalHackingScripts/IP-locator/Ip-locator.py
Original file line number Diff line number Diff line change
@@ -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)
17 changes: 17 additions & 0 deletions EthicalHackingScripts/IP-locator/ReadME.md
Original file line number Diff line number Diff line change
@@ -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