Skip to content

Instantly share code, notes, and snippets.

View kevin81767's full-sized avatar
🧑‍💻

Kevin Nyawakira kevin81767

🧑‍💻
View GitHub Profile

GitHub Search Syntax for Finding API Keys/Secrets/Tokens

As a security professional, it is important to conduct a thorough reconnaissance. With the increasing use of APIs nowadays, it has become paramount to keep access tokens and other API-related secrets secure in order to prevent leaks. However, despite technological advances, human error remains a factor, and many developers still unknowingly hardcode their API secrets into source code and commit them to public repositories. GitHub, being a widely popular platform for public code repositories, may inadvertently host such leaked secrets. To help identify these vulnerabilities, I have created a comprehensive search list using powerful search syntax that enables the search of thousands of leaked keys and secrets in a single search.

Search Syntax:

(path:*.{File_extension1} OR path:*.{File_extension-N}) AND ({Keyname1} OR {Keyname-N}) AND (({Signature/pattern1} OR {Signature/pattern-N}) AND ({PlatformTag1} OR {PlatformTag-N}))

Examples:

**1.

@kevin81767
kevin81767 / trash.sh
Created September 14, 2020 17:58 — forked from geek-at/trash.sh
The script used to trash a banking phishing site
#!/bin/bash
while :; do
verf=$(cat /dev/urandom | tr -dc '0-9' | fold -w 8 | head -n 1)
pin=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
ip=$(printf "%d.%d.%d.%d\n" "$((RANDOM % 256))" "$((RANDOM % 256))" "$((RANDOM % 256))" "$((RANDOM % 256))")
@kevin81767
kevin81767 / infosec_newbie.md
Created April 25, 2019 12:58 — forked from mubix/infosec_newbie.md
How to start in Infosec
@kevin81767
kevin81767 / webdev_online_resources.md
Created August 13, 2018 16:55 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)