Files
keyhunter-parser/patterns_extra.py

63 lines
9.0 KiB
Python

"""AUTO-GENERATED + manually curated kh_* families."""
import re
EXTRA_PATTERNS = {
'gl_gitlab-session-cookie': re.compile(r'_gitlab_session=[0-9a-z]{32}'),
'gl_gitter-access-token': re.compile('(?i)[\\w.-]{0,50}?(?:gitter)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-z0-9_-]{40})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_grafana-api-key': re.compile('(?i)\\b(eyJrIjoi[A-Za-z0-9]{70,400}={0,3})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_grafana-cloud-api-token': re.compile('(?i)\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_grafana-service-account-token': re.compile('(?i)\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_harness-api-key': re.compile(r'(?:pat|sat)\.[a-zA-Z0-9_-]{22}\.[a-zA-Z0-9]{24}\.[a-zA-Z0-9]{20}'),
'gl_hashicorp-tf-api-token': re.compile(r'(?i)[a-z0-9]{14}\.(?-i:atlasv1)\.[a-z0-9\-_=]{60,70}'),
'gl_hashicorp-tf-password': re.compile('(?i)[\\w.-]{0,50}?(?:administrator_login_password|password)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}("[a-z0-9=_\\-]{8,20}")(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_heroku-api-key': re.compile('(?i)[\\w.-]{0,50}?(?:heroku)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_heroku-api-key-v2': re.compile('\\b((HRKU-AA[0-9a-zA-Z_-]{58}))(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_hubspot-api-key': re.compile('(?i)[\\w.-]{0,50}?(?:hubspot)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_huggingface-access-token': re.compile('\\b(hf_(?i:[a-z]{34}))(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_huggingface-organization-api-token': re.compile('\\b(api_org_(?i:[a-z]{34}))(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_infracost-api-token': re.compile('\\b(ico-[a-zA-Z0-9]{32})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_intercom-api-key': re.compile('(?i)[\\w.-]{0,50}?(?:intercom)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-z0-9=_\\-]{60})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_jfrog-api-key': re.compile('(?i)[\\w.-]{0,50}?(?:jfrog|artifactory|bintray|xray)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-z0-9]{73})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_jfrog-identity-token': re.compile('(?i)[\\w.-]{0,50}?(?:jfrog|artifactory|bintray|xray)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-z0-9]{64})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_jwt': re.compile('\\b(ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_kraken-access-token': re.compile('(?i)[\\w.-]{0,50}?(?:kraken)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-z0-9\\/=_\\+\\-]{80,90})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_kubernetes-secret-yaml': re.compile('(?i)(?:\\bkind:[ \\t]*["\\\']?\\bsecret\\b["\\\']?(?s:.){0,200}?\\bdata:(?s:.){0,100}?\\s+([\\w.-]+:(?:[ \\t]*(?:\\||>[-+]?)\\s+)?[ \\t]*(?:["\\\']?[a-z0-9+/]{10,}={0,3}["\\\']?|\\{\\{[ \\t\\w"|$:=,.-]+}}|""|\\\'\\\'))|\\bdata:(?s:.){0,100}?\\s+([\\w.-]+:(?:[ \\t]*(?:\\||>[-+]?)\\s+)?[ \\t]*(?:["\\\']?[a-z0-9+/]{10,}={0,3}["\\\']?|\\{\\{[ \\t\\w"|$:=,.-]+}}|""|\\\'\\\'))(?s:.){0,200}?\\bkind:[ \\t]*["\\\']?\\bsecret\\b["\\\']?)'),
'gl_kucoin-access-token': re.compile('(?i)[\\w.-]{0,50}?(?:kucoin)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-f0-9]{24})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_kucoin-secret-key': re.compile('(?i)[\\w.-]{0,50}?(?:kucoin)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_launchdarkly-access-token': re.compile('(?i)[\\w.-]{0,50}?(?:launchdarkly)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-z0-9=_\\-]{40})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_linear-client-secret': re.compile('(?i)[\\w.-]{0,50}?(?:linear)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-f0-9]{32})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_linkedin-client-id': re.compile('(?i)[\\w.-]{0,50}?(?:linked[_-]?in)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-z0-9]{14})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_linkedin-client-secret': re.compile('(?i)[\\w.-]{0,50}?(?:linked[_-]?in)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-z0-9]{16})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_lob-api-key': re.compile('(?i)[\\w.-]{0,50}?(?:lob)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}((live|test)_[a-f0-9]{35})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_lob-pub-api-key': re.compile('(?i)[\\w.-]{0,50}?(?:lob)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}((test|live)_pub_[a-f0-9]{31})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_looker-client-id': re.compile('(?i)[\\w.-]{0,50}?(?:looker)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-z0-9]{20})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_looker-client-secret': re.compile('(?i)[\\w.-]{0,50}?(?:looker)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-z0-9]{24})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_mailchimp-api-key': re.compile('(?i)[\\w.-]{0,50}?(?:MailchimpSDK.initialize|mailchimp)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-f0-9]{32}-us\\d\\d)(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_mailgun-private-api-token': re.compile('(?i)[\\w.-]{0,50}?(?:mailgun)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}(key-[a-f0-9]{32})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_mailgun-pub-key': re.compile('(?i)[\\w.-]{0,50}?(?:mailgun)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}(pubkey-[a-f0-9]{32})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_mailgun-signing-key': re.compile('(?i)[\\w.-]{0,50}?(?:mailgun)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_mapbox-api-token': re.compile('(?i)[\\w.-]{0,50}?(?:mapbox)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}(pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_mattermost-access-token': re.compile('(?i)[\\w.-]{0,50}?(?:mattermost)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-z0-9]{26})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_maxmind-license-key': re.compile('\\b([A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_messagebird-api-token': re.compile('(?i)[\\w.-]{0,50}?(?:message[_-]?bird)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([a-z0-9]{25})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_messagebird-client-id': re.compile('(?i)[\\w.-]{0,50}?(?:message[_-]?bird)(?:[ \\t\\w.-]{0,20})[\\s\\\'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60\\\'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60\\\'"\\s;]|\\\\[nr]|$)'),
'gl_microsoft-teams-webhook': re.compile(r'https://[a-z0-9]+\.webhook\.office\.com/webhookb2/[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}'),
'kh_anthropic': re.compile(r'sk-ant-api03-[A-Za-z0-9_-]{93}'),
'kh_fireworks': re.compile(r'fw_[A-Za-z0-9]{32,}'),
'kh_google': re.compile(r'AIza[0-9A-Za-z_-]{35}'),
'kh_grok': re.compile(r'xai-[A-Za-z0-9]{48,}'),
'kh_groq': re.compile(r'gsk_[A-Za-z0-9]{52,}'),
'kh_huggingface': re.compile(r'hf_[A-Za-z0-9]{34,}'),
'kh_mailchimp': re.compile(r'[a-f0-9]{32}-us[0-9]{1,2}'),
'kh_mailgun': re.compile(r'key-[a-f0-9]{32}'),
'kh_openai': re.compile(r'sk-[A-Za-z0-9]{20}T3BlbkFJ[A-Za-z0-9]{20}|sk-proj-[A-Za-z0-9_-]{48,180}|sk-[a-zA-Z0-9]{48}'),
'kh_paypal': re.compile(r'access_token\$production\$[a-z0-9]{16}\$[a-f0-9]{32}'),
'kh_perplexity': re.compile(r'pplx-[A-Za-z0-9]{48,}'),
'kh_replicate': re.compile(r'r8_[A-Za-z0-9]{38,}'),
'kh_sendgrid': re.compile(r'SG\.[A-Za-z0-9_-]{22}\.[A-Za-z0-9_-]{43}'),
'kh_square': re.compile(r'sq0[a-z]{3}-[0-9A-Za-z_-]{22,50}'),
'kh_stripe_live': re.compile(r'sk_live_[0-9a-zA-Z]{24,99}'),
'kh_stripe_restricted': re.compile(r'rk_live_[0-9a-zA-Z]{24,99}'),
'kh_twilio': re.compile(r'SK[a-f0-9]{32}'),
}