root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat web-enumeration.md
// Offensive

Web Enumeration

12 Nov 2026 · 11 min read
Overview — A hands-on Offensive room about the enumeration stage of a web assessment. It starts with what your own browser can tell you for free, then introduces three standard tools, each with its own practice instance: Gobuster for directories, files, subdomains and virtual hosts, WPScan for WordPress themes, plugins, users and password attacks, and Nikto for server misconfigurations and outdated software. The common thread is learning what each tool does under the hood so you can pick the right one and avoid rabbit holes.
PlatformTryHackMe
CategoryOffensive
DifficultyEasy
RoomWeb Enumeration

Task 1 — Introduction

You cannot attack what you have not mapped. Enumeration means finding every page, file, parameter, subdomain, component and version a web target exposes, and it is easy to drown in output. The room therefore teaches a few fundamental tools and pairs each with a dedicated target instance. You need the TryHackMe VPN (or the AttackBox, which is what the room is written for). Each practice instance needs a few minutes to boot before scanning.

Task 2 — Manual Enumeration

Before launching any scanner, remember that automated tools are noisy and the most valuable find is often sitting in plain view. Your browser records everything the server sends, and its developer tools (press F12) let you:

  • read the page source and the live DOM in the Inspector;
  • list every loaded asset (scripts, stylesheets, images and their paths) in the Network tab, which reveals directory names and sometimes technologies;
  • run and debug client-side JavaScript in the console.

Developers frequently leave HTML comments (<!-- like this -->) in the source. They are invisible when the page renders but may contain hints, old paths, or credentials. Checking the source costs nothing and generates no suspicious traffic in the server logs.

Task 3 — Introduction to Gobuster

Gobuster is a brute-forcing tool written in Go, which means it is a single fast, multi-threaded binary with no runtime dependencies. It takes a wordlist and tries each entry against a target: as a URL path, as a file name, as a subdomain, or as a virtual host name. On Kali it installs with one command:

sudo apt install gobuster

Useful global flags:

FlagMeaning
-t, --threadsConcurrent threads (default 10). Raising it to around 64 speeds scans up considerably, at the cost of more load on the target.
-v, --verboseVerbose output.
-z, --no-progressHide the progress counter.
-q, --quietSuppress the banner and other noise.
-o, --outputWrite results to a file.

Task 4 — Gobuster Modes

dir mode

Directory structures usually follow conventions, so they can be guessed. Gobuster requests each wordlist entry and reports the HTTP status, which tells you at once whether a path exists (200), redirects (301/302), or is forbidden (403). The URL you give is the starting point, so scanning /products/ enumerates inside that folder.

gobuster dir -u http://MACHINE_IP -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 64
FlagPurpose
-x, --extensionsAlso try each word with these file extensions (for example -x html,js,css,php,txt). Extensions hint at content: .php is server-side code, .conf configuration, .txt notes or flags.
-s / -bStatus codes to treat as positive / to blacklist.
-c, -HSend cookies or custom headers, useful for authenticated areas.
-U / -PBasic Auth credentials.
-kSkip TLS certificate validation. Self-signed certificates are common in labs, and without -k a scan against HTTPS just errors out.
-nDo not print status codes.

dns mode

Subdomains often run older or less hardened applications than the main site, so a patched main domain says little about dev. or staging.. DNS mode resolves each candidate name:

gobuster dns -d mydomain.thm -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-5000.txt

Handy options: -i shows resolved IPs, -c shows CNAME records, and -r chooses a custom DNS resolver.

vhost mode

Virtual hosts are separate sites served from the same machine and IP, selected by the Host header. They can look like subdomains but need no DNS record, so DNS brute forcing will not find them. Vhost mode sends the same request with different Host values and compares responses:

gobuster vhost -u http://webenum.thm -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-5000.txt --append-domain
Recent Gobuster releases need --append-domain (it appends the domain from the URL to each word) to turn a word such as learning into learning.webenum.thm. Without it the tool sends the bare word as the Host header, and the server answers every request with the same 400 error. In the original run, the newer version produced a screen full of useless "Found ... Status: 400" lines (1, 2, 123, 2012 and so on), while an older release (3.0.1), which behaved differently, listed the real hosts. Check the status and size of results; a long list of identical sizes means a false positive.

