Skip to content

Commit

Permalink
Merge pull request #86 from blacklanternsecurity/regex_tuning
Browse files Browse the repository at this point in the history
fixing catastrophically awful regex
  • Loading branch information
liquidsec authored Jul 16, 2023
2 parents 11c6ae7 + 7cff88f commit 318c16f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion badsecrets/modules/express_signedcookies_cs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ExpressSignedCookies_CS(BadsecretsBase):
}

def carve_regex(self):
return re.compile(r"(\w+=[^;]{4,512}).+\w+.sig=([^;]{27,86})")
return re.compile(r"(\w{1,64}=[^;]{4,512})[^\.]+\.sig=([^;]{27,86})")

def get_product_from_carve(self, regex_search):
return f"Data Cookie: [{regex_search.groups()[0]}] Signature Cookie: [{regex_search.groups()[1]}]"
Expand Down

0 comments on commit 318c16f

Please sign in to comment.