Created
November 1, 2018 09:15
-
-
Save wb4r/f33ee3b5044d4e8446ef4258ff26f0fb to your computer and use it in GitHub Desktop.
github repos cloner + trufflehog & gittyleaks checker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USERNAME=$1 | |
# Only reads 200 for now. Havent implemented token + page iteration to extend this | |
# Show repo name when showing findings | |
# display help/usage | |
# display need of install pip install gittyleaks => pip list --format=legacy | grep -F gittyleaks | |
# AND trufflehog => pip install truffleHog | |
echo "Creating directory for $1" | |
mkdir $1 | |
cd $1 | |
echo "" | |
echo "Found these repos:" | |
curl -s https://api.github.com/users/$USERNAME/repos?per_page=200 | jq -r '.[].name' | |
echo "" | |
echo "Downloading repositories" | |
curl -s https://api.github.com/users/$USERNAME/repos?per_page=200 | jq -r '.[].clone_url' | xargs -n 1 git clone | |
echo "" | |
echo "Download doen" | |
echo "" | |
echo "gittyleaks => Checking repos for creds and keys" | |
for d in *; do | |
echo " Checking: $d" | |
gittyleaks -user=$1 -repo $d | |
echo "" | |
echo "" | |
done | |
echo "" | |
echo "truffleHog => Checking repos for creds and keys" | |
for d in *; do | |
echo " Checking: $d" | |
trufflehog --regex --entropy=False $d | |
echo "" | |
echo "" | |
done | |
echo "" | |
echo "Fin" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment