Skip to content

Commit 5117480

Browse files
authored
Add script for enumerating GitHub org members' emails
Added a script to enumerate GitHub organization members and find their public emails.
1 parent 8ed6b05 commit 5117480

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

Threat_Intel.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ azscan -domain umgc
537537

538538
## GitHub Email Addresses
539539

540-
A script for enumerating GitHub to find a user's email:
540+
- A script for enumerating GitHub to find a user's email:
541541

542542
```sh
543543
#!/usr/bin/env bash
@@ -573,6 +573,41 @@ else
573573
fi
574574
```
575575

576+
- Script to enumerate all users in a GitHub organization and find their public emails
577+
578+
```sh
579+
#!/usr/bin/env bash
580+
581+
# Script to enumerate all users in a GitHub org and find their public emails using gh CLI
582+
583+
ORG="$1"
584+
PER_PAGE=100
585+
586+
if [ -z "$ORG" ]; then
587+
echo "Usage: $0 <github_organization>"
588+
exit 1
589+
fi
590+
591+
echo "Enumerating users and searching for public emails in GitHub organization: $ORG"
592+
593+
page=1
594+
while :; do
595+
USERS=$(gh api "/orgs/$ORG/members?per_page=$PER_PAGE&page=$page" | jq -r '.[].login')
596+
[ -z "$USERS" ] && break
597+
598+
for USERNAME in $USERS; do
599+
PROFILE_EMAIL=$(gh api "/users/$USERNAME" | jq -r '.email // empty')
600+
if [ -n "$PROFILE_EMAIL" ]; then
601+
echo "$USERNAME: $PROFILE_EMAIL"
602+
else
603+
echo "$USERNAME: No public email"
604+
fi
605+
done
606+
607+
((page++))
608+
done
609+
```
610+
576611
## Code Enumeration with Grep App
577612

578613
- Rapidly scan millions of code repositories with Grep App:

0 commit comments

Comments
 (0)