Skip to content

Instantly share code, notes, and snippets.

View saturn99's full-sized avatar
🧑‍🦳
:)

King Louie saturn99

🧑‍🦳
:)
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.

@saturn99
saturn99 / android-burp-cert.sh
Created August 3, 2022 12:07 — forked from vavkamil/android-burp-cert.sh
One Liner For Installing Burp Certificate Into Android Nougat and Later
# https://securitychops.com/2019/08/31/dev/random/one-liner-to-install-burp-cacert-into-android.html
#
curl --proxy http://127.0.0.1:8080 -o cacert.der http://burp/cert \
&& openssl x509 -inform DER -in cacert.der -out cacert.pem \
&& cp cacert.der $(openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1).0 \
&& adb root \
&& adb remount \
&& adb push $(openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1).0 /sdcard/ \
&& echo -n "mv /sdcard/$(openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1).0 /system/etc/security/cacerts/" | adb shell \
&& echo -n "chmod 644 /system/etc/security/cacerts/$(openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1).0" | adb shell \
@zubiden
zubiden / validate_init_data.js
Created April 17, 2022 03:33
Telegram Web Bots data validation in JavaScript via Web Crypto API (dependency-free)
// Thanks to @MarvinMiles for Telegram Widget Login check function https://gist.github.com/MarvinMiles/f041205d872b0d8547d054eafeafe2a5
// This function validates Web App input https://core.telegram.org/bots/webapps#validating-data-received-via-the-web-app
// Transforms Telegram.WebApp.initData string into object
function transformInitData(initData) {
return Object.fromEntries(new URLSearchParams(initData));
}
// Accepts init data object and bot token
async function validate(data, botToken) {
@saturn99
saturn99 / killswitch.bat
Created September 30, 2021 21:20 — forked from whoamiTM/killswitch.bat
VPN Kill Switch For Windows | Terminal User Interface | route.exe
@echo off
:: GetAdmin
:-------------------------------------
:: Verify permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
:: On Error No Admin
if '%errorlevel%' NEQ '0' (
echo Getting administrative privileges...
@mahmoud-eskandari
mahmoud-eskandari / README.md
Last active April 18, 2023 06:01
SSH Tunnel as systemd service

${LOCAL_ADDR IP:PORT}

یعنی سرور ایرانتون و پورت داخلی که میخواهید روش ساکس داشته باشید و باید با این جایگزین بشود.

مثال:

10.10.10.10:9090

و قسمت پایین هم یوزر سرور خارجتون و آدرس IP سرور خارجیتونه که باید جایگزین کنید تو خط 7 فایل ssh-tunnel-as-systemd.sh

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 17, 2024 18:10
set -e, -u, -o, -x pipefail explanation
@crittermike
crittermike / wget.sh
Last active March 26, 2024 22:49
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@plutoegg
plutoegg / TetherToken.sol
Last active May 25, 2024 08:15
TetherToken.sol - Tether.to USD
pragma solidity ^0.4.11;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
@tejainece
tejainece / cgo1.go
Last active March 27, 2024 04:29
Examples of calling C code from Golang
package main
//#include<stdio.h>
//void inC() {
// printf("I am in C code now!\n");
//}
import "C"
import "fmt"
func main() {
@spikebike
spikebike / client.go
Created March 29, 2012 01:13
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)