Paper Details  
 
   

Has Bibliography
48 Pages
11996 Words

 
   
   
    Filter Topics  
 
     
   
 

sendmail

- [ SendmailD ] -- #editor's notes: SendmailD stands for Sendmail Daemon(1), just like TelnetD stands for Telnet Daemon etc'#!/usr/bin/perluse Socket;$port=25;$hostname="booga.com"; # does windog have gethostbyname?$banner="220 boogaa.com ESMTP Sendmail 8.6.1/8.5.0nr"; # 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,"");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 $ipaddrn";print NS $banner;while(*NS*) {if (/EHLO/i) {print NS "Hello $ipaddr. nice to meet younr";} else { print NS "$fail $_r"; print "tried $_"; }}print "$ipaddr disconnectedn";close(NS);}-- [ End of SendmailD ] ---- [ Telnetd ] --#!/usr/bin/perluse Socket;$port=23;$login="nrlogin:";$password="password:";$banner="nrnrUnix(r) System V Release 4.0 (brooder)nr";$fail="login incorrect.nr";socket(S,AF_INET,SOCK_STREAM,$protocol) || die "socket: $!";$sockaddr='S n a4 x8';$this=pack($sockaddr,AF_INET,$port,"");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 $ipaddrn";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 give...

< Prev Page 36 of 48 Next >

    More on sendmail...

    Loading...
 
Copyright © 1999 - 2025 CollegeTermPapers.com. All Rights Reserved. DMCA