Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PHP:
- <html>
- <body>
- <p>Enter something here:<br>
- <form name="Example" action="index.php" method="post">
- <input type="text" name="data" style="width: 300px;">
- <input type="submit" value="submit">
- </form></center>
- <?php
- if(isset($_POST["data"])) {
- $mydata = $_POST["data"];
- $query = shell_exec("powershell -command C:\\inetpub\\ps.ps1 $mydata");
- echo "It worked: $query";
- }
- ?>
- Powershell:
- Param (
- [Parameter(Mandatory=$True)]
- [string]$data
- )
- echo $data >> C:\inetpub\log.txt
- return $data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement