use re.search.regs instead of index()

This commit is contained in:
Levon 'noptrix' Kayan 2021-10-27 04:28:22 +03:00
parent db3f72acca
commit d7135c43a6
1 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ from concurrent.futures import ThreadPoolExecutor, as_completed
__author__ = 'noptrix'
__version__ = '2.2'
__version__ = '2.3'
__copyright__ = 'santa clause'
__license__ = 'MIT'
@ -189,8 +189,8 @@ def scan(url):
r = http_req(url)
if 'body' in opts['where']:
if re.search(opts['searchstr'], r.text, opts['case_in']):
idx = r.text.index(opts['searchstr'])
idx = re.search(opts['searchstr'], r.text, opts['case_in']).regs[0][0]
if idx:
res = repr(r.text[idx:idx+opts['bytes']])
log(f'{url} | body | {res}', 'good')
if opts['logfile']: