Skip to main content
XsiSec.com
HomeReposBlogProjectsPortfolio
© 2026 XsiSec.com
Security rules |security.txt
Updated 2026-08-15 · v1.0.0+2026-08-14.82f92cb · 82f92cb
← Back to overview
Security article

HTB Academy - nmap scanning basics

HTB Academy - nmap scanning basics: Nmap Enumeration & Vulnerability Assessment The objective was divided into two tasks: 1. Find all TCP ports on your target. Submit the total number of found TCP ports as the answer. 2. Enumerate the hostname of your target and submit it as the answer (case-sensitive). --- ## Explanation of Flags... • PortSwigger • nmap

2022-10-261 tag
Tags

Nmap Enumeration & Vulnerability Assessment

The objective was divided into two tasks:

  1. Find all TCP ports on your target. Submit the total number of found TCP ports as the answer.
bash
nmap -v -A 10.129.255.146
  1. Enumerate the hostname of your target and submit it as the answer (case-sensitive).
bash
nmap -v -A 10.129.255.146

Explanation of Flags

  • -v: increases verbosity. Shows open ports as they are found and adds completion time estimates.
  • -A: enables OS detection, version detection, script scanning, and traceroute.

Updated Scan

A better scan would be:

bash
nmap -sV -sC -p- 10.129.42.253

Example output:

text
Starting Nmap 7.80 ( https://nmap.org ) at 2021-02-25 16:18 EST
Nmap scan report for 10.129.42.253
Host is up (0.11s latency).
Not shown: 65530 closed ports
PORT    STATE SERVICE     VERSION
21/tcp  open  ftp         vsftpd 3.0.3
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_drwxr-xr-x   2 ftp  ftp       4096 Feb 25 19:25 pub
22/tcp  open  ssh         OpenSSH 8.2p1 Ubuntu 4ubuntu0.1 (Ubuntu Linux; protocol 2.0)
80/tcp  open  http        Apache httpd 2.4.41 ((Ubuntu))
139/tcp open  netbios-ssn Samba smbd 4.6.2
445/tcp open  netbios-ssn Samba smbd 4.6.2

Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

Host script results:
|_nbstat: NetBIOS name: GS-SVCSCAN

Explanation

  • -sC: run Nmap default scripts
  • -sV: service version detection
  • -p-: scan all 65,535 TCP ports

Nmap Scripts (NSE)

Scripts can be located with:

bash
locate scripts/citrix

Run them with:

bash
nmap --script <script-name> -p <port> <host>

Output Options

  • Normal: -oN target.nmap
  • Grepable: -oG target.gnmap
  • XML: -oX target.xml

Convert XML to HTML:

bash
xsltproc target.xml -o target.html

NSE Examples

Default Scripts

bash
sudo nmap <target> -sC

Script Category

bash
sudo nmap <target> --script <category>

Defined Scripts

bash
sudo nmap <target> --script <script1>,<script2>

Example: SMTP Enumeration

bash
sudo nmap 10.129.2.28 -p 25 --script banner,smtp-commands

Output:

text
PORT   STATE SERVICE
25/tcp open  smtp
|_banner: 220 inlane ESMTP Postfix (Ubuntu)
|_smtp-commands: PIPELINING, SIZE, VRFY, STARTTLS, 8BITMIME

This shows the SMTP server is Postfix on Ubuntu and supports VRFY.


Aggressive Scan

bash
sudo nmap 10.129.2.28 -p 80 -A

Output:

text
80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))
|_http-title: blog.inlanefreight.com
|_http-generator: WordPress 5.3.4

This reveals the server software and CMS version.


Vulnerability Assessment

Using the vuln category:

bash
sudo nmap 10.129.2.28 -p 80 -sV --script vuln

Output:

text
80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))
| http-enum:
|   /wp-login.php: Wordpress login page
|   /readme.html: Wordpress version: 2
|   /: WordPress version: 5.3.4
| vulners:
|   CVE-2019-0211    https://vulners.com/cve/CVE-2019-0211
|   CVE-2018-1312    https://vulners.com/cve/CVE-2018-1312
|   CVE-2017-15715   https://vulners.com/cve/CVE-2017-15715

The scripts reveal web application versions and related CVEs.

More NSE scripts: Nmap NSE Documentation

Navigate

In this post

  1. 01Nmap Enumeration & Vulnerability Assessment
  2. 02Explanation of Flags
  3. 03Updated Scan
  4. 04Explanation
  5. 05Nmap Scripts (NSE)
  6. 06Output Options
  7. 07NSE Examples
  8. 08Default Scripts
  9. 09Script Category
  10. 10Defined Scripts
  11. 11Example: SMTP Enumeration
  12. 12Aggressive Scan
  13. 13Vulnerability Assessment
Search
Explore

Popular tags

Browse all 30 tags

Comments

0 comments

No comments yet — be the first to comment.