-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathrepossessed.sh
More file actions
executable file
·51 lines (38 loc) · 945 Bytes
/
repossessed.sh
File metadata and controls
executable file
·51 lines (38 loc) · 945 Bytes
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
#!/bin/bash
# RepoSsessed -- By Daniel Miessler
# Find repos possessed by demonic secrets, or something.
export GREP_OPTIONS='--color=always'
# Find interesting files
echo ""
echo "--------- FILES OUTPUT ----------"
echo ""
while read filetype;
do
#find ./target/ -type f | grep -iR $filetype
find ./target/ -type f | rg -ip $filetype
done < filetypes.txt
# Find strings within files
echo ""
echo "------------ STRINGS OUTPUT --------------"
echo ""
while read string;
do
grep -ri $string ./target/
rg -ip $string ./target/
done < strings.txt
# Find regex within files
echo ""
echo "------------ REGEX OUTPUT --------------"
echo ""
while read regex;
do
#grep -re $regex ./target/
rg -ipe $regex ./target/
done < regex.txt
# Output
echo ""
echo ""
echo "RepoSsessed Execution complete…"
echo ""
#echo "Results found: `wc -l results.txt | awk '{ print $1 }'`"
# git grep my_secret $(git rev-list --all)