Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

1. The actual HTML Website with a button.
2. A php script which executes the script
3. A Script

The File Tree:

 


No Format
root@test:/var/www/html# tree testscript/
testscript/
???- index.html
???- testexec.php
??? -test.sh

1. The main WebPage:

No Format
root@test:/var/www/html# cat testscript/indexcat<<'EOF'>index.html
<form action="/testscript/testexec.php">
    <input type="submit" value="Open Script">
</form>
EOF

 


2. The PHP Page that runs the script and redirects back to the main page:

No Format
root@test:/var/www/html# cat testscript/testexeccat<<'EOF'>testexec.php
 
<?php
shell_exec("/var/www/html/testscript/test.sh");
header('Location: httphttps://192odev.168freesoftwareservers.1.222com/testscriptwebhooks/index.html?success=true');
?>
EOF

3. The Script :

No Format
root@test:/var/www/html# cat testscript/test.sh
cat<<'EOF'>test.sh
#!/bin/bash

touch /tmp/testfile 

...

testfile 
EOF