Chapter 8: Working with Nmap Scanners

 

  1. Which method allows us to see the machines that have been targeted for scanning?

nmap.all_hosts()

 

  1. How do we invoke the scan function if we want to perform an asynchronous scan and also execute a script at the end of that scan?

nmasync.scan('ip','ports',arguments='--script=/usr/local/share/nmap/scripts/')

 

  1. Which method can we use to obtain the result of the scan in dictionary format?

nmap.csv()

 

  1. What kind of Nmap module is used to perform scans asynchronously?

nma = nmap.PortScannerAsync()

 

  1. What kind of Nmap module is used to perform scans synchronously?

nma = nmap.PortScanner()

 

  1. How can we launch a synchronous scan on a given host, on a given port if we initialize the object with the self.nmsync = nmap.PortScanner () instruction?

self.nmsync.scan(hostname, port)

 

  1. Which method can we use to check whether a host is up or not in a specific network?

We can see whether a host is up or not with the state() function. Here's an example of its use:

nmap[‘127.0.0.1’].state()

 

  1. What function is it necessary to define when we perform asynchronous scans using the PortScannerAsync() class ?

When performing the scan, we can indicate an additional callback parameter where we define the return function, which would be executed at the end of the scan. Here's an example:

def callback_result(host, scan_result)

nmasync.scan(hosts=’127.0.0.1’, arguments=’-sP’, callback=callback_result)

 

  1. Which script do we need to run on port 21 if we need to know whether the FTP service allows authentication anonymously without having to enter a username and password?

ftp-anon.nse

 

  1. Which script do we need to run on port 3306 if we need to know whether the MySQL service allows authentication anonymously without having to enter a username and password?

mysql-enum.nse

..................Content has been hidden....................

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