Skip to main content
See Security Labs

SEC504 - Hacker Tools, Techniques, and Incident Handling

Cloud Attack Surface Mapping with masscan and TLS Fingerprinting

Solo, Lab

Focus: Cloud Network Forensics

Level: SEC504

Date: Jun 2026

Artifacts: Sanitized masscan, tls-scan, jq, and nmap output from the SEC504 Slingshot Linux lab against a 10.200.0.0/16 cloud range

TL;DR

  • masscan swept a /16 (65,536 hosts) for port 443 in seconds and found 14 live TLS endpoints
  • tls-scan + jq parsed each certificate's subject CN to attribute anonymous cloud IPs to their owners
  • One cert (downloads.falsimentis.com on 10.200.74.2) identified the target; nmap http-enum found a directory listing

Skills demonstrated

High-rate network sweeping with masscan (--rate, -oL)TLS certificate collection and parsing (tls-scan)JSON field extraction with jqCloud asset attribution via certificate subject CNTargeted web enumeration with nmap NSE (http-enum)

Note: Course-provided PCAPs and lab instructions are not shared. Only my own captures and sanitized notes are published.

Why this matters

In shared cloud ranges you cannot tell whose asset an IP is by the address alone, and that is exactly the gap an attacker exploits to find a target's forgotten internet-facing hosts. The TLS certificate is the tell: the subject CN names the service even when DNS says nothing. The same masscan-to-certificate pipeline a red team uses to find your shadow assets is what an asset-management program should run against its own ranges first.

Context

Cloud IP space has no reverse DNS to map an address back to an owner, so this lab uses the TLS certificate as the attribution mechanism. The workflow is: sweep a /16 with masscan for one port, pull each host's certificate with tls-scan, parse the subject common name with jq to find which anonymous cloud IP belongs to the target organization, then enumerate that host with nmap.

Tools used

masscan 1.3.9tls-scanjqawkNmap 7.60Slingshot Linux

Steps taken

1Mass-sweep the /16 for port 443

Ran masscan across the entire 10.200.0.0/16 (65,536 hosts) for a single port at 10,000 packets/sec. The list output (-oL) recorded 14 open 443/tcp hosts. Scanning one port across a huge range is the fast way to find the live TLS surface before spending time on any single host.

$ masscan -p 443 --rate 10000 -oL simcloud.txt 10.200.0.0/16
$ wc -l simcloud.txt
-p 443single port
--rate 10000packets per second
-oLlist output format

2Extract the live IPs

masscan -oL lines look like 'open tcp 443 10.200.x.x <epoch>'. awk pulled field 4 (the IP) into a clean target list for the certificate scan.

$ awk '/open/ {print $4}' simcloud.txt > simcloud-targets.txt
/open/match result lines
{print $4}the IP address column

3Collect TLS certificates

tls-scan read the target list on stdin and completed all 14 handshakes in 0.13 seconds, writing structured JSON. This is the step that turns a list of anonymous IPs into a set of certificates that name their services.

$ tls-scan --port=443 --cacert=/opt/tls-scan/ca-bundle.crt -o simcloud-tlsinfo.json < simcloud-targets.txt
--port=443TLS port
--cacertCA bundle for chain validation
-oJSON output; reads targets on stdin

4Attribute IPs by certificate subject CN

jq projected each IP next to its certificate subject CN. Most were wildcards for unrelated tenants sharing the cloud range (*.genusight.com, *.sunsetisp.com). One stood out: 10.200.74.2 presenting downloads.falsimentis.com, the target organization.

$ jq '.ip + " " + .certificateChain[].subjectCN' simcloud-tlsinfo.json
$ jq '.ip + " " + .certificateChain[].subjectCN' simcloud-tlsinfo.json | grep falsimentis
certificateChain[].subjectCNthe CN names the service
grep isolates the target's asset

5Enumerate the identified host

With the target IP known, nmap -sV plus the http-enum NSE script fingerprinted nginx 1.18.0 and surfaced /robots.txt and a browsable /css/ directory listing. Attribution first, enumeration second, so the noisy scan only ever touches the one host that matters.

$ sudo nmap -sT -sV -p 443 --script http-enum 10.200.74.2
-sVversion detection
--script http-enumenumerate web paths

Key findings

masscan found 14 live 443/tcp hosts in a 65,536-address /16 in seconds
TLS certificate subject CN attributed each anonymous cloud IP to an owner
10.200.74.2 = downloads.falsimentis.com, the target, isolated by a single grep
nginx 1.18.0 on the target exposed /robots.txt and a /css/ directory listing

Outcome / Lessons learned

Reduced a 65,536-address cloud range to the single host that belonged to the target by pivoting on TLS certificate subject CNs, then confirmed an exposed directory listing on it. 14 live TLS hosts, one match, one finding, in well under a minute of active scanning.

Run the same masscan-to-certificate sweep against your own cloud ranges on a schedule and diff the results so newly exposed hosts and unexpected certificate names get flagged as possible shadow assets. Remove directory listing (autoindex off) on the identified nginx host and review what /css/ and /robots.txt exposed. Feed discovered certificates into an inventory keyed on subject CN so attribution is automatic next time.

Security controls relevant

  • Continuous external attack surface management over owned cloud ranges
  • Certificate transparency / inventory keyed on subject CN
  • Disabling directory listing (autoindex) on web servers
  • Egress and ingress controls limiting which cloud hosts expose 443

What I took away from this

The lesson that transfers to real cloud security is that DNS is not the source of truth for who owns an IP; the certificate is. In a shared range, a reverse lookup gives you nothing, but the TLS handshake hands you the service name for free. Any attacker who can sweep a range can attribute it, which means defenders have no advantage here unless they are running the same sweep against their own space first.

Speed is the point of the masscan stage. Sweeping 65,536 hosts for one port takes seconds, which changes the economics of reconnaissance: an attacker does not need to know where your assets are, they can afford to look at an entire /16 and let the certificates sort out ownership. Asset management that relies on a hand-maintained list will always be behind the tool that just scans everything.

Evidence gallery

Cloud Attack Surface Mapping with masscan and TLS Fingerprinting | Luis Javier Lozoya