88from urllib .parse import urlparse # url parsing
99from logging import getLogger
1010from wordlists import ssrf_parameters # ssrf parameters wordlist
11+ from core .libs import alert_bug
1112from modules import Scan
1213from modules .python .xss import main as xss_main
1314from modules .python .xss_param import main as xss_param_main
2223# send requests per sec
2324parameters_in_one_request = 10
2425
25- # parameters_in_one_request = 2
26-
2726# ?ex1=http://google.com&ex2=http://google.com
2827
2928class Lorsrf (Scan ):
@@ -53,7 +52,7 @@ def lor(self, url: str):
5352 op = self .opts .copy ()
5453 op ['url' ] = url
5554 op ['method' ] = method
56- if self .opts ['one_scan' ] == True :
55+ if self .opts ['one_scan' ] == False :
5756 log .debug ('Scannig with another modules' )
5857 xss_main (op ,self .http )
5958 xss_param_main (op ,self .http )
@@ -69,11 +68,17 @@ def org(self) -> list:
6968 l = len (ssrf_parameters ())
7069 newurl = self .opts ['url' ]
7170 allu = []
71+ proto = ['http://' ,'https://' ,'smpt://' ,'' ]
72+ if self .opts ['host' ]:
73+ pass
74+ else :
75+ return
7276 for par in ssrf_parameters ():
73- pay = f"{ self .opts ['host' ]} /{ par } "
74- newurl += self .check_url (newurl , par , pay )
75- if len (urlparse (newurl ).query .split ('=' )) == parameters_in_one_request + 1 :
76- allu .append (newurl )
77- newurl = self .opts ['url' ]
77+ for pr in proto :
78+ pay = f"{ pr } { par } .{ self .opts ['host' ]} "
79+ newurl += self .check_url (newurl , par , pay )
80+ if len (urlparse (newurl ).query .split ('=' )) == parameters_in_one_request + 1 :
81+ allu .append (newurl )
82+ newurl = self .opts ['url' ]
7883 return allu
7984
0 commit comments