From d7135c43a64032e50cce8ab217dea178db116234 Mon Sep 17 00:00:00 2001 From: Levon 'noptrix' Kayan Date: Wed, 27 Oct 2021 04:28:22 +0300 Subject: [PATCH] use re.search.regs instead of index() --- httpgrep.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/httpgrep.py b/httpgrep.py index 72891d6..893e643 100755 --- a/httpgrep.py +++ b/httpgrep.py @@ -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']: