File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ iptables -nL INPUT | egrep "ACCEPT +tcp +-- +0\.0\.0\.0/0 +0\.0\.0\.0/0 +tcp dpt
5151if [[ $? == 0 ]]; then
5252 echo " Executing: iptables -D INPUT -p tcp --dport 2222 -j ACCEPT"
5353 iptables -D INPUT -p tcp --dport 2222 -j ACCEPT
54+ if [[ $? != 0 ]]; then
55+ echo " ERROR: failed to remove iptables rule!"
56+ exit -1
57+ fi
5458fi
5559
5660# Check if the PREROUTING table has a REDIRECT for port 22 to 2222. If so,
@@ -59,7 +63,11 @@ iptables -t nat -nL PREROUTING | egrep "REDIRECT +tcp +-- +0\.0\.0\.0/0 +0\.0\.0
5963if [[ $? == 0 ]]; then
6064 echo " Executing: iptables -t nat -D PREROUTING -p tcp --dport 22 -j REDIRECT --to-ports 2222"
6165 iptables -t nat -D PREROUTING -p tcp --dport 22 -j REDIRECT --to-ports 2222
66+ if [[ $? != 0 ]]; then
67+ echo " ERROR: failed to remove iptables rule!"
68+ exit -1
69+ fi
6270fi
6371
64- echo -e " \nDone! \n"
72+ echo -e " \nSuccessfully stopped sshd_mitm daemon and disabled forwarding rules. \n"
6573exit 0
You can’t perform that action at this time.
0 commit comments