File tree Expand file tree Collapse file tree 1 file changed +36
-1
lines changed
Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Original file line number Diff line number Diff 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
573573fi
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:
You can’t perform that action at this time.
0 commit comments