Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: unterminated subpattern #67

Open
anand4234 opened this issue Jan 24, 2023 · 2 comments
Open

Error: unterminated subpattern #67

anand4234 opened this issue Jan 24, 2023 · 2 comments

Comments

@anand4234
Copy link

Any idea whats going wrong here?
python SecretFinder.py -i js.js -o test.html

 + ] URL: file:///home/kali/Desktop/Tools/SecretFinder/js.js
Traceback (most recent call last):
  File "/home/kali/Desktop/Tools/SecretFinder/SecretFinder.py", line 435, in <module>
    matched = parser_file(file,mode)
  File "/home/kali/Desktop/Tools/SecretFinder/SecretFinder.py", line 182, in parser_file
    items = getContext(all_matches,content,regex[0])
  File "/home/kali/Desktop/Tools/SecretFinder/SecretFinder.py", line 158, in getContext
    context = re.findall('%s%s%s'%(rex,m,rex),content,re.IGNORECASE)
  File "/usr/lib/python3.10/re.py", line 240, in findall
    return _compile(pattern, flags).findall(string)
  File "/usr/lib/python3.10/re.py", line 303, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.10/sre_compile.py", line 788, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.10/sre_parse.py", line 955, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib/python3.10/sre_parse.py", line 444, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
  File "/usr/lib/python3.10/sre_parse.py", line 843, in _parse
    raise source.error("missing ), unterminated subpattern",
re.error: missing ), unterminated subpattern at position 14
@srand2
Copy link

srand2 commented May 18, 2023

same issue here

@halfluke
Copy link

halfluke commented Oct 6, 2023

I used the suggestion in #30 and remove the last part of the regex from secretfinder.py and the issue is gone

 'possible_Creds' : r"(?i)(" \
                    r"password\s*[`=:\"]+\s*[^\s]+|" \
                    r"password is\s*[`=:\"]*\s*[^\s]+|" \
                    r"pwd\s*[`=:\"]*\s*[^\s]+|" \
                    r"passwd\s*[`=:\"]+\s*[^\s]+)",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants