A closer look at the code

Let's take a look at an overview of the essential files and methods that we will use to build our network scanner using Python:

  • Driver_main_class.py: This is the Python class, file, or module that prompts the user for input information such as the project name, the IP addresses to scan, the port range to scan, the scan switch to use, and the scan type.
  • main_class_based_backup.py: This is the Python class, file, or module that contains all the main logic for port scanning that we discussed previously. It takes an input from Driver_main_class.py and stores the input in the database. Finally, it starts port scanning on our targets using threading and multiprocessing.
  • Driver_scanner.py: After port scanning is over, the next step is to perform service scanning and this Python class invokes another class, driver_meta.py, which takes the project name or ID for which service scanning is to be performed.
  • driver_meta.py: This class displays the default result of the port scanning and gives the user the option to reconfigure the results if needed. After reconfiguration, this class reads the hosts from the database table for the current project for which service scanning is to be done. For each host, it then reads the JSON file to get the commands to be executed, and for each command to be executed, it passes on the control to another file, auto_comamnds.py.
  • auto_commands.py: This is the file that takes arguments from driver_meta.py and calls the external technologies such as NSE, Ruby, Python, Java, bash scripts, or tools such as Metasploit, Wireshark, and Nikto. These are then used to perform service scanning for a chosen service, host, and port. After the command execution is over, it returns the results to driver_meta.py to be saved in the database.
  • IPtable.py: This is the class that stores the port scanning results in the database table. It represents the data layer of our vulnerability scanner.
  • IPexploits.py: This is the class that stores the service scanning results in the database table. It also represents the data layer of our vulnerability scanner.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.107.96