Run default scripts with nmap -sC 192.168.1.1
In this step, we will explore how to use Nmap to run its default set of scripts against a target. Nmap scripts are powerful tools that can automate a wide range of tasks, from identifying vulnerabilities to gathering information about a target system. The -sC
option tells Nmap to use the "default" script category. This category includes scripts that are considered safe and useful for general-purpose scanning.
Before we begin, let's make sure we are in the correct directory.
cd ~/project
Now, let's run Nmap with the -sC
option against the target IP address 192.168.1.1
. This IP address is a placeholder. In a real-world scenario, you would replace it with the actual IP address of the target you want to scan. For this lab environment, we will assume that 192.168.1.1
is a valid target.
sudo nmap -sC 192.168.1.1
This command will perform a standard Nmap scan, including a port scan and service detection, and then run the default scripts against any open ports. The output will show the results of the port scan, service detection, and any information gathered by the scripts.
The output will look something like this (the exact output will vary depending on the target system):
Starting Nmap 7.80 ( https://nmap.org ) at ...
Nmap scan report for 192.168.1.1
Host is up (0.00028s latency).
Not shown: 999 filtered ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu)
| ssh-hostkey:
| 2048 ... (RSA)
| ssh-rsa ...
|_ssh-algorithm: ...
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Host script results:
|_clock-skew: mean: -1s, deviation: 0s, median: -1s
|_nbstat: NetBIOS name: ..., NetBIOS user: ..., NetBIOS MAC: ... (unknown)
| smb-os-discovery:
| OS: Unix
| ...
|_ System time: ...
Nmap done: 1 IP address (1 host up) scanned in ... seconds
In this example, the output shows that port 22 is open and running SSH. The ssh-hostkey
script has identified the SSH host key, and the ssh-algorithm
script has identified the supported algorithms. The clock-skew
script has detected a slight clock skew on the target system. The nbstat
and smb-os-discovery
scripts have gathered information about the NetBIOS and SMB services, respectively.