Exam PT0-002 All QuestionsBrowse all questions from this exam
Question 262

During a vulnerability scanning phase, a penetration tester wants to execute an Nmap scan using custom NSE scripts stored in the following folder:

/home/user/scripts

Which of the following commands should the penetration tester use to perform this scan?

    Correct Answer: C

    To execute an Nmap scan using custom NSE scripts stored in a specified folder, the correct command is nmap --script followed by the path to the folder. This option directs Nmap to use all the scripts located in the given directory. Therefore, nmap --script /home/user/scripts is the appropriate command to use for this scenario.

Discussion
hqle26Option: C

https://nmap.org/book/man-nse.html

mazingyOption: C

nmap has no "--load" option. nmap --script /path/to/directory is correct

CCSXoraboveOption: C

nmap --script default,banner,/home/user/customscripts Loads the script in the default category, the banner script, and all .nse files in the directory /home/user/customscripts. https://nmap.org/book/nse-usage.html

LiveLaughToasterBathOption: C

--script <filename>|<category>|<directory>/|<expression>[,...]

ACMaverickOption: D

To execute an Nmap scan using custom NSE scripts stored in the folder /home/user/scripts, the penetration tester should use the command D. nmap --load /home/user/scripts 1. Option A is not a valid command for executing an Nmap scan with custom NSE scripts 1. Option B is not a valid command for executing an Nmap scan with custom NSE scripts 1. Option C is not a valid command for executing an Nmap scan with custom NSE scripts. The --script option is used to specify the name of a script or category of scripts to run, not the path to a directory containing scripts 1. Therefore, option D is the correct command for executing an Nmap scan with custom NSE scripts.