Skip to content

Commit c5af3e1

Browse files
committed
Added Corsy and change steps
1 parent ce9c423 commit c5af3e1

File tree

1 file changed

+38
-20
lines changed

1 file changed

+38
-20
lines changed

magicRecon.sh

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@ NORMAL="\e[0m"
1717
GREEN="\e[92m"
1818

1919
#########SUBDOMAIN ENUMERATIONS#########
20-
echo -e "${BOLD}${GREEN}[+] Starting Subdomain Enumeration"
20+
echo -e "${BOLD}${GREEN}[+] Welcome to MagicRecon"
21+
echo -e ""
22+
echo -e "${BOLD}${GREEN}[+] MagicRecon has 5 steps: "
23+
echo -e "${BOLD}${GREEN}[+] STEP 1: Subdomain Enumeration"
24+
echo -e "${BOLD}${GREEN}[+] STEP 2: JavaScript files and Hidden Endpoints"
25+
echo -e "${BOLD}${GREEN}[+] STEP 3: Find directories and hidden files"
26+
echo -e "${BOLD}${GREEN}[+] STEP 4: Port scan for alive domains"
27+
echo -e "${BOLD}${GREEN}[+] STEP 5: Subdomain headers and response bodies"
28+
29+
echo -e ""
30+
echo -e "${BOLD}${GREEN}[+] STEP 1: Starting Subdomain Enumeration"
2131

2232
#Amass
2333
echo -e "${GREEN}[+] Starting Amass"
@@ -56,6 +66,11 @@ cat domains.txt | ~/go/bin/httprobe | tee -a alive.txt
5666

5767
sort alive.txt | uniq -u
5868

69+
#Corsy
70+
echo -e ""
71+
echo -e "${GREEN}[+] Starting Corsy to find CORS missconfigurations"
72+
python3 ~/Corsy/corsy.py -i alive.txt -o CORS.txt
73+
5974
#Aquatone
6075
echo -e ""
6176
echo -e "${BOLD}${GREEN}[+] Starting Aquatone to take screenshots"
@@ -72,25 +87,9 @@ cat alive.txt | python -c "import sys; import json; print (json.dumps({'domains'
7287

7388
cat domains.txt | python -c "import sys; import json; print (json.dumps({'domains':list(sys.stdin)}))" > domains.json
7489

75-
#########SUBDOMAIN HEADERS#########
76-
echo -e ""
77-
echo -e "${BOLD}${GREEN}[+] Storing subdomain headers and response bodies"
78-
79-
mkdir headers
80-
mkdir responsebody
81-
82-
CURRENT_PATH=$(pwd)
83-
84-
for x in $(cat alive.txt)
85-
do
86-
NAME=$(echo $x | awk -F/ '{print $3}')
87-
curl -X GET -H "X-Forwarded-For: evil.com" $x -I > "$CURRENT_PATH/headers/$NAME"
88-
curl -s -X GET -H "X-Forwarded-For: evil.com" -L $x > "$CURRENT_PATH/responsebody/$NAME"
89-
done
90-
9190
#########JAVASCRIPT FILES#########
9291
echo -e ""
93-
echo -e "${BOLD}${GREEN}[+] Collecting JavaScript files and Hidden Endpoints"
92+
echo -e "${BOLD}${GREEN}[+] STEP 2: Collecting JavaScript files and Hidden Endpoints"
9493

9594
mkdir scripts
9695
mkdir scriptsresponse
@@ -162,9 +161,10 @@ do
162161

163162
cd ..
164163
done
164+
165165
#########FILES AND DIRECTORIES#########
166166
echo -e ""
167-
echo -e "${BOLD}${GREEN}[+] Starting Gobuster to find directories and hidden files"
167+
echo -e "${BOLD}${GREEN}[+] STEP 3: Starting Gobuster to find directories and hidden files"
168168

169169
mkdir directories
170170

@@ -178,13 +178,31 @@ do
178178
rm directories/$NAME
179179
fi
180180
done
181+
181182
#########NMAP#########
182183
echo -e ""
183-
echo -e "${BOLD}${GREEN}[+] Starting Nmap Scan for alive domains"
184+
echo -e "${BOLD}${GREEN}[+]STEP 4: Starting Nmap Scan for alive domains"
184185

185186
mkdir nmapscans
186187

187188
for domain in $(cat domains.txt)
188189
do
189190
nmap -sC -sV -v $domain | tee nmapscans/$domain
190191
done
192+
193+
#########SUBDOMAIN HEADERS#########
194+
echo -e ""
195+
echo -e "${BOLD}${GREEN}[+] STEP 5: Storing subdomain headers and response bodies"
196+
197+
mkdir headers
198+
mkdir responsebody
199+
200+
CURRENT_PATH=$(pwd)
201+
202+
for x in $(cat alive.txt)
203+
do
204+
NAME=$(echo $x | awk -F/ '{print $3}')
205+
curl -X GET -H "X-Forwarded-For: evil.com" $x -I > "$CURRENT_PATH/headers/$NAME"
206+
curl -s -X GET -H "X-Forwarded-For: evil.com" -L $x > "$CURRENT_PATH/responsebody/$NAME"
207+
done
208+

0 commit comments

Comments
 (0)