1+ #author:九世
2+ #time:2019/2/6
3+
4+ class Weblogic :
5+ def read (self ,files ):
6+ dk = open (files ,'r' )
7+ for r in dk :
8+ sc = "" .join (r .split ('\n ' ))
9+ yield sc
10+
11+ def jiance (self ):
12+ faq = __import__ ('plugin.jiance' ,fromlist = True )
13+ faq2 = __import__ ('plugin.filepd' ,fromlist = True )
14+ daoru = getattr (faq ,'reqt' )
15+ daoru2 = getattr (faq2 ,'pd' )
16+ xz = input ('文件或单个(单个输入1/批量检测输入2):' )
17+ if xz == '1' :
18+ user = input ('url:' ).rstrip ('/' ).strip ()
19+ fang = daoru (user )
20+ print (fang )
21+ elif xz == '2' :
22+ user = input ('file:' )
23+ file_pd = daoru2 (user )
24+ if file_pd == 1 :
25+ for v in self .read (user ):
26+ fnag = daoru (v )
27+ print (fnag )
28+ elif file_pd == 0 :
29+ print ('[-] 不存在此文件' )
30+ else :
31+ print ('[-] 没有此选择' )
32+
33+ def exp (self ):
34+ jq = __import__ ('plugin.exploit' ,fromlist = True )
35+ jq2 = __import__ ('plugin.filepd' ,fromlist = True )
36+ gt = getattr (jq ,'exploit' )
37+ gt2 = getattr (jq2 ,'pd' )
38+ xz = input ('文件或单个(单个输入1/批量检测输入2):' )
39+ if xz == '1' :
40+ users = input ('IP:' )
41+ prott = input ('port:' )
42+ gt (users ,int (prott ),0 )
43+ elif xz == '2' :
44+ mz = input ('file:' )
45+ fz = gt2 (mz )
46+ if fz == 1 :
47+ import re
48+ for l in self .read (mz ):
49+ host = re .findall ('.*:' ,str (l ))
50+ ports = re .findall (':.*' ,str (l ))
51+ hosts = str (host [0 ]).replace (':' ,'' ).strip ()
52+ port = str (ports [0 ]).replace (':' ,'' ).strip ()
53+ gt (hosts ,int (port ),0 )
54+ else :
55+ print ('[-] 不存在此文件' )
56+ else :
57+ print ('[-] 不存在此选择' )
58+
59+ def zoomeye (self ):
60+ ipo = __import__ ('plugin.search' ,fromlist = True )
61+ search = getattr (ipo ,'zoomeye' )
62+ search ()
63+
64+ def portscan (self ):
65+ jr = __import__ ('plugin.portscan' ,fromlist = True )
66+ pd = __import__ ('plugin.filepd' ,fromlist = True )
67+ port = getattr (jr ,'portscan' )
68+ jc = getattr (pd ,'pd' )
69+ xz = input ('单个或批量(单个检测输入1批量检测输入2):' )
70+ if xz == '1' :
71+ user = input ('IP:' )
72+ port (user ,7001 )
73+
74+ elif xz == '2' :
75+ user = input ('file:' )
76+ pds = jc (user )
77+ if pds == 1 :
78+ for v in self .read (user ):
79+ port (v ,7001 )
80+ else :
81+ print ('[-] 不存在此文件' )
82+ else :
83+ print ('[-] 不存在此选项' )
84+
85+
86+ if __name__ == '__main__' :
87+ obj = Weblogic ()
88+ print ('weblogic 反序列化检测 by 九世' )
89+ jg = ['1.通过网页关键字来判断是否为weblogic' ,'2.检测是否存在weblogic反序列化' ,'3.从zoomeye采集目标' ,'4.7001端口扫描判断是否开放' ]
90+ jgs = {'1' :obj .jiance ,'2' :obj .exp ,'3' :obj .zoomeye ,'4' :obj .portscan }
91+ while True :
92+ for j in jg :
93+ print (j )
94+
95+ user = input ('选择:' )
96+ if user in jgs :
97+ jgs .get (user )()
98+ print ('' )
99+ else :
100+ print ('[-] 不存在这个选择' )
101+ continue
0 commit comments