-
Notifications
You must be signed in to change notification settings - Fork 13
/
jbossScan.py
66 lines (55 loc) · 1.59 KB
/
jbossScan.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
#coding=utf-8
#by GGyao
import sys
import requests
requests.packages.urllib3.disable_warnings()
headers = {
"User-Agent":"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
}
vuls=['/jmx-console','/web-console','/invoker/JMXInvokerServlet','/admin-console','/jbossmq-httpil/HTTPServerILServlet','/invoker/readonly']
def main():
for target in open("target.txt"):
target=target.strip()
print ("========== " + target + " ==========")
for listt in vuls:
listt = listt.strip()
url = target + listt
try:
r = requests.get(url, headers=headers, timeout=3, verify=False)
#jmx-console
#web-console
if r.status_code == 401:
if "jmx" in url:
print ("[+]jmx-console vulnerability may exist!")
elif "web" in url:
print ("[+]web-console vulnerability may exist!")
else:
pass
else:
pass
#admin-console
#JBoss JMXInvokerServlet(CVE-2015-7501)
#JBOSSMQ JMS(CVE-2017-7504)
if r.status_code == 200:
if "admin" in url:
print ("[+]admin-console vulnerability may exist!")
elif "JMXInvokerServlet" in url:
print ("[+]JBoss JMXInvokerServlet(CVE-2015-7501) vulnerability may exist!")
elif "jbossmq" in url:
print ("[+]JBOSSMQ JMS(CVE-2017-7504) vulnerability may exist!")
else:
pass
else:
pass
#(CVE-2017-12149)
if r.status_code == 500:
if "readonly" in url:
print ("[+]CVE-2017-12149 vulnerability may exist!")
else:
pass
else:
pass
except Exception as e:
pass
if __name__=="__main__":
main()