Closed henrique-marcomini-movile closed 4 years ago
import argparse
a = argparse.ArgumentParser()
a.add_argument('-a','--aa',help="ok",default="")
b = a.parse_args()
print(b.aa.split('\\n'))
To clarify it, the error that I'm trying tackle here is this one
$git branch
* master
$python3 SecretFinder.py
usage: SecretFinder.py [-h] [-e] -i INPUT [-o OUTPUT] [-r REGEX] [-b]
[-c COOKIE] [-g IGNORE] [-n ONLY] [-H HEADERS]
[-p PROXY]
SecretFinder.py: error: the following arguments are required: -i/--input
$python3 SecretFinder.py -H "test" -i "https://something"
[ + ] URL: https://something
Traceback (most recent call last):
File "SecretFinder.py", line 428, in <module>
file = send_request(url)
File "SecretFinder.py", line 354, in send_request
for i in args.header.split('\\n'):
AttributeError: 'Namespace' object has no attribute 'header'
There is mismatch due to
parser.add_argument("-H","--headers",help="Set headers (\"Name:Value\\nName:Value\")",action="store",default="")
and then calling it like this on line 354
for i in args.header.split('\\n'):
@m4ll0k Looks like I get AttributeError
, while using -H
argument
export CUSTOMHEADER='X-HackerOne-Research:storenth'
xargs -I '{}' secretfinder -H $CUSTOMHEADER -i {} -o cli < ./js-list.txt
Note: works fine without -H
.
Do we need a separate issue?
Hi, in the line 354 of SecretFinder.py there is a call to args.header, but the correct according to the object is headers
so line 354 becomes args.headers.split('\n')