-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
39 lines (30 loc) · 1.14 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import requests
from pyfiglet import Figlet
import folium
def get_info_by_ip(ip="127.0.0.1"):
try:
response = requests.get(url=f"http://ip-api.com/json/{ip}").json()
information = {
"[IP]": response.get('query'),
"[Int prov]": response.get('isp'),
"[Org]": response.get('org'),
"[Country]": response.get('country'),
"[Region name]": response.get("regionName"),
"[City]": response.get('city'),
"[ZIP]": response.get('zip'),
"[Lat]": response.get('lat'),
"[Lon]": response.get('lon')
}
for k, v in information.items():
print(f"{k} : {v}")
area = folium.Map(location=[response.get('lat'), response.get('lon')])
area.save(f"{response.get('query')}_{response.get('city')}.html")
except requests.exceptions.ConnectionError:
print("[!] Please check your connection [!]")
def main():
preview = Figlet(font='slant')
print(preview.renderText('WELCOME'))
ip = input("Please enter a target IP: ")
get_info_by_ip(ip=ip)
if __name__ == "__main__":
main()