Skip to content
This repository was archived by the owner on Sep 23, 2022. It is now read-only.

Commit 13ffa21

Browse files
author
NerdOfLinux
authored
Create php_exec.php
1 parent 43a6a4d commit 13ffa21

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

php_exec.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
session_start();
3+
if($_SESSION['status']!="1"){
4+
header("Location: /404.php");
5+
}
6+
?>
7+
<html>
8+
<head>
9+
<title>Admin Panel</title>
10+
<link rel="stylesheet" type="text/css" href="style.css">
11+
</head>
12+
<body>
13+
<h1 style="text-align:center;">Admin Panel</h1>
14+
<a href="logout.php">Logout</a>&ensp;
15+
<a href="options.php">Home</a><hr>
16+
17+
<form action="" name="query" id="query" method="post">
18+
PHP: &nbsp;&nbsp;&ensp;&nbsp;&nbsp;<input type="text" id="query_box" name="query_box" placeholder="Ex: whoami"></input><br><br>
19+
<button type="Submit" value="Submit">Submit</button>
20+
</form>
21+
<?php
22+
$cwd=getcwd();
23+
echo "<br>Current directory: $cwd<br>";
24+
$shell = $_POST['query_box'];
25+
if (!empty($_POST['query_box'])) {
26+
//Run the shell command
27+
$run = eval($shell);
28+
echo "<br><b>Output: </b><br>";
29+
echo "<pre>$run</pre>";
30+
}else{
31+
echo "<b>Nothing has been run yet.</b>";
32+
}
33+
?>
34+
</body>
35+
</html>

0 commit comments

Comments
 (0)