Advertisement
Guest User

Untitled

a guest
Jun 8th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. PHP:
  2. <html>
  3. <body>
  4. <p>Enter something here:<br>
  5. <form name="Example" action="index.php" method="post">
  6. <input type="text" name="data" style="width: 300px;">
  7. <input type="submit" value="submit">
  8. </form></center>
  9. <?php
  10. if(isset($_POST["data"])) {
  11. $mydata = $_POST["data"];
  12. $query = shell_exec("powershell -command C:\\inetpub\\ps.ps1 $mydata");
  13. echo "It worked: $query";
  14. }
  15.  
  16. ?>
  17.  
  18. Powershell:
  19.  
  20. Param (
  21. [Parameter(Mandatory=$True)]
  22. [string]$data
  23. )
  24.  
  25. echo $data >> C:\inetpub\log.txt
  26. return $data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement