Advertisement
Guest User

Untitled

a guest
Jun 8th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <html>
  2. <body>
  3. <p>Enter something here:<br>
  4. <form name="Example" action="index.php" method="post">
  5. <input type="text" name="data" style="width: 300px;">
  6. <input type="submit" value="submit">
  7. </form></center>
  8. <?php
  9. if(isset($_POST["data"])) {
  10. $mydata = $_POST["data"];
  11. if(preg_match('/^[a-zA-Z0-9_.]+$/', $mydata)) {
  12. $submit = escapeshellcmd($mydata);
  13. $query = shell_exec("powershell -command C:\\inetpub\\ps.ps1 $submit");
  14. echo "It worked: $query";
  15. } else {
  16. echo "Invalid character";
  17. }
  18. }
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement