Preview: WifiCTF Participant Docs- Level 2:

Reconnaissance – The Art of Seeing What’s Hidden

Security Domain: Network Reconnaissance & Service Discovery 

Learner Level: Beginner 

Estimated Time: 30-45 minutes 

Prerequisites: Basic networking concepts (IP addresses, ports), command-line comfort


What You’ll Learn (The Concepts)

In concrete terms, you’ll understand:

  • Network reconnaissance – What it means to gather information without exploitation
  • Service enumeration – How systems advertise what they’re running (often unintentionally)
  • Port scanning mechanics – The difference between “listening” and “attacking”
  • The reconnaissance mindset – Why attackers spend 80% of their time just looking

Why This Matters (The Stakes)

Real-world impact: In the 2017 Equifax breach, attackers spent weeks mapping internal systems before exploiting a single vulnerability. The reconnaissance phase revealed what was vulnerable and where the valuable data lived. The actual exploitation took minutes—the reconnaissance took weeks.

When reconnaissance is possible, attackers learn:

  • What services are running (and their versions, which have known vulnerabilities)
  • What the network topology looks like (where to go next)
  • What’s supposed to be hidden but isn’t (security through obscurity failures)

The Story Arc

You’ve successfully connected to the CTF_LAB WiFi network. You’re now “inside the perimeter”—but what’s here?

In this level, you’re playing the role of an initial access operator who needs to map the terrain before attempting any exploitation. By the end, you’ll understand why security professionals say: “Attackers don’t need to exploit everything—they just need to find the one thing you forgot to lock down.”


🧠 Conceptual Foundation: The Metaphor

What Reconnaissance Really Is

The Core Metaphor:

“Network reconnaissance is like being a detective casing a building before a heist—but with one critical difference: the building is actively telling you where all the doors and windows are if you just know how to ask.”

In a physical building:

  • You walk the perimeter, noting doors, windows, cameras, guards
  • You look for open windows, unlocked doors, or hiding spots
  • You try door handles gently to see if they’re locked (without actually entering)
  • You note patterns: “The back door is always propped open at 2pm”
  • The building doesn’t tell you what’s inside—you have to observe

In network reconnaissance:

  • You “walk the network” by scanning IP addresses
  • You “try door handles” by sending packets to ports to see if services respond
  • Open ports are like unlocked doors—something is actively listening there
  • Services often identify themselves (“Hi, I’m SSH version 2.0!”)—like a door with a sign saying “Break Room – No Lock”
  • You’re not breaking in yet—you’re just cataloging what’s available

Why the analogy matters:

Most beginners think hacking is about “breaking through walls”—brute force, password cracking, sophisticated exploits. In reality, 80% of security compromises start with reconnaissance that reveals a system that was never meant to be accessible but is.

The metaphor breaks down when: Unlike physical buildings that don’t actively respond, network services announce themselves when probed. A door doesn’t shout “I’m unlocked!” when you walk by—but an HTTP server on port 8000 literally sends back “HTTP/1.1 200 OK” when you knock. This is both a feature (for legitimate users) and a security risk (for attackers).

Mental Models: What Might Mislead You

Misconception 1: “Port scanning is hacking/attacking a system”

  • Why it’s tempting: It feels aggressive. You’re probing something. Surely that’s an attack?
  • Why it’s wrong: Port scanning is like checking if a store is open by looking through the window. The system is designed to respond to connection attempts. You’re not exploiting a vulnerability—you’re just asking “Is anyone listening here?” The system chooses to answer.
  • Correction: Reconnaissance is passive information gathering. You’re observing what the system willingly tells you. Exploitation (which comes later) is when you abuse that information to make the system do something it shouldn’t.
  • Legal nuance: While technically not an “attack,” unauthorized port scanning can be illegal in some jurisdictions because it’s interpreted as “attempted unauthorized access.” Always get permission. In this CTF, you have permission.

