aboutsummaryrefslogtreecommitdiffstats
path: root/nocompile/libexec/telnet-gateway.sh
blob: aac9dd678dc3d88935a77b91dcd69a2b1047215c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
grep "^telnet:" /var/www/sites/hacking/links.txt \
 | cat -n
printf "Which do you want to connect to?\nnumber: "
read N
export N=$(printf "%s" "$N" | sed "s/[^0-9]//g")
serverURL=$(grep "^telnet:" /var/www/sites/hacking/links.txt \
 | cut '-d ' -f1 \
 | head -n${N} \
 | tail -n1)
echo "You've selected: $serverURL (#$N)"
printf "connecting in...\n"
for i in `seq 5 1`;do
 printf "\r%d..." $i
 sleep 1
done
port=$(printf "%s" "$serverURL" | cuturl | grep ^port | cut '-d ' -f2)
exec ncat -i 600 $(printf "%s" "$serverURL" \
                     | cuturl \
                     | grep ^domain \
                     | cut '-d ' -f2 ) $port