- Which method allows us to see the machines that have been targeted for scanning?
nmap.all_hosts()
- 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/')
- Which method can we use to obtain the result of the scan in dictionary format?
nmap.csv()
- What kind of Nmap module is used to perform scans asynchronously?
nma = nmap.PortScannerAsync()
- What kind of Nmap module is used to perform scans synchronously?
nma = nmap.PortScanner()
- 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)
- 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()
- 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)
- 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
- 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