Misconception 2: “Services on non-standard ports are hidden”

  • Why it’s tempting: If port 80 is for HTTP and something is running on port 8000, it must be “hidden” right? The developer must have intended it to be secret.
  • Why it’s wrong: Ports are just numbers. There’s nothing technically hidden about port 8000 vs. port 80. The service is listening publicly—it will respond to anyone who asks. “Security through obscurity” (hiding things in non-standard places) fails the moment someone does thorough enumeration.
  • Correction: Think of ports as doors in a hallway numbered 1-65535. Just because you usually enter through door 80 doesn’t mean door 8000 is locked. It’s just a different entrance. Any listening service is discoverable with thorough scanning.

Misconception 3: “If I can’t see it in a browser, it’s not there”

  • Why it’s tempting: Browsers are how we experience the web. If I go to 192.168.4.1 and see a page, that’s what exists, right?
  • Why it’s wrong: A web browser makes assumptions about what you want (typically port 80 for HTTP, port 443 for HTTPS). But systems run dozens of services on different ports: SSH (22), database servers (3306), streaming servers (8000), etc. Your browser isn’t looking for those—but they’re still there.
  • CorrectionWeb browsers are opinionated clients that only show you HTTP/HTTPS on standard ports by default. To see the full attack surface, you need tools that systematically check all possible doors (ports 1-65535). That’s where tools like nmap come in.

📖 The Case: A Real-World Scenario

Context & Setup

The System: You’ve gained access to CTF_LAB, a WiFi network for a fictional “Secure Research Facility.” According to the welcome portal (192.168.4.1:80), the network hosts:

  • A registration system (publicly advertised)
  • A scoreboard dashboard (publicly advertised)
  • Backend infrastructure (not mentioned)

The Vulnerability: The network administrators assumed participants would only access the advertised services. They didn’t consider that running additional services on other ports makes them discoverable.

The Stakes: One of those “background services” is an Icecast streaming server on port 8000 running chiptune music—an easter egg. In a real scenario, this could be an unsecured admin panel, a debug endpoint, or a legacy service the team forgot about.

Your Role: You’re a penetration tester contracted to assess the network’s attack surface. Your job isn’t to exploit vulnerabilities yet—just to enumerate what exists. The defenders will be surprised by what you find.


🔍 The Reconnaissance Process: Seeing What’s Really There

Challenge 1: Service Enumeration (50 pts)

The Mission

Objective: Identify all publicly accessible services running on 192.168.4.1

What you’re testing: Whether the network administrators are aware of everything they’re running

Expected discovery:

  • Port 22: SSH (secure shell – remote access)
  • Port 80: HTTP (registration portal)
  • Port 5000: HTTP (vulnerable Flask application)
  • Port 8000: Icecast (streaming server – THE SURPRISE)
  • Port 8080: HTTP (dashboard)

The Detective Work

What we’re doing and why:

# Run service version detection scan
nmap -sV 192.168.4.1

Breaking down this command:

  • nmap: Network Mapper – the industry-standard reconnaissance tool
  • -sV: “Service Version detection” – not just “is port open?” but “what’s running there?”
  • 192.168.4.1: The target IP

What’s actually happening (TCP three-way handshake):

When nmap scans a port, it’s performing a “knock and listen” operation:

  1. SYN packet sent: “Hello, is anyone listening on port 80?”
  2. SYN-ACK received: “Yes! I’m here! Let’s establish a connection.”
  3. RST packet sent: “Actually, never mind.” (nmap politely closes the connection)

The service volunteered that information. You didn’t exploit anything—you just asked.

Why services identify themselves:

When you connect to port 5000, the Flask app sends back an HTTP response header:

HTTP/1.1 200 OK
Server: Werkzeug/2.3.0 Python/3.9.2

This is intentional behavior to help legitimate clients know what they’re talking to. But it also tells attackers exactly what version is running (and whether it has known vulnerabilities).

What You’ll Observe

Expected nmap output:

