Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['ip'])) {
- $ip = $_POST['ip'];
- $q = "nmap " . escapeshellarg($ip);
- $outp = [];
- exec($q,$outp);
- echo implode("<br/>",$outp);
- } else {
- page();
- }
- function page() {
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>nmap</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="description" content="" />
- <meta name="keywords" content="" />
- <meta name="robots" content="index,follow" />
- <!-- <link rel="stylesheet" type="text/css" href="styles.css" /> -->
- <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
- <script type="text/javascript">
- function nmap_ip(ip) {
- $.ajax({ type: 'post',
- url:'nmap.php',
- data: {ip: ip},
- beforeSend: function() { $('#result').html('<img src="ajax_wait.gif"/>'); },
- success: function(data){ $('#result').html(data); }
- });
- }
- $(document).ready( function() {
- $( "form:first" ).submit(function( event ) {
- event.preventDefault();
- nmap_ip($('#ip').val());
- })
- });
- </script>
- </head>
- <body>
- <form name="main">
- <input type="text" name="ip" value="" id="ip" maxlength="30" />
- <input type="submit" value="nmap"/>
- </form>
- <div id="result"> </div>
- </body>
- </html>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement