|
8 | 8 | $_SESSION['logged_in']="0"; |
9 | 9 | }}else if($status != "1"){ |
10 | 10 | header("Location: /404.php");} |
| 11 | +include "user.php"; |
11 | 12 | ?> |
12 | 13 | <html> |
13 | 14 | <head> |
|
17 | 18 | <body> |
18 | 19 | <h1 style="text-align: center;">Admin Panel</h1> |
19 | 20 | <a href="logout.php">Logout</a><hr> |
20 | | -<p>Below is version v.000001 of admin panel by NerdOfCode</p> |
21 | | -<p>You can execute shell commands seperately from Mysql commands</p> |
22 | | -<form action="" name="query" id="query" method="post"> |
23 | | - SHELL:   <input type="text" id="query_box" name="query_box" placeholder="Ex: whoami"></input><br><br> |
24 | | - DBNAM: <input type="text" id="mysql_get" name="mysql_get" placeholder="ex: custom" value="<?php echo $_SESSION[udb];?>"></input><br><br> |
25 | | - HOST :    <input type="text" id="host" name="host" placeholder="localhost" value="<?php echo $_SESSION['host'];?>"></input><br><br> |
26 | | - USER :    <input type="text" id="username" name="username" value="<?php echo $_SESSION['mysql_user'];?>"></input><br><br> |
27 | | - PASS :     <input type="password" id="password" name="password" value="<?php echo $_SESSION['mysql_pass'];?>"></input></br><br> |
28 | | - QUERY:   <input type="text" id="myquery" name="myquery" placeholder="SELECT * FROM test;" value="<?php echo $_SESSION['query'];?>"></input><br><br> |
29 | | - <button type="Submit" value="Submit">Submit</button> |
30 | | - |
31 | | -</form> |
| 21 | +<p>You are currently running version <?php echo $version; ?></p> |
| 22 | +<p>Below you will find shortcuts to a number of settings meant to replace SSH</p> |
32 | 23 |
|
| 24 | +<a href="shell.php"><p class="server">EXECUTE SHELL</p></a> |
| 25 | +<a href="mysql_exec.php"><p class="server">EXECUTE MYSQL</p></a> |
33 | 26 | </body> |
34 | 27 |
|
35 | | -<?php |
36 | | -$udb=$_POST['mysql_get'];//Database |
37 | | -$user=$_POST['user']; |
38 | | -$pass=$_POST['pass']; |
39 | | -$query=$_POST['myquery'];//Commands |
40 | | -$host=$_POST['host']; |
41 | | -//Set all current values as session variables below |
42 | | -$_SESSION['saved_info']="1";$_SESSION['udb']="$udb";$_SESSION['mysql_user']="$user";$_SESSION['mysql_pass']="$pass";$_SESSION['query']="$query";$_SESSION['host']="$host"; |
43 | | - |
44 | | - |
45 | | -$db = mysqli_connect($host,$user,$pass,$udb) or die("<p style=\"color:red;\"><b>Error: </b> connection to MySQL failed. Please re-enter information and try again.</p>"); |
46 | | -mysqli_query($db, $query) or die("Unable to access MYSQL"); |
47 | | -$result = mysqli_query($db, $query); |
48 | | -$row = mysqli_fetch_array($result); |
49 | | -$column=$row['password']; |
50 | | -echo "<b>Query Result: $column</b><br>"; |
51 | | -$mysqli_close($db); |
52 | | - |
53 | | -$cwd=getcwd(); |
54 | | -echo "<br>Current directory: $cwd<br>"; |
55 | | -$shell = $_POST['query_box']; |
56 | | -$run = exec("$shell"); |
57 | | -echo "<br><b>Output: $run</b><br>"; |
58 | | -?> |
59 | | - |
60 | 28 |
|
61 | 29 | </html> |
0 commit comments