Starting Nmap 7.94 ( https://nmap.org )
Nmap scan report for 192.168.4.1
Host is up (0.0023s latency).

PORT     STATE SERVICE    VERSION
22/tcp   open  ssh        OpenSSH 8.4p1 Debian 5+deb11u1
80/tcp   open  http       nginx 1.18.0
5000/tcp open  http       Werkzeug/2.3.0 Python/3.9.2
8080/tcp open  http       nginx 1.18.0

Nmap done: 1 IP address (1 host up) scanned in 12.45 seconds

Reading the Results Like a Pro

Port 22 – SSH:

  • What it is: Secure Shell – remote terminal access
  • Why it’s here: Legitimate administrative access
  • Risk level: Medium – if credentials are weak or default, this is an entry point
  • What you learned: The system is running Debian 11 (from OpenSSH version)

Port 80 – HTTP (nginx):

  • What it is: Web server hosting the registration portal
  • Why it’s here: Publicly advertised – expected
  • Risk level: Low – this is meant to be accessed
  • What you learned: nginx reverse proxy is in front (probably routing to backend apps)

Port 5000 – HTTP (Werkzeug/Python):

  • What it is: Flask development server (Python web framework)
  • Why it’s here: Backend application
  • Risk level: HIGH – Werkzeug is Flask’s development server, not meant for production
  • What you learned: This app is probably the intentionally vulnerable CTF target
  • Red flag: Development servers often have debug features enabled

Port 8080 – HTTP (nginx):

  • What it is: Dashboard application
  • Why it’s here: Publicly advertised scoreboard
  • Risk level: Low – expected public service

The Security Flaw Being Demonstrated

The vulnerabilityUnnecessary services with excessive exposure

The Flask app on port 5000 shouldn’t be directly accessible. In a properly designed architecture:

  • Public users hit nginx on port 80
  • nginx proxies to Flask internally (not exposed to the network)
  • Port 5000 would be filtered/firewalled from external access

Why this matters: Every exposed service is an additional attack surface. The Flask app on 5000 is now:

  1. Discoverable by anyone on the network
  2. Directly accessible (bypassing any protections nginx might provide)
  3. Running a development server (which likely has debug features)

The design flaw: Developers often expose services for “convenience” during development, then forget to lock them down in production. This is exactly how real breaches happen.


Challenge 2: Hidden Chiptune Server (100 pts)

The Mission

Objective: Find the hidden easter egg service that’s not on standard ports

What you’re testing: Whether “security through obscurity” (hiding services on non-standard ports) actually works

Expected discovery: Icecast streaming server on port 8000

The Thorough Detective

Why the first scan missed it:

By default, nmap scans only the 1,000 most common ports (80, 443, 22, 3306, etc.). This is fast and catches 95% of services. But it misses non-standard ports.

The comprehensive approach:

# Scan ALL possible ports (1-65535)
nmap -p1-65535 192.168.4.1

# Or focus on a likely range for streaming services
nmap -p 8000-8010 192.168.4.1

Why this takes longer:

  • 1,000 ports: ~10-30 seconds
  • 65,535 ports: ~5-10 minutes (depending on network speed)

The trade-off: Speed vs. thoroughness. Professional penetration testers do both:

  1. Fast scan first (find the obvious stuff)
  2. Comprehensive scan overnight (find the obscure stuff)

What You’ll Discover

PORT     STATE SERVICE
8000/tcp open  http-alt

Visiting http://192.168.4.1:8000 reveals:

  • An Icecast streaming server playing chiptune music
  • Complete with web interface and stream metadata
  • Totally functional, totally undocumented

The “Security Through Obscurity” Fallacy

What the administrator thought: “I’ll put the streaming server on port 8000 instead of 80. No one will find it unless they know it’s there.”

Why this failed:

  1. Ports are not secret compartments: They’re just numbers. Scanning all 65,535 takes minutes.
  2. Services still respond: When you connect to port 8000, Icecast says “Hello! I’m Icecast!”
  3. Obscurity ≠ Security: Hiding something non-obviously is not the same as protecting it.

The lesson:

Security through obscurity is not security—it’s hope.

Real security uses:

  • Authentication: Require credentials
  • Firewall rules: Block access from untrusted networks
  • Encryption: Protect data in transit
  • Least privilege: Don’t run services you don’t need

Not:

  • Running something on port 8000 instead of 80 and hoping no one notices

The Easter Egg Significance

In this CTF, the chiptune server is harmless fun. But in real penetration tests, this exact pattern reveals:

  • Forgotten admin panels on port 8443
  • Debug interfaces on port 9000
  • Database servers on non-standard ports (thinking they’re “hidden”)
  • Legacy applications no one remembered deploying

Real case study: In 2020, a major university breach occurred because a MongoDB database was running on port 27018 (one number off the standard 27017). The sysadmin thought changing the port was security. Attackers found it in 3 minutes with a port scan.


🛡️ The Defense: How To Do This Right

Root Cause vs. Symptom Fix

Symptom Fix (Band-aid):

  • “Let’s move the service to an even more obscure port!”
  • Why this fails: Obscurity is not security. It only delays discovery by minutes.

Root Cause Fix (Proper architecture):

1. Principle of Least Exposure

# Don't expose services that don't need to be public
# Use firewall rules to restrict access
sudo ufw deny 5000  # Block Flask app from network
sudo ufw deny 8000  # Block Icecast from network
sudo ufw allow 80   # Only expose the public web server

2. Proper Service Architecture

[User] → [Port 80: nginx (public)]
              ↓ (internal proxy)
         [Port 5000: Flask (localhost only)]

The Flask app should only listen on 127.0.0.1:5000 (localhost), not 0.0.0.0:5000 (all interfaces). This makes it invisible to network scans.

3. Disable Unnecessary Services

# If you don't need it, don't run it
sudo systemctl stop icecast2
sudo systemctl disable icecast2

Every running service is a potential attack vector. Turn off anything you don’t actively need.

Defense in Depth (Layered Security)

To prevent reconnaissance from revealing your attack surface:

Layer 1: Minimize services

  • Only run what’s necessary
  • Turn off debug/development features in production

Layer 2: Firewall/Network segmentation

  • Use firewall rules to block unauthorized access
  • Segment internal services from public-facing ones

Layer 3: Disable banner grabbing

# In nginx config
server_tokens off;  # Hides version numbers

This prevents nmap from seeing “nginx 1.18.0” – it just sees “nginx”

Layer 4: Intrusion detection

  • Monitor for port scans (excessive connection attempts)
  • Alert when scanning patterns are detected

Layer 5: Honeypots

  • Run fake services that log anyone who connects
  • Serves as an early warning system

Why layers matter: Even if an attacker bypasses one defense, the others catch them.


🧑‍🔬 Practice: Transfer Your Learning

Challenge 1: Same Vulnerability, Different System

Scenario: You’re auditing a corporate network. You scan the web server (10.0.1.50) and find:

PORT     STATE SERVICE    VERSION
80/tcp   open  http       Apache 2.4.41
443/tcp  open  https      Apache 2.4.41
3389/tcp open  ms-wbt-server Microsoft Terminal Services

Questions:

  1. What services are running?
  2. Which one is unusual for a web server?
  3. What does its presence suggest?
  4. How would you verify if it’s intentionally exposed?

Solution:

  • Port 3389 is Remote Desktop Protocol (RDP) – Windows remote access
  • Unusual because: Web servers don’t typically need RDP exposed to the public internet
  • Suggests: Either poor network segmentation OR this server has multiple roles (web + admin workstation)
  • Verification: Check if RDP is firewalled from external IPs but allowed internally (proper), or wide open (problem)
  • Risk: RDP is a high-value target – brute force attacks, exploits, credential theft

Challenge 2: Detecting the Vulnerability in Code

Scenario: You’re reviewing a Flask application’s configuration:

# app.py
from flask import Flask
app = Flask(__name__)

@app.route('/')
def index():
    return "Hello World"

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000, debug=True)

