3131
3232
3333__author__ = 'noptrix'
34- __version__ = '2.4 '
34+ __version__ = '2.5 '
3535__copyright__ = 'santa clause'
3636__license__ = 'MIT'
3737
@@ -181,15 +181,15 @@ def http_req(url):
181181 return r
182182
183183
184- def scan (url ):
184+ def scan (url , string ):
185185 if opts ['verbose' ]:
186186 log (f'scanning { url } ' + ' ' * 20 , 'verbose' , esc = '\r ' )
187187 sys .stdout .flush ()
188188
189189 r = http_req (url )
190190
191191 if 'body' in opts ['where' ]:
192- idx = re .search (opts [ 'searchstr' ] , r .text , opts ['case_in' ]).regs [0 ][0 ]
192+ idx = re .search (string , r .text , opts ['case_in' ]).regs [0 ][0 ]
193193 if idx :
194194 res = repr (r .text [idx :idx + opts ['bytes' ]])
195195 log (f'{ url } | body | { res } ' , 'good' )
@@ -198,8 +198,8 @@ def scan(url):
198198
199199 if 'headers' in opts ['where' ]:
200200 for k , v in r .headers .items ():
201- if re .search (opts [ 'searchstr' ] , k , opts ['case_in' ]) or \
202- re .search (opts [ 'searchstr' ] , v , opts ['case_in' ]):
201+ if re .search (string , k , opts ['case_in' ]) or \
202+ re .search (string , v , opts ['case_in' ]):
203203 log (f"{ url } | header | { k } : { v } " , 'good' )
204204 if opts ['logfile' ]:
205205 log (f"{ url } | header | { k } : { v } " , 'file' )
@@ -363,7 +363,7 @@ def main(cmdline):
363363 if 'http' not in host :
364364 url = build_url (host )
365365 for string in get_strings (opts ['searchstr' ]):
366- exe .submit (scan , url )
366+ exe .submit (scan , url , string )
367367
368368 if opts ['verbose' ]:
369369 log ('\n \n ' )
0 commit comments