· 6 years ago · Oct 27, 2019, 09:44 PM
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4import requests
5import json
6import os
7import signal
8
9# shodansploit v1.0.0
10
11searchploit_txt = """
12 _ _ _ _ _
13 ___| |__ ___ __| | __ _ _ __ ___ _ __ | | ___ (_) |_
14 / __| '_ \ / _ \ / _` |/ _` | '_ \/ __| '_ \| |/ _ \| | __|
15 \__ \ | | | (_) | (_| | (_| | | | \__ \ |_) | | (_) | | |_
16 |___/_| |_|\___/ \__,_|\__,_|_| |_|___/ .__/|_|\___/|_|\__|
17 |_| v1.2.0
18 Author : Ismail Tasdelen
19 GitHub : github.com/ismailtasdelen
20 Linkedin : linkedin.com/in/ismailtasdelen
21 Twitter : twitter.com/ismailtsdln
22"""
23
24shodansploit_menu_txt = """
25[1] GET > /shodan/host/{ip}
26[2] GET > /shodan/host/count
27[3] GET > /shodan/host/search
28[4] GET > /shodan/host/search/tokens
29[5] GET > /shodan/ports
30
31[6] GET > /shodan/exploit/author
32[7] GET > /shodan/exploit/cve
33[8] GET > /shodan/exploit/msb
34[9] GET > /shodan/exploit/bugtraq-id
35[10] GET > /shodan/exploit/osvdb
36[11] GET > /shodan/exploit/title
37[12] GET > /shodan/exploit/description
38[13] GET > /shodan/exploit/date
39[14] GET > /shodan/exploit/code
40[15] GET > /shodan/exploit/platform
41[16] GET > /shodan/exploit/port
42
43[17] GET > /dns/resolve
44[18] GET > /dns/reverse
45[19] GET > /labs/honeyscore/{ip}
46
47[20] GET > /account/profile
48[21] GET > /tools/myip
49[22] GET > /tools/httpheaders
50[23] GET > /api-info
51
52[24] Exit
53"""
54
55if os.path.exists("./api.txt") and os.path.getsize("./api.txt") > 0:
56 with open('api.txt', 'r') as file:
57 shodan_api=file.readline().rstrip('\n')
58else:
59 file = open('api.txt', 'w')
60 shodan_api = "99pGzkCnJDMtjG6rKDhlHtspQM7925bN"
61 file.write(shodan_api)
62 print('[~] File written: ./api.txt')
63 file.close()
64
65def signal_handler(signal, frame):
66 print("\nExiting...\n")
67 exit()
68
69def shodan_host_ip():
70 host_ip = raw_input("Shodan Host Search : ")
71 url = "https://api.shodan.io/shodan/host/"+ host_ip +"?key=" + shodan_api
72 request = requests.get(url)
73 txt = request.text
74 parsed = json.loads(txt)
75 print (json.dumps(parsed, indent=2, sort_keys=True))
76
77def shodan_count_search():
78 host_search = raw_input("Shodan Host Search : ")
79 url = "https://api.shodan.io/shodan/host/count?key="+ shodan_api +"&query=" + host_search
80 request = requests.get(url)
81 txt = request.text
82 parsed = json.loads(txt)
83 print (json.dumps(parsed, indent=2, sort_keys=True))
84
85def host_search():
86 host_search = raw_input("Shodan Host Search : ")
87 url = "https://api.shodan.io/shodan/host/search?key="+ shodan_api +"&query=" + host_search
88 request = requests.get(url)
89 txt = request.text
90 parsed = json.loads(txt)
91 print (json.dumps(parsed, indent=2, sort_keys=True))
92
93def shodan_token_search():
94 token_search = raw_input("Shodan Token Search : ")
95 url = "https://api.shodan.io/shodan/host/search/tokens?key="+ shodan_api +"&query=" + token_search
96 request = requests.get(url)
97 txt = request.text
98 parsed = json.loads(txt)
99 print (json.dumps(parsed, indent=2, sort_keys=True))
100
101def shodan_ports():
102 url = "https://api.shodan.io/shodan/ports?key=" + shodan_api
103 request = requests.get(url)
104 txt = request.text
105 parsed = json.loads(txt)
106 print (json.dumps(parsed, indent=2, sort_keys=True))
107
108def shodan_dns_lookup():
109 hostnames = raw_input("DNS Lookup : ")
110 url = "https://api.shodan.io/dns/resolve?hostnames="+ hostnames +"&key=" + shodan_api
111 request = requests.get(url)
112 txt = request.text
113 parsed = json.loads(txt)
114 print (json.dumps(parsed, indent=2, sort_keys=True))
115
116def shodan_dns_reverse():
117 ips = raw_input("DNS Reverse : ")
118 url = "https://api.shodan.io/dns/reverse?ips="+ ips +"&key=" + shodan_api
119 request = requests.get(url)
120 txt = request.text
121 parsed = json.loads(txt)
122 print (json.dumps(parsed, indent=2, sort_keys=True))
123
124def shodan_honeyscore():
125 honeypot = raw_input("DNS Reverse : ")
126 url = "https://api.shodan.io/labs/honeyscore/"+ ips +"&key=" + shodan_api
127 request = requests.get(url)
128 txt = request.text
129 parsed = json.loads(txt)
130 print (json.dumps(parsed, indent=2, sort_keys=True))
131
132def shodan_profile():
133 url = "https://api.shodan.io/account/profile?key=" + shodan_api
134 request = requests.get(url)
135 txt = request.text
136 parsed = json.loads(txt)
137 print (json.dumps(parsed, indent=2, sort_keys=True))
138
139def shodan_myip():
140 url = "https://api.shodan.io/tools/myip?key=" + shodan_api
141 request = requests.get(url)
142 txt = request.text
143 parsed = json.loads(txt)
144 print (json.dumps(parsed, indent=2, sort_keys=True))
145
146def shodan_httpheaders():
147 url = "https://api.shodan.io/tools/httpheaders?key=" + shodan_api
148 request = requests.get(url)
149 txt = request.text
150 parsed = json.loads(txt)
151 print (json.dumps(parsed, indent=2, sort_keys=True))
152
153def shodan_api_info():
154 url = "https://api.shodan.io/api-info?key=" + shodan_api
155 request = requests.get(url)
156 txt = request.text
157 parsed = json.loads(txt)
158 print (json.dumps(parsed, indent=2, sort_keys=True))
159
160def shodan_exploit_author():
161 exploit_author = raw_input("Exploit Author : ")
162 url = "https://exploits.shodan.io/api/search?query="+ "author:" + exploit_author +"&key=" + shodan_api
163 request = requests.get(url)
164 txt = request.text
165 parsed = json.loads(txt)
166 print (json.dumps(parsed, indent=2, sort_keys=True))
167
168def shodan_exploit_cve():
169 exploit_cve = raw_input("Exploit CVE : ")
170 url = "https://exploits.shodan.io/api/search?query="+ "cve:" + exploit_cve +"&key=" + shodan_api
171 request = requests.get(url)
172 txt = request.text
173 parsed = json.loads(txt)
174 print (json.dumps(parsed, indent=2, sort_keys=True))
175
176def shodan_exploit_msb():
177 exploit_msb = raw_input("Exploit Microsoft Security Bulletin ID : ")
178 url = "https://exploits.shodan.io/api/search?query="+ "msb:" + exploit_msb +"&key=" + shodan_api
179 request = requests.get(url)
180 txt = request.text
181 parsed = json.loads(txt)
182 print (json.dumps(parsed, indent=2, sort_keys=True))
183
184def shodan_exploit_bid():
185 exploit_bid = raw_input("Exploit Bugtraq ID : ")
186 url = "https://exploits.shodan.io/api/search?query="+ "bid:" + exploit_bid +"&key=" + shodan_api
187 request = requests.get(url)
188 txt = request.text
189 parsed = json.loads(txt)
190 print (json.dumps(parsed, indent=2, sort_keys=True))
191
192def shodan_exploit_osvdb():
193 exploit_osvdb = raw_input("Exploit Open Source Vulnerability Database ID : ")
194 url = "https://exploits.shodan.io/api/search?query="+ "osvdb:" + exploit_osvdb +"&key=" + shodan_api
195 request = requests.get(url)
196 txt = request.text
197 parsed = json.loads(txt)
198 print (json.dumps(parsed, indent=2, sort_keys=True))
199
200def shodan_exploit_title():
201 exploit_title = raw_input("Exploit Title : ")
202 url = "https://exploits.shodan.io/api/search?query="+ "title:" + exploit_title +"&key=" + shodan_api
203 request = requests.get(url)
204 txt = request.text
205 parsed = json.loads(txt)
206 print (json.dumps(parsed, indent=2, sort_keys=True))
207
208def shodan_exploit_description():
209 exploit_description = raw_input("Exploit Description : ")
210 url = "https://exploits.shodan.io/api/search?query="+ "description:" + exploit_description +"&key=" + shodan_api
211 request = requests.get(url)
212 txt = request.text
213 parsed = json.loads(txt)
214 print (json.dumps(parsed, indent=2, sort_keys=True))
215
216def shodan_exploit_date():
217 exploit_date = raw_input("Exploit Date : ")
218 url = "https://exploits.shodan.io/api/search?query="+ "description:" + exploit_date +"&key=" + shodan_api
219 request = requests.get(url)
220 txt = request.text
221 parsed = json.loads(txt)
222 print (json.dumps(parsed, indent=2, sort_keys=True))
223
224def shodan_exploit_code():
225 exploit_code = raw_input("Exploit Code : ")
226 url = "https://exploits.shodan.io/api/search?query="+ "code:" + exploit_code +"&key=" + shodan_api
227 request = requests.get(url)
228 txt = request.text
229 parsed = json.loads(txt)
230 print (json.dumps(parsed, indent=2, sort_keys=True))
231
232def shodan_exploit_platform():
233 exploit_platform = raw_input("Exploit Platform : ")
234 url = "https://exploits.shodan.io/api/search?query="+ "platform:" + exploit_platform +"&key=" + shodan_api
235 request = requests.get(url)
236 txt = request.text
237 parsed = json.loads(txt)
238 print (json.dumps(parsed, indent=2, sort_keys=True))
239
240def shodan_exploit_port():
241 exploit_platform = raw_input("Exploit Port : ")
242 url = "https://exploits.shodan.io/api/search?query="+ "port:" + exploit_platform +"&key=" + shodan_api
243 request = requests.get(url)
244 txt = request.text
245 parsed = json.loads(txt)
246 print (json.dumps(parsed, indent=2, sort_keys=True))
247
248def shodansploit_exit():
249 exit()
250
251def pause():
252 programPause = raw_input("\nPress the <ENTER> key to continue...")
253
254# Author : Ismail Tasdelen
255# GitHub : https://github.com/ismailtasdelen/
256# Linkedin : https://www.linkedin.com/in/ismailtasdelen/
257# Twitter : https://twitter.com/ismailtsdln/
258
259
260# multi function use
261
262def run(shodan_host_ip,host_search,shodan_token_search,shodan_ports,shodan_dns_lookup,shodan_count_search,
263 shodan_dns_reverse,shodan_honeyscore,shodan_profile,shodan_myip,shodan_httpheaders,shodan_api_info,
264 shodan_exploit_author,shodan_exploit_cve,shodan_exploit_msb,shodan_exploit_bid,shodan_exploit_osvdb,
265 shodan_exploit_title,shodan_exploit_description,shodan_exploit_date,shodan_exploit_code,
266 shodan_exploit_platform,shodan_exploit_port,shodansploit_exit):
267
268 choice = input("Which option number : ")
269
270 if choice == 1:
271 shodan_host_ip()
272
273 elif choice == 2:
274 shodan_count_search()
275
276 elif choice == 3:
277 host_search()
278
279 elif choice == 4:
280 shodan_token_search()
281
282 elif choice == 5:
283 shodan_ports()
284
285 elif choice == 6:
286 shodan_exploit_author()
287
288 elif choice == 7:
289 shodan_exploit_cve()
290
291 elif choice == 8:
292 shodan_exploit_msb()
293
294 elif choice == 9:
295 shodan_exploit_bid()
296
297 elif choice == 10:
298 shodan_exploit_osvdb()
299
300 elif choice == 11:
301 shodan_exploit_title()
302
303 elif choice == 12:
304 shodan_exploit_description()
305
306 elif choice == 13:
307 shodan_exploit_date()
308
309 elif choice == 14:
310 shodan_exploit_code()
311
312 elif choice == 15:
313 shodan_exploit_platform()
314
315 elif choice == 16:
316 shodan_exploit_port()
317
318 elif choice == 17:
319 shodan_dns_lookup()
320
321 elif choice == 18:
322 shodan_dns_reverse()
323
324 elif choice == 19:
325 shodan_honeyscore()
326
327 elif choice == 20:
328 shodan_profile()
329
330 elif choice == 21:
331 shodan_myip()
332
333 elif choice == 22:
334 shodan_httpheaders()
335
336 elif choice == 23:
337 shodan_api_info()
338
339 elif choice == 24:
340 shodansploit_exit()
341
342signal.signal(signal.SIGINT, signal_handler)
343while 1:
344 print (searchploit_txt)
345 print (shodansploit_menu_txt)
346 try:
347 # batch arguments
348 run(shodan_host_ip,host_search,shodan_tok#!/usr/bin/env python
349# -*- coding: utf-8 -*-
350
351import requests
352import json
353import os
354import signal
355
356# shodansploit v1.0.0
357
358searchploit_txt = """
359 _ _ _ _ _
360 ___| |__ ___ __| | __ _ _ __ ___ _ __ | | ___ (_) |_
361 / __| '_ \ / _ \ / _` |/ _` | '_ \/ __| '_ \| |/ _ \| | __|
362 \__ \ | | | (_) | (_| | (_| | | | \__ \ |_) | | (_) | | |_
363 |___/_| |_|\___/ \__,_|\__,_|_| |_|___/ .__/|_|\___/|_|\__|
364 |_| v1.2.0
365 Author : Ismail Tasdelen
366 GitHub : github.com/ismailtasdelen
367 Linkedin : linkedin.com/in/ismailtasdelen
368 Twitter : twitter.com/ismailtsdln
369"""
370
371shodansploit_menu_txt = """
372[1] GET > /shodan/host/{ip}
373[2] GET > /shodan/host/count
374[3] GET > /shodan/host/search
375[4] GET > /shodan/host/search/tokens
376[5] GET > /shodan/ports
377
378[6] GET > /shodan/exploit/author
379[7] GET > /shodan/exploit/cve
380[8] GET > /shodan/exploit/msb
381[9] GET > /shodan/exploit/bugtraq-id
382[10] GET > /shodan/exploit/osvdb
383[11] GET > /shodan/exploit/title
384[12] GET > /shodan/exploit/description
385[13] GET > /shodan/exploit/date
386[14] GET > /shodan/exploit/code
387[15] GET > /shodan/exploit/platform
388[16] GET > /shodan/exploit/port
389
390[17] GET > /dns/resolve
391[18] GET > /dns/reverse
392[19] GET > /labs/honeyscore/{ip}
393
394[20] GET > /account/profile
395[21] GET > /tools/myip
396[22] GET > /tools/httpheaders
397[23] GET > /api-info
398
399[24] Exit
400"""
401
402if os.path.exists("./api.txt") and os.path.getsize("./api.txt") > 0:
403 with open('api.txt', 'r') as file:
404 shodan_api=file.readline().rstrip('\n')
405else:
406 file = open('api.txt', 'w')
407 shodan_api = "99pGzkCnJDMtjG6rKDhlHtspQM7925bN"
408 file.write(shodan_api)
409 print('[~] File written: ./api.txt')
410 file.close()
411
412def signal_handler(signal, frame):
413 print("\nExiting...\n")
414 exit()
415
416def shodan_host_ip():
417 host_ip = raw_input("Shodan Host Search : ")
418 url = "https://api.shodan.io/shodan/host/"+ host_ip +"?key=" + shodan_api
419 request = requests.get(url)
420 txt = request.text
421 parsed = json.loads(txt)
422 print (json.dumps(parsed, indent=2, sort_keys=True))
423
424def shodan_count_search():
425 host_search = raw_input("Shodan Host Search : ")
426 url = "https://api.shodan.io/shodan/host/count?key="+ shodan_api +"&query=" + host_search
427 request = requests.get(url)
428 txt = request.text
429 parsed = json.loads(txt)
430 print (json.dumps(parsed, indent=2, sort_keys=True))
431
432def host_search():
433 host_search = raw_input("Shodan Host Search : ")
434 url = "https://api.shodan.io/shodan/host/search?key="+ shodan_api +"&query=" + host_search
435 request = requests.get(url)
436 txt = request.text
437 parsed = json.loads(txt)
438 print (json.dumps(parsed, indent=2, sort_keys=True))
439
440def shodan_token_search():
441 token_search = raw_input("Shodan Token Search : ")
442 url = "https://api.shodan.io/shodan/host/search/tokens?key="+ shodan_api +"&query=" + token_search
443 request = requests.get(url)
444 txt = request.text
445 parsed = json.loads(txt)
446 print (json.dumps(parsed, indent=2, sort_keys=True))
447
448def shodan_ports():
449 url = "https://api.shodan.io/shodan/ports?key=" + shodan_api
450 request = requests.get(url)
451 txt = request.text
452 parsed = json.loads(txt)
453 print (json.dumps(parsed, indent=2, sort_keys=True))
454
455def shodan_dns_lookup():
456 hostnames = raw_input("DNS Lookup : ")
457 url = "https://api.shodan.io/dns/resolve?hostnames="+ hostnames +"&key=" + shodan_api
458 request = requests.get(url)
459 txt = request.text
460 parsed = json.loads(txt)
461 print (json.dumps(parsed, indent=2, sort_keys=True))
462
463def shodan_dns_reverse():
464 ips = raw_input("DNS Reverse : ")
465 url = "https://api.shodan.io/dns/reverse?ips="+ ips +"&key=" + shodan_api
466 request = requests.get(url)
467 txt = request.text
468 parsed = json.loads(txt)
469 print (json.dumps(parsed, indent=2, sort_keys=True))
470
471def shodan_honeyscore():
472 honeypot = raw_input("DNS Reverse : ")
473 url = "https://api.shodan.io/labs/honeyscore/"+ ips +"&key=" + shodan_api
474 request = requests.get(url)
475 txt = request.text
476 parsed = json.loads(txt)
477 print (json.dumps(parsed, indent=2, sort_keys=True))
478
479def shodan_profile():
480 url = "https://api.shodan.io/account/profile?key=" + shodan_api
481 request = requests.get(url)
482 txt = request.text
483 parsed = json.loads(txt)
484 print (json.dumps(parsed, indent=2, sort_keys=True))
485
486def shodan_myip():
487 url = "https://api.shodan.io/tools/myip?key=" + shodan_api
488 request = requests.get(url)
489 txt = request.text
490 parsed = json.loads(txt)
491 print (json.dumps(parsed, indent=2, sort_keys=True))
492
493def shodan_httpheaders():
494 url = "https://api.shodan.io/tools/httpheaders?key=" + shodan_api
495 request = requests.get(url)
496 txt = request.text
497 parsed = json.loads(txt)
498 print (json.dumps(parsed, indent=2, sort_keys=True))
499
500def shodan_api_info():
501 url = "https://api.shodan.io/api-info?key=" + shodan_api
502 request = requests.get(url)
503 txt = request.text
504 parsed = json.loads(txt)
505 print (json.dumps(parsed, indent=2, sort_keys=True))
506
507def shodan_exploit_author():
508 exploit_author = raw_input("Exploit Author : ")
509 url = "https://exploits.shodan.io/api/search?query="+ "author:" + exploit_author +"&key=" + shodan_api
510 request = requests.get(url)
511 txt = request.text
512 parsed = json.loads(txt)
513 print (json.dumps(parsed, indent=2, sort_keys=True))
514
515def shodan_exploit_cve():
516 exploit_cve = raw_input("Exploit CVE : ")
517 url = "https://exploits.shodan.io/api/search?query="+ "cve:" + exploit_cve +"&key=" + shodan_api
518 request = requests.get(url)
519 txt = request.text
520 parsed = json.loads(txt)
521 print (json.dumps(parsed, indent=2, sort_keys=True))
522
523def shodan_exploit_msb():
524 exploit_msb = raw_input("Exploit Microsoft Security Bulletin ID : ")
525 url = "https://exploits.shodan.io/api/search?query="+ "msb:" + exploit_msb +"&key=" + shodan_api
526 request = requests.get(url)
527 txt = request.text
528 parsed = json.loads(txt)
529 print (json.dumps(parsed, indent=2, sort_keys=True))
530
531def shodan_exploit_bid():
532 exploit_bid = raw_input("Exploit Bugtraq ID : ")
533 url = "https://exploits.shodan.io/api/search?query="+ "bid:" + exploit_bid +"&key=" + shodan_api
534 request = requests.get(url)
535 txt = request.text
536 parsed = json.loads(txt)
537 print (json.dumps(parsed, indent=2, sort_keys=True))
538
539def shodan_exploit_osvdb():
540 exploit_osvdb = raw_input("Exploit Open Source Vulnerability Database ID : ")
541 url = "https://exploits.shodan.io/api/search?query="+ "osvdb:" + exploit_osvdb +"&key=" + shodan_api
542 request = requests.get(url)
543 txt = request.text
544 parsed = json.loads(txt)
545 print (json.dumps(parsed, indent=2, sort_keys=True))
546
547def shodan_exploit_title():
548 exploit_title = raw_input("Exploit Title : ")
549 url = "https://exploits.shodan.io/api/search?query="+ "title:" + exploit_title +"&key=" + shodan_api
550 request = requests.get(url)
551 txt = request.text
552 parsed = json.loads(txt)
553 print (json.dumps(parsed, indent=2, sort_keys=True))
554
555def shodan_exploit_description():
556 exploit_description = raw_input("Exploit Description : ")
557 url = "https://exploits.shodan.io/api/search?query="+ "description:" + exploit_description +"&key=" + shodan_api
558 request = requests.get(url)
559 txt = request.text
560 parsed = json.loads(txt)
561 print (json.dumps(parsed, indent=2, sort_keys=True))
562
563def shodan_exploit_date():
564 exploit_date = raw_input("Exploit Date : ")
565 url = "https://exploits.shodan.io/api/search?query="+ "description:" + exploit_date +"&key=" + shodan_api
566 request = requests.get(url)
567 txt = request.text
568 parsed = json.loads(txt)
569 print (json.dumps(parsed, indent=2, sort_keys=True))
570
571def shodan_exploit_code():
572 exploit_code = raw_input("Exploit Code : ")
573 url = "https://exploits.shodan.io/api/search?query="+ "code:" + exploit_code +"&key=" + shodan_api
574 request = requests.get(url)
575 txt = request.text
576 parsed = json.loads(txt)
577 print (json.dumps(parsed, indent=2, sort_keys=True))
578
579def shodan_exploit_platform():
580 exploit_platform = raw_input("Exploit Platform : ")
581 url = "https://exploits.shodan.io/api/search?query="+ "platform:" + exploit_platform +"&key=" + shodan_api
582 request = requests.get(url)
583 txt = request.text
584 parsed = json.loads(txt)
585 print (json.dumps(parsed, indent=2, sort_keys=True))
586
587def shodan_exploit_port():
588 exploit_platform = raw_input("Exploit Port : ")
589 url = "https://exploits.shodan.io/api/search?query="+ "port:" + exploit_platform +"&key=" + shodan_api
590 request = requests.get(url)
591 txt = request.text
592 parsed = json.loads(txt)
593 print (json.dumps(parsed, indent=2, sort_keys=True))
594
595def shodansploit_exit():
596 exit()
597
598def pause():
599 programPause = raw_input("\nPress the <ENTER> key to continue...")
600
601# Author : Ismail Tasdelen
602# GitHub : https://github.com/ismailtasdelen/
603# Linkedin : https://www.linkedin.com/in/ismailtasdelen/
604# Twitter : https://twitter.com/ismailtsdln/
605
606
607# multi function use
608
609def run(shodan_host_ip,host_search,shodan_token_search,shodan_ports,shodan_dns_lookup,shodan_count_search,
610 shodan_dns_reverse,shodan_honeyscore,shodan_profile,shodan_myip,shodan_httpheaders,shodan_api_info,
611 shodan_exploit_author,shodan_exploit_cve,shodan_exploit_msb,shodan_exploit_bid,shodan_exploit_osvdb,
612 shodan_exploit_title,shodan_exploit_description,shodan_exploit_date,shodan_exploit_code,
613 shodan_exploit_platform,shodan_exploit_port,shodansploit_exit):
614
615 choice = input("Which option number : ")
616
617 if choice == 1:
618 shodan_host_ip()
619
620 elif choice == 2:
621 shodan_count_search()
622
623 elif choice == 3:
624 host_search()
625
626 elif choice == 4:
627 shodan_token_search()
628
629 elif choice == 5:
630 shodan_ports()
631
632 elif choice == 6:
633 shodan_exploit_author()
634
635 elif choice == 7:
636 shodan_exploit_cve()
637
638 elif choice == 8:
639 shodan_exploit_msb()
640
641 elif choice == 9:
642 shodan_exploit_bid()
643
644 elif choice == 10:
645 shodan_exploit_osvdb()
646
647 elif choice == 11:
648 shodan_exploit_title()
649
650 elif choice == 12:
651 shodan_exploit_description()
652
653 elif choice == 13:
654 shodan_exploit_date()
655
656 elif choice == 14:
657 shodan_exploit_code()
658
659 elif choice == 15:
660 shodan_exploit_platform()
661
662 elif choice == 16:
663 shodan_exploit_port()
664
665 elif choice == 17:
666 shodan_dns_lookup()
667
668 elif choice == 18:
669 shodan_dns_reverse()
670
671 elif choice == 19:
672 shodan_honeyscore()
673
674 elif choice == 20:
675 shodan_profile()
676
677 elif choice == 21:
678 shodan_myip()
679
680 elif choice == 22:
681 shodan_httpheaders()
682
683 elif choice == 23:
684 shodan_api_info()
685
686 elif choice == 24:
687 shodansploit_exit()
688
689signal.signal(signal.SIGINT, signal_handler)
690while 1:
691 print (searchploit_txt)
692 print (shodansploit_menu_txt)
693 try:
694 # batch arguments
695 run(shodan_host_ip,host_search,shodan_token_search,shodan_ports,shodan_dns_lookup,shodan_count_search,
696 shodan_dns_reverse,shodan_honeyscore,shodan_profile,shodan_myip,shodan_httpheaders,shodan_api_info,
697 shodan_exploit_author,shodan_exploit_cve,shodan_exploit_msb,shodan_exploit_bid,shodan_exploit_osvdb,
698 shodan_exploit_title,shodan_exploit_description,shodan_exploit_date,shodan_exploit_code,
699 shodan_exploit_platform,shodan_exploit_port,shodansploit_exit)
700
701 pause()
702
703 except ValueError as e:
704 print('\n[✘] Error: %s' % e)
705 option = raw_input('[*] Would you like to change API Key? <Y/n>: ').lower()
706 if option.startswith('y'):
707 file = open('api.txt', 'w')
708 shodan_api = raw_input('[*] Please enter valid Shodan.io API Key: ')
709 file.write(shodan_api)
710 print('[~] File written: ./api.txt')
711 file.close()
712 print('[~] Restarting...')
713 print('')
714 else:
715 print('')
716 print('[•] Exiting...')
717 exit()en_search,shodan_ports,shodan_dns_lookup,shodan_count_search,
718 shodan_dns_reverse,shodan_honeyscore,shodan_profile,shodan_myip,shodan_httpheaders,shodan_api_info,
719 shodan_exploit_author,shodan_exploit_cve,shodan_exploit_msb,shodan_exploit_bid,shodan_exploit_osvdb,
720 shodan_exploit_title,shodan_exploit_description,shodan_exploit_date,shodan_exploit_code,
721 shodan_exploit_platform,shodan_exploit_port,shodansploit_exit)
722
723 pause()
724
725 except ValueError as e:
726 print('\n[✘] Error: %s' % e)
727 option = raw_input('[*] Would you like to change API Key? <Y/n>: ').lower()
728 if option.startswith('y'):
729 file = open('api.txt', 'w')
730 shodan_api = raw_input('[*] Please enter valid Shodan.io API Key: ')
731 file.write(shodan_api)
732 print('[~] File written: ./api.txt')
733 file.close()
734 print('[~] Restarting...')
735 print('')
736 else:
737 print('')
738 print('[•] Exiting...')
739 exit()