Questions:

  1. What’s the security problem here?
  2. How would you fix it for production?
  3. What’s the difference between ‘0.0.0.0’ and ‘127.0.0.1’?

Solution:

  1. Problems:
    • host='0.0.0.0' – Listens on ALL network interfaces (discoverable from network)
    • debug=True – Enables debug mode (exposes code, allows code execution via console)
    • Using Flask’s development server (not production-ready)
  2. Fixes:
# Production configuration
if __name__ == '__main__':
    # For local development only
    app.run(host='127.0.0.1', port=5000, debug=False)

# In production, use proper WSGI server:
# gunicorn -w 4 -b 127.0.0.1:5000 app:app
  1. host parameter:
    • '0.0.0.0' = “listen on ALL network interfaces” (WiFi, ethernet, localhost) – discoverable via network scan
    • '127.0.0.1' = “listen on localhost only” – only accessible from the machine itself (invisible to network scans)

Challenge 3: Attack Variation

Scenario: A system administrator read about port scanning and implemented this defense:

# Block nmap scans
iptables -A INPUT -p tcp --tcp-flags ALL SYN,ACK -j DROP

Question: Does this effectively hide services? Why or why not?

Solution:

  • No, this is easily bypassed
  • This rule blocks standard SYN scans, but nmap has multiple scan types:
    • -sT (TCP connect scan) – completes full handshake
    • -sF (FIN scan) – sends FIN packets instead of SYN
    • -sN (NULL scan) – sends packets with no flags
    • -sX (Xmas scan) – sends FIN, PSH, URG flags

