Browse Source

using Nmap-service table for open ports

aidmar.wainakh 6 years ago
parent
commit
f968f7f272
1 changed files with 4 additions and 0 deletions
  1. 4 0
      code/Attack/PortscanAttack.py

+ 4 - 0
code/Attack/PortscanAttack.py

@@ -178,6 +178,10 @@ class PortscanAttack(BaseAttack.BaseAttack):
             if ports_used_by_ip_dst:
                 ports_open = ports_used_by_ip_dst
             else: # if no ports were retrieved from database
+                # Take open ports from nmap-service file
+                #ports_temp = self.get_ports_from_nmap_service_dst(100)
+                #ports_open = ports_temp[0:randint(1,10)]
+                # OR take open ports from the most used ports in traffic statistics
                 ports_open = self.statistics.process_db_query(
                     "SELECT portNumber FROM ip_ports GROUP BY portNumber ORDER BY SUM(portCount) DESC LIMIT "+str(randint(1,10)))
         # in case of one open port, convert ports_open to array