Task 5 — Useful Wordlists

Results are only as good as the wordlist. Kali ships several:

  • /usr/share/wordlists/dirbuster/directory-list-2.3-*.txt (small, medium, big) and directory-list-1.0.txt
  • /usr/share/wordlists/dirb/common.txt, small.txt, big.txt
  • /usr/share/wordlists/dirb/extensions_common.txt, good for choosing file extensions

The large community collection SecLists, by Daniel Miessler, covers directories, subdomains, passwords, usernames and more; install it with sudo apt install seclists. Wordlists are interchangeable between modes, so a good subdomain list can also be used for vhosts.

Task 6 — Practical: Gobuster

Deploy the instance and wait about five minutes. Add the base domain to your hosts file, and add every virtual host you discover the same way so your browser and tools can resolve them:

echo "MACHINE_IP webenum.thm" | sudo tee -a /etc/hosts
echo "MACHINE_IP learning.webenum.thm products.webenum.thm" | sudo tee -a /etc/hosts

Q: Run a directory scan on the host. Other than the standard css, images and js directories, what other directories are available?

gobuster dir -u http://webenum.thm -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 64
/images   (Status: 301)
/public   (Status: 301)
/css      (Status: 301)
/js       (Status: 301)
/Changes  (Status: 301)
/VIDEO    (Status: 301)

A: public,Changes,VIDEO (note the case sensitivity: Linux paths are case sensitive, and the wordlist contains mixed-case entries)

Q: Run a directory scan on the host. In the "C" directory, what file extensions exist?

gobuster dir -u http://webenum.thm -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -t 64 -x html,txt,js,php,conf
/changes.conf   (Status: 200) [Size: 24]
/bootstrap.js   (Status: 200) [Size: 151880]

A: conf,js. The hits /.html and /.php with status 403 are Apache refusing dotfiles, not real content.

Q: There's a flag out there that can be found by directory scanning! Find it.

The same scan turns up /flag.php with status 200 after only about a third of the wordlist; once a result like that appears, there is no need to let the scan finish. Request it directly:

curl http://webenum.thm/flag.php

A: FLAG

Q: There are some virtual hosts running on this server. What are they?

Use the vhost mode with the SecLists subdomain list and --append-domain as described above.

A: learning,products (separate answers with a comma and no space, as the room requires)

Q: There's another flag to be found in one of the virtual hosts! Find it.

With the vhosts in /etc/hosts, run a directory scan against each one with extensions. A shortcut when you already know what you are looking for is a one-line custom wordlist: it tests flag with every extension in seconds instead of crawling a large list.

echo 'flag' > only_flag.dict
gobuster dir -u http://learning.webenum.thm -w only_flag.dict -t 64 -x html,txt,js,php,conf
gobuster dir -u http://products.webenum.thm -w only_flag.dict -t 64 -x html,txt,js,php,conf

One of the two reports /flag.txt with status 200; read it with curl.

A: FLAG

Task 7 — Introduction to WPScan

WPScan, first released in 2011, is a black-box scanner dedicated to WordPress. It can find:

  • version information for the core, themes and plugins, which maps to known vulnerabilities and CVEs;
  • exposed paths and misconfigured files such as a readable wp-config.php backup;
  • weak passwords, through brute forcing;
  • default installation leftovers;
  • common WAF plugins.

It comes pre-installed on Kali and the AttackBox. It relies on a local database of known themes and plugins, so update it before each engagement:

wpscan --update

Task 8 — WPScan Modes

Everything is driven by --enumerate (short -e) followed by a letter.

Themes: --enumerate t

You can do this by hand: open the Network tab and note asset URLs like /wp-content/themes/twentytwentyone/style.css. WPScan automates it and tells you how it was identified (CSS style in the homepage, known locations, and so on) and what confidence it has.

wpscan --url http://TARGET --enumerate t

Plugins: --enumerate p

Plugins live in /wp-content/plugins/NAME/. If directory listing is enabled (the web server prints the folder contents when no index file exists), plugins are visible directly. WPScan also detects them from references in page source, and learns the version from the plugin's mandatory readme.txt, which includes the "Stable tag" and changelog.