Better approach: Don’t try to hide services from scans—actually secure them with authentication, firewalls, and proper architecture.


📚 Building Your Mental Model: Key Takeaways

You Now Understand

  • Reconnaissance: The phase where attackers gather information without exploiting vulnerabilities. It’s about discovery, not intrusion.
  • Service enumeration: The process of identifying what services are running on which ports by systematically probing and observing responses.
  • Attack surface: The sum of all exposed services and interfaces. More services = larger attack surface = more opportunities for vulnerabilities.
  • Security through obscurity: The flawed practice of hiding things (changing default ports, obscure filenames) instead of properly securing them. It delays discovery, but doesn’t prevent it.
  • Banner grabbing: The technique of extracting version information from services (they volunteer this in response headers). Critical for attackers to identify vulnerable versions.

You Can Now Reason About

When you encounter a system, you can now:

  1. Systematically enumerate what services are exposed (using tools like nmap)
  2. Distinguish between expected/public services and unexpected/hidden ones
  3. Assess risk based on what’s discoverable (development servers, unnecessary services)
  4. Understand why “hiding” services on non-standard ports is ineffective security
  5. Propose defenses based on reducing exposure, firewalling, and proper architecture

The Bigger Picture

Reconnaissance is one phase of the Cyber Kill Chain:

  1. Reconnaissance ← YOU ARE HERE – gather information about the target
  2. Weaponization – prepare exploits for discovered vulnerabilities
  3. Delivery – transmit the exploit to the target
  4. Exploitation – execute code/commands on the target
  5. Installation – install backdoors/persistence
  6. Command & Control – establish remote control
  7. Actions on Objectives – steal data, cause damage, etc.

Understanding reconnaissance teaches you:

  • Why minimizing attack surface matters: Every exposed service is a potential entry point
  • Why network segmentation works: Limiting what’s discoverable from untrusted networks
  • Why intrusion detection matters: Catching reconnaissance early stops the kill chain before exploitation

🔗 Connect to Prior Knowledge

This Builds On:

  • Basic networking (Level 1): You learned how to connect to a network. Now you’re learning what’s on that network.
  • TCP/IP fundamentals: Understanding how ports, services, and protocols work
  • Client-server architecture: Recognizing that servers listen and clients connect

This Enables:

  • Web exploitation (Level 3): Now that you know what services exist (HTTP on 5000), you can test them for vulnerabilities
  • System access (Level 4): The SSH service you discovered is how you’ll gain a shell
  • Privilege escalation (Level 5): Understanding running services helps identify escalation vectors
  • Vulnerability scanning (next step after reconnaissance)
  • CVE databases (how to look up known vulnerabilities in discovered services)
  • Network mapping (creating visual maps of discovered infrastructure)

🚨 Common Pitfalls & Misconceptions (Specific to This Lab)

Pitfall 1: “I don’t see anything else on port 80, so there’s nothing else running”

Why it happens: Browsers only show HTTP/HTTPS. If you type 192.168.4.1 into a browser, you only see port 80.

What to watch for: The assumption that “what I see in a browser = everything that exists”

The correction: Browsers are opinionated clients that default to port 80/443. To see the full picture, you need systematic scanning of all ports and protocols.


