Topic: lookin for fake telnet

Im looking for a fake telnet daemon that wont let anyone log in ever but looks like the real deal. Login attempts should be emailed as alarms.

I can run a full blown honeyd but i dont want that much functionality or the abilty to see what attacks are happening ....only trigger on login attempts.

Anyone seen something like this about?

Re: lookin for fake telnet

Found something. Posted here for posterity... would welcome other options.

http://www.darkfall.demon.co.uk/fallen/ … dmail.html

Appendix A: Fake Daemons(1)
I found these two fake daemons (Sendmail and Telnet(19)) at packetstorm.securify.com once. They're great to fool attackers and to play tricks on your friends.
These are Perl (a programming language) programs.
To execute them (no, executing a file doesn't have anything to do with killing it...) on Unix, simply type ./filename and replace filename with the name of the file you wish to execute. Every Unix "flavor", "distribution" or whatever you want to call it, comes with Perl (I think. Correct me if I'm wrong: barakirs@netvision.net.il).
To execute them under DOS/Windows, you have to download Active Perl from www.activeperl.com and then simply double click them.
I don't know how to execute them under Mac. I guess Active Perl supports Macs, but I'm not sure.

Now, on to the fake daemons.
These two daemons came in a single package together with a readme file. Following are all three files. I did not alter any of those files, it's up to you to do so. Play with them and learn.
Oh, by the way, if you wish to learn Perl (or any other programming language), head off to http://blacksun.box.sk and find the books section.
Enjoy!

== Readme ==

heh.. this piece is no way serious, but if anyone think it would be cool to
keep working on the piece, drop a line with your ideas. We may develop it
further. ;-). I basically coded it just for fun, when I had few spare
minutes.


The piece is supposed to be `want-to-be-Windog-Deception-toolkit' which
contains sample sendmail.pl and telnetd.pl which are supposed to be fake
sendmail and telnet daemons. To run this code you will need to download
and install perl for windoze. (I used active perl from
http://www.activeware.com to test it).

Hope you will have fun with it

C.P.
fygrave@tigerteam.net
Sun May 23 17:12:51 KGST 1999

== End of Readme ==

-- [ SendmailD ] -- #editor's notes: SendmailD stands for Sendmail Daemon(1), just like TelnetD stands for Telnet Daemon etc'

#!/usr/bin/perl

use Socket;

$port=25;
$hostname="booga.com"; # does windog have gethostbyname?
$banner="220 boogaa.com ESMTP Sendmail 8.6.1/8.5.0\n\r"; # date should be aslo here
$fail="500 Command unrecognized:";

socket(S,AF_INET,SOCK_STREAM,$protocol) || die "socket: $!";

$sockaddr='S n a4 x8';

$this=pack($sockaddr,AF_INET,$port,"\0\0\0\0");

bind(S,$this) || die "bind: $!";

listen(S,10) || die "listen: $!";

select(S);
$|=1;
select(STDOUT);

while(1) {
($addr= accept(NS,S)) || die "accept: $!";

select(NS);
$|=1;
select(STDOUT);

#
#here we should fork. but damn windog doesn't support this. crap.
# Any ideas?
($af,$port,$inetaddr)=unpack($sockaddr,$addr);
@inetaddr=unpack('C4',$inetaddr);
($i1,$i2,$i3,$i4)=@inetaddr;
$ipaddr="$i1.$i2.$i3.$i4";
print "connected from $ipaddr\n";

print NS $banner;
while(<NS>) {
if (/EHLO/i) {
print NS "Hello $ipaddr. nice to meet you\n\r";
} else {
print NS "$fail $_\r";
print "tried $_";
}
}
print "$ipaddr disconnected\n";

close(NS);
}

-- [ End of SendmailD ] --

-- [ Telnetd ] --

#!/usr/bin/perl

use Socket;

$port=23;
$login="\n\rlogin:";
$password="password:";
$banner="\n\r\n\rUnix(r) System V Release 4.0 (brooder)\n\r";
$fail="login incorrect.\n\r";

socket(S,AF_INET,SOCK_STREAM,$protocol) || die "socket: $!";

$sockaddr='S n a4 x8';

$this=pack($sockaddr,AF_INET,$port,"\0\0\0\0");

bind(S,$this) || die "bind: $!";

listen(S,10) || die "listen: $!";

select(S);
$|=1;
select(STDOUT);

while(1) {
($addr= accept(NS,S)) || die "accept: $!";

select(NS);
$|=1;
select(STDOUT);

#
#here we should fork. but damn windog doesn't support this. crap.
# Any ideas?
($af,$port,$inetaddr)=unpack($sockaddr,$addr);
@inetaddr=unpack('C4',$inetaddr);
($i1,$i2,$i3,$i4)=@inetaddr;
$ipaddr="$i1.$i2.$i3.$i4";
print "connected from $ipaddr\n";

print NS $banner;
print NS $login;
while(<NS>) {
print "attempt to log in as $_\n";
print NS "$password";

$ll=<NS> || last;
sleep 5;
print "tried password $ll. Login incorrect is given\n";
print NS $fail;
print NS $login;
}
print "$ipaddr disconnected\n";

close(NS);
}

-- [ End of TelnetD ] --

Re: lookin for fake telnet

You could use inetd to run a slightly hacked version of the real telnetd with an unprivileged uid.

Or an unhacked telnetd, with -L pointing to a slightly hacked version of /bin/login.

This way the emulation of a real telnetd would be perfect.

Re: lookin for fake telnet

thats an interesting idea. will ponder it

Re: lookin for fake telnet

Why not just capture connections coming in to that port and get an email of the IP who made the connection? Unless you want to display a login/password prompt to them but isn't that a waste of server resources instead of just closing down the service? If your constantly being attacked i'd capture the information and call the cops if the IP's are originating from the US. We are working with some web content management solutions company to rebuild some addons to Ubuntu and integrate them with our backend web interfaces.

Re: lookin for fake telnet

I like to use ProteMac LoginTrap (protemac.com)

Re: lookin for fake telnet

<a href="http://www.databasepublish.com/solutions/web-content-management-systems">web content management solutions</a>

Re: lookin for fake telnet

Any program with a hidden intent. Trojans are one of the leading causes of breaking into machines. If you pull down a program from a chat room when looking for
Generic Viagra , new group, or even from unsolicited e-mail, then the program is likely trojaned with some subversive purpose.