Skip to content

Commit 80341ec

Browse files
authored
Merge pull request #1493 from HackTricks-wiki/research_update_src_generic-methodologies-and-resources_external-recon-methodology_github-leaked-secrets_20251016_082732
Research Update Enhanced src/generic-methodologies-and-resou...
2 parents 06a6881 + 1b98edb commit 80341ec

File tree

4 files changed

+75
-21
lines changed

4 files changed

+75
-21
lines changed

src/binary-exploitation/ios-exploiting/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ These are the defenses built into modern userland xzone:
11481148
---
11491149

11501150
If you like, I can also generate a cheat-sheet or diagram of xzone internals for your book. Do you want me to do that next?
1151-
::contentReference[oaicite:20]{index=20}
1151+
::contentReference[oai:20]{index=20}
11521152

11531153

11541154
---

src/generic-methodologies-and-resources/external-recon-methodology/github-leaked-secrets.md

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,73 @@
1212
- [https://github.com/JaimePolop/RExpository](https://github.com/JaimePolop/RExpository)
1313
- [https://github.com/Yelp/detect-secrets](https://github.com/Yelp/detect-secrets)
1414
- [https://github.com/hisxo/gitGraber](https://github.com/hisxo/gitGraber)
15-
- [https://github.com/eth0izzle/shhgit](https://github.com/eth0izzle/shhgit)
15+
- https://github.com/eth0izzle/shhgit (unmaintained)
1616
- [https://github.com/techgaun/github-dorks](https://github.com/techgaun/github-dorks)
17-
- [https://github.com/michenriksen/gitrob](https://github.com/michenriksen/gitrob)
18-
- [https://github.com/anshumanbh/git-all-secrets](https://github.com/anshumanbh/git-all-secrets)
17+
- https://github.com/michenriksen/gitrob (archived)
18+
- https://github.com/anshumanbh/git-all-secrets (archived)
1919
- [https://github.com/awslabs/git-secrets](https://github.com/awslabs/git-secrets)
2020
- [https://github.com/kootenpv/gittyleaks](https://github.com/kootenpv/gittyleaks)
2121
- [https://github.com/obheda12/GitDorker](https://github.com/obheda12/GitDorker)
2222

23+
> Notes
24+
> - TruffleHog v3 can verify many credentials live and scan GitHub orgs, issues/PRs, gists, and wikis. Example: `trufflehog github --org <ORG> --results=verified`.
25+
> - Gitleaks v8 supports scanning git history, directories and archives: `gitleaks detect -v --source .` or `gitleaks detect --source <repo> --log-opts="--all"`.
26+
> - Nosey Parker focuses on high-throughput scanning with curated rules and has an Explorer UI for triage. Example: `noseyparker scan --datastore np.db <path|repo>` then `noseyparker report --datastore np.db`.
27+
> - ggshield (GitGuardian CLI) provides pre-commit/CI hooks and Docker image scanning: `ggshield secret scan repo <path-or-url>`.
28+
29+
### Where secrets commonly leak in GitHub
30+
31+
- Repository files in default and non-default branches (search `repo:owner/name@branch` in the UI).
32+
- Full git history and other branches/tags (clone and scan with gitleaks/trufflehog; GitHub search focuses on indexed content).
33+
- Issues, pull requests, comments, and descriptions (TruffleHog GitHub source supports these via flags like `--issue-comments`, `--pr-comments`).
34+
- Actions logs and artifacts of public repositories (masking is best-effort; review logs/artifacts if visible).
35+
- Wikis and release assets.
36+
- Gists (search with tooling or the UI; some tools can include gists).
37+
38+
> Gotchas
39+
> - GitHub’s REST code search API is legacy and does not support regex; prefer the Web UI for regex searches. The gh CLI uses the legacy API.
40+
> - Only files below a certain size are indexed for search. To be thorough, clone and scan locally with a secrets scanner.
41+
42+
### Programmatic org-wide scanning
43+
44+
- TruffleHog (GitHub source):
45+
```bash
46+
export GITHUB_TOKEN=<token>
47+
trufflehog github --org Target --results=verified \
48+
--include-wikis --issue-comments --pr-comments --gist-comments
49+
```
50+
- Gitleaks over all org repos (clone shallow and scan):
51+
```bash
52+
gh repo list Target --limit 1000 --json nameWithOwner,url \
53+
| jq -r '.[].url' | while read -r r; do
54+
tmp=$(mktemp -d); git clone --depth 1 "$r" "$tmp" && \
55+
gitleaks detect --source "$tmp" -v || true; rm -rf "$tmp";
56+
done
57+
```
58+
- Nosey Parker over a mono checkout:
59+
```bash
60+
# after cloning many repos beneath ./org
61+
noseyparker scan --datastore np.db org/ && noseyparker report --datastore np.db
62+
```
63+
- ggshield quick scans:
64+
```bash
65+
# current working tree
66+
ggshield secret scan path -r .
67+
# full git history of a repo
68+
ggshield secret scan repo <path-or-url>
69+
```
70+
71+
> Tip: For git history, prefer scanners that parse `git log -p --all` to catch removed secrets.
72+
73+
### Updated dorks for modern tokens
74+
75+
- GitHub tokens: `ghp_` `gho_` `ghu_` `ghs_` `ghr_` `github_pat_`
76+
- Slack tokens: `xoxb-` `xoxp-` `xoxa-` `xoxs-` `xoxc-` `xoxe-`
77+
- Cloud and general:
78+
- `AWS_ACCESS_KEY_ID` `AWS_SECRET_ACCESS_KEY` `aws_session_token`
79+
- `GOOGLE_API_KEY` `AZURE_TENANT_ID` `AZURE_CLIENT_SECRET`
80+
- `OPENAI_API_KEY` `ANTHROPIC_API_KEY`
81+
2382
### **Dorks**
2483

2584
```bash
@@ -304,7 +363,15 @@ AWS SECRET
304363
"private" extension:pgp
305364
```
306365

307-
{{#include ../../banners/hacktricks-training.md}}
366+
{{#ref}}
367+
wide-source-code-search.md
368+
{{#endref}}
369+
308370

309371

310372

373+
## References
374+
375+
- Keeping secrets out of public repositories (GitHub Blog, Feb 29, 2024): https://github.blog/news-insights/product-news/keeping-secrets-out-of-public-repositories/
376+
- TruffleHog v3 – Find, verify, and analyze leaked credentials: https://github.com/trufflesecurity/trufflehog
377+
{{#include ../../banners/hacktricks-training.md}}

src/macos-hardening/macos-security-and-privilege-escalation/mac-os-architecture/macos-kernel-extensions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ pyimg4 im4p extract -i kernelcache.release.iphone14 -o kernelcache.release.iphon
131131
# imjtool (https://newandroidbook.com/tools/imjtool.html)
132132
imjtool _img_name_ [extract]
133133

134-
# disarm (you can use it directly on the IMG4 file) - https://newandroidbook.com/tools/disarm.html
134+
# disarm (you can use it directly on the IMG4 file) - [https://newandroidbook.com/tools/disarm.html](https://newandroidbook.com/tools/disarm.html)
135135
disarm -L kernelcache.release.v57 # From unzip ipsw
136136

137-
# disamer (extract specific parts, e.g. filesets) - https://newandroidbook.com/tools/disarm.html
137+
# disamer (extract specific parts, e.g. filesets) - [https://newandroidbook.com/tools/disarm.html](https://newandroidbook.com/tools/disarm.html)
138138
disarm -e filesets kernelcache.release.d23
139139
```
140140

src/macos-hardening/macos-security-and-privilege-escalation/macos-security-protections/macos-macf-mandatory-access-control-framework.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -447,18 +447,5 @@ __END_DECLS
447447
448448
- [**\*OS Internals Volume III**](https://newosxbook.com/home.html)
449449
450-
{{#include ../../../banners/hacktricks-training.md}}
451-
452-
453-
454-
455-
456450
457-
458-
on system boot, IMage4, AMFI and Sandbox are fisrt to load
459-
460-
AMFI registers label #1 - attacher to the creds stores the entielements of process
461-
462-
during kern_exec.c -> exec_actovate_image -> macho activation (loader) -> load_code_signature --> hook vnode_check_signature
463-
464-
this will offload all of the
451+
{{#include ../../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)