SecretFinder icon indicating copy to clipboard operation
SecretFinder copied to clipboard

Unbalanced parenthesis at position 17

Open Tejpandya opened this issue 3 years ago • 2 comments

Hello,

I'm using this command to trigger scan

python SecretFinder.py -i https://www.mywebsite.com -e

but after enumerating some JavaScript files , it throws an error like this

Traceback (most recent call last): File "SecretFinder.py", line 435, in <module> matched = parser_file(file,mode) File "SecretFinder.py", line 182, in parser_file items = getContext(all_matches,content,regex[0]) File "SecretFinder.py", line 158, in getContext context = re.findall('%s%s%s'%(rex,m,rex),content,re.IGNORECASE) File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\re.py", line 225, in findall return _compile(pattern, flags).findall(string) File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\re.py", line 288, in _compile p = sre_compile.compile(pattern, flags) File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\sre_compile.py", line 764, in compile p = sre_parse.parse(p, flags) File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\sre_parse.py", line 938, in parse raise source.error("unbalanced parenthesis") re.error: unbalanced parenthesis at position 17

upon googling I found out that it is related to escaping character in Regex, but still not able to solve the problem. Any solution?

Tejpandya avatar Apr 24 '21 13:04 Tejpandya

Im also getting this error

Traceback (most recent call last):
  File "/opt/Tools/Recon/secretfinder/SecretFinder.py", line 435, in <module>
    matched = parser_file(file,mode)
  File "/opt/Tools/Recon/secretfinder/SecretFinder.py", line 182, in parser_file
    items = getContext(all_matches,content,regex[0])
  File "/opt/Tools/Recon/secretfinder/SecretFinder.py", line 158, in getContext
    context = re.findall('%s%s%s'%(rex,m,rex),content,re.IGNORECASE)
  File "/usr/lib/python3.9/re.py", line 241, in findall
    return _compile(pattern, flags).findall(string)
  File "/usr/lib/python3.9/re.py", line 304, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.9/sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.9/sre_parse.py", line 962, in parse
    raise source.error("unbalanced parenthesis")
re.error: unbalanced parenthesis at position 21

srand2 avatar Aug 04 '21 13:08 srand2

@m4ll0k same issue here

python3 SecretFinder.py -i https://test.test/assets/frontend/cache/scripts-cab86ccc6d-min.js                 
[ + ] URL: https://test.test/assets/frontend/cache/scripts-cab86ccc6d-min.js
Traceback (most recent call last):
  File "SecretFinder.py", line 435, in <module>
    matched = parser_file(file,mode)
  File "SecretFinder.py", line 182, in parser_file
    items = getContext(all_matches,content,regex[0])
  File "SecretFinder.py", line 158, in getContext
    context = re.findall('%s%s%s'%(rex,m,rex),content,re.IGNORECASE)
  File "/home/linuxbrew/.linuxbrew/Cellar/python/3.7.1/lib/python3.7/re.py", line 223, in findall
    return _compile(pattern, flags).findall(string)
  File "/home/linuxbrew/.linuxbrew/Cellar/python/3.7.1/lib/python3.7/re.py", line 286, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/home/linuxbrew/.linuxbrew/Cellar/python/3.7.1/lib/python3.7/sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "/home/linuxbrew/.linuxbrew/Cellar/python/3.7.1/lib/python3.7/sre_parse.py", line 944, in parse
    raise source.error("unbalanced parenthesis")
re.error: unbalanced parenthesis at position 12

arzzen avatar Jan 18 '22 14:01 arzzen