Pitfall 2: “nmap didn’t find port 8000, so I’m done”

Why it happens: Default nmap scans only check the 1,000 most common ports. Port 8000 is common, but not in the top 1,000 by default for all nmap configurations.

What to watch for: Stopping after the first quick scan without doing comprehensive enumeration

The correction: Professional reconnaissance uses multiple passes:

  1. Quick scan (top 1000 ports) – fast initial view
  2. Full scan (all 65,535 ports) – comprehensive enumeration
  3. Targeted scans (specific services, UDP, etc.)

Pitfall 3: “This port scan is taking forever, I’ll just cancel it”

Why it happens: Scanning 65,535 ports takes time (5-10 minutes). It feels like waiting.

What to watch for: Impatience leading to incomplete reconnaissance

The correction: Real penetration testing requires patience. Attackers don’t rush—they systematically explore. That hidden service on port 8000 is worth the wait.

Pro tip: Run comprehensive scans in the background while working on other challenges:

nmap -p1-65535 192.168.4.1 -oN fullscan.txt &

The & runs it in the background. Check results later with cat fullscan.txt


📖 Conceptual Glossary: Key Terms & Their Meanings

Port: A numbered endpoint (1-65535) where a service can listen for connections. Think of it as a numbered door in a building—each service gets its own door.

Service: A program that listens on a port and responds to network requests. Examples: web servers (HTTP), SSH servers, databases.

Banner: The identification information a service sends when you connect. Example: “OpenSSH 8.4p1” or “nginx/1.18.0”. Services do this to help legitimate clients, but it also helps attackers.

Attack surface: The total of all exposed services, ports, and interfaces that could potentially be exploited. Larger surface = more opportunities for attackers.

Enumeration: The systematic process of identifying what exists on a network (services, users, shares, etc.). Not exploitation—just discovery.

Service version detection (-sV in nmap): The process of connecting to services and identifying not just what port is open but what service is running and what version.

Security through obscurity: The flawed practice of “hiding” things (e.g., running a service on port 8000 instead of 80) as a security measure. It fails because hidden ≠ secure.

Reconnaissance vs Exploitation:

  • Reconnaissance: Gathering information (port scanning, service enumeration) – asking questions
  • Exploitation: Using discovered information to compromise a system (SQL injection, buffer overflow) – taking action

🎓 Self-Assessment: Did You Master This?

You’ve mastered this lab when you can:

  • [ ] Explain what port scanning does and why it’s not the same as “hacking” (in your own words, using the detective metaphor)
  • [ ] Run an nmap scan and interpret the results (identify services, versions, and which ones are unusual)
  • [ ] Identify why the Flask app on port 5000 shouldn’t be directly exposed to the network
  • [ ] Explain why security through obscurity (port 8000 for Icecast) failed
  • [ ] Propose how the system should be properly architected (firewall rules, localhost binding, minimal services)
  • [ ] Recognize the same pattern in a different scenario (like the RDP on web server example)
  • [ ] Distinguish between reconnaissance (discovery) and exploitation (compromise)

🧵 The Thread Onward

Now that you understand reconnaissance, you’re ready for the natural next step:

Level 3: Web Exploitation – You’ve discovered services. Now you’ll test them for vulnerabilities. The Flask app on port 5000 is intentionally vulnerable to SQL injection, command injection, and XSS. But you wouldn’t even know it existed without this reconnaissance phase.

The principle you’re learningattack surface reduction through exposure minimization—applies to:

  • Cloud security: Only opening necessary ports in security groups
  • Container security: Not exposing internal service ports
  • API security: Not exposing debug/admin endpoints in production
  • IoT security: Minimizing network-facing services on embedded devices

The broader lesson: Security isn’t just about “making things harder to exploit”—it’s about reducing what’s discoverable in the first place. You can’t exploit what you can’t find.


Key Insight: You didn’t “hack” anything in this level. You just looked. And yet you discovered things the defenders didn’t want you to know. That’s the power—and the danger—of reconnaissance.

Ready to move on? In Level 3, you’ll start actually testing these services for vulnerabilities. The discovery phase is over. The exploitation phase begins.