From db340f69aab29f12f29cf9707fe828ba4077018c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikail=20Tun=C3=A7?= Date: Fri, 27 Mar 2020 01:05:59 +0000 Subject: [PATCH] Improve password regex More work to be done here but this is a start. --- .gitignore | 1 + SlackPirate.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ff2bd54..269e520 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .*/ __pycache__ SlackPirate_*/ +.DS_Store diff --git a/SlackPirate.py b/SlackPirate.py index f1a0359..1e4fac8 100755 --- a/SlackPirate.py +++ b/SlackPirate.py @@ -88,12 +88,12 @@ r"|s3-[a-zA-Z0-9-\.\_\/]+" \ r"|s3.amazonaws.com/[a-zA-Z0-9-\.\_]+" \ r"|s3.console.aws.amazon.com/s3/buckets/[a-zA-Z0-9-\.\_]+)" -# https://regex101.com/r/DoPV1M/1 +# https://regex101.com/r/DoPV1M/3 CREDENTIALS_REGEX = r"(?i)(" \ - r"password\s*[`=:\"]+\s*[^\s]+" \ - r"|password is\s*[`=:\"]+\s*[^\s]+" \ - r"|pwd\s*[`=:\"]+\s*[^\s]+" \ - r"|passwd\s*[`=:\"]+\s*[^\s]+)" + r"password\s*[`=:\"]+\s*[^\s]+|" \ + r"password is\s*[`=:\"]*\s*[^\s]+|" \ + r"pwd\s*[`=:\"]*\s*[^\s]+|" \ + r"passwd\s*[`=:\"]+\s*[^\s]+)" # https://regex101.com/r/IEq5nU/4 AWS_KEYS_REGEX = r"((?