Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $script_name = 'Simple Shell Launcher';
- $username = 'admin';
- $password = 'bcp-pass';
- $scripts[0]['file'] = '/opt/bukkit.sh';
- $scripts[0]['name'] = 'Start bukkit';
- $scripts[1]['file'] = '/opt/nyan.sh';
- $scripts[1]['name'] = 'Kill the whole server';
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <title><?php echo $script_name; ?></title>
- </head>
- <body>
- <?php
- if(isset($_POST['username']) AND isset($_POST['password']) AND isset($_POST['scriptno'])){
- $exec_res = shell_exec($scripts[$_POST['scriptno']]['file']);
- ?>
- <h3>Scripts launched</h3>
- <p>Execution result:</p>
- <p>
- <?php if(empty($exec_res)){
- echo '(empty)';
- } else {
- echo $exec_res;
- }
- ?>
- </p>
- <?php
- } else {
- ?>
- <form action="<?php $PHP_SELF; ?>" method="POST">
- <table>
- <tr>
- <td>
- <p>Username:</p>
- </td>
- <td>
- <input name="username" type="text">
- </td>
- </tr>
- <tr>
- <td>
- <p>Password:</p>
- </td>
- <td>
- <input name="password" type="password" size="20">
- </td>
- </tr>
- <tr>
- <td>
- <p>Script:</p>
- </td>
- <td>
- <select name="scriptno" size="3">
- <?php foreach($scripts as $key=>$value) echo "<option value=\"$key\">" . $value['name'] . '</option>' . "\n";?>
- </select>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <input type="reset">
- <input type="submit">
- </td>
- </tr>
- </table>
- </form>
- <?php
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement