-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshowme.py
59 lines (50 loc) · 2.16 KB
/
showme.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
#Author:sidious
import sys
import dns.resolver
from shodan import Shodan
def banner():
print("""
███████╗██╗ ██╗ ██████╗ ██╗ ██╗███╗ ███╗███████╗
██╔════╝██║ ██║██╔═══██╗██║ ██║████╗ ████║██╔════╝
███████╗███████║██║ ██║██║ █╗ ██║██╔████╔██║█████╗
╚════██║██╔══██║██║ ██║██║███╗██║██║╚██╔╝██║██╔══╝
███████║██║ ██║╚██████╔╝╚███╔███╔╝██║ ╚═╝ ██║███████╗
╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚══════╝
-sidious-
Type exit to quit.
""")
SHODAN_API_KEY = "API-KEY-HERE"
def iplookup():
nslook = input("Enter domain: ")
if nslook == "exit":
sys.exit()
else:
pass
result = dns.resolver.resolve(f'{nslook}', 'A')
for ipval in result:
iplookup.output = ipval.to_text()
def showd():
api = Shodan(SHODAN_API_KEY)
host = api.host(iplookup.output)
print("\n[IP]: {}".format(host['ip_str']))
for item in host['data']:
print("[Open Port]: {}".format(item['port'], item['data']))
print("[Operating System]:",host['data'][0]['os'])
print("[Organization]: {}".format(host.get('org')))
print("[City]: {}".format(host.get('city')))
print()
if __name__ == '__main__':
banner()
while (True):
try:
iplookup()
except Exception as error:
print("IP lookup failed.. Please check domain..!")
continue
except KeyboardInterrupt:
print("\nExited by user..")
sys.exit()
try:
showd()
except Exception as error:
print("Shodan API not available...")