-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitOsint
53 lines (50 loc) · 932 Bytes
/
gitOsint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# Looks for the below keywords and dumps it into a file.
# Run this script inside of a GIT folder.
keywords=(
"password"
"credentials"
"key"
"passwd"
"secret"
"aws_key"
"ftp"
"sftp"
"token"
"secret_key"
"authorization"
"access_token"
"login"
"github_token"
"API_key"
"secret"
"account"
"mlab"
"db_username"
"db_password"
"ssh-rsa"
"auth"
"creds"
"api_key"
"aws"
"-----BEGIN RSA PRIVATE KEY-----"
"-----BEGIN OPENSSH PRIVATE KEY-----"
"-----BEGIN DSA PRIVATE KEY-----"
"-----BEGIN EC PRIVATE KEY-----"
"-----BEGIN PGP PRIVATE KEY BLOCK-----"
"https://hooks.slack.com/services/"
"client_secret"
"CELERY_BROKER_URL"
)
echo
touch result.txt
echo "Usage : ./gitDump.sh [ignore-case]" >> result.txt
echo "=================" >> result.txt
for word in "${keywords[@]}"; do
if [ -z "$1" ]
then
git grep "$word" >> result.txt
else
git grep "$word" | grep -v $1 >> result.txt
fi
done