wpscan --url http://TARGET --enumerate p

Users: --enumerate u

WordPress posts have authors, and authors are users. WPScan walks author IDs (/?author=1, 2, ...), reads display names from author pages and the RSS generator, and confirms them from login error messages that differ for valid and invalid usernames.

wpscan --url http://TARGET --enumerate u

Vulnerable components: v

Adding v (for instance --enumerate vp) cross-references found plugins against a vulnerability database. This needs an API token for the WPScan vulnerability service; without one, the output warns that no vulnerability data is available, and you must check names and versions in NVD, MITRE or CVEdetails yourself.

Password attack

With a valid username, give WPScan a wordlist:

wpscan --url http://TARGET --usernames USER --passwords /usr/share/wordlists/rockyou.txt

Aggressiveness

By default WPScan is "mixed" and tries to be quiet, so a plugin referenced nowhere on the page can be missed. --plugins-detection aggressive probes many known plugin paths (more requests, more chance of a WAF block); passive only reads what the pages already reveal and is the stealthiest.

OptionEffect
--enumerate pPlugins
--enumerate tThemes
--enumerate uUsers
--enumerate vpVulnerable plugins (API token required)
--plugins-detection aggressive|passiveDetection profile

Q: What would be the full URL for the theme "twentynineteen" installed on the WordPress site given in the question?
A: the site's base URL followed by /wp-content/themes/twentynineteen, which is the default theme location.

Q: What argument would we provide to enumerate a WordPress site?
A: enumerate

Q: What is the name of the other aggressiveness profile that we can use in our WPScan command?
A: passive

Task 9 — Practical: WPScan

Deploy the instance, wait five minutes, and map the hostname in /etc/hosts:

echo "MACHINE_IP wpscan.thm" | sudo tee -a /etc/hosts

A baseline scan shows a WordPress 5.0 site (flagged as insecure), Apache 2.4.29 on Ubuntu, XML-RPC enabled, an exposed readme and the external WP-Cron enabled. XML-RPC matters later because it is what the password attack uses.

Q: What is the name of the theme that is detected as running?

wpscan --url http://wpscan.thm --enumerate t

A: twentynineteen (version 1.0, found passively from the CSS on the homepage and 404 page)

Q: What is the name of the plugin that WPScan has found?

wpscan --url http://wpscan.thm --enumerate p

Two names show up: nextcellent-gallery-nextgen-legacy (a 60%-confidence guess driven by the NextGEN meta tag) and nextgen-gallery at version 3.5.0 with 100% confidence, confirmed by the readme stable tag and changelog. The real plugin is the latter.

A: nextgen-gallery

Q: What username can WPScan find?

wpscan --url http://wpscan.thm --enumerate u

WPScan reports the same user twice, as Phreakazoid (from the author display name) and phreakazoid (from author ID brute forcing), confirmed by login error messages. The login name is the lowercase one.

A: phreakazoid

Q: Construct a WPScan command to brute-force the site with this username, using the rockyou wordlist. What is the password?

wpscan --url http://wpscan.thm --usernames phreakazoid --passwords /usr/share/wordlists/rockyou.txt

WPScan attacks through XML-RPC, which lets it test many passwords per request, and finishes in well under a minute. If it runs for more than a few minutes, the username, wordlist or URL is wrong.

[SUCCESS] - phreakazoid / linkinpark

A: linkinpark

Task 10 — Introduction to Nikto

Nikto, an open-source web server scanner dating from 2001, checks for sensitive or default files, outdated server software, and common misconfigurations such as directory indexing, risky CGI scripts and missing security headers. It is pre-installed on Kali and the AttackBox. Unlike Gobuster, it is checklist-driven rather than wordlist-driven, and it is extremely noisy: thousands of requests, trivially visible in logs.

Task 11 — Nikto Modes

Basic scan. -h takes a host or IP and fingerprints the server from headers, favicon and known default pages. In the room's example, Nikto recognised Apache Tomcat from its favicon and from /examples/servlets/index.html, and reported that the PUT and DELETE methods were allowed, which could allow uploading or deleting files.

nikto -h MACHINE_IP

