m4ll0k / SecretFinder

SecretFinder - A python script for find sensitive data (apikeys, accesstoken,jwt,..) and search anything on javascript files
GNU General Public License v3.0
2k stars 373 forks source link

Getting Error #19

Closed r3curs1v3-pr0xy closed 3 years ago

r3curs1v3-pr0xy commented 4 years ago

Traceback (most recent call last): File "SecretFinder.py", line 434, in matched = parser_file(file,mode) File "SecretFinder.py", line 181, in parser_file items = getContext(all_matches,content,regex[0]) File "SecretFinder.py", line 157, in getContext context = re.findall('%s%s%s'%(rex,m,rex),content,re.IGNORECASE) File "/usr/lib/python3.7/re.py", line 223, in findall return _compile(pattern, flags).findall(string) File "/usr/lib/python3.7/re.py", line 286, in _compile p = sre_compile.compile(pattern, flags) File "/usr/lib/python3.7/sre_compile.py", line 764, in compile p = sre_parse.parse(p, flags) File "/usr/lib/python3.7/sre_parse.py", line 938, in parse raise source.error("unbalanced parenthesis") re.error: unbalanced parenthesis at position 12

m4ll0k commented 4 years ago

you modified the tool with your regexs?

r3curs1v3-pr0xy commented 4 years ago

No, whenever I run this tool it creates an output.html file with location of target as content. Nothing else is show there?

m4ll0k commented 4 years ago

The issues is in regex (with unbalanced parenthesis)

r3curs1v3-pr0xy commented 4 years ago

Can you fix this?

m4ll0k commented 4 years ago

ok

whiteorange007 commented 4 years ago

i have similer issue: Traceback (most recent call last): File "SecretFinder.py", line 433, in matched = parser_file(file,mode) File "SecretFinder.py", line 180, in parser_file items = getContext(all_matches,content,regex[0]) File "SecretFinder.py", line 156, in getContext context = re.findall('%s%s%s'%(rex,m,rex),content,re.IGNORECASE) File "/usr/lib/python3.8/re.py", line 239, in findall return _compile(pattern, flags).findall(string) File "/usr/lib/python3.8/re.py", line 302, in _compile p = sre_compile.compile(pattern, flags) File "/usr/lib/python3.8/sre_compile.py", line 764, in compile p = sre_parse.parse(p, flags) File "/usr/lib/python3.8/sre_parse.py", line 962, in parse raise source.error("unbalanced parenthesis") re.error: unbalanced parenthesis at position 12

r3curs1v3-pr0xy commented 4 years ago

@whiteorange007

Use command line flag i.e -o cli then it will work fine

PxHunt3r commented 4 years ago

have same issue $ python3 SecretFinder.py -i https://DOMAIN -c "COOKIE" -e -o results.html [ + ] URL: ....js [ + ] URL: ....js Traceback (most recent call last): File "SecretFinder.py", line 433, in matched = parser_file(file,mode) File "SecretFinder.py", line 180, in parser_file items = getContext(all_matches,content,regex[0]) File "SecretFinder.py", line 156, in getContext context = re.findall('%s%s%s'%(rex,m,rex),content,re.IGNORECASE) File "/usr/lib64/python3.7/re.py", line 225, in findall return _compile(pattern, flags).findall(string) File "/usr/lib64/python3.7/re.py", line 288, in _compile p = sre_compile.compile(pattern, flags) File "/usr/lib64/python3.7/sre_compile.py", line 764, in compile p = sre_parse.parse(p, flags) File "/usr/lib64/python3.7/sre_parse.py", line 938, in parse raise source.error("unbalanced parenthesis") re.error: unbalanced parenthesis at position 855

Didn't edit, but just pulled the tool from git

RAVIPRAJ commented 3 years ago

@whiteorange007 @m4ll0k

i am also facing this error some time ago because of wrong command type like this and secretfinder will work fine

python3 SecretFinder.py -i https://www.example.com/main.js -o cli -r 'apikey=my.api.key[a-zA-Z]+'