Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
636 B

  1. #!./perl
  2. $pat = 'S n C4 x8';
  3. $inet = 2;
  4. $echo = 7;
  5. $smtp = 25;
  6. $nntp = 119;
  7. $test = 2345;
  8. $SIG{'INT'} = 'dokill';
  9. $this = pack($pat,$inet,0, 128,149,13,43);
  10. $that = pack($pat,$inet,$test,127,0,0,1);
  11. if (socket(S,2,1,6)) { print "socket ok\n"; } else { die $!; }
  12. if (bind(S,$this)) { print "bind ok\n"; } else { die $!; }
  13. if (connect(S,$that)) { print "connect ok\n"; } else { die $!; }
  14. select(S); $| = 1; select(stdout);
  15. if ($child = fork) {
  16. while (<STDIN>) {
  17. print S;
  18. }
  19. sleep 3;
  20. do dokill();
  21. }
  22. else {
  23. while (<S>) {
  24. print;
  25. }
  26. }
  27. sub dokill { kill 9,$child if $child; }