forked from dock3rX/ReconT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reconT.py
170 lines (143 loc) · 4.27 KB
/
reconT.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#-*- coding: utf-8 -*-
import sys
if sys.version[0] == '2':
print('[X] Not Supported For python 2.x please use python 3')
exit()
try:
import click
import tldextract
import requests
import colorlog
except Exception:
print('\n!pip install -r requirements.txt\n')
import click,sys,urllib3,os
from datetime import datetime as date
from http.cookies import SimpleCookie
from src.fingerprint import (
waf,
respon_hider,
location_info,
reverse_DNS,
port_scan,
sslInfo
)
from src.disclosure import disc
from src.crawl import extractor
from src.enumeration import subdomain_enumeration
from src.utils.request_handler import request_handler
from src.utils.ngelog import (
logger,
skema,
no_skema,
merah,
kuning,
hijau,
ban
)
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
log = logger(__name__)
def set_cookie(x):
try:
if x != None:
cc = SimpleCookie()
kue = cc.load()
coki_coki = {a:b.value for a,b in kue.items()}
return coki_coki
else:
return None
except Exception:
return None
def set_proxy(x):
try:
if x != None:
return {'http':x,'https':x}
else:
return None
except Exception:
return None
@click.command()
@click.argument('target')
@click.option('--timeout',help='Seconds to wait before timeout connections ',default=None,show_default=True,type=int)
@click.option('--proxy',default=None,help='if Use a proxy ex: 0.0.0.0:8888'
'if with auth 0.0.0.0:8888@user:password')
@click.option('--cookies',default=None,help='if use cookie comma separated cookies to add the request'
'ex: PHPSESS:123,kontol=True')
def main(target,timeout,proxy,cookies):
try:
print(ban)
log.log(50,'Starting At {}'.format(hijau(str(date.now()))))
batas = '-'*50
kue = set_cookie(cookies)
proxies = set_proxy(proxy)
res = request_handler(
proxy=proxies,
cookie=kue,
timeout=timeout
).send(
mtd='GET',
url=skema(target),
allow_redirects=True,
verify=False
)
log.log(50,'Collecting Information On: {}'.format(merah(target)))
log.log(10,'Status: \033[1;30m{}\033[0m'.format(res.status_code))
print(batas)
hider = respon_hider(res)
hider.detect()
for a,b in res.headers.items():
print('- {}: {}'.format(a,b))
print(batas)
location_info(target).location()
print(batas)
wff = waf(res)
wff.start_()
if wff.bNer == False:
log.log(40,"Didn't Detect WAF Presence on: {}".format(hijau(res.url)))
print(batas)
reverse_DNS(target).rDNS()
print(batas)
port_scan(target).nmap()
print(batas)
ssl = sslInfo(target)
ssl.get_ssl()
print(batas)
log.log(50,'Collecting Information Disclosure!')
dd = disc(target,cookie=kue,proxy=proxies,timeout=timeout)
dd.mail()
dd.phone()
dd.cc()
dd.ssn()
dd.sitemap()
dd.robot()
dd.mailman()
print(batas)
log.log(50,'Crawling Url Parameter On: {}'.format(merah(res.url)))
ext = extractor(target,res)
print(batas)
ext.form()
print(batas)
ext.dom()
print(batas)
ext.in_dynamic()
print(batas)
ext.ex_dynamic()
print(batas)
ext.in_link()
print(batas)
ext.ex_link()
print(batas)
log.log(10,'Mapping Subdomain..')
sub = subdomain_enumeration(target)
sub.request()
if len(sub.raw_result) == 0:
log.log(30,'No Any Subdomain Found')
log.log(20,'Found {} Subdomain'.format(hijau(len(sub.raw_result))))
for i in sub.raw_result:
print('- {}'.format(hijau(i)))
print(batas)
log.log(20,'Done At {}'.format(hijau(date.now())))
except Exception as e:
print(merah(e))
log.log(20,'Done At {}'.format(hijau(date.now())))
if __name__ == '__main__':
main()