#!/bin/sh # # FAKED TELNET v0.1.3 beta # (c) 2000 Giancarlo Erra # # Please remeber: THIS SOFTWARE IS HIGHLY INSECURE # and intended only for test and experimental purposes. # I'm not responsible for any damage derived from this # software, use it at your own risk! # # It's experimental code so it's possible that don't # go well on some system nd/or situation. # user="user" password="password" command="command" echo "" >> file.log echo "<----------------------------------------------->" >> file.log echo "" >> file.log echo `date` >> file.log echo "" >> file.log # # This filter on the output of netstat is required, but it is right only # if you have a line similar to this (for example you should get errors # if you try to connect to the same machine on which the faked telnet # is loading): # # tcp 24 0 a-rm50-36.tin.it:telnet sourceforge.net:63637 ESTABLISHED # # This line says that faked telnet is a-rm50-36.tin.it and remote host # sourceforge.net # Please notice that this filter is still very buggy. # # START OF THE FILTER echo `netstat -a | egrep -E telnet` >> file.log fhost=$(netstat -a | egrep -E telnet) ffhost=$(echo $fhost | sed 's/^tcp..[1-9]*//' | sed 's/...[1-9]*//' | sed 's/:[1-9].*.ESTABLISHED$//' | sed 's/^.*:telnet//') fffhost=$(echo $ffhost) #END OF THE FILTER finger @$fffhost >> file.log 2> /dev/null & echo "" >> file.log nslookup $fffhost >> file.log 2> /dev/null & echo "" >> file.log echo "" echo "" echo "" sleep 02 # # This is issue and password/login request # echo "Welcome to Linux RedHat 6.2 (Cartman)" | cat echo "" echo "" sleep 02 echo -n "Router login: " | cat read user sleep 05 echo -n "Password: " | cat read password echo "" >> file.log echo "Utente: $user Password: $password" >> file.log echo "" >> file.log traceroute $fffhost 1>> file.log 2> /dev/null & sleep 05 echo "" echo "" # # Finally, the prompt.... # echo -n "router:~ > " read command sleep 06 echo "" # # Final goodbye message before closing connection ;) # echo "" echo "You are now logged! :)" echo "" echo "Faked Telnet v0.1.3 beta (c) 2000 Giancarlo Erra" echo "" echo "http://alfalinux.sourceforge.net" echo "" echo "" # # Comment out this line to receive a mail with the full file.log # for every connection. I suggest you to leave this untouched. # If you activate this function the user can get a warning message # when you try to send yourself the email. # It is highly insecure code and procedure. # I'll fix and remake this in the future. # #./mailwarn 12> /dev/null & exit #