-
Notifications
You must be signed in to change notification settings - Fork 0
/
git_misconfiguration.sh
executable file
·73 lines (50 loc) · 1.54 KB
/
git_misconfiguration.sh
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
#A script which is used to check for git misconfirations on various domains supplied by user in a file
echo
read -p "Enter the location of file to read: "
echo "${REPLY}"
INPUT=${REPLY}
COUNT=0
echo
echo
read -p "Enter the location of .git files to Store (if not found,it will create the directory): "
INPUT2=${REPLY}
#################################################################
#Check if user supplied a valid path
echo
echo
if [[ -f "${INPUT}" ]]
then
echo "File located succesfully..."
else
echo "Enter correct path! "
exit 1
fi
echo
echo
###################################################################
#Count number of webistes to check for Git Misconfiguration
for http in $(cat ${INPUT})
do
((COUNT++))
done
echo "Number of websites to process: ${COUNT}"
echo
###################################################################
#___Check and download for .git directory on all domains___########
#Create a temporary file of domain names
echo "Creating a temporary file...."
echo
(cat ${INPUT} > tmp_domain_names.txt)
#Append /.git/ on the domain names of temporary file
echo "Appending .git on supplied domains "
(awk '{print $0"/.git/"}' tmp_domain_names.txt > tmp_append_git.txt)
echo
#Catch and download .git folders of domains supplied in the file
echo
echo "Looking for exposed .git folders...."
echo
(wget -r -P ${INPUT2}website_output -i tmp_append_git.txt)
echo
echo "Check Download_location/website_output folder for any git catches"
#Still working on using a sudomain enumeration tool to look for other .git access#