<html> <head> <title>Port Scan</title> </head> <body> <div align="center"> <?php $server = $_POST['server']; ?> <h2>Enter your url and click scan.</h2> <table style="border-width: 1px; border-style: solid;" cellpadding="5" cellspacing="6"> <form action="portscan.php" method="post"> <tr> <td>URL to scan: </td><td><input type="text" value="<?php echo $server; ?>" name="server" id="server" /></td> </tr> <tr> <td colspan="2"><input type="hidden" value="1" name="submit" /><input type="button" name="submit1" value="Scan" id="submit1" /></td> </tr> </form> </table> <?php if ($_POST['submit'] == "1"){ echo "<br><h2>Results</h2><table style=\"border-width: 1px; border-style: solid;\" cellpadding=\"5\" cellspacing=\"5\"><tr><td>"; echo "<pre>"; system("/usr/bin/nmap $server"); echo "</pre>"; echo "</td></tr></table>"; system("killall -q nmap"); } ?> </div> </body> </html>
/usr/bin/nmap