Nmap saves scan results to a file using output options that specify the format and destination of the results. Here are the common methods to save scan results:
-
Basic Output: To save the results in a simple text format, you can use the
-oNoption followed by the filename.nmap <target_ip> -oN output.txt -
XML Output: For saving results in XML format, use the
-oXoption.nmap <target_ip> -oX output.xml -
Grepable Output: To save results in a format that is easy to parse with grep, use the
-oGoption.nmap <target_ip> -oG output.gnmap -
All Formats: You can also save results in all formats simultaneously using the
-oAoption, which creates files with the same base name in all three formats (normal, XML, and grepable).nmap <target_ip> -oA output
Replace <target_ip> with the actual IP address you want to scan, and output.txt, output.xml, or output.gnmap with your desired filenames. This allows you to keep a record of your scans for future reference or analysis.
