Async Scanning

Nmapthon2 provides another scanner class to perform asynchronous scans and operations, which is NmapAsyncScanner. This class inherits from NmapScanner, so all the methods that you just learned from the previous sections can also be used here. This class, allows us to:

  • Perform scans in the background.

  • Pause your main thread until the scan finishes.

  • Retrieve the scan status.

import nmapthon2 as nm2

scanner = nm2.NmapAsyncScanner()

Documentation

class nmapthon2.async_.NmapAsyncScanner(nmap_bin: Union[None, str] = None, engine: Union[None, nmapthon2.engine.NSE] = None)

Allows async operations for Nmap scans, like background execution, status retrieval and process awaiting

It works like the NmapScanner object but has some additional methods and kwargs on its methods. The class overrides some of the core NmapScanner functionality in order allow the manipulation of the Nmap’s child process.