-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathip_info.py
83 lines (73 loc) · 2.93 KB
/
ip_info.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/python3
from colorama import Fore
from colorama import init
init(autoreset = True)
import requests
import ipinfo, random , sys , time
class Whois_Ip(object):
def __init__(self, ip):
self.ip = ip
# pass
def token(self):
token =random.choice(['2111c655baec9d', '4739a4a4d565ae',
'f27228a07e8887', '4d1d7f0646f6a5',
'd9feb34c01672a','7086838867b4f0',
'ee44d553cc8fd4', 'e0d0d5c26a960e',
'7c9b5904191f80', '760ba3b2eac4b4'])
return token
banner_t = """
+++++++++++++++++++++++++++++++++++++++++++++++++++++
# Ip_Info #
# Version 0.1 #
# Ip_info : https://github.com/reza-tanha/ #
# Telegram : T.me/S3CURITY_GARY #
# Youtube : https://bit.ly/2yas3rm #
# Code By : Haji (Reza) #
# #
# Gray Security Team #
+++++++++++++++++++++++++++++++++++++++++++++++++++++
"""
def banner(self):
for x in self.banner_t:
print(Fore.LIGHTYELLOW_EX+x, end='', flush=True)
time.sleep(0.0003)
print()
def whois_ip(self):
handler = ipinfo.getHandler(self.token())
handler = ipinfo.getHandler(self.token())
details = handler.getDetails(self.ip)
x_details = details.all
for key, value in x_details.items():
if type(value) is dict:
for k , v in value.items():
print(Fore.GREEN + k + Fore.RED + " : ", Fore.CYAN + v)
time.sleep(0.1)
else:
print(Fore.GREEN+key+Fore.RED+" : ",Fore.CYAN+value)
time.sleep(0.1)
try:
a = details.latitude
b = details.longitude
map_1 = "https://www.google.com/maps/place/"+a+b+"/@"+a+","+b
except:
pass
count = 0
your_ip = None
while count < 12 and not your_ip:
count += 1
try:
r = requests.post("https://cleanuri.com/api/v1/shorten",data={"url": map_1})
map = r.json()['result_url']
print(Fore.GREEN + "Google Map location : " + Fore.CYAN + map)
break
except:
print(Fore.RED + "[*] Not Found Google Map location Pleaas Waiting ")
if __name__ == '__main__':
if len(sys.argv) == 2:
w = Whois_Ip(sys.argv[1])
w.banner()
w.whois_ip()
else:
w = Whois_Ip('0.0.0.0')
w.banner()
print(Fore.LIGHTCYAN_EX+ "\t\tusage : python3 who-ip.py 0.0.0.0\n\n")