Several hosts or ports. Nikto can read targets piped from Nmap's greppable output (useful after landing inside a network), and -p accepts a comma-separated port list for several services on one host:

nmap -p80 172.16.0.0/24 -oG - | nikto -h -
nikto -h MACHINE_IP -p 80,8080

Plugins. nikto --list-plugins shows the available modules, and -Plugin NAME runs a specific one. Examples:

PluginWhat it does
apacheusersTries to enumerate Apache HTTP authentication users.
cgiLooks for exploitable CGI scripts.
robotsAnalyses robots.txt for paths the owner wanted to hide.
dir_traversalTries traversal sequences to read system files such as /etc/passwd.

Verbosity. -Display adds detail to the output:

ValueShowsWhy
1RedirectsServers may push you elsewhere, so adjust your scan.
2Cookies receivedCookies can hold session data or even credentials.
EErrorsDebugging a scan that returns less than expected.

Tuning. -Tuning restricts the test categories, cutting scan time and noise:

OptionCategory
0File upload
2Misconfigurations / default files
3Information disclosure
4Injection (XSS, HTML)
8Command execution
9SQL injection

Saving results. -o writes a report whose format follows the extension (text, HTML and others):

nikto -h MACHINE_IP -o report.html

Q: What argument would we use if we wanted to scan port 80 and 8080 on a host?
A: -p 80,8080

Q: What argument would we use if we wanted to see any cookies given by the web server?
A: -Display 2

Task 12 — Nikto Practical

Deploy the instance, wait five minutes, and scan the target.

Q: What is the name and version of the web server that Nikto has determined running on port 80?

nikto -h MACHINE_IP -p 80

The report includes Server: Apache/2.4.7 (Ubuntu), flags it as outdated, and lists findings such as missing X-Frame-Options and X-Content-Type-Options headers, ETag inode leakage, directory indexing in /css/ and /images/, an exposed sitemap.xml and the default /icons/README. Only POST, OPTIONS, GET and HEAD are allowed.

A: Apache/2.4.7

Q: There is another web server running on another port. What is the name and version of this web server?

Find it with Nmap and pipe the result to Nikto, or just scan 8080 directly:

nmap -p80,8080 MACHINE_IP -oG - | nikto -h -

On port 8080 Nikto shows Server: Apache-Coyote/1.1 with an x-powered-by: Servlet/3.0; JBossAS-6 header and a favicon that identifies a JBoss server. It also notes that PUT and DELETE are permitted, which is a serious finding for an application server.

A: Apache-Coyote/1.1

Q: What is the name of the cookie that this JBoss server gives?

nikto -h MACHINE_IP -p 8080 -Display 2

With cookie display on, requests to /admin-console/config.php and /jmx-console/ reveal a session cookie, flagged as created without the httponly attribute. The question asks for the name, not the value.

A: JSESSIONID

Defensive note: the JBoss /jmx-console/ and /admin-console/ interfaces should never be reachable by untrusted users. Exposed JBoss management consoles are a well-known route to remote code execution on old installations.

Task 13 — Conclusion

The room suggests continuing with OWASP Top 10, EasyPeasyCTF and ToolsRUs to practise Gobuster and Nikto, and the Blog room for WPScan.

Key takeaways

  • Start manually: page source, comments and the Network tab cost nothing and are silent.
  • Gobuster has three modes: dir for paths and files (use -x for extensions, -k for bad certificates), dns for real subdomains and vhost for virtual hosts that exist only as Host header values.
  • Always sanity-check brute-force output; many identical sizes or statuses point to a false positive (as with vhost scans missing --append-domain).
  • Wordlist choice matters; keep SecLists handy and use tiny custom lists when you know your target filename.
  • WPScan's --enumerate letters (t, p, u, vp) map themes, plugins, users and known-vulnerable components; the password attack works through XML-RPC.
  • Nikto is a loud checklist scanner: use -p, -Tuning, -Display and -Plugin to focus it, and read its output for outdated versions, dangerous HTTP methods, and exposed consoles.
  • Hardening: disable directory listing, remove default files, patch outdated servers, set security headers and cookie flags, restrict management consoles, and disable or protect XML-RPC if not needed.