-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathusage.py
32 lines (23 loc) · 789 Bytes
/
usage.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
#!/usr/bin/env python3
from ZoomEye import ZoomEye
import signal
def signal_handler(signal, frame):
print('Aborting..')
quit()
signal.signal(signal.SIGINT, signal_handler)
if __name__ == "__main__":
zm = ZoomEye("memcached +port:'11211'", "YOUR_ZOOMEYE_EMAIL", "YOUR_ZOOMEYE_PASSWORD", page=1, verbose=True)
resource = zm.resource_info()
print("Search hits remaining: %s" % resource)
try:
token = zm.login()
while 1:
result = zm.next_page()
if not result:
print("EOF")
quit()
for item in result:
print("%s:%s (%s)" % (item["ip"], item["port"], item["country"]))
except ConnectionError as err:
print("Connection error: %s" % err)
quit()