itzceekay

PORT-SCANNING

Apr 6th, 2013
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.19 KB | None | 0 0
  1.  
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  5. <?php
  6. include('ipConvertDec.php');
  7. $con = mysql_connect("localhost","intern","intern@123");
  8.  
  9. if (!$con) {
  10.   die('Could not connect: ' . mysql_error());
  11. }
  12.  
  13. mysql_select_db("test", $con);
  14.  
  15. $result = mysql_query("select ipsource,ipdest,count(portDest)as NumberOfTimes from packetheader group by ipsource,ipdest ORDER BY portDest ASC");
  16. while ($row = mysql_fetch_array($result)) {
  17.     $scans[]=$row['NumberOfTimes'];
  18.     $ipDec= convertIpDec($row['ipsource']);
  19.     $subresult = mysql_query("SELECT distinct * FROM `tblipv4range` WHERE $ipDec BETWEEN `ipv4from` AND `ipv4to`");
  20. while ($subrow = mysql_fetch_array($subresult))  
  21.     {
  22.     $data[]=$subrow;
  23.     $index=$subrow['ipv4country2'];
  24.      $scans[$index]+=$row['NumberOfTimes'];
  25.     }
  26. }
  27. ?>
  28.  
  29.  
  30. <title>Activity Distribution</title>
  31.  
  32.  <link rel="stylesheet" media="all" href="tooltip.css"/>
  33.  <link rel="stylesheet" media="all" href="jquery-jvectormap.css"/>
  34.   <script src="jquery-1.8.2.js"></script>
  35.   <script src="jquery-jvectormap.js"></script>
  36.   <script src="jquery-mousewheel.js"></script>
  37.  
  38.   <script src="lib/jvectormap.js"></script>
  39.  
  40.   <script src="lib/abstract-element.js"></script>
  41.   <script src="lib/abstract-canvas-element.js"></script>
  42.   <script src="lib/abstract-shape-element.js"></script>
  43.  
  44.   <script src="lib/svg-element.js"></script>
  45.   <script src="lib/svg-group-element.js"></script>
  46.   <script src="lib/svg-canvas-element.js"></script>
  47.   <script src="lib/svg-shape-element.js"></script>
  48.   <script src="lib/svg-path-element.js"></script>
  49.   <script src="lib/svg-circle-element.js"></script>
  50.  
  51.   <script src="lib/vml-element.js"></script>
  52.   <script src="lib/vml-group-element.js"></script>
  53.   <script src="lib/vml-canvas-element.js"></script>
  54.   <script src="lib/vml-shape-element.js"></script>
  55.   <script src="lib/vml-path-element.js"></script>
  56.   <script src="lib/vml-circle-element.js"></script>
  57.  
  58.   <script src="lib/vector-canvas.js"></script>
  59.   <script src="lib/simple-scale.js"></script>
  60.   <script src="lib/numeric-scale.js"></script>
  61.   <script src="lib/ordinal-scale.js"></script>
  62.   <script src="lib/color-scale.js"></script>
  63.   <script src="lib/data-series.js"></script>
  64.   <script src="lib/proj.js"></script>
  65.   <script src="lib/world-map.js"></script>
  66.  
  67.   <script src="jquery-jvectormap-world-mill-en.js"></script>
  68.   <style>
  69. .jvectormap-label {
  70.     border:  1px solid white;
  71.     -webkit-border-radius: 5px;
  72.     -moz-border-radius: 5px;
  73.     border-radius: 10px;
  74.     background: #4A7E2A;
  75.     color: white;
  76.     font-family: Arial;
  77.     padding: 5px 10px;
  78.     font-size:13px;
  79. }
  80.   </style>  
  81. <script type="text/javascript">
  82.  
  83.     var countries = new Array();
  84. countries = <?php echo json_encode($data); ?>;
  85. scans = <?php echo json_encode($scans); ?>;
  86. var i=0;
  87. var countryData = [];
  88. var scanData = [];
  89.  
  90. //for each country, set the code and value
  91.  
  92. $.each(countries, function() {
  93.     countryData[this.ipv4country2] = scans[this.ipv4country2];
  94. });
  95.  
  96.  
  97.  
  98. $(function() {
  99.     $('#world-map').vectorMap({
  100.         map: 'world_mill_en',
  101.         series: {
  102.             regions: [{
  103.                 values: countryData, //load the data
  104.                 scale: ['#00FF00', '#FF0000'],
  105.                 normalizeFunction: 'polynomial'}]
  106.         },
  107.        
  108.         onRegionLabelShow: function(e, el, code) {
  109.             //search through dataC to find the selected country by it's code
  110.             var country = $.grep(countries, function(obj, index) {
  111.                 return obj.ipv4country2 == code;
  112.             })[0]; //snag the first one
  113.             //only if selected country was found in dataC
  114.             if (country != undefined) {
  115.                 el.html(el.html() +"<br/><b>Number Of Ports Scanned: </b>" + countryData[country.ipv4country2]);
  116.             }
  117.             else
  118.             el.html(el.html() +"<br/><b>Number Of Ports Scanned: 0 </b>");
  119.         }
  120.     });
  121.     $('#view').tooltip({
  122.     delay: 0,
  123.     showURL: false,
  124.     bodyHandler: function() {
  125.         return $("<img/>").attr("src", this.src);
  126.     }
  127.    
  128. });
  129.  
  130. });
  131. </script>
  132. </head>
  133. <body>
  134. <a href="#" class="tooltip">
  135.     <img id="view" src="Click.png" align="top" >
  136.                        
  137. </body>
  138. </html>
Advertisement
Add Comment
Please, Sign In to add comment