forked from 0xInfection/TIDoS-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbannergrab.py
More file actions
61 lines (49 loc) · 1.66 KB
/
Copy pathbannergrab.py
File metadata and controls
61 lines (49 loc) · 1.66 KB
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
#!/usr/bin/env python
# coding: utf-8
#-:-:-:-:-:-:-:-:-:-:-:-:#
# TIDoS Framework #
#-:-:-:-:-:-:-:-:-:-:-:-:#
#Author: @_tID
#This module requires TIDoS Framework
#https://github.com/0xInfection/TIDoS-Framework
from __future__ import print_function
import shodan
import requests
import socket
import json
import time
import sys
sys.path.append('files/')
from core.Core.colors import *
from files.API_KEYS import SHODAN_API_KEY
def grab(web):
api = shodan.Shodan(SHODAN_API_KEY)
print(GR+' [*] Resolving hostnames...')
time.sleep(0.7)
dnsResolve = 'https://api.shodan.io/dns/resolve?hostnames=' + web + '&key=' + SHODAN_API_KEY
try:
resolved = requests.get(dnsResolve)
print(O+' [!] Parsing information...')
hostIP = resolved.json()[web]
print(O+' [!] Setting query parameters...')
host = api.host(hostIP)
for item in host['data']:
print(GR+'\n [+] Port : '+O+ str(item['port']))
print(B+' [+] Banner : \n')
for q in str(item['data']).splitlines():
if ':' in q:
print(G+' '+q.split(':')[0]+' : '+O+q.split(':')[1].strip())
else:
print(C+' '+q)
time.sleep(0.02)
except KeyboardInterrupt:
print(R+' [-] An error occured...\n')
def bannergrab(web):
print(R+'\n ===============================')
print(R+' B A N N E R G R A B B I N G')
print(R+' ===============================\n')
print(GR+' [*] Parsing Url...')
web = web.replace('http://','')
web = web.replace('https://','')
grab(web)
print(G+'\n [+] Banner Grabbing Done!')