Skip to content

Instantly share code, notes, and snippets.

View kumarchandresh's full-sized avatar
πŸ› οΈ
Tinkering stuff

Kumar Chandresh kumarchandresh

πŸ› οΈ
Tinkering stuff
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.

#Requires AutoHotkey v2.0
; AutoHotkey script for animation cancel in Stardew Valley
; Source: https://forums.stardewvalley.net/threads/a-better-animation-canceling-autohotkey-script.7391/
#HotIf WinActive("ahk_exe StardewModdingAPI.exe") or WinActive("ahk_exe Stardew Valley.exe")
SleepForFrames(x)
{
@kumarchandresh
kumarchandresh / tsconfig.json
Created December 6, 2023 08:24
tsconfig.json
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
function daily_calendar(tp) {
const lines = [];
lines.push("| SUN | MON | TUE | WED | THU | FRI | SAT |");
lines.push("| :---: | :---: | :---: | :---: | :---: | :---: | :---: |");
const now = tp.user.daily_note(tp);
const before = Array(now.date(1).weekday()).fill(0).map(() => " ");
const after = Array(6 - now.date(now.daysInMonth()).weekday()).fill(0).map(() => " ");
const during = Array(now.daysInMonth()).fill(0).map((_, i) => i + 1);
const calendar = [...before, ...during, ...after];
while (calendar.length) {
function hexToRgb(hex) {
if (!/^#?([A-F0-9]{3}){1,2}$/gim.test(hex)) {
throw new TypeError("Bad Hex");
}
digits = hex.replace("#", "").split("");
if (digits.length == 3) {
digits = digits.flatMap(n => Array(2).fill(n));
}
val = "0x" + digits.join("");
r = (val >> 16) & 0xff;
//β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”//
//β”‚ Network β”‚//
//β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜//
rate "786432"
cl_cmdrate "64"
cl_updaterate "64"
cl_interpolate "1"
cl_interp "0"
cl_interp_ratio "1"
@kumarchandresh
kumarchandresh / flask-environment.yml
Created July 12, 2022 05:49
Setup Flask environment for web developement.
name: flask-env
channels:
- conda-forge
dependencies:
- flask
- flask-sqlalchemy
@kumarchandresh
kumarchandresh / nord.json
Last active February 4, 2022 04:33
nord theme : windows terminal + oh-my-posh
{
"name": "nord",
"background": "#2E3440",
"foreground": "#D8DEE9",
"selectionBackground": "#434C5E",
"black": "#2E3440",
"white": "#E5E9F0",
"brightBlack": "#434C5E",
"brightWhite": "#ECEFF4",
"brightBlue": "#81A1C1",
@kumarchandresh
kumarchandresh / LimitFPS.cpp
Created December 6, 2021 10:56
How to limit FPS using C++ on Win32.
#include <tchar.h>
#include <Windows.h>
#define TARGET_FPS 60
INT64 QPCFrequency;
LRESULT CALLBACK WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
INT64 __forceinline ElapsedMicroseconds(INT64 startCount, INT64 endCount)
@kumarchandresh
kumarchandresh / console-win32.c
Created December 1, 2021 23:46
Output to console in win32 app
// printf and cout will work as usual
FILE* fp;
AllocConsole();
freopen_s(&fp, "CONIN$", "r", stdin);
freopen_s(&fp, "CONOUT$", "w", stdout);
freopen_s(&fp, "CONOUT$", "w", stderr);
// Source: https://stackoverflow.com/a/19406695/5887576