Masscan Scans Entire IPv4 Internet in One Hour on Gigabit Line

Massscanning the Internet - Defcon 22 (2014) — vissago

vissago

Stateless packet synthesis allows a single terminal on commodity gigabit fiber to sweep the entire IPv4 address space in under an hour, crashing enterprise firewalls and exposing unprotected infrastructure that defenders fail to monitor.

AI-assisted summary of Massscanning the Internet - Defcon 22 (2014) — original source. Check the original for full context.

Source published:

Key ideas

  • Masscan leverages a stateless architecture and custom TCP/IP stack to scan the entire IPv4 address space across a single gigabit link in roughly an hour at speeds reaching 1,000,000 packets per second. (43:29)
  • Enterprise firewalls, switch CAM tables, and intrusion detection systems regularly fail or experience state exhaustion when subjected to line-rate, randomized port sweeps across large IP blocks. (30:04)
  • Global vulnerability assessments reveal systemic exposure of embedded hardware, unauthenticated Redis instances, digital billboards, and critical infrastructure, while security teams over-index on noisy inbound alerts rather than compromised outbound responses. (8:07)
  • Advanced scanning workflows use decoupled architectures, including spoofed SYN packets routed back to mobile endpoints and distributed cloud fleets to process deep application-layer banners asynchronously. (31:53)

Detailed notes

## Background This presentation was uploaded to YouTube by the channel vissago on October 1, 2014, capturing a talk from DEF CON 22. According to the page description, speakers Rob Graham, Paul McMillan, and Dan Tentler discuss the practical and operational quirks of scanning the entire internet.

## TL;DR Security researchers demonstrate Masscan, an asynchronous, stateless port scanner engineered to probe the entire IPv4 address space in under an hour from a single commodity gigabit connection. The speakers contrast its custom TCP/IP architecture and SYN cookie design against traditional synchronous tools like Nmap, highlighting how bypassing kernel connection state achieves wire-speed throughput. Alongside technical mechanics, the panel explores operational challenges, including handling upstream abuse complaints, crashing fragile enterprise firewalls, and avoiding automated blacklists. They also detail real-world discoveries and scanning pipelines, revealing exposed industrial control hardware, unauthenticated VNC sessions, open Redis databases leaking credentials, and unpatched Heartbleed instances scattered across the internet.

## Atmosphere & style The presentation carries the irreverent, energetic vibe of a classic DEF CON conference, balancing deep technical engineering with casual hacker humor and war stories. The dynamic among Rob Graham, Dan Tentler, and Paul McMillan is loose and collaborative, featuring witty banter about angry sysadmins, broken intrusion sensors, and live demos running actively in the background while they speak. It feels fast-paced, pragmatic, and slightly mischievous, capturing the thrill of treating the entire global IPv4 internet as a local subnet to experiment on in real time.

## Bulletin - [43:29](https://www.youtube.com/watch?v=UOWexFaRylM&t=2609s) Masscan leverages a stateless architecture and custom TCP/IP stack to scan the entire IPv4 address space across a single gigabit link in roughly an hour at speeds reaching 1,000,000 packets per second. - [30:04](https://www.youtube.com/watch?v=UOWexFaRylM&t=1804s) Enterprise firewalls, switch CAM tables, and intrusion detection systems regularly fail or experience state exhaustion when subjected to line-rate, randomized port sweeps across large IP blocks. - [08:07](https://www.youtube.com/watch?v=UOWexFaRylM&t=487s) Global vulnerability assessments reveal systemic exposure of embedded hardware, unauthenticated Redis instances, digital billboards, and critical infrastructure, while security teams over-index on noisy inbound alerts rather than compromised outbound responses. - [31:53](https://www.youtube.com/watch?v=UOWexFaRylM&t=1913s) Advanced scanning workflows use decoupled architectures, including spoofed SYN packets routed back to mobile endpoints and distributed cloud fleets to process deep application-layer banners asynchronously.

## Key takeaways - [00:00](https://www.youtube.com/watch?v=UOWexFaRylM&t=0s) Commodity gigabit uplinks and raw packet generation make scanning the entire 4-billion-address IPv4 space feasible from a single terminal. - [25:40](https://www.youtube.com/watch?v=UOWexFaRylM&t=1540s) Masscan achieves up to 1,000 times the speed of traditional tools like Nmap by eliminating connection state tracking and using asynchronous probe dispatch. - [04:05](https://www.youtube.com/watch?v=UOWexFaRylM&t=245s) Target-space randomization ensures packet drops predominantly occur on local network switches or upstream transit routers rather than target endpoints. - [08:07](https://www.youtube.com/watch?v=UOWexFaRylM&t=487s) Organizations fall victim to the 'streetlight effect' by obsessing over noisy inbound scan alerts while ignoring outbound responses that indicate actual vulnerabilities. - [11:55](https://www.youtube.com/watch?v=UOWexFaRylM&t=715s) Automated abuse reporting systems frequently generate false complaints against scan engines due to misconfigured intrusion detection sensors located outside target IP ranges. - [16:10](https://www.youtube.com/watch?v=UOWexFaRylM&t=970s) Cellular mobile carriers assign publicly routable IP addresses to smartphones, directly exposing consumer mobile devices to internet-wide probes. - [19:38](https://www.youtube.com/watch?v=UOWexFaRylM&t=1178s) Multi-stage scanning pipelines filter out millions of spurious SYN-ACK responders by verifying real services with secondary application-layer probes. - [30:04](https://www.youtube.com/watch?v=UOWexFaRylM&t=1804s) Stateful defensive appliances like Next-Generation Firewalls can suffer total state-table exhaustion and crash when processing randomized high-volume packet bursts. - [31:53](https://www.youtube.com/watch?v=UOWexFaRylM&t=1913s) Split-scanning decouples probe generation from response capture by spoofing a secondary IP address, shielding high-bandwidth scan nodes from abuse takedowns. - [34:40](https://www.youtube.com/watch?v=UOWexFaRylM&t=2080s) Global sweeps indicate that lingering vulnerabilities like Heartbleed concentrate primarily on embedded firmware and unmanaged networked appliances rather than mainstream web servers. - [46:12](https://www.youtube.com/watch?v=UOWexFaRylM&t=2772s) Massive unauthenticated surfaces, including digital billboards, county law enforcement terminals, and active IBM mainframes, remain directly accessible across IPv4. - [47:11](https://www.youtube.com/watch?v=UOWexFaRylM&t=2831s) While brute-forcing the 128-bit IPv6 address space remains mathematically infeasible, targeted scanning relies on allocation heuristics and observed prefix patterns.

## Detailed walkthrough ### [00:00](https://www.youtube.com/watch?v=UOWexFaRylM&t=0s) Demystifying Internet-Scale Scanning

Rob Graham took the stage alongside co-presenters Paul McMillan and Dan Tentler, opening with an early-morning joke for the DEF CON 22 crowd, hoping that attendees were still awake from the night before rather than waking up at such an ungodly hour. While McMillan and Tentler worked on setting up live demonstrations in the background, Graham framed the premise of their talk: scanning the entire IPv4 address space. Despite how formidable that sounds, Graham stressed that internet-wide scanning is not actually a monumental technological leap. Instead, it was simply an area where tools historically had not existed because researchers had never bothered to build them.

The landscape shifted once commodity internet service providers began offering gigabit fiber uplinks to everyday users. Viewed through the lens of modern networking speeds, the IPv4 internet is surprisingly compact, consisting of only about four billion addresses. Graham described the visceral thrill of sitting at a terminal, configuring Nmap-style flags, entering the `/0` root subnet as the target, and watching an unbroken torrent of real-time scan results flood across the console. As Rob Graham observed, “This is really an exciting thing to do is to sit down on your command line using Nmap style options and just say I want to scan the subnet the /0 subnet that and immediately start getting results back just watching your screen just flow and flow and flow and flow.”

- Masscan was built to bridge the gap between traditional port scanners and modern gigabit uplink capabilities. - The entire IPv4 internet consists of approximately 4 billion IP addresses, making a comprehensive `/0` sweep feasible from a single high-speed terminal. - Traditional tools lacked native high-speed architectures, whereas Masscan leverages raw packet synthesis to stream responses back in real time.

---

[01:09](https://www.youtube.com/watch?v=UOWexFaRylM&t=69s) The Dual Motivations: Defense and Exploration

Turning to the rationale behind internet-scale scanning, Graham outlined clear benefits for both defensive administrators and offensive security researchers. From a defensive posture, enterprise tools frequently collapse under massive scale. While Nmap remains a staple, scanning hundreds of thousands of internal and perimeter systems with it can take days or weeks. In contrast, Masscan can blast through a 100,000-host enterprise perimeter in mere minutes, which proved essential when organizations scrambled to locate OpenSSL instances vulnerable to Heartbleed. Internet-wide surveys also provide empirical answers to systemic threats, such as enumerating misconfigured NTP servers weaponized in distributed denial-of-service amplification attacks, assessing botnet exposure when vendors like D-Link publish critical router flaws, or analyzing global SSL certificate renewal cadences in the aftermath of major disclosures.

For researchers and offensive practitioners, the motivation often centers on raw discovery and probing the unindexed "deep net"—systems that search engines like Google never crawl. By invoking banner-grabbing features, researchers can locate exposed, hackable devices within minutes of initiating a scan. Graham highlighted the sheer unpredictability of scanning 65,000 potential ports, noting that choosing an arbitrary port often reveals bizarre exposed machinery, including Siemens industrial control systems governing power generation plants or millions of smart home automation appliances operating on obscure ports like 7468. Dan Tentler chimed in to ask the audience if anyone remembered the port number for a newly publicized iPhone backdoor service in the 62,000 range so they could scan the entire planet for it live on stage. Emphasizing the psychological shift that comes from scanning the globe, Rob Graham stated, “We really don't appreciate how small the internet is until we've typed in /0 and run our scan.”

- Scanning for Heartbleed across 100,000 enterprise hosts takes minutes with Masscan compared to hours or days with conventional scanners. - Comprehensive internet sweeps allow researchers to quantify DDoS amplification risks (such as vulnerable NTP daemons) and measure unpatched residential routers. - Using banner enumeration (`--banners`) reveals unindexed infrastructure, industrial SCADA equipment, and exposed embedded devices that search engines cannot discover.

---

[04:05](https://www.youtube.com/watch?v=UOWexFaRylM&t=245s) Bandwidth Overhead, Switch Limits, and Sharding

When users decide to fire up a scanner on an unmetered VPS or a commercial ISP uplink, they quickly encounter the physical realities and quirks of packet transport. On a gigabit Ethernet link, the maximum theoretical throughput for standard scanning is roughly 476 Mbps rather than the full 1,000 Mbps. Because TCP SYN scanning relies on transmitting enormous volumes of tiny probe packets, the per-packet Ethernet framing, preamble, inter-packet gap, and IP/TCP headers consume far more wire bandwidth than the payload itself. At maximum line rate, a gigabit pipe equates to roughly 1.488 million packets per second. However, physical switches almost never sustain that pace during scanning bursts. Rob Graham admitted, “I just know that when I connect I get between 300,000 to maybe 800,000 packets per second I'm not getting what Ethernet tells me I should get even on a well-configured switch that's got nothing on but my but me I don't get the full bandwidth I don't know why.”

Upstream peering arrangements and hosting providers introduce further complications. While some ISPs remain oblivious to outbound micro-packets—sometimes billing a customer for merely a few megabytes after a full sweep of the planet—others enforce strict peering ratios that react harshly to relentless streams of 64-byte packets. Even high-capacity networks can struggle; Graham recalled the Chaos Computer Club conference featuring a 100 Gbps pipe, noting that even with 10 GbE network cards, pushing millions of small packets strains routing hardware and violates carrier agreements. Virtual private servers frequently buckle under the I/O load, and transit routers drop traffic along the path. Because all major modern mass-scanners randomize target ordering across the address space, dropped packets almost never occur at the destination endpoint; packet loss happens locally or within the immediate transit hops. To achieve reliable results without swamping local gear, Graham recommended distributing the load across multiple geographically separated VPS instances using built-in sharding flags.

```mermaid flowchart TD accTitle: Masscan Sharded Architecture and Transit Bottlenecks accDescr: Diagram illustrating distributed Masscan scanning across multiple VPS instances and intermediate network bottlenecks. subgraph DistributedNodes ["Distributed VPS Probes"] N1["Tokyo Node (--shard 1/3)"] N2["Dallas Node (--shard 2/3)"] N3["Paris Node (--shard 3/3)"] end subgraph LocalBottlenecks ["Transit and Switching Limits"] SW["Local Switch (Bottlenecks to 300k-800k pps)"] PEER["ISP Transit / Peering (Small-packet ratio limits)"] end subgraph GlobalInternet ["Target Address Space"] TARGETS["IPv4 Targets (Randomized /0 Space)"] end N1 --> SW N2 --> SW N3 --> SW SW --> PEER PEER --> TARGETS ```

- A gigabit Ethernet connection maxes out at approximately 1,488,000 packets per second for 64-byte probe frames, yielding an effective TCP/IP payload rate around 476 Mbps. - Real-world enterprise switches frequently throttle or drop scan packets, dropping actual output to between 300,000 and 800,000 packets per second. - Target addresses are pseudo-randomized so destination networks do not experience packet loss; packet drops occur almost exclusively on the scanner's local link or upstream provider. - Scanning workloads can be divided cleanly across distinct datacenters (such as Tokyo, Dallas, and Paris) by passing native sharding arguments like `--shard 1/5`.

---

[08:07](https://www.youtube.com/watch?v=UOWexFaRylM&t=487s) Abuse Complaints, IDS Signatures, and Asymmetric Monitoring

The most significant operational obstacle to mass scanning is not bandwidth or processing power, but the inevitable flood of abuse complaints. Modern hosting providers and ISPs face automated abuse reporting systems targeting scanning, scraping, and spam. Even when an upstream provider is technically sympathetic to security research, they often have their hand forced: external networks will routinely blacklist their autonomous system number (ASN) or threaten to sever peering agreements if outbound port scanning continues unchecked. Scanning for active vulnerabilities such as Heartbleed triggers intrusion detection systems worldwide, causing security teams to panic and file emergency complaints. Graham noted that conducting a monthly Heartbleed sweep across the 300,000 remaining vulnerable systems generated staggering volumes of abuse tickets—though humorously, running a standard Tor exit node still managed to draw even more hostility from network operators.

To mitigate complaints and prevent systems from automatically getting added to fail2ban blocks during HTTP probes, Graham urged researchers to configure custom headers via `--user-agent` that politely explain the nature of the research project. Modifying scan signatures to bypass strict intrusion detection rules is also worthwhile, not out of malice, but simply to keep system administrators from panicking over harmless research sweeps. Graham criticized the common industry obsession with monitoring inbound perimeter probes, likening it to the classic joke of the drunk looking for his lost keys under a streetlight simply because the illumination is better there. Organizations fixate on inbound IDS alerts because internet background radiation constantly triggers them, but meaningful defense requires monitoring outbound responses. Rob Graham highlighted this disconnect: “And that's what most organizations do these days is they monitor the inbound attacks for hackers because the light's better because they you put an IDS on the wire and immediately you see alerts coming up because people are there's always this background radiation of someone's doing something on the internet sending you packets and you'll get events the light's better on the inbound side but the detection you really want is on the outbound side what is all the response.”

- Monthly Heartbleed surveys uncovered approximately 300,000 vulnerable servers worldwide, triggering massive volumes of automated IDS abuse reports. - Tor exit nodes operate at an abuse complaint volume that rivals or exceeds global vulnerability scanning sweeps. - Automated defenses like fail2ban frequently blacklist web probes unless scanners customize their request metadata by setting informative `--user-agent` strings. - Network defenders suffer from the "streetlight effect" by focusing on noisy inbound scan probes rather than analyzing outbound responses that indicate actual compromises or data leaks.

[11:14](https://www.youtube.com/watch?v=UOWexFaRylM&t=674s) Heartbleed Inbound vs. Outbound Monitoring and ISP Pressure

Rob Graham points out a major failure in enterprise detection postures regarding Heartbleed: organizations monitor inbound traffic to see whether scanners are probing them, but fail to monitor their own outbound responses confirming that they are indeed vulnerable. As Graham remarks, “they're monitoring our inbound stuff saying that are you vulnerable and not monitoring the outbound stuff saying yes we are and that's really really bad.”

Internet Service Providers (ISPs) are under intense pressure when mass scanning occurs, particularly because the Department of Defense (DoD) gets extremely upset. When DoD officials in suits arrive at an ISP’s office to demand that traffic ceases, the ISP immediately passes that pressure directly down to the researchers, demanding that those specific address ranges be excluded from future sweeps.

[11:55](https://www.youtube.com/watch?v=UOWexFaRylM&t=715s) Exclusion Lists, BGP Data, and Broken Sensor Logic

Handling exclusion requests in Masscan is straightforward and mirrors Nmap’s methodology. The tool accepts a configuration file or command-line parameters specifying an exclude list of IP address ranges. The file supports inline comments, allowing the operators to maintain a sprawling record of every network that has submitted an abuse complaint. Whenever a complaint arrives, the team responds cordially, explaining that they are conducting legitimate security research, and offers to add the requester's IP ranges to the exclude list.

While the team would love to publish a public exclude list, almost every organization asking to be removed explicitly refuses to have their exclusion publicized out of fear that attackers will discover their network blocks. As Paul McMillan points out, this secrecy is fundamentally misguided because organizations assume that hiding their ranges prevents attackers from finding them, yet Hurricane Electric's BGP portal (`bgp.he.net`) indexes and provides this routing information publicly in an easily searchable format.

```mermaid flowchart TD accTitle: Exclusion List Pipeline accDescr: Workflow from incoming abuse complaints to updating Masscan exclude configurations.

subgraph INTAKE["Complaint Intake"] A["Incoming Abuse Complaint"] --> B{"Contains IP Ranges?"} B -- "No" --> C["Lookup ASN / Ranges on bgp.he.net"] B -- "Yes" --> D["Extract Target CIDR Blocks"] C --> D end

subgraph CONFIG["Engine Configuration"] D --> E["Add to Masscan Exclude File"] E --> F["Annotate with Comments & Context"] F --> G["Masscan Skips IP Ranges on Next Run"] end ```

The speakers describe the sheer absurdity of automated Intrusion Detection System (IDS) and Intrusion Prevention System (IPS) abuse complaints. Security appliances deployed across disparate subnets, netblocks, and upstream ISPs routinely dispatch automated notices crying foul over a single SYN packet. In one scenario, a target’s automated abuse messages demanded the removal of their public-facing frontend IPs, yet their monitoring sensors sat on completely different, unlisted networks. As a result, subsequent scans hit the unlisted sensors, generating duplicate complaints demanding the exclusion of addresses that were already excluded. As Dan Tentler vents about the broken logic: “we kept doing scans and their sensors would keep picking up scans and keep complaining for us to take off IPs that were already in the block list and we're like we don't know what you guys are take your crack back to the dealer you got bad crack like tell them you want better crack stop”.

- Masscan exclude lists function identically to Nmap using configuration parameters or an exclude file with full comment support. - Quoting Dan Tentler on hyper-sensitive defenses: “sorry I didn't know a single SYN packet was malicious but you know whatever... it's malicious a single SYN packet it's malicious internet is over”. - Defenders often refuse to disclose their IP ranges while demanding exclusions, forcing the scanners to look up their ASNs and prefixes on `bgp.he.net`.

[14:14](https://www.youtube.com/watch?v=UOWexFaRylM&t=854s) Paranoid Defenders and the Illusion of Targeted Attacks

When conducting internet-wide scans, defenders frequently suffer from confirmation bias because they refuse to believe anyone is actually scanning the entire IPv4 space. An organization might operate well-known corporate IP blocks alongside an obscure, unlinked subnet that was supposed to remain hidden. When Masscan traverses the entire IPv4 address space uniformly, hits both ranges, and flags their services, the defenders assume they are being singled out by an advanced, targeted adversary who somehow mapped their secret internal infrastructure.

Rob Graham illustrates this defender panic with an incident from six months prior. While scheduled to appear as a guest on a podcast, Graham kicked off an internet-wide scan the evening before the show. One of the podcast hosts began tweeting late at night about being jolted awake for an emergency bridge call because his organization was actively under attack. Once the host realized the probe was simply Graham's scan hitting their infrastructure, he had to talk down the incident responders so everyone could go back to sleep. Graham notes that the host's team adapted, so that “whenever I do a scan the the the ticket gets opened up it immediately gets closed is just Rob scanning again.”

[16:10](https://www.youtube.com/watch?v=UOWexFaRylM&t=970s) The Australian Freakout and Becoming `internetpolice.us`

Dan Tentler shares an ordeal that occurred during ShmooCon in February, where the team sat in the hotel lobby until 3:00 AM running mass scans (tentatively for VNC). Tentler hosts his scanning rig with a friend who operates a boutique ISP, a necessity because mainstream tier-1 transit providers will instantly terminate service if a customer requests 800 Mbps of bandwidth solely to scan the internet. Because of this personal relationship, Tentler makes a point of being transparent about scan schedules so his upstream provider can field the inevitable blowback.

The morning after the ShmooCon scan, Tentler’s ISP called to warn him about an aggressive system administrator from Australia who was completely outraged over receiving a solitary SYN packet. Although the ISP cordially replied with links to Tentler's project documentation explaining the benign research context, the Australian administrator was shocked that an actual human responded to an abuse complaint. The administrator flew into an uncontrollable rage, screaming over the phone and threatening to call the "internet police." Seizing on the absurdity, Tentler acted immediately: “3 hours later I own internetpolice.us and now my scans come from internetpolice.us”.

- Tentler’s scanning footprint pushes roughly 800 Mbps of raw SYN traffic. - Scanning mobile carrier IP pools (such as Verizon and AT&T) exposes cell phones directly to public routing, prompting Tentler to joke: “your phone is directly connected to the internet and we will be touching you against your will wherever your phone may be”. - Running a live scan on stage against port 6278 (associated with an Apple/iPhone backdoor rumor) yielded roughly 542,000 responding IPs, which later climbed to 902,000.

[19:38](https://www.youtube.com/watch?v=UOWexFaRylM&t=1178s) Multi-Stage Scanning and Open Redis Instances

A major complication in large-scale measurement is the presence of 1 to 2 million devices on the internet—such as misconfigured firewalls, routers, and load balancers—that return a SYN-ACK to literally every single probe regardless of port. Because of this, internet-scale scanning must be executed in multiple sequential stages rather than relying on a single raw port sweep.

```mermaid flowchart LR accTitle: Two-Stage Scanning Methodology accDescr: Stage 1 high-speed SYN sweep feeding into Stage 2 application-layer validation.

subgraph STAGE1["Stage 1: Broad Sweep"] A["Masscan SYN Sweep"] --> B["Identify Raw Responders"] end

subgraph FILTER["Artifact Elimination"] B --> C{"Responds to Every Port?"} C -- "Yes" --> D["Discard False Responder"] end

subgraph STAGE2["Stage 2: Protocol Deep-Dive"] C -- "No" --> E["Secondary Inspection"] E --> F["Connect & Issue Commands"] F --> G["Collect Unauthenticated Data"] end ```

The first pass uses Masscan to perform a blisteringly fast SYN sweep across the target port to discover raw responders. Once candidates are identified, a secondary process connects at the application layer to validate the service and eliminate devices that simply answer everything.

Tentler illustrates this two-stage pipeline using Redis as an example. Masscan discovers thousands of exposed Redis instances. The secondary process establishes a connection and issues the native `MONITOR` command. While properly secured systems prompt for authentication (which the scanner ignores), an alarming number of databases run wide open without authentication. In those instances, the `MONITOR` stream dumps live credit card numbers, Facebook session cookies, and Twitter session cookies directly across the wire in plaintext. Tentler laments the architectural disconnect where organizations deploy heavily hardened frontends with dual-factor authentication, SSL, and OAuth, while leaving backend data transports completely open and unencrypted to the public internet. Furthermore, the secondary pass demonstrates massive drop-offs from initial port hits: an initial sweep might surface several million raw SYN-ACKs, but only a fraction prove to be real, functional services once protocol-level handshakes occur.

[21:16](https://www.youtube.com/watch?v=UOWexFaRylM&t=1276s) Defensive Misconfigurations and Absurd Abuse Responses

When reviewing large-scale scan results that yielded several million responses for what should have been around 200,000 active hosts, the presenters realized that many perimeter devices were configured to listen and answer on every single TCP port. Dan Tentler noted that certain security appliances—such as Check Point firewalls—offer defensive features designed to thwart scanners like Nmap by responding to every connection request to create confusion. However, facing an 8 Gbps mass scan, this defensive strategy backfires disastrously, often crashing the state tables of firewalls and intrusion detection systems. Tentler joked about late-night scanning sessions in hotel lobbies while an administrator somewhere watched their infrastructure burn: “I'm thinking that like we're doing these in a, you know, in the hotel lobby tinkering around at 3:00 in the morning, and somewhere there's a guy with his head on fire cuz his IDS went down or his firewall went down.”

The team highlighted the absurdity of the complaints they receive in response to scans. Many administrators send boastful notes declaring they have blocked the scanner's IP, prompting Paul McMillan to dismiss them as irrelevant: “So one of my favorite complaints I get back is the one saying, uh, to the effect of, 'We've blocked you at the firewall, na-na-na-na-boo-boo,' of like, I don't care, I don't even know who you are, I don't really care.” Rob Graham added that abuse handling frequently reveals broken organizational processes, pointing to a recurring notice from a South Korean financial group that claimed to be a Class A National Security Objective Facility. Each time Graham scanned their range, the company's automated ticketing system replied by CCing every internal sysadmin in the enterprise, inadvertently handing attackers a comprehensive, ready-made employee directory for spear-phishing campaigns.

- Several defensive products attempt to thwart port scanners by sending SYN-ACK responses on all 65,535 ports, which causes them to exhaust their own state tables when targeted by multi-gigabit scans. - An unnamed South Korean financial institution routinely exposes its entire systems administration staff by CCing every internal operator on external abuse notifications.

[23:00](https://www.youtube.com/watch?v=UOWexFaRylM&t=1380s) ISP Relations, SWIP, and the Fake Internet Police

To manage external scrutiny, the researchers emphasize working closely with upstream network providers rather than hiding. By utilizing the Shared Whois Project (SWIP), operators can have their public IP address ranges explicitly assigned to their own names in ARIN or RIPE databases. In theory, this directs all incoming abuse tickets to the scanner instead of burdening upstream network engineers. In practice, however, complainants still forward reports indiscriminately to any administrative contact uncovered in WHOIS or DNS records, including the upstream ISP and irrelevant postmaster addresses. McMillan cautioned against using legitimate corporate email addresses for registration, as security teams routinely spray abuse notices to every contact associated with any query result.

Meanwhile, Dan Tentler shared an update on his project, `internetpolice.us`, which he maintained as a landing page for bewildered administrators investigating inbound scans. The site had briefly gone offline because Apache was not running, prompting laughs from the panel. Tentler noted that the webpage featured a mock complaint form that silently discarded all user input. Despite receiving low-effort SQL injection and cross-site scripting attacks from frustrated visitors, Tentler mused about the comedic potential of logging what sysadmins actually wrote: “I can't imagine if people have tried to fill this form out and what went into it, because that would be like a whole Tumblr feed, like security reactions, just what goes in that form, that would be so rad.”

- Utilizing SWIP assigns IP block ownership directly to the scanner, reducing uncoordinated upstream transit disconnects. - Nearly 50% of abuse reporters ignore dedicated abuse mailbox fields in SWIP records and continue CCing upstream transit providers and arbitrary postmaster aliases. - Running anonymous scans through budget virtual private server (VPS) providers funded with Bitcoin frequently leads to prompt account termination, whereas major providers like Linode accommodate responsible scanning if approached transparently with verified credentials and throttled transmission rates.

[25:40](https://www.youtube.com/watch?v=UOWexFaRylM&t=1540s) Masscan Architecture: Asynchronous Scanning and SYN Cookies

Rob Graham explained the fundamental architectural difference between traditional scanners like Nmap and Masscan. Nmap operates synchronously: it dispatches a probe to a host, waits for a response, and handles retransmissions if packets drop before advancing to the next target. This stateful, serialized design makes Nmap exceptionally thorough for detailed analysis of small network segments, but severely bottlenecks large-scale operations. Masscan, by contrast, operates asynchronously, borrowing the architectural paradigm of high-throughput web servers like Nginx versus process-bound servers like Apache. It transmits raw SYN packets at full line rate without holding connection state in RAM.

```mermaid flowchart TD accTitle: Masscan Stateless Scanning Mechanism accDescr: Diagram contrasting Nmap's stateful scanning queue with Masscan's stateless SYN-cookie verification.

subgraph NMAP["Nmap: Synchronous & Stateful"] N1["Send SYN probe to Target"] --> N2["Maintain record in local RAM"] N2 --> N3["Wait for SYN-ACK or timeout"] N3 --> N4["Scan next port / host"] end

subgraph MASSCAN["Masscan: Asynchronous & Stateless"] M1["Generate SYN with crypto cookie"] --> M2["Transmit immediately at wire speed"] M2 -.->|"No memory allocated for waiting"| M3["Target receives probe"] M3 --> M4["Target returns SYN-ACK"] M4 --> M5["Validate SEQ/ACK via cookie formula"] M5 --> M6["Log open port without state lookups"] end ```

By discarding state tracking, Masscan can generate four billion packets without running out of memory. To identify valid returning traffic without maintaining a four-billion-entry lookup table, Masscan generates TCP initial sequence numbers using a cryptographic SYN cookie algorithm. When a target host responds with a SYN-ACK, the scanner verifies the acknowledgment number against its internal hashing parameters to confirm that the response corresponds to a legitimate outgoing probe. Graham emphasized that the choice of tool depends entirely on scope: “The only reason that you're using Masscan is because of you want to do million-node networks or billion-node networks.”

- Nmap is stateful and synchronous, tracking active probes in memory and retransmitting lost packets, which caps its throughput on massive CIDR blocks. - Masscan transmits packets without buffering connection state, validating incoming SYN-ACK replies strictly via calculated TCP SYN cookies. - Masscan scales linearly to multi-gigabit speeds, achieving scans up to 1,000 times faster than synchronous scanning engines.

[26:59](https://www.youtube.com/watch?v=UOWexFaRylM&t=1619s) Custom TCP/IP Stacks, Banner Checking, and Sharding

A critical design consideration in Masscan is that it incorporates its own custom TCP/IP stack that bypasses the operating system's kernel network subsystem. While this enables extreme speed, it introduces operating system conflicts when performing banner grabbing or full TCP handshakes. Because the underlying kernel has no knowledge of the outgoing SYN packet generated by Masscan, it treats incoming SYN-ACK replies from targets as unsolicited connections and immediately sends a TCP RST packet to tear them down. To prevent the host OS from killing connections before banners or SSL certificates can be collected, operators must configure an `iptables` rule to drop outgoing RST packets or configure Masscan to transmit using a dedicated, secondary IP address that the host OS stack ignores.

```mermaid flowchart LR accTitle: Operating System Kernel RST Conflict accDescr: Shows how the host kernel interrupts Masscan's banner grabbing unless an iptables rule or separate IP is used.

subgraph Host["Scanning Host Machine"] MS["Masscan Custom TCP Stack"] OS["Host OS Kernel Network Stack"] end

Target["Target Server"]

MS -->|"1. Raw SYN packet"| Target Target -->|"2. SYN-ACK response"| OS OS -->|"3. Unsolicited! Sends RST (kills connection)"| Target MS -.->|"Blocked from receiving Banner/Cert"| Target ```

Graham noted that basic operation requires defining the source IP address, source port ranges, and the local router's MAC or gateway IP address. For banner grabbing, Masscan foregoes Nmap's heavy NSE scripting engine in favor of a lightweight `--hello-string` parameter. Operators can encode raw request payloads—such as proprietary industrial control commands—into a file and instruct Masscan to transmit the payload immediately upon establishing a TCP connection. Additionally, large-scale scanning campaigns can be split across dozens of physical machines using the `--shard <index>/<total>` argument, which mathematically partitions the pseudorandom target sequence so multiple systems scan distinct slices of the Internet without duplicating effort.

- Masscan's custom TCP/IP engine bypasses the host operating system kernel, causing the kernel to automatically transmit TCP RST packets when targets return a SYN-ACK. - The RST conflict is mitigated by implementing firewall drop rules or binding Masscan to an auxiliary IP address unmanaged by the host OS. - Banner inspection supports custom network protocols using `--hello-string <filename>`, enabling users to extract responses from niche industrial control devices. - Scanning tasks can be evenly distributed across a cluster of systems using the `--shard` directive without coordinating via a central server.

[30:04](https://www.youtube.com/watch?v=UOWexFaRylM&t=1804s) Stress-Testing Firewalls and the Infinite Loop

The panel discussed how Masscan’s extreme packet volume makes it an unintentional stress-testing utility for network perimeters. Dan Tentler shared an experience testing enterprise Next-Generation Firewalls (NGFW) with deep packet inspection features during a client deployment. When he pointed Masscan from a standard laptop at a non-existent external IP subnet behind the firewall, the device's state inspection engines immediately choked: “One NGFW had Active Directory authentication, and all of its little gauges went to 100%, and AD broke and it never came back.” A competing vendor's firewall also pegged its CPU gauges to 100% and dropped traffic, recovering only after Tentler killed the scan with Ctrl+C. Tentler also admitted to accidentally exhausting a switch's CAM table in a customer production environment due to excessive MAC and IP state generation.

```mermaid flowchart TD accTitle: Network Appliance State Table Exhaustion accDescr: Flowchart illustrating how Masscan overwhelms stateful inspection engines.

M["Masscan Engine"] -->|"Massive stream of SYN packets"| FW["Next-Generation Firewall (NGFW)"] FW -->|"Deep Packet Inspection (DPI)"| AD["Active Directory Auth Subsystem"] FW -->|"State Table Allocation"| ST["Connection State Table"]

ST -->|"Exhausted (>100k sessions)"| Crash["Packet Dropping & Appliance Freeze"] AD -->|"Query Queue Overwhelmed"| Lockup["Authentication Service Failure"] ```

Rob Graham pointed out that while Masscan easily transmits millions to billions of packets in minutes, conventional network appliances begin experiencing severe performance degradation once their active state tables exceed 100,000 connections. To push this stress testing further, Masscan includes an `--infinite` flag. When this parameter is supplied, the scanner seamlessly loops back to the start of its scanning range as soon as it completes, leaving all unclosed TCP connections open in memory across iterations. This enables an operator to sustain upwards of 100 million concurrent TCP states against a target environment. Finally, Graham remarked that for managing the massive datasets generated by these runs, he prefers writing directly to raw binary output using the `--slob` format rather than parsing plain text.

- Stateful inspection devices and Next-Generation Firewalls routinely exhaust memory and crash when subjected to Masscan traffic due to deep packet inspection overhead. - Masscan can trigger MAC address table (CAM) exhaustion on enterprise switches when operating across broad IP and port spaces. - The `--infinite` option causes Masscan to loop through its target range continuously, holding open previous TCP connections to simulate over 100 million concurrent sessions. - High-rate scanning output is most efficiently preserved using Masscan's native binary format (`--slob`) rather than human-readable text logs.

[31:53](https://www.youtube.com/watch?v=UOWexFaRylM&t=1913s) Split-Scanning with Burner Phones and Spoofed Syns

Rob Graham explains an obscure feature of masscan: saving results in binary format and re-reading them later using the `--rescan` parameter to convert the data into XML, JSON, or text. Moving on to an unconventional scanning architecture discussed with Paul McMillan, Rob details how to split transmission and reception across completely separate networks. A high-bandwidth colocation facility with a gigabit pipe transmits outbound SYN packets at wire speed while spoofing the source IP address of a mobile burner device, such as an inexpensive phone. When internet targets respond, the SYN-ACK packets return at a far lower rate directly to the phone. The primary operational benefit of this decoupled design is abuse mitigation: upstream complaints are routed to the burner phone’s cellular carrier rather than putting the high-speed colo account at risk.

Rob tested this concept using a jailbroken "Ninja Telephone" running masscan compiled for the command line. While T-Mobile blocked the inbound traffic behind a stateful firewall, Clearwire allowed the setup to function properly. Although Clearwire blocks incoming SYNs, it allows unsolicited incoming SYN-ACKs through its edge, permitting masscan to complete the handshake. Because masscan uses a deterministic mathematical seed to generate and validate SYN cookies asynchronously, the receiver verifies whether an incoming packet belongs to the active scan. Once validated, the mobile endpoint can establish a full TCP connection, allowing deep protocol operations such as grabbing SSL certificates or probing for vulnerabilities like Heartbleed. Meanwhile, the raw, multi-gigabit traffic volume originates entirely from the distant colo servers.

```mermaid flowchart LR accTitle: Asymmetric Masscan Architecture accDescr: High-bandwidth colo sends spoofed SYNs while targets send SYN-ACK replies back to a burner mobile device.

subgraph SENDER["Colocation Facility"] C["High-Speed Colo Server<br/>(1 Gbps Pipe)"] end

subgraph TARGETS["The Internet"] T["Target Hosts"] end

subgraph RECEIVER["Mobile Endpoint"] M["Burner Phone / Clearwire<br/>(Masscan Receiver)"] end

C -->|"1. Blasts SYN packets<br/>(spoofs Phone IP)"| T T -->|"2. SYN-ACK responses flow back"| M M -->|"3. Validates SYN cookie seed<br/>& completes TCP connection"| T ```

- Clearwire passes unsolicited SYN-ACK responses through its firewall, while T-Mobile drops them completely. - Verizon is believed to assign public, reachable IP addresses to prepaid devices, making it a viable target for split-scanning. - The panel jokes about using this asymmetric architecture across submarine fiber cables to mystify the NSA: “Set up your phone on the other side of some ocean and just send all the results over there and watch them what the hell is going on.”

---

[34:40](https://www.youtube.com/watch?v=UOWexFaRylM&t=2080s) Exposed Law Enforcement Systems, Mainframes, and Heartbleed

Transitioning to scan findings, Rob presents an image captured by an automated screenshotting pipeline built by Paul. The slide displays an unprotected remote desktop window from a law enforcement agency: “County warrant processing system something or other State Police. The derp is very strong.” Paul contacted an intermediary to report the open host immediately, noting that while the agency likely passed standard regulatory compliance checks, nobody had realized that leaving an unauthenticated Remote Desktop Protocol (RDP) session directly accessible to the open internet was a critical security failure.

``` +--------------------------------------------------------------+ | COUNTY WARRANT PROCESSING SYSTEM - [STATE POLICE] | | | | [!] Remote Desktop Protocol (RDP) listening publicly | | [!] Authentication: NONE REQUIRED | | | | Status: Reported to emergency contact and removed | +--------------------------------------------------------------+ ```

Rob also reviews the ongoing fallout from the Heartbleed vulnerability, sharing that approximately 300,000 systems remain unpatched globally. An analysis of the SSL certificate subject names returned during scanning reveals that the vulnerable surface consists largely of embedded appliances rather than traditional web servers. These include thousands of QNAP and Synology Network Attached Storage (NAS) boxes—such as the Synology TS series—alongside Hikvision surveillance cameras. Because these devices rarely possess dedicated domain names and are mapped exclusively to raw IP allocations, vulnerability discovery requires whole-internet port scanning rather than DNS enumeration. Rob and Dan Tentler also highlight another researcher maintaining a Tumblr feed dedicated to scanning internet-connected IBM mainframes, revealing active installations belonging to departments of motor vehicles, pharmacies, and critical infrastructure exposed directly to the public web.

---

[36:55](https://www.youtube.com/watch?v=UOWexFaRylM&t=2215s) Paul McMillan's Distributed VNC Screenshot Pipeline

Attempting to run a live demonstration on stage, the team encounters network issues with their primary scanning host, `internetsurvey2.arc.com`. While Rob sets up a local alternative, Paul explains the mechanics of his distributed internet screenshot scanner. The pipeline separates discovery from payload processing using an asynchronous queue:

```mermaid flowchart TD accTitle: Distributed VNC Capture Architecture accDescr: Masscan scans port 5900, pushes open IPs into a Redis queue, and cheap cloud workers capture screenshots.

A["Masscan on Friendly Host<br/>Scans Port 5900 (VNC)"] -->|"IPs with port 5900 open"| B[("Redis Queue")]

subgraph WORKERS["Elastic Cloud Fleet (~100 Nodes @ $0.16/hr)"] W1["Worker: Connects & probes VNC auth"] W2["Worker: Connects & probes VNC auth"] end

B --> W1 B --> W2

W1 -->|"Auth bypassed: capture frame"| C[("Image Queue / Web Results")] W2 -->|"Auth bypassed: capture frame"| C ```

Paul scans TCP port 5900 (VNC) across the entire IPv4 space in 15 to 20 minutes from a friendly hosting provider. Rather than having the high-speed scanning machine execute protocol interactions, the resulting open ports are dumped into a Redis queue. A pool of cloud worker instances pulls IPs from the queue, connects to each target, and evaluates the VNC handshake. If the VNC server explicitly indicates that no authentication is required, the worker captures a frame buffer screenshot and pushes the image into a result pipeline intended to be viewed at `results.survey.tx.a`. Paul notes that while the full configuration typically uses around 100 cloud nodes costing roughly $0.16 per hour each, he had to rebuild the deployment shortly before the presentation after losing access to his original staging servers two hours prior.

- The VNC worker script checks for explicit passwordless access: “If the VNC protocol says you may connect without authentication, it's a very explicit thing; we're not, you know, hacking into something that's not authorized.” - Workers only capture screenshots after confirming the remote server permits authentication-free sessions. - Cloud instances are ephemeral and can be scaled elastically for pennies per job: “They cost me 16 cents an hour, so it's perfectly reasonable to spin them up for a job like this and then tear them down when you're done with them.”

---

[40:40](https://www.youtube.com/watch?v=UOWexFaRylM&t=2440s) Live Demonstration: Masscan Mechanics vs. Nmap

While waiting on the web dashboard to resolve access issues on the conference network, Rob opens a terminal to demonstrate masscan in real time directly from the DEF CON network drop. He illustrates how masscan fundamentally differs from Nmap in design and feedback latency. When scanning a subnet with Nmap, the tool performs host discovery, sends ICMP pings, evaluates multiple ports, and retains results in internal memory until a host scan completely finishes. If an operator makes an error in the command-line parameters, they must wait extended periods before seeing the failure: “You start your Nmap scan, you go wait for a coffee and come back, realize you made a mistake in the configuration parameters, do it again, and it's an iterative process.”

| Feature / Behavior | Nmap | Masscan | |:--- |:--- |:--- | | **Scanning Methodology** | Host-centric (pings, checks multiple ports per target in sequence) | Packet-centric / Stateless (one port probe fired at random targets) | | **Result Latency** | High (batches outputs until the target host completes) | Immediate (displays responses as soon as a single SYN-ACK arrives) | | **Pings / Pre-probing** | Defaults to host discovery pings before port probing | No ping pre-checks; directly fires SYN packets to specified ports | | **Global Scan Safeguards** | Scans specified targets directly without broad safety checks | Requires an explicit `--exclude` parameter when targeting `0.0.0.0/0` |

Masscan fires raw TCP SYN packets directly at the requested port without prior ICMP checks, producing instantaneous stdout feedback even at modest rates like 10 packets per second. Rob tests a localized sweep against the `23.0.0.0/8` netblock—a space heavily populated by Akamai, Amazon, and commercial CDN platforms—noting that it consistently yields HTTP responses on port 80 without generating abuse tickets. When he cranks the rate up to 10,000 packets per second, the terminal stream floods with incoming banner updates. Rob explains that masscan includes a built-in safeguard against accidental wide-scale attacks: the program requires the user to explicitly define an `--exclude` address before it will initiate an unrestricted scan across the global internet. Demonstrating a global scan with a dummy exclude rule, masscan immediately begins surfacing active systems across the entire world within seconds.

[43:29](https://www.youtube.com/watch?v=UOWexFaRylM&t=2609s) Masscan Speed, Remaining Time Estimates, and Live Scanning

Rob Graham explains one of the most satisfying operational features of Masscan: its real-time completion countdown. While sending traffic at a sluggish pace will make the progress indicator feel completely hopeless, unleashing the tool at full throttle against the entire global routing table transforms the experience. Rob jokes, “It's like when you copy a file in Windows 95, but it's really cool when you type in that 0.0.0.0/0, the zero subnet meaning the internet, and at a much faster rate like a million packets per second, and it tells you, ‘Yeah, it's about an hour.’”

The speakers demonstrate that these astronomical numbers are not theoretical lab benchmarks but achievable on real-world uplinks. Dan Tentler jumps in to provide actual metrics from a live scan kicked off just before walking into the presentation hall: “Yeah, for reference, I'm getting 690,000 packets a second on my scan that's going right now and it—I started as I walked in and it was telling me an hour and 20 minutes, and that's just on like a modest gig pipe.” With hundreds of thousands of probes firing per second across the wire, the trio attempts to pipe the incoming data live onto the stage screen.

- Target syntax: Probing `0.0.0.0/0` instructs Masscan to scan the entire public IPv4 address space. - Rate comparison: Scanning at 10 packets per second yields an impractical Windows 95-style copy estimate, whereas rates approaching 1,000,000 packets per second can cover the entire public internet in roughly an hour. - Live demonstration metric: An active scan launched on a standard 1 Gbps uplink sustained approximately 690,000 packets per second, forecasting full completion in about 1 hour and 20 minutes.

---

[44:18](https://www.youtube.com/watch?v=UOWexFaRylM&t=2658s) Stage AV Logistics, Network Shenanigans, and the Demo Gods

The transition from theory to the live demonstration descends into the chaotic hardware and networking friction familiar to DEF CON presenters. Between scrambling for VGA-to-HDMI adapters and trying to route live output across machines, the speakers work to expose their collection dashboard (`results.survey.tx.`) where scan data is starting to pour in. When teasing out local IP addresses on the conference network, Dan playfully throws out `192.168.0.1`, before Rob explains the paranoia behind restricting access to the local DEF CON subnet: “Someone got mad last time I did this and exposed it to the whole public internet, so I figured I'll just expose it to all of Defcon and then I can't complain.”

```mermaid flowchart LR accTitle: Live Scan Demo Flow accDescr: High-speed internet scan feeding live survey data into local Defcon stage displays subgraph Scanning ["Masscan Engine"] A["Masscan on 1 Gbps Pipe<br/>(~690k pps)"] -->|"Probes IPv4 (0.0.0.0/0)"| B["Public Internet Hosts"] end subgraph Ingestion ["Stage Collection"] B -->|"Live Responses"| C["results.survey Collector"] C -->|"Internal Defcon Subnet (172.18.x.x)"| D["Audience & Stage Laptops"] end ```

While waiting for the visual feed to bridge onto the main projector, Rob points out Masscan’s portability, noting that it compiles smoothly out of the box across Linux, macOS, and Windows. Yet, in typical live-demo fashion, the audience members on the room’s Wi-Fi can view the web frontend while the presenters’ own laptops struggle to route to it. Rob laughs off the tech glitch as an inevitable rite of passage: “So here's the thing about—here's the rule of Defcon is we call them the demo gods or the demo demons, is that even when your demo is actually working, something does not work.”

- Cross-platform build: Masscan compiles cleanly on macOS, Linux, and Windows environments using basic build tooling (`make`). - Access restriction: The presenters restricted the survey web interface to DEF CON attendees over a private `172.18.x.x` address rather than leaving the dashboard open to the wider public internet. - Audience verification: Attendees in the hall with open laptops confirmed they could reach the live results server before the stage display was able to show it.

---

[46:12](https://www.youtube.com/watch?v=UOWexFaRylM&t=2772s) Internet Quirks: Vulnerable Korean Billboards

As the team sifts through incoming hosts and tries to resolve local browser routing anomalies on `172.18.46.x`, specific real-world artifacts begin surfacing in the scan results. Prominently appearing in the output are unauthenticated remote control endpoints for electronic advertising billboards located across South Korea.

The speakers marvel at the sheer surrealism of having direct, unauthenticated network access to massive physical infrastructure from an auditorium in Las Vegas. Dan highlights the Hollywood-style absurdity of the finding: “And this is one of those opportunities where like you think of Hollywood movies and you're saying, well, so I'm looking at a billboard that's probably in a really big public place and, you know, exploitable—the trolling opportunities.” Rob quips that he should probably steer clear of entire Korean address blocks simply because the exposed billboard controllers show up everywhere and are completely identical. Running out of time with projector routing bugs, the team swaps video cables directly over to Dan's machine so the room can see the raw feed.

- Device discovery: A wide swath of digital advertising billboards in South Korea were found completely exposed on public IPv4 addresses. - Physical-to-digital impact: The systems control digital signs situated in prominent public spaces, presenting severe defacement and trolling vectors straight out of a movie scenario. - Practical mitigation: The presenters jokingly note that staying away from certain regional IP ranges is necessary because vast pools of identical, vulnerable commercial equipment pollute the data.

---

[47:11](https://www.youtube.com/watch?v=UOWexFaRylM&t=2831s) Open Source Release, IPv6 Scanning Feasibility, and the Live Reveal

With only minutes remaining, the speakers open the floor to brief audience questions while final connections are made. An attendee asks whether Masscan is publicly available. Rob Graham confirms that the project is entirely open source and hosted on GitHub under `robertdavidgraham/masscan`. When asked about scanning the vast expanse of IPv6, Rob clarifies the mathematical reality: brute-force scanning the entire IPv6 keyspace is impossible, but targeted discovery is still viable by exploiting allocation patterns: “The question for IPv6 and the implications are is going to not really work; there are some things we can do knowing how IPv6 allocates your addresses and you can maybe do target ranges.”

At that moment, the stage display switches over, finally revealing the live stream of scanned assets on screen to an eruption of cheers and applause from the audience. Dan rushes to emphasize that every host displayed on the screen was discovered in real time over the course of the talk: “So to be clear, these are all results that have been dynamically found while we've been on stage, while they've been furiously typing.” The presentation ends abruptly on a high note as track organizers usher them off the stage, leaving the room with visual proof of an entire internet scan harvested in under an hour.

- GitHub repository: The code is freely available under `https://github.com/robertdavidgraham/masscan`. - IPv6 feasibility: While a brute-force sweep of $2^{128}$ addresses is computationally and bandwidth-prohibitive, intelligence on subnet allocation schemas allows targeted range scanning. - Dynamic demonstration: The live results projected at the close of the talk were gathered entirely during the DEF CON presentation window.

## Notable quotes > [01:09](https://www.youtube.com/watch?v=UOWexFaRylM&t=69s) We really don't appreciate how small the internet is until we've typed in /0 and run our scan. — Rob Graham

> [36:55](https://www.youtube.com/watch?v=UOWexFaRylM&t=2215s) If the VNC protocol says you may connect without authentication, it's a very explicit thing; we're not, you know, hacking into something that's not authorized. — Paul McMillan

## Mentioned Rob Graham, Paul McMillan, Dan Tentler, Masscan, Nmap, OpenSSL, Heartbleed, D-Link, Siemens, Chaos Computer Club, Tor, fail2ban, Department of Defense, Hurricane Electric, bgp.he.net, ShmooCon, Verizon, AT&T, Apple, Redis, Facebook, Twitter, Check Point, ARIN, RIPE, Linode, Apache, Nginx, Active Directory, Clearwire, T-Mobile, Ninja Telephone, QNAP, Synology, Hikvision, IBM, Tumblr, Akamai, Amazon, GitHub, DEF CON 22

## Video description Rob Graham, Paul McMillan and Dan Tentler discuss the some of the quirks of scanning the whole internet

[Source](https://www.youtube.com/watch?v=UOWexFaRylM)

中文简报

Masscan借助千兆网络一小时内即可扫描整个IPv4互联网 无状态数据包合成技术使单个终端能在商用千兆光纤上于一小时内扫遍整个IPv4地址空间,导致企业防火墙崩溃并暴露出防御方未能监控的无保护基础设施。 安全研究人员展示了Masscan,这是一款异步、无状态的端口扫描工具,旨在通过单条商用千兆连接在不到一小时内探测整个IPv4地址空间。演讲者将其定制的TCP/IP架构与SYN cookie设计同Nmap等传统同步工具进行了对比,强调了绕过内核连接状态如何实现线速吞吐。除技术机制外,该小组还探讨了运营挑战,包括处理上游滥用投诉、导致脆弱的企业防火墙崩溃以及避开自动化黑名单。他们还详细介绍了实际发现和扫描流程,揭示了暴露在互联网上的工控硬件、未认证的VNC会话、泄露凭据的开放Redis数据库以及未修补的Heartbleed实例。 Masscan利用无状态架构和定制TCP/IP协议栈,在单条千兆链路上以高达每秒1,000,000个数据包的速度,在大约一小时内扫描完整个IPv4地址空间。 (43:29) 企业防火墙、交换机CAM表和入侵检测系统在面对跨大IP段的线速、随机化端口扫描时,经常出现故障或状态耗尽。 (30:04) 全球漏洞评估揭示了嵌入式硬件、未认证的Redis实例、数字广告牌以及关键基础设施的系统性暴露,而安全团队往往过度关注嘈杂的入站警报,而非受害的出站响应。 (8:07) 高级扫描工作流采用解耦架构,包括将伪造的SYN数据包路由回移动终端,并利用分布式云集群异步处理深层应用层标头(banner)。 (31:53)

Detailed notes — zh

## Background 本内容由频道 vissago 于 2014 年 10 月 1 日发布在 YouTube 平台上,记录了 Defcon 22 安全大会上的一场技术演讲。页面简介显示,演讲者 Rob Graham、Paul McMillan 和 Dan Tentler 在现场共同探讨了扫描整个互联网时所遭遇的各种技术奇特现象与现实挑战。 ## TL;DR 三位安全研究员系统性分享了使用开源工具 Masscan 进行全网无状态高速探测的实战经验。内容涵盖千兆网络下单包发包的物理与协议瓶颈、利用 SYN Cookies 绕过操作系统内核栈的高性能架构,以及两阶段扫描与非对称发包的设计思路。同时,演讲深入披露了面对潮水般的网络滥用投诉、误报预警、美国国防部等机构介入时的应对机制,并通过现场演示揭示了大量直接裸奔在公网上的 Redis、未授权 RDP 甚至户外巨型广告牌等荒谬的安全暴露面。 ## Atmosphere & style 整场演讲洋溢着极客黑客大会特有的随性、狂欢与荒诞幽默。三位讲者在台上如同老友围坐酒吧聊天,一边手忙脚乱地应付网络掉线、转接头不匹配等经典的“演示之神”恶作剧,一边爆笑分享把滥用投诉做成恶作剧网站、逼得暴躁网管扬言呼叫“互联网警察”的真实段子。现场氛围在技术内核的硬核严谨与对互联网现实脆弱性的戏谑自嘲之间自如切换,观众在欢笑声中不仅能直观感受到海量数据瞬间刷屏的冲击力,更能体会到那种洞察网络空间全貌的极客快感。 ## Bulletin - [43:29](https://www.youtube.com/watch?v=UOWexFaRylM&t=2609s) Masscan 采用无状态异步发包与 SYN Cookie 验证机制,绕过操作系统内核 TCP 栈,在普通千兆网络上以约 100 万 pps 速率扫遍整个 IPv4 地址空间仅需 1 小时左右。 - [34:40](https://www.youtube.com/watch?v=UOWexFaRylM&t=2080s) 全网扫描暴露出大量缺乏防护的公网敏感资产,包括未修复 Heartbleed 的嵌入式设备、完全无需密码的政府逮捕令处理系统 RDP、明文传输用户凭证的裸奔 Redis 以及户外数字广告牌。 - [04:05](https://www.youtube.com/watch?v=UOWexFaRylM&t=245s) 高速无状态扫描的最大物理与架构瓶颈在于以太网小包开销及交换机处理能力,实测小包吞吐在 300k 至 800k pps 时极易引发网络设备队列溢出甚至次世代防火墙崩溃。 - [47:11](https://www.youtube.com/watch?v=UOWexFaRylM&t=2831s) 针对 IPv6 庞大的 128 位地址空间,暴力遍历扫描已不再可行,必须结合地址分配规律与特定网络前缀进行针对性收敛扫描。 ## Key takeaways - [00:00](https://www.youtube.com/watch?v=UOWexFaRylM&t=0s) IPv4 地址空间总共约 40 亿个地址,在普及的千兆接入与异步发包工具支持下,全网扫描已不再具备高技术门槛。 - [01:09](https://www.youtube.com/watch?v=UOWexFaRylM&t=69s) 全网扫描是网络防御者的刚需工具,能在数分钟内清点 10 万台主机资产,快速评估 Heartbleed、僵尸网络或 NTP 放大攻击风险。 - [04:05](https://www.youtube.com/watch?v=UOWexFaRylM&t=245s) 千兆以太网在小包探测下有效 TCP/IP 吞吐上限仅约 476 Mbps,交换机硬件在 30 万至 80 万 pps 就会面临队列爆满甚至宕机瓶颈。 - [06:42](https://www.youtube.com/watch?v=UOWexFaRylM&t=402s) 通过 Masscan 原生内置的分片参数(--shard),可以将庞大的全网扫描任务水平分散到全球多数据中心 VPS,避免单点出口过载被 ISP 制裁。 - [08:07](https://www.youtube.com/watch?v=UOWexFaRylM&t=487s) 安全防御普遍陷入只关注入站告警的“路灯谬误”,企业往往对入站探测神经过敏,却忽视了自家出站流量中早已暴露的漏洞响应。 - [13:10](https://www.youtube.com/watch?v=UOWexFaRylM&t=790s) 网络管理员常将均匀覆盖全网的无差别扫描误判为针对秘密子网的定向 APT 攻击,从而引发大量荒谬的滥用投诉甚至政府介入。 - [19:38](https://www.youtube.com/watch?v=UOWexFaRylM&t=1178s) 规范的全网资产探测应采用“两阶段架构”:一阶段依靠 Masscan 无状态单包极速过滤,二阶段再针对存活目标进行真实协议握手以剔除虚假响应节点。 - [21:16](https://www.youtube.com/watch?v=UOWexFaRylM&t=1276s) Checkpoint 等防火墙对所有端口一律返回 SYN-ACK 的反扫描策略,在面对数 Gbps 级别的高速异步扫描时会因自身连接状态耗尽而直接崩溃。 - [25:40](https://www.youtube.com/watch?v=UOWexFaRylM&t=1540s) Masscan 采用类似 Nginx 的异步无状态事件机制,并借助 SYN Cookies 算法解码响应,彻底摆脱了传统同步扫描器(如 Nmap)维护海量连接等待状态的内存开销。 - [26:59](https://www.youtube.com/watch?v=UOWexFaRylM&t=1619s) 为避免内核 TCP 栈对扫描响应自动回发 RST 中断 Banner 抓取,最佳实践是为扫描分配独立的专用公网 IP,让操作系统内核忽略该接口流量。 - [29:10](https://www.youtube.com/watch?v=UOWexFaRylM&t=1750s) Masscan 可以作为极端压力测试工具,其无限循环扫描模式能维持数以亿计的并发假连接,能迅速打崩次世代防火墙的深度包检测(DPI)与 AD 联动机制。 - [31:53](https://www.youtube.com/watch?v=UOWexFaRylM&t=1913s) 利用伪随机种子同步技术可实现非对称扫描:由千兆机房伪造手机源 IP 极速发包,响应流量则分流至移动网络终端处理,有效规避机房投诉风险。 - [34:40](https://www.youtube.com/watch?v=UOWexFaRylM&t=2080s) 全网未修复 Heartbleed 漏洞的主机中绝大多数不是大型网站,而是群晖 NAS、海康威视摄像头等不绑定域名的嵌入式 IoT 设备。 - [40:40](https://www.youtube.com/watch?v=UOWexFaRylM&t=2440s) Masscan 内置防手滑安全机制,扫描目标指定为全网 /0 时强制要求显式配置排除列表(--exclude),以防止用户打错命令误伤网络。 - [47:11](https://www.youtube.com/watch?v=UOWexFaRylM&t=2831s) 全网暴力扫描无法直接迁移至 IPv6 环境,128 位超大地址空间要求研究人员必须结合特定的地址分配模式与子网规律进行探测。 ## Detailed walkthrough ### [00:00](https://www.youtube.com/watch?v=UOWexFaRylM&t=0s) 破除迷思:扫描全网其实轻而易举 Rob Graham 开场向台下观众问好,打趣道希望大多数人只是前一晚通宵狂欢还没睡,否则这个时间起床实在太早了。他介绍了身旁的两位演讲搭档 Paul McMillan 与 Dan Tentler,两人正在台上调试设备以确保现场演示顺利进行。 ```mermaid flowchart LR accTitle: 全网扫描可行性与规模对比 accDescr: 展示千兆接入下扫描40亿IPv4地址的极低门槛与高产出特征 subgraph SCALE["互联网规模现状"] A["IPv4 全地址空间 (/0)<br/>约 40 亿 IP 地址"] B["千兆接入普及<br/>家庭/ISP 均可获取"] end subgraph TOOL["Masscan 执行逻辑"] C["类 Nmap 简易指令<br/>指定全网网段 0.0.0.0/0"] D["无连接高速发包<br/>屏幕实时海量回显"] end A --> D B --> C C --> D ``` 谈及扫描整个互联网,Rob 指出这在技术上并非什么翻天覆地的大突破,只是过去缺乏合适的现成工具。其实写出这类扫描器相当简单,只是行业过去一直没动力去实现。如今不同了,任何人都可以从 ISP 那里买到千兆宽带接入,而 IPv4 互联网实际上非常小,总共只有大约 40 亿个地址。如今只需要坐在终端前,敲入熟悉的类似 Nmap 风格的命令行选项,直接将目标网段指定为 `/0`(即扫描整个互联网),按下回车便能立刻看到返回的数据在屏幕上飞速滚动刷屏,这种体验极具冲击力。 --- ### [01:09](https://www.youtube.com/watch?v=UOWexFaRylM&t=69s) 为什么要全网扫描:防御者的视角 对于网络防御者而言,全网级别的扫描并非可有可无,而是至关重要的安全能力。例如在“心脏滴血”(Heartbleed)漏洞爆发后,许多人开始使用 Masscan 在自家网络中排查风险。当大型企业内部拥有数十万台主机时,绝大多数传统漏洞扫描工具在扩展性上根本吃不消;Nmap 的表现虽然好一些,但在面对数十万台设备的大规模资产时速度依旧太慢。而换作 Masscan,只需敲下一行命令,几分钟内便能完成对 10 万台主机的全量探测,迅速揪出所有易受 Heartbleed 攻击的脆弱节点。 全网扫描还能为全网性质的威胁治理提供关键数据支持: - **DDoS 放大攻击源排查**:摸清全网被错误配置、常被黑客利用发起放大反射攻击的 NTP 服务器底数。 - **僵尸网络风险评估**:当 D-Link 宣布其家用路由器曝出高危漏洞时,研究人员能够通过快速全网测绘,统计出暴露在公网的受影响设备总数,从而评估潜在僵尸网络的规模上限。 - **全网证书更新监测**:在 Heartbleed 漏洞曝光后,抓取全网正在使用的 SSL 证书,统计证书签发时间,以分析全球网站是否真正重新生成并替换了私钥。 --- ### [02:31](https://www.youtube.com/watch?v=UOWexFaRylM&t=151s) 进攻视角与“深网”探索:随机端口的奇遇 从进攻和安全研究的角度来看,全网扫描揭示了真正的“深网”(Deep Net)——即搜索引擎 Google 根本无法抓取或索引的网络资产。Rob 解释道,在 Masscan 中只要加上获取横幅信息的参数(`--banners`),几分钟之内就能撞见处于可入侵状态的系统。对于大多数白帽安全研究人员来说,这种探索既具有丰富的研究价值,又充满乐趣。正如 Rob Graham 所总结的那样:“我们真的很难体会到互联网到底有多小,直到你在命令行敲下 /0 并把扫描跑起来。” 网络空间共有 65,535 个端口,随便挑一个不常见的端口去扫,往往能挖出从未有人公布过的新大陆,例如一台控制着核电站运行的西门子工控系统。Rob 提及就在本场演讲之后的下一个议程中,有研究者专门针对某个智能家居端口(如 7468 端口)进行了全网测绘,瞬间捕获了数百万台脆弱设备。在现场,Dan 突然插话向观众求证:“谁还记得最近刚曝光的 iPhone 后门端口?好像是 62,000 多?我现在就想直接扫它,有人记得具体端口号吗?”虽然台下无人回应,Dan 决定晚点查出端口立刻实机验证。 --- ### [04:05](https://www.youtube.com/watch?v=UOWexFaRylM&t=245s) 网络与硬件瓶颈:千兆以太网下的丢包陷阱 当被调动起扫描全网的热情后,许多人的第一反应是在 ISP 开通宽带或直接在 Amazon AWS 等云厂商上开一台 VPS 开始发包。然而,真实环境的第一道物理鸿沟便是以太网的带宽与报文开销机制: ```mermaid flowchart TD accTitle: 千兆线路上小包扫描的开销与瓶颈 accDescr: 说明千兆以太网下协议开销导致实际吞吐受限及交换机性能骤降的过程 subgraph PHY["物理链路层吞吐限制"] L1["千兆物理层极限速率<br/>理论最高约 1,488,000 pps"] L2["TCP 探测小包特征<br/>帧头/帧间隙开销大于有效载荷"] L3["真实可用 TCP/IP 吞吐<br/>上限仅约 476 Mbps"] end subgraph BOTTLENECK["网络承载瓶颈"] B1["交换机队列溢出与处理暴跌<br/>实测骤降至 300k - 800k pps"] B2["VPS 虚拟化 I/O 资源枯竭"] B3["沿途公网跳数路由丢弃"] end L2 --> L3 L1 --> B1 L3 --> B1 B1 --> B2 B2 --> B3 ``` - **协议开销占比失衡**:在千兆以太网(Gigabit Ethernet)链路上进行 TCP 扫描时,发送的是数以亿计的微型探测包。以太网本身的帧头、前导码以及帧间隙开销远大于探测包内部的有效载荷,因此在千兆链路上,实际能够跑出的原始 TCP/IP 有效流量只有约 476 Mbps。 - **理论包率与实测落差**:虽然千兆跑满 64 字节小包的理论速率高达 1,488,000 pps,但在现实世界中几乎没有交换机能承受这种压力。即便是配置良好、链路完全空闲的独立交换机,往往在发包率达到 300,000 到 800,000 pps 时便会卡顿甚至崩溃。 - **计费与对等互联冲突**:不同 ISP 的计费方式大相径庭。有的 ISP 对小包出站几乎“致盲”,Rob 曾完成了一次全网扫描后,ISP 的账单上竟然显示全过程只消耗了几兆字节的流量;也有部分厂商提供真正的不限流链路。然而,大跨度传输海量碎包极易破坏网络运营商之间的对等互联(Peering)协议,从而引发机房上游网络服务商的断网制裁。 --- ### [06:42](https://www.youtube.com/watch?v=UOWexFaRylM&t=402s) 架构优化与多点分片部署 面对基础设施的处理极限,Rob 分享了大规模实操时的架构建议与避坑经验: 单台 VPS 的虚拟化 I/O 极易被密集的数据包击垮。即便本地直连的交换机宣称能够吞吐 500,000 pps,也并不意味着通往公网的中间路由节点全部具备相同的转发能力。由于所有主流扫描工具都会对扫描目标地址或目标端口进行全局伪随机打散,这种离散流量在目标端网络通常不会造成单点阻塞或被丢弃;真正的丢包几乎全发生在扫描发起端本地。因此,必须先对受控网络进行回环对照测试(例如发射 10,000 个探测包并确认是否能准确接收到 10,000 个响应),以校准发包阈值。 ```mermaid flowchart TD accTitle: Masscan 分布式分片扫描架构 accDescr: 使用内置分片参数将扫描任务分散到全球多数据中心 VPS JOB["全网扫描任务 (0.0.0.0/0)"] subgraph SHARDS["内置分片机制 (--shard N/5)"] S1["东京节点 VPS<br/>--shard 1/5"] S2["达拉斯节点 VPS<br/>--shard 2/5"] S3["巴黎节点 VPS<br/>--shard 3/5"] S4["备用节点 VPS<br/>--shard 4/5"] S5["备用节点 VPS<br/>--shard 5/5"] end JOB --> S1 JOB --> S2 JOB --> S3 JOB --> S4 JOB --> S5 ``` 为了避免单一站点出口过载,实操中往往放弃从单点全速轰击,转而在全球多数据中心进行分布式并发。Masscan 本身原生支持非常简洁的扫描分片逻辑,通过指定参数(如 `--shard 1/5`、`--shard 2/5` 直至 `5/5`),便可无缝将整个全网空间均分到位于东京、达拉斯、巴黎等不同地理区域的 VPS 实例上协同完成。 --- ### [08:07](https://www.youtube.com/watch?v=UOWexFaRylM&t=487s) 滥用投诉机制与网络检测的“路灯谬误” 全网测绘面临的最大非技术性阻力,来自于潮水般的网络滥用投诉(Abuse Complaints)。在现行的互联网管理机制下,一旦扫描触发下游报警,投诉便会逐级倒灌至主机的接入 ISP。即便接入商理解学术研究性质并支持扫描,它们也往往无能为力:上游运营商极有可能直接将该 ISP 的整段 IP 掩码、自治系统号(AS Number)列入黑名单,或强行中止 BGP 对等互联。为了防止账户被直接注销,扫描者必须建立一套合规的投诉处理与名单剔除机制。 各类业务场景带来的投诉压力截然不同: - **Heartbleed 扫描**:由于全球大量入侵检测系统(IDS)升级了漏洞利用报警规则,误将探测包当成真实漏洞攻击,导致每个月例行开展 Heartbleed 扫描(当时全网约有 30 万台脆弱主机)都会引发极为海量的投诉报警。 - **Tor 出口节点对比**:Rob 补充道,尽管 Heartbleed 扫描带来的投诉极多,但在同一个网络环境下,运行一个 Tor 出口节点所招致的滥用投诉数量还要更多。 - **Web 应用防护规避**:对 80 端口进行 HTTP 扫描极易触发服务器端的 Fail2ban 等封禁策略。必须在配置中通过自定义 User-Agent(如 `--user-agent`)声明研究者身份,以友好的态度解释来源与研究目的,甚至应有针对性地微调发包指纹,避免触发机械的 IDS 拦截规则。 谈及现存安全体系的弊病,Rob 严厉批评了当前主流网络监控逻辑中的“路灯谬误”(Streetlight Fallacy)。他讲了一个经典的笑话:一个人在路灯下的地面上摸索,朋友问他找什么,他说钥匙丢在另一边了,朋友又问为什么不回去找,他回答“因为这边的光线比较好”。这恰恰是当前绝大多数网络安全运营团队的真实写照——所有人都在入站方向(Inbound)拼命部署 IDS 并监控攻击,仅仅是因为“那里的光线更好”,只要连上网线,入站方向无时无刻不在接收互联网背景辐射探测包,监控仪表盘上立马就会跳出大批图表与警报。然而企业真正亟需关注的生命线,应当是出站方向(Outbound)究竟产生了哪些异常响应。许多防守方在向他们发来要求移出扫描列表的投诉时,连自身外发了什么脆弱响应都完全不知情。 ### [11:14](https://www.youtube.com/watch?v=UOWexFaRylM&t=674s) 排除列表与国防部的“西装客” 全网扫描中最棘手的问题之一是与各类网络提供商及监管机构打交道。讲者提到,许多监控系统存在严重盲区:他们拼命监控入站流量中是否存在针对心脏出血(Heartbleed)漏洞的探测,却根本不管出站流量中自家机器早已在大喊“是的,我们有漏洞”。与此相伴的是 ISP 承受的巨大外部压力,特别是来自美国国防部(DoD)。一旦扫描流量触碰到了军方网段,便会有穿着西装的政府官员直接上门拜访 ISP 办公室,要求立即阻断流量;压力随即传导至扫描者头上,要求他们必须将这些 IP 地址段加入排除列表(Exclude List)。 ```mermaid flowchart TD accTitle: IP排除请求与维护流程 accDescr: 展示从接收投诉、获取网段到加入本地排除列表并过滤扫描目标的完整流程 subgraph Complaints ["外部压力与请求"] A["DoD / 机构发出滥用投诉"] --> B{"是否提供网段?"} B -- "是" --> C["直接提取 IP/CIDR"] B -- "否 (仅给域名/隐藏网段)" --> D["查询 bgp.he.net 获取真实网段"] end subgraph Engine ["Masscan 扫描引擎"] C --> E["写入排除配置文件 (exclude.conf)"] D --> E E --> F["更新排除列表 (支持注释与多网段)"] G["全网待扫 IP 空间"] --> H["Masscan 过滤引擎"] F --> H H --> I["跳过目标 / 发送探测包"] end ``` 在 Masscan 中实现排除规则非常直接,其机制与 Nmap 基本一致:用户只需在配置文件中指定一个包含排除网段的清单,或者在命令行参数中逐条追加,并且该文件完美支持注释。每当有机构发来滥用投诉邮件(Abuse Mail),团队都会以礼貌的态度回复,解释这只是学术研究扫描,并承诺只要对方提供网段就会立即剔除。然而,维护一个公开透明的排除清单几乎是不可能的,因为提交申请的机构绝不希望外界知道他们主动退出了扫描。正如讲者所打趣的: > “每个人都说:‘把我们从你们的名单中删掉,因为我担心有人会去查我们组织的 IP 范围,从而黑掉我们。’” 幸运的是,即便某些机构遮遮掩掩不愿提供具体网段,研究人员也能通过 `bgp.he.net`(Hurricane Electric BGP 工具包)轻松查到其公网 BGP 广播的全部 IP 范围。 --- ### [13:10](https://www.youtube.com/watch?v=UOWexFaRylM&t=790s) 自动化误报、奇葩投诉与“被害妄想” 扫描全网时会遭遇各种光怪陆离的自动化防御机制。许多企业在完全不同的子网、网段甚至不同 ISP 上部署了入侵检测与防御系统(IDS/IPS),并配置了粗糙的脚本自动向外发送千篇一律的滥用警告,指控扫描者在进行所谓的“恶意活动”。讲者对此哭笑不得:什么时候向开放端口发送一个单独的 SYN 数据包也成了十恶不赦的恶意攻击?如果连一个 SYN 都是恶意行为,那整个互联网干脆关门算了。 更荒诞的是,某些机构的自动化投诉系统漏洞百出。有一次,对方反复投诉了三四次,要求将几个网段加入黑名单,但他们给出的只是前端公开业务 IP,而实际触发告警的 IDS 传感器却落在另一个未说明的网段上。结果扫描继续进行,传感器不断告警,对方又继续发信要求删除那些早就列入黑名单的 IP。讲者甚至在台上直接吐槽:“把你们的毒品退给毒贩吧,你们抽到的货太烂了,告诉他们你们想要更好的货,赶紧打住吧!” ```mermaid flowchart LR accTitle: 防御方误判全网扫描为针对性攻击 accDescr: 展示防御方如何将扫描器随机无差别的全网探测,错误推断为其秘密网段被精准针对的心理逻辑 A["扫描器均匀覆盖全网<br>(包含所有已知及未知网段)"] --> B["命中企业公开业务 IP"] A --> C["命中企业隐蔽/敏感子网"] B & C --> D["安全团队联合告警"] D --> E{"防御方逻辑推论"} E -->|"错误归因"| F["‘他们竟然知道我们的秘密子网,<br>这是一场针对我们企业的定向 APT 攻击!’"] ``` 与此同时,网络安全防守方普遍存在一种认知偏差:他们潜意识里不相信有人能以如此低成本扫描整个互联网。许多公司拥有几段人人皆知的对外公网 IP,但同时内部又有一段自以为极度隐蔽、无人知晓的“秘密子网”。当全网扫描器以均匀无差别的步调同时扫过这两个网段时,防守人员顿时惊恐万状,断定自己遭到了高深莫测的针对性攻击——因为在他们的逻辑里,除非黑客专门搜集过本公司的内部分布,否则怎么可能把秘密子网与主网络关联在一起?讲者讲起半年前的一个趣事:他在参加一档播客的前夜随手启动了全网扫描,结果该播客的主持人正是某大企业安全人员,半夜被紧急呼叫叫醒参加应急响应会议,声称遭遇了黑客入侵;后来当主持人得知真相后,公司内部形成了一条固定惯例: > “现在据说只要我一做扫描,工单刚被创建就会立即被关闭,上面写着‘只是 Rob 又在扫描了’。” --- ### [16:10](https://www.youtube.com/watch?v=UOWexFaRylM&t=970s) 澳大利亚愤怒大叔与“互联网警察” 关于滥用投诉,丹·坦特勒(Dan Tentler)分享了一则在业内广为流传的经典笑话。寻找一家支持全网扫描的 ISP 极度困难,如果你跑到主流运营商那里说“你好,我想用 800 Mbps 的带宽扫一下全网”,对方绝对会毫不犹豫地拒绝。幸运的是,Tentler 的一位好友运营着一家机房,不仅愿意提供托管服务,还非常包容这种研究行为。为了不给朋友添麻烦,Tentler 始终保持高度透明,提前通报扫描计划,以便机房面对外界投诉时有备而来。 在当年二月份的 ShmooCon 安全会议期间,几位讲者在酒店大堂一直“LobbyCon”折腾到凌晨三点并发起了全网探测(可能针对 VNC 端口)。次日早晨,机房运营朋友打来电话,称收到了一封措辞极其激进的投诉信,希望居中协调。虽然 Tentler 很快将对方提供的 IP 加入了排除列表,但由于网络管理员排查日志往往存在数天甚至一周的滞后,投诉依然接踵而至。其中有一名来自澳大利亚的管理员,因为自己的系统收到了一枚独立的 TCP SYN 探测包而彻底暴怒。尽管机房负责人礼貌地回复信件,并附上了详细记录研究目的与联系方式的项目主页,但这名澳洲男子反而彻底失控,直接在电话那头歇斯底里地咆哮: > “他在电话里对着那些人大喊大叫,声称自己要打电话叫‘互联网警察’(Internet Police)来抓人。” 听到朋友转述后,Tentler 一开始甚至以为对方在开玩笑。在确认对方真的把“互联网警察”挂在嘴边威胁后,Tentler 决定将荒诞进行到底:他在短短三小时内迅速买下了 `internetpolice.us` 域名,并立即将扫描源地址的逆向 DNS 全部解析到该域名之下。此后,全网范围内所有的被扫描目标在反查探测源时,看到的都是这名暴躁澳洲大叔心心念念呼叫的“互联网警察”。 - 面对疯狂的投诉,与其陷入无休止的争吵,不如将其变成一个自嘲的极客梗(“You have to know how to work the crazy”)。 - 在演讲现场,讲者正在对 iPhone 后门端口(Port 6278)进行实时扫描,该端口已收到多达 54.2 万台设备响应;稍后针对特定端口的探测还发现约 9.2 万台设备。 - 手机蜂窝网络防护极度脆弱:Verizon 以及 AT&T 等运营商的移动设备直接挂在公网 IP 上,没有任何 NAT 或有效防火墙隔离,全网扫描流量可以直接触达这些随身携带的智能手机。 --- ### [19:38](https://www.youtube.com/watch?v=UOWexFaRylM&t=1178s) 两阶段扫描机制与裸奔的 Redis 全网扫描并非一次请求就能搞定全部信息搜集,而是严格分为两个阶段:第一阶段使用 Masscan 依靠单包无状态机制进行极速“地毯式扫描”,仅为了摸清哪个 IP 的特定端口处于开启状态;一旦命中目标,后续的第二阶段流程才会跟进,负责建立真实连接并执行针对性的协议交互。 ```mermaid flowchart TD accTitle: 两阶段全网资产发现流程 accDescr: 展示从 Masscan 一阶段极速端口探测到二阶段具体应用协议握手过滤的清洗架构 subgraph Phase1 ["第一阶段:极速粗扫 (Masscan)"] A["全网公网 IPv4 空间"] -->|单包 SYN 极速扫描| B["海量响应 IP 列表<br>(产生数百万个开放候选)"] end subgraph Noise ["干扰清洗:全响应垃圾节点"] B --> C{"是否对所有端口均回应?"} C -- "是 (假阳性)" --> D["识别为防火墙/负载均衡等<br>(全网约 100~200 万台)"] D --> E["丢弃 / 排除"] end subgraph Phase2 ["第二阶段:深入探测 (Secondary Pass)"] C -- "否 (真实候选)" --> F["二次握手与协议解析流程"] F --> G["以 Redis 为例:发送 MONITOR 命令"] G --> H{"返回鉴权要求?"} H -- "是" --> I["直接忽略 / 标记加密"] H -- "否" --> J["输出敏感数据:<br>信用卡号、Facebook/Twitter Session Cookies"] end ``` 这种两阶段设计不仅能极大节省网络资源,更是清洗数据噪声的刚需。互联网上存在大约一百万到两百万台“对一切端口都回应”的设备——包括各类行为怪异的负载均衡器、异常配置的防火墙以及路由器。如果只看一阶段的 Masscan 结果,可能会出现数百万个虚假开放端口;只有进入二次探测,才能把这些滥竽充数的节点彻底剥离。 为了说明二次探测的威力与互联网资产配置的荒谬,Tentler 以 Redis 缓存数据库为例:全网有大量毫无防护、直接裸奔在公网上的开放 Redis 实例。研究脚本与端口建连后,只要敲入一条内置的 `MONITOR` 监控指令,如果遇到需要密码鉴权的,脚本直接跳过;然而现实中令人瞠目结舌的是,大量生产环境的 Redis 居然毫无鉴权。许多企业的前端架构做得天衣无缝,配备了双因子认证、SSL 证书乃至 OAuth,防守极其森严;但他们却把最底层承载核心数据的传输机制毫不设防地扔在明网传输,攻击者完全不需要绕过前端认证,直接连上后端的公开 Redis,控制台瞬间便开始疯狂刷出明文信用卡卡号、Facebook 与 Twitter 的用户会话 Cookie(Session Cookies)。第一阶段数百万的探测数字,正是通过这样具体的第二阶段业务筛选,才最终转化成了震撼人心的安全态势结论。 ### [21:16](https://www.youtube.com/watch?v=UOWexFaRylM&t=1276s) 防火墙“逢问必答”的策略反噬与 8 Gbps 流量冲击 扫描全网时经常会遇到极其离谱的响应数据:例如在几百万条扫描结果中,看似有多达 20 万台存活主机,但通过人工手动验证才发现,很多设备其实是对每一个端口都无差别返回响应。演讲者们对此哭笑不得,吐槽现在都 2014 年了,居然还有网络管理员不知道什么是 SYN Flood(SYN 洪水攻击),甚至将设备配置为“对任何请求都直接回应”。Checkpoint 等防火墙设备就带有这种反扫描策略——试图通过对所有端口响应来混淆和拖慢 Nmap 之类的扫描工具。然而,当安全研究人员在酒店大堂凌晨三点边喝边折腾、以高达 8 Gbps 的速率向全网灌包时,这种防御机制反而成了自杀行为。演讲者戏谑道:“在地球的某个角落,肯定有管理员急得火烧眉毛,因为他的 IDS 或防火墙直接崩溃了。” 对于那些发来洋洋自得抱怨信的管理员,讲者们也是一笑了之。最搞笑的一种投诉邮件往往写着:“我们已经在防火墙上把你给屏蔽了,略略略(na-na-na boo-boo)!”对于这种挑衅,Rob Graham 直接表示:“我根本不在乎,我甚至都不知道你是谁,我也完全无所谓。” ```mermaid flowchart TD accTitle: 防火墙全端口响应反遭打崩流程 accDescr: 展示了防火墙试图以全端口响应迷惑扫描器,结果在高速异步扫描下被自身状态耗尽冲垮的过程。 subgraph DefenseMechanism["防御方预设策略"] A["Nmap 传统扫描"] --> B["防火墙配置:对所有端口返回 SYN-ACK"] B --> C["目标:耗尽扫描器资源以混淆结果"] end subgraph ActualScan["Masscan 实际攻击面"] D["Masscan 异步发包 (8 Gbps)"] --> E["海量 SYN 探测包瞬时抵达"] E --> F["防火墙对每个探测端口拼命回包并建连"] F --> G["防火墙/IDS 状态表爆满、CPU 100% 崩溃"] end ``` ### [22:16](https://www.youtube.com/watch?v=UOWexFaRylM&t=1336s) 荒谬的滥用投诉与把内部网管全员送上的韩国涉密机构 扫描引发的邮件投诉往往暴露出各大机构内部流程的混乱与断裂。Rob 提到一个令人喷饭的真实案例:韩国有一家名为 Woori 的金融集团(被其内部反复强调是所谓的“国家安全甲级目标设施”),每当 Rob 扫描到他们时,对方都会发来严厉的滥用投诉邮件。然而令人难以置信的是,该机构在发送投诉信时,居然把整个公司所有系统管理员的邮箱全部抄送了一遍。Dan Tentler 忍不住当场吐槽:“你只有这一个工作,居然还能搞砸(You had one job)!”对于想要实施钓鱼攻击的黑客来说,这封邮件简直是拱手奉上了一份完美的管理员钓鱼名单。 针对滥用投诉的处理,演讲者们强调了与网络运营商(ISP)密切合作的重要性: - **利用 SWIP(Shared Whois Project)机制**:必须向 ISP 申请将特定的 IP 地址段直接分配在自己的名下,这样当别人做反向查询并提交投诉时,滥用邮件会直接投递到扫描者自己的邮箱,而不是打扰 ISP。 - **投诉者的无差别全抄送习惯**:即便设置了清晰的联系信息,大约一半的投诉者依然会不由分说地同时抄送 ISP。甚至有人会根据 Whois 查询结果中跳出的任何域名,把无关的 `postmaster@domain` 也一并抄送。 - **切忌使用公司工作邮箱**:如果扫描操作者的公司邮箱网管对这类高频滥用警报神经过敏,绝对不要在 Whois 中留下自己的工作邮箱。 ### [23:51](https://www.youtube.com/watch?v=UOWexFaRylM&t=1431s) 恶作剧网站 internetpolice.us 与匿名 VPS 踩坑指南 现场演讲过程中,Dan Tentler 此前搭建的恶作剧网站 `internetpolice.us`(互联网警察)刚好恢复上线。该网站原本用来调侃那些被扫描后惊慌失措的人,页面下方特意留了一个“提交投诉”的表单。搞笑的是,这个表单在后台根本没有绑定任何处理逻辑,所有提交都直接进入虚无黑洞。Dan 坦言这原本是故意设计的,但后来有些后悔,因为他非常好奇究竟有多少人认真填过这个表单、里面写了哪些愤怒的言辞或低劣的 XSS/SQL 注入尝试;如果能把这些内容收集起来发在 Tumblr 上,绝对会是一个爆火的安全圈神级素材。 关于发起扫描的基础设施选择,很多人试图使用比特币购买匿名 VPS 来当掩护,但实际体验往往很糟糕: - **账户封杀极快**:许多主机商允许跑完扫描前就会封禁账户,例如 Linode 会在一瞬间封停并没收 50 美元的押金。 - **正规报备才是正道**:Paul McMillan 指出,Linode 并非完全不通情达理,如果扫描方是一个知名且经过身份验证的正规组织,并主动将速率限制在较低水平并提前报备,他们对网络扫描其实相当友好;他们唯一零容忍的是利用匿名 VPS 恶意胡作非为。 ### [25:40](https://www.youtube.com/watch?v=UOWexFaRylM&t=1540s) Masscan 核心机制:无状态异步扫描与 SYN Cookies 魔法 Rob Graham 详细剖析了 Masscan 与传统扫描器 Nmap 的本质差异。Nmap 属于经典的“同步扫描器”,其核心工作逻辑是一次针对单台主机,发包后必须停下来等待响应,若没有收到预期结果就触发重试,正是这种等待机制彻底拖慢了速度。而 Masscan 彻底抛弃了等待机制,它采用“异步扫描”,如同机关枪一样疯狂对外喷射数据包,发完就走,绝不在内存中保留 40 亿个等待状态。 这种极速能力的底层架构设计逻辑包括: - **基于 SYN Cookies 的无状态验证**:既然不维护状态表,当收到外界弹回来的响应包时,Masscan 利用 SYN Cookies 算法直接反解计算,从而验证该包是否是自己先前发出的探测及其对应的目标端口。 - **类比 Apache 与 Nginx 的并发革命**:这种架构差异就像当年单线程阻塞的 Apache 遇上事件驱动异步非阻塞的 Nginx 一样,并非技术本身多深奥,而是运行模式决定了并发能力的几何级飞跃。 - **工具选型定位**:如果只扫描几台主机,Nmap 在功能深度上毫无疑问完全碾压 Masscan;但如果任务是探测数百万乃至数十亿个节点的网络空间,Masscan 是唯一的选择。 > “What Masscan does is it just blasts out packets, the packets, and never waits for a response and that's why it can send out 4 billion packets because it doesn't have 4 billion records in memory waiting for the response.” —— Rob Graham ### [26:59](https://www.youtube.com/watch?v=UOWexFaRylM&t=1619s) 绕过内核 TCP 栈的陷阱与 Banner 抓取实战 Masscan 的一个特殊设计在于它自带了一套微型 TCP/IP 协议栈,完全绕过了底层操作系统内核。这带来了极致的性能,但也伴随着一系列意想不到的副作用:例如系统察觉不到重复的 ARP 广播,更严重的是在抓取服务 Banner(建立连接、发送 HTTP 请求并记录回包)时,宿主机操作系统的内核 TCP 栈会因为收到未记录在案的 SYN-ACK 数据包而自动向对方发送 RST(重置连接)包,从而粗暴掐断刚刚建立的连接。 为了解决内核发送 RST 的问题,必须采取特定的网络配置对策: 1. **防火墙规则拦截**:在宿主机上配置防火墙规则,丢弃本地内核对外发送的 RST 数据包。 2. **独立专用 IP 扫描法(最佳实践)**:Rob 团队推荐为扫描单独分配一个未绑定在任何机器网卡上的独立 IP 地址。启动 Masscan 时通过 `--source-ip`(或 adapter-ip)指定该地址对外发包,由于本地操作系统根本不认领该 IP,内核就不会插手发 RST,从而无需折腾复杂的防火墙规则。此时仅需手动配置网关的路由器 MAC 地址或让其通过路由器 IP 执行 ARP 解析。 3. **自定义载荷参数 `--hello-string`**:虽然 Masscan 不支持像 Nmap 那样的 NSE 复杂脚本,但它提供了轻量级的数据注入能力。只要将特定协议的数据载荷存入文件,并通过 `--hello-string` 指定该文件,Masscan 就会在 TCP 握手成功后瞬间将这串数据推入端口。这对于探测运行在冷门端口上的特有协议(如工控 SCADA 协议)极度高效,既能识别有效工控系统,又不会被那些盲目响应 SYN-ACK 的空虚系统所欺骗。 ### [29:10](https://www.youtube.com/watch?v=UOWexFaRylM&t=1750s) 分片扫描、并发压力测试与搞垮次世代防火墙 Masscan 具备极强的水平横向扩展能力。支持将整个扫描任务分片(`--shard 1/50` 等),从而将几十亿端口的扫描轻松分配到 50 台甚至更多机器上并行运行;源 IP 和源端口也均支持直接输入整个 Class C 网段或端口范围。深夜喝酒闲聊时,讲者们甚至调侃过一种狂野的理论假设:如果将全网所有 IP 范围都设为源 IP,理论上能用它发起来自全网的单兵 SYN Flood 洪泛,当然前提是上游 ISP 没有配置任何出站出口过滤(Egress Filtering)。 Masscan 的另一大杀手级应用是充当网络硬件的极致压力测试工具,尤其是其 `--infinite`(无限循环)参数。一旦开启该选项,扫描器跑完全网后会立即重新开始,上一轮扫描遗留的 TCP 连接继续保持存活,能极其轻松地在网络中维持上亿条并发 TCP 连接。目前市面上几乎没有任何安全设备能够承受这种海啸般的并发压力。 Dan Tentler 分享了他在客户现场测试全新豪华次世代防火墙(NGFW)的破坏性经历: - **深度包检测(DPI)硬件的克星**:这类防火墙面对普通流量游刃有余,但一旦开启深包检测,遇到 Masscan 这种异步并发流就会瞬间失控。 - **活动目录(AD)认证连带雪崩**:Dan 在现场拿出一台破旧笔记本,运行 Masscan 对防火墙后方一个根本不存在的网段发起无休止扫描。一台与 Windows Active Directory 做认证联动的次世代防火墙仪表盘仪表瞬间全部拉满至 100%,AD 认证服务当场挂死且再也没能恢复;另一台测试设备同样 CPU 飙到 100% 并严重丢包,直到在笔记本上按下 `Ctrl + C` 强行终止扫描,防火墙才缓缓复活。 - **摧毁交换机 CAM 表**:Dan 还曾不小心用 Masscan 把客户网络核心交换机的 CAM 表彻底撑爆。 > “The optimization we're doing with the whole asynchronous thing is if for us is a billion connections in a few minutes, that's no problem, but the devices start straining at 100,000 connections and so they just everything falls over.” —— Rob Graham ### [31:53](https://www.youtube.com/watch?v=UOWexFaRylM&t=1913s) 非对称扫描架构与移动网络测试 Rob Graham 介绍了一种利用 Masscan 非对称特性的巧妙玩法:通过具备千兆带宽的托管机房(Colo)高速发送探测包,同时伪造源 IP 地址为另一台接收设备(例如一部一次性非实名预付费手机,即“burner phone”)。所有外发 SYN 数据包以极高速率冲向互联网,而目标响应的 SYN-ACK 则以极低的数据速率回传到手机端。这种设计最大的好处在于,所有由扫描引发的网络滥用投诉(abuse complaints)都不会发送到昂贵的机房主机账户,而是直接涌向手机。为了验证这个想法,Rob 特意买了一张 T-Mobile SIM 卡,插进自己两年前越狱的“Ninja Phone”中并编译了 Masscan 命令行工具。然而测试失败了,因为 T-Mobile 的防火墙会拦截这些未经发起的入站流量。相比之下,Clear 运营商虽然也有防火墙阻断入站 SYN,但对入站的 SYN-ACK 却完全放行,因此测试非常顺利。对于 Verizon 和 AT&T,Rob 推测 Verizon 可能会为预付费手机分配直接暴露在公网的 IP 地址。 利用 Masscan 的伪随机数种子同步机制,这种架构不仅能探测端口存活,还能进行复杂的 Banner 抓取。发送端与接收端只需配置相同的随机种子,手机端捕获到 SYN-ACK 时,便会验证其是否符合该随机种子生成的 SYN Cookie;如果匹配,手机端就直接建立完整的 TCP 连接,进而完成诸如批量抓取 SSL 证书或检测 Heartbleed 等复杂任务。台上嘉宾甚至调侃起美国国家安全局(NSA):“NSA 正在监控所有跨大洋的洲际网络流量,如果你想彻底惹毛他们,只要把手机架在大洋彼岸,然后把全部扫描结果跨洋灌过去,看他们分析流量时抓狂地想‘这特么到底在搞什么鬼’。” ```mermaid flowchart LR accTitle: 非对称扫描架构 accDescr: 展示千兆机房伪造手机IP向全网发包,以及目标服务器响应汇聚到移动设备的流程 subgraph TX ["发送端 (Colo 机房)"] A["Masscan 发送引擎<br/>(千兆带宽)"] end subgraph Internet ["公网目标"] B["全网目标主机"] end subgraph RX ["接收端 (移动网络)"] C["预付费手机 / 终端<br/>(运行 Masscan 监听)"] end A -->|"伪造源 IP 为手机地址<br/>极高速发送 SYN"| B B -->|"低速返回 SYN-ACK"| C C -->|"验证 SYN Cookie 匹配<br/>完成 TCP 握手抓取 Banner"| B ``` - 发送端负责千兆线速的大规模 SYN 数据包喷射,完全剥离响应处理压力。 - 接收端通过校验 TCP 初始序列号(SYN Cookie)确认合法响应,无需跨节点同步状态表。 - 运营商网络环境测试:Clear 放行入站 SYN-ACK,T-Mobile 完全阻断,Verizon 推测支持直接公网接入。 --- ### [34:40](https://www.youtube.com/watch?v=UOWexFaRylM&t=2080s) 全网扫描发现的荒谬暴露面与 Heartbleed 现状 讨论转向具体的扫描发现时,Paul McMillan 展示了一张让全场大跌眼镜的远程桌面截图。窗口标题赫然写着某某县“逮捕令处理系统”(County warrant processing system)以及某州州警的字样,系统竟然在公网开放远程桌面协议(RDP)且没有任何密码保护。Paul 解释道,这张截图在演讲前不久已经失效,因为他发现后立刻联系了相关部门的人处理。针对这种荒唐的安全现状,演讲者感叹道:“The Derp is very strong... you know this is probably someone who is all kinds of compliant with all the local regs except that they didn't seem to think that a remote desktop protocol with no password was a problem.”(这种愚蠢简直无以复加……这大概是一个完全符合当地所有合规审计要求的人搞出来的,只不过他们压根没觉得 RDP 不设密码是个安全问题。) 除了完全未受保护的政府核心系统,全网 Heartbleed(心脏出血)漏洞的扫描数据同样令人吃惊。当时全网仍有超过 30 万台系统易受攻击,但提取返回的证书主题名称后发现,最主要的漏洞载体并不是大型网站,而是各种嵌入式网络设备——例如近万台群晖(Synology)TS 系列 NAS 设备,以及海康威视(Hikvision)的网络监控摄像头。这些设备几乎从来不会配置域名,如果仅通过扫描 DNS 域名列表根本无法发现,只有全网直接扫 IPv4 才能抓出。此外,嘉宾们还提到有人专门使用 Masscan 扫描互联网上的大型机(Mainframes),甚至建了一个 Tumblr 博客记录战果,里面赫然充斥着车管所(DMV)和连锁药房直接暴露在公网上的活跃大型机系统。 - 全网仍有 30 万台主机未修复 Heartbleed 漏洞,主要集中在群晖 NAS、海康威视摄像头等物联网与嵌入式设备。 - 仅靠基于域名的探测会遗漏绝大部分公网暴露资产,无状态的全网 IP 盲扫是发现隐蔽边缘设施的唯一手段。 - 诸如车管所与药房的核心大型机系统经常在没有任何公网访问控制的情况下直接暴露。 --- ### [36:55](https://www.youtube.com/watch?v=UOWexFaRylM&t=2215s) 现场演示翻车与分布式 VNC 抓图架构 讲师们原本准备进行现场实时扫描演示,但现场遭遇了经典的“墨菲定律”。Rob 的核心扫描服务器(`internet-survey-2.arc.com`)在开讲前突然失去响应,台下笑问到底给“演示之神”(Demo Gods)献祭了多少只山羊,Rob 只能自嘲:“The answer is always not enough.”(答案永远是不够多)。为了救场,Paul McMillan 接过演示棒,一边运行自动化配置脚本重构环境,一边讲解他搭建的分布式扫描系统的内部架构。 这套系统的核心思路是将“高速端口发现”与“慢速协议验证”解耦。首先在一台对端口扫描友好的主机上运行 Masscan,全网扫描 5900 端口(VNC 服务)。由于 Masscan 效率极高,全网 VNC 扫描在短短 15 到 20 分钟内即可收尾。随后,扫描结果被推入 Redis 任务队列中。后端部署了一组云端工作节点(Cloud Workers),这些节点不执行任何原始 SYN 扫描,只负责消费队列中的 IP,尝试建立真正的 VNC 协议握手。如果目标 VNC 服务明确返回“允许免密登录”(without authentication),节点便进一步抓取当前屏幕截图,并将图片数据交回结果队列。Paul 指出,这些云主机单台每小时只需 16 美分,平时需要处理任务时可以瞬间横向扩展出 100 台并行抓图,任务结束后立即销毁,成本极低。由于现场网络出口 IP 变动以及部分机器仍在启动,演示结果网页(`results.survey.tx.a`)的加载依然受阻,现场只能继续调试。 ```mermaid flowchart TD accTitle: 分布式 VNC 扫描与无认证抓图流水线 accDescr: 展示从 Masscan 全网探测 5900 端口到 Redis 队列分发并由云节点抓图的完整数据流 subgraph Discovery ["阶段一:端口快速发现"] M["友好 IDC 主机<br/>(Masscan 扫全网 TCP 5900)"] end subgraph Broker ["阶段二:任务调度中转"] Q[("Redis 任务队列")] end subgraph Workers ["阶段三:分布式协议交互与抓图"] W1["Cloud Worker 1"] W2["Cloud Worker 2"] Wn["Cloud Worker N...<br/>(按需扩展,每台 $0.16/hr)"] end subgraph Storage ["阶段四:结果呈现"] Web["Web 结果展示端<br/>(仅免密登录截图)"] end M -->|"开放 5900 的 IP"| Q Q --> W1 Q --> W2 Q --> Wn W1 -->|"VNC 免密连接成功"| Web W2 -->|"VNC 免密连接成功"| Web Wn -->|"VNC 免密连接成功"| Web ``` - 探测与交互解耦:Masscan 负责前置线速过滤,轻量云节点负责标准应用层协议交互与鉴权判断。 - 严格遵循合规边界:系统仅对明确声明无需认证的 VNC 服务执行屏幕抓取,不尝试破解密码。 - 弹性成本优势:使用单价约 0.16 美元/小时的廉价计算节点,按需启停上百个实例。 --- ### [40:40](https://www.youtube.com/watch?v=UOWexFaRylM&t=2440s) Defcon 内网实战演示与防手滑安全机制 为了填补分布式云端节点启动的空档,Rob 决定直接从 Defcon 现场的网络发起实时扫描演示。为了展示 Masscan 相比传统工具的交互差异,他详细对比了 Masscan 与 Nmap 的工作原理:Nmap 在扫描子网时,默认会先做 Ping 存活探测、再执行端口探测与其他检查,整个流程必须等单个主机完整扫完才会输出结果。这导致运维或黑客启动 Nmap 后必须先去喝杯咖啡,回来发现参数配错又得从头再来;而 Masscan 完全不需要预先 Ping,它只是直接向目标端口射出请求,即使只设定每秒 10 个数据包的龟速,屏幕上也会在几秒钟内立刻实时滚出响应。 Rob 在现场将发包速率从每秒 10 个包逐步提升到 10,000 个包,并选择针对 `23.0.0.0/8` 网段测试 80 端口。之所以选择这个网段,是因为该网段包含了大量亚马逊 AWS、Akamai 等大型 CDN 和云服务商的机器,不仅 80 端口必定常年有服务响应,而且这些服务商对端口探测早已习以为常,几乎从来不会发滥用投诉信。最后,Rob 演示了 Masscan 内置的人性化防手滑机制:由于 Masscan 威力过大,如果用户不小心敲错了 CIDR 掩码导致扫描范围覆盖了全网(`0.0.0.0/0`),程序为了防止误操作会主动抛出警告并直接拒绝执行;用户必须通过显式指定 `--exclude` 参数排除掉至少一个 IP 地址,向工具证明自己确实清楚正在做什么,Masscan 才会真正开始向整个互联网喷射数据包。在随后的演示中,即使用户仅以极低速率进行全网探测,来自微软等网段的 HTTP 响应几乎瞬间就跳了出来。 - Nmap 采用按主机顺序的同步阻塞式探测流程,而 Masscan 采用按端口喷射的异步无状态机制,结果随收随显。 - `23.0.0.0/8` 是端口扫描测试的“黄金靶场”,其密集分布着 AWS 与 Akamai 节点,具备高响应率与免投诉特性。 - Masscan 内置强制安全保护:全网扫描时强制要求配置 `--exclude` 排除特定 IP,防止用户手滑打错命令导致全网误扫。 ### [43:29](https://www.youtube.com/watch?v=UOWexFaRylM&t=2609s) 实时扫描速率与现场演示的波折 演讲者们深入探讨了 Masscan 在执行全网扫描时的实际性能与时间预估特性。Masscan 会根据发包速率实时显示剩余扫描时间:如果在极慢的每秒 10 个数据包(10 pkt/s)下运行,预估剩余时间会像“在 Windows 95 里复制文件一样”漫长无期;但当针对整个互联网地址空间(即 `0.0.0.0/0` 子网)以每秒 100 万包的高速进行全网扫描时,工具给出的预计耗时仅约一小时。台上一位讲者补充说明自己的测试基准:他在走进演讲厅入场时启动了一项扫描,依托一条普通的千兆带宽(gig pipe),发包速率达到了每秒 69 万包(690,000 pkt/s),当时的预计总耗时大约为 1 小时 20 分钟。 随后,讲者们试图将后台正在运行的实时扫描结果投影到公屏上供全场观看,但现场遭遇了音视频与网络路由问题。演讲者的笔记本仅有 HDMI 接口,缺乏会场投影所需的 VGA 接口。为了让观众查看正在生成的扫描数据(如 `results.survey.tx`),他们尝试在内网共享服务,甚至给出了内网 IP 地址供台下观众直接访问测试。一位讲者打趣解释为什么没把服务挂到公网:“因为上次我这么做的时候有人很不爽,把它暴露到了整个公网,所以我想这次干脆直接暴露给整个 Defcon,这样他们就没法抱怨了。” - 扫描 `0.0.0.0/0` 全网地址空间在 1,000,000 pkt/s 的速率下大约需要 1 小时。 - 现场实测速率为 690,000 pkt/s,在千兆网络下全网扫描预估耗时约 1 小时 20 分钟。 - Masscan 具有出色的跨平台可移植性,能够直接在 macOS、Windows 以及 Linux 上顺利编译运行。 ### [45:48](https://www.youtube.com/watch?v=UOWexFaRylM&t=2748s) “演示之神”与暴露在公网的韩国广告牌 现场网络连接与投屏依然磕磕绊绊,台下部分观众能成功加载网页查看结果,但讲者自己的机器却因为本地路由异常无法访问。面对这种情况,讲者调侃了技术演讲界著名的“墨菲定律”:“这就是 Defcon 的法则,我们称之为‘演示之神’(demo gods)或‘演示恶魔’(demo demons)——即使你的演示实际上完全正常,也总会有某些环节出岔子。” 在排查扫描到的实时数据时,屏幕上跳出了大量来自韩国的 IP 资产,包括一批直接暴露在公网、缺乏有效访问控制的户外数字广告牌。讲者们回忆起以往扫描经常碰到的这类设备,笑称这简直就像好莱坞黑客电影里的桥段:一个处于极繁华公共场所的巨型大屏幕居然毫无防备地暴露在网络空间,让人忍不住联想到各种恶搞和漏洞利用的可能性(“exploitable trolling opportunities”)。 ```mermaid flowchart TD accTitle: Masscan 现场演示与数据交互流程 accDescr: 展示 Masscan 在现场扫描、输出结果以及面临投屏与网络环境问题的流程图 subgraph ScanProcess["扫描与数据输出"] A["启动 Masscan 扫描<br/>(速率约 690k pkt/s)"] --> B["扫描结果输出<br/>(results.survey.tx)"] end subgraph ServiceHosting["本地/会场网络服务"] B --> C["通过内网 IP 提供 Web 访问<br/>(172.18.x.x)"] C --> D{"观众与讲者访问测试"} D -->|"观众笔记本"| E["成功加载页面<br/>查看到实时数据"] D -->|"讲者机器/路由异常"| F["无法连接本地服务<br/>(遭遇 'Demo Gods')"] end subgraph AssetDiscovery["暴露资产发现"] E --> G["发现脆弱资产<br/>(如韩国公网户外广告牌)"] end ``` ### [47:11](https://www.youtube.com/watch?v=UOWexFaRylM&t=2831s) 开源项目地址、IPv6 局限性与现场收尾 在演讲的最后阶段,讲者们一边紧急换用另一台笔记本直接接驳视频线投屏,一边回答台下观众的提问。有观众询问该工具是否开源,Rob Graham 确认 Masscan 是完全开源的,代码托管在 GitHub 上(项目路径为 `github.com/robertdavidgraham/masscan`)。 随后观众提出了一个关键技术问题:这种全网无状态快速扫描技术是否能应用到 IPv6 网络中?讲者明确指出,面对庞大无垠的 IPv6 地址空间,暴力全网扫描是行不通的(“IPv6... is going to not really work”)。不过,由于 IPv6 在实际分配和使用地址时存在特定的规律与分配模式,安全人员依然可以结合这些分配特性对特定的目标网段进行针对性扫描。在演讲倒计时最后一分钟,投影屏幕终于成功亮起,显示出了演讲期间台上后台程序动态抓取到的全网活跃资产结果。在全场观众的掌声与欢呼声中,讲者宣布演示完成并结束了本次议题。 - 源码获取途径:GitHub 上的 `robertdavidgraham/masscan` 仓库。 - IPv6 扫描局限:由于 128 位地址空间过大,全网遍历不再可行,只能依赖分配规律进行子网或目标范围收敛扫描。 - 演示成果:公屏最终展示的全部资产数据均为讲者在台上演讲并敲击键盘的几十分钟内,利用 Masscan 实时动态扫描并发现的真实互联网节点。 ## Notable quotes > [02:31](https://www.youtube.com/watch?v=UOWexFaRylM&t=151s) 我们真的很难体会到互联网到底有多小,直到你在命令行敲下 /0 并把扫描跑起来。 — Rob Graham ## Mentioned Rob Graham, Paul McMillan, Dan Tentler, Masscan, Nmap, Heartbleed, D-Link, Google, Siemens, iPhone, Amazon AWS, Akamai, Fail2ban, DoD, Hurricane Electric, ShmooCon, internetpolice.us, Verizon, AT&T, T-Mobile, Clear, Redis, Facebook, Twitter, Checkpoint, Woori Financial Group, Linode, Apache, Nginx, Active Directory, NSA, Synology, Hikvision, Tumblr, Defcon ## Video description Rob Graham, Paul McMillan and Dan Tentler discuss the some of the quirks of scanning the whole internet [Source](https://www.youtube.com/watch?v=UOWexFaRylM)

Source quotes

[2:31] Rob Graham: 我们真的很难体会到互联网到底有多小,直到你在命令行敲下 /0 并把扫描跑起来。

Source quotes

[1:09] Rob Graham: We really don't appreciate how small the internet is until we've typed in /0 and run our scan. [36:55] Paul McMillan: If the VNC protocol says you may connect without authentication, it's a very explicit thing; we're not, you know, hacking into something that's not authorized.

Original transcript

[0:00] good morning if you're I hope that most [0:03] of you are actually just still up from [0:04] last night otherwise you're getting up [0:06] way too [0:08] early um my name is Rob Graham this is [0:11] Paul McMillan and Dan tentler [0:13] hello uh they're busy getting our demo [0:16] working making sure we can demo live [0:19] stuff um we're going to talk today about [0:21] scanning the entire internet which [0:25] really isn't a huge technological [0:27] development but um it's something that [0:30] tools really haven't existed before and [0:33] they're really easy tools to create and [0:34] we just haven't bothered but we started [0:37] creating these tools because now we can [0:38] go to isps and get gigabit connections [0:41] to the internet and the internet's [0:43] pretty small it's only 4 billion [0:46] addresses so this is really an exciting [0:49] thing to do is to sit down on your [0:51] command line using nmap style options [0:55] and just say I want to scan the subnet [0:58] the slz subnet [1:01] that and immediately start getting [1:03] results back just watching your screen [1:05] just flow and flow and flow and [1:09] flow um why I scan the [1:12] internet well if you're a Defender it's [1:15] really actually an important thing to do [1:17] um a lot of people have used M scan to [1:20] scan for heart bleed on their own [1:21] networks because [1:24] um a lot of scanning tools just don't [1:27] support the scale if they have hundreds [1:28] of thousands of systems most [1:30] vulnerability scanning tools uh just [1:32] can't handle the scale map does a much [1:35] better job but still hundreds of [1:36] thousands of systems it's really slow um [1:39] but Mass scan you just type it in and [1:42] just a few minutes later 100,000 systems [1:44] get scanned and you find all your heart [1:46] bed vulnerable [1:47] systems or we have other really [1:49] important answers we need to solve about [1:52] the internet right now like [1:53] amplification attacks with DDOS that [1:56] people have been using such as the ntp [1:58] servers that have been misconfigured to [2:00] solve those we need to scan everything [2:02] on the internet to find [2:04] them or when like dlink announces a [2:07] vulnerability in in its home routers [2:09] will scan the internet looking for all [2:11] those dlink servers to say how big of a [2:13] botn net problem does that present to [2:15] us or like again with Heartbleed scan [2:19] all the SSL certificates in use to see [2:21] how old they are and if they've been [2:22] regenerated since the [2:26] bug um there's also the offensive reason [2:31] um it it's the Deep net and that's the [2:34] kind of a popular term these [2:37] days of um things that you can't find by [2:42] by Googling [2:44] them so uh with masan you just um scan [2:48] with the banners option and you will [2:49] find hackable systems with within [2:53] minutes uh and for us most of us are [2:55] white hat researchers and from the [2:57] offensive side it's a lot of fun it's [3:00] informative um we really don't [3:02] appreciate how small the internet is [3:04] until we've typed in slz and run our [3:07] scan also there's 65,000 ports out there [3:12] um pick one at random and you'll find [3:16] something new that no one's ever found [3:17] before like a seamen control system that [3:20] controls a nuclear power plant or or [3:22] something uh the talk after this one in [3:24] this room um there's a uh home [3:28] automation I don't know what the talk [3:29] was about I didn't get the exact details [3:31] but it was like ort 7468 or something [3:33] like that that he that they they scanned [3:36] for and found millions of vulnerable [3:39] systems so uh pick a port start scanning [3:42] for it see what the heck you get do a [3:44] black hat talk or a Defcon talk who who [3:46] remembers the uh iPhone Port that just [3:48] came out recently the iPhone back door [3:50] Port it's like 65 62,000 something I'm [3:53] going to scan it right now I just can't [3:54] remember what the port is somebody shout [3:56] it anybody remember no I gu I'll have to [3:59] look it up [4:00] wor a shot sorry go [4:04] on [4:05] um so so lots of people say okay now [4:08] you've excited me about scanning the [4:10] whole internet I really want to like [4:11] just log onto my my ISP my hosting [4:14] environment laun to VPS on on Amazon and [4:18] start scanning what do I do what are the [4:21] things I need to know [4:22] about uh the first problem is knowing [4:25] what the bandwidth limitations are if [4:27] you have a gigabit Ethernet you're [4:29] actually only sending uh about 48 or 476 [4:34] megabits per second of actual traffic [4:36] and that's because ethernet has a pretty [4:38] large overhead and what scanning does [4:41] TCP scanning is you send out lots of [4:43] small packets probing the devices so the [4:46] per packet overhead is actually more [4:47] than the contents of the packet so when [4:50] you do a gigabit [4:52] Ethernet what your ISP probably is going [4:54] to charge you for is just the raw tcpip [4:57] overhead which would be 7 476 megabit [4:59] per [5:02] second and by the way this is a really [5:04] high rate so uh that comes out to 1,4 uh [5:09] 488,000 packet per second but in [5:12] practice you're going to get a lot less [5:14] switches just bar at that and I haven't [5:17] figured out why I just know that when I [5:19] connect I get between 300,000 to maybe [5:21] 800,000 packets per second I'm not [5:24] getting what ethernet tells me I should [5:26] get even on a wellc configured switch [5:28] that's got nothing on but my but me I [5:31] don't get the full bandwidth I don't [5:32] know [5:35] why um the billing issue is is pretty [5:37] interesting because different isps build [5:39] at different rates um some isps don't [5:43] seem to notice the small packets um this [5:46] one time we got we we did this whole SC [5:48] of the internet and the ISP came back [5:50] and said yeah but you've only used like [5:52] a few megabytes total of traffic and [5:55] they weren't seeing our outbound [5:57] traffic uh some isps they give you [5:59] unmetered links and that's pretty [6:02] awesome because you can just go to your [6:05] heart's [6:06] content note that there's some other [6:08] subtle issues here um CCC in Germany the [6:13] C Computer Club they do their annual [6:15] thing uh last year they had 100 gabit [6:17] connection to the internet which I had [6:19] other plans but maybe this year I'll go [6:22] and just bring a my 10 gigabit Ethernet [6:24] cards with me but there's still problems [6:27] because um when you we're shoving lots [6:30] of small packets across the wire and [6:31] apparently that breaks agreements [6:33] between peering agreements so your ISP [6:35] no matter how wonderful they are may [6:37] still get mad at [6:40] you um there's the Practical physical [6:42] infrastructure vpss tend not to be able [6:45] to handle the packet rate as off as much [6:47] uh one The Strain the io gets strained [6:51] as I mentioned before the ethernet [6:52] switches slow down quite a [6:55] lot uh also be aware that just because [6:58] the ethernet switch says that it will [7:00] accept 500,000 packets per second [7:03] doesn't mean that the rest of the [7:04] infrastructure and all the Hops out to [7:06] the internet will accept [7:08] those um scanning all the scanners um [7:11] randomize the port numbers or the the [7:14] targets so that on the destination side [7:18] you probably won't drop any packets the [7:20] the packet dropping happens on your side [7:23] so you need to scan some things and make [7:24] sure okay I'm going scan my own network [7:27] across the internet blast it with packet [7:28] and make sure if I send send 10,000 [7:30] packets that receive 10,000 [7:33] packets most of my scans run even less [7:37] than that is I will run up multiple vpss [7:40] on different sites different data [7:42] centers and do a scan like one in Tokyo [7:45] One in um Dallas and one in Paris um and [7:49] do that instead of uh blasting one [7:52] blasting out a scan from one site uh um [7:56] masan shards really easy you just do [7:57] dash dash Shard one to five two a five [8:00] three of five and you'll split the [8:03] scan um your biggest issue is abuse [8:07] complaints um the internet now is done [8:10] in a way that when people do abusive [8:12] things like um spam um or um SEO [8:18] optimization stuff and scanning of [8:20] websites um the complaints come back to [8:22] the US to the isps and the isps will [8:25] block them and and cancel those customer [8:28] accounts and even if your ISP is nice [8:30] and willing and wants you to scan from [8:32] their Network they don't really have [8:34] much choice because other organizations [8:36] will just um Blacklist their entire [8:39] address range their entire um as number [8:43] or peerings agreements will de to stop [8:45] peering with them and so uh even if your [8:48] ISP is nice still they don't have much [8:50] choice in this they can't let you do too [8:52] much nasty stuff and so part of that is [8:55] responding to abuse [8:57] complaints and um answering them which [9:00] we'll get [9:01] into uh some things are worse than [9:03] others doing a heart bleed scan these [9:05] days with all the IDS detection out [9:07] there saying someone's exploiting me um [9:10] that gets a lot so we've been doing a [9:12] heart bleed scan once a month now for [9:14] the past several months which by the way [9:16] there's about 300,000 systems [9:18] vulnerable and that's generated a huge [9:20] amount of [9:21] complaints uh by the way we've also run [9:23] a tour exit node that's actually [9:25] generated more complaints than just the [9:26] heart bleed scan so still that's the Rel [9:31] level uh HTTP scan tends to put you on [9:33] the fail to ban list so uh put something [9:36] nice in your use registering as one of [9:38] the configuration options D user agent [9:41] so that um say something nice like you [9:45] we're doing a research [9:46] scan uh and then uh various ids's have [9:49] rules and stuff and it's nice to try to [9:51] EV evade them not to um to try to get [9:55] away with something evil but change your [9:57] signature of what you're doing to made [9:59] them so you just don't make people upset [10:02] uh sadly and this is a bad thing is [10:06] today's um methodology for monitoring [10:09] the network tends to monitor the inbound [10:12] stuff there's this old joke about this [10:15] guy is looking on the [10:17] ground and looking for something and his [10:19] friend asks well what are you looking [10:20] for and he says well I dropped my my [10:23] keys over there and I can't find them [10:26] and his friend asked but why are you [10:27] looking over here [10:30] and the guy says well the light's better [10:32] over [10:33] here and and that's what I that's what [10:36] most organizations do these days is they [10:38] monitor the inbound attacks for hackers [10:42] because the light's better because they [10:43] you put an IDs on the wire and [10:45] immediately you see alerts coming up [10:48] because people are there's always this [10:49] background radiation of someone's doing [10:51] something on the Internet sending you [10:53] packets and you'll get events the lights [10:55] better on the inbound side but the [10:58] detection you really want is on the [11:00] outbound side what is all the response [11:02] so for example one of the abuse [11:05] complaints we get from heart bleed uh is [11:08] please take us off your your scanning [11:09] list and we look at our data and the [11:12] data they're G the addresses they're [11:14] giving us are ones that are vulnerable [11:16] to Heart bed so they're monitoring our [11:18] inbound stuff saying that are you [11:21] vulnerable and not monitoring the [11:23] outbound stuff saying yes we [11:25] are and that's really really bad [11:30] so as I mentioned before isps must take [11:32] this seriously one of the biggest things [11:34] is the dod gets really really angry and [11:38] when you've got people in suits show up [11:40] at the isp's office and say we're seeing [11:43] traffic from you and we don't want to um [11:47] they the pressure then comes down on us [11:49] where they say yeah these address [11:51] Rangers need to be [11:55] excluded the exclude is pretty easy it's [11:57] the same way as end map which [12:00] is um you just have a configuration file [12:05] uh either a file containing exclude list [12:07] or you just add to your configuration [12:08] parameters and um just keep adding them [12:12] and uh it supports comments so we just [12:14] have this long exclude list of of [12:17] address ranges whenever people send us [12:19] an abuse mail and we say yes hello we're [12:21] just doing uh research scanning we'll [12:23] happily take you off the list if you [12:24] want and they give us their IP address [12:27] range and then we add to this list [12:30] now one of the cool things that we wish [12:32] we could do is to have a public exclude [12:34] list but most everyone who sends us a [12:37] request to be taken off our list doesn't [12:40] want that to be known publicly so yeah a [12:44] funny aside about this so everybody says [12:47] uh take me off your list because I'm [12:49] worried someone will be able to go look [12:50] up what my IP ranges are for my [12:52] organization so they can hack me [12:55] fortunately bgp he.net has all this [12:58] information publicly available in a [12:59] really nice easily searchable format [13:01] which is occasionally necessary when [13:03] they don't want to tell you their ranges [13:05] but they still want you to stop scanning [13:06] them which is I don't understand yeah [13:10] and Paul's got the block list open um [13:12] sorry so Paul's got the part of the [13:13] block list open and one of the other [13:15] things that's really fun is people will [13:16] run IDs and IPS sensors on whole [13:19] different subnet masks and different net [13:20] blocks and different isps and they have [13:23] automated complaint messages that come [13:25] in and say do your so and so you're [13:27] doing malicious activity sorry I didn't [13:29] know a single sin packet was malicious [13:31] but you know whatever um it's malicious [13:33] a single sin packet it's malicious [13:34] internet is over um but uh they would [13:39] write in a complaint and say take these [13:41] net blocks off your list or take us off [13:43] your list and give us no information at [13:45] all um and in one particular case uh we [13:48] had to go back and forth three or four [13:49] times with them because they didn't [13:51] their automated messages uh asked us to [13:53] take their publicly known [13:55] straightforward front end IP addresses [13:57] off their lists but their sensors on [13:59] different lists so we kept doing scans [14:01] and their sensors would keep picking up [14:02] scans and keep complaining for us to [14:03] take off IPS that were already in the [14:05] block list and we're like we don't know [14:06] what you guys are take your crack back [14:09] to the dealer you got bad crack like [14:12] tell them you want better crack stop so [14:14] it's it's bizarre and when you scan the [14:16] whole internet you get a massive grab [14:18] bag of random like every possible [14:20] ridiculous thing that can happen will [14:22] and every scan you do like you think we [14:25] have like several Pages now long with [14:27] multiple huge ceret blocks of stuff [14:29] we're leaving off the scans and uh every [14:33] single time we do a scan like I'm doing [14:34] a scan right now on the port 6278 the [14:37] iPhone backd door Port there are 542,000 [14:40] IPS responding that doesn't necessarily [14:42] mean they're iPhones it just means [14:44] there's something that's responding um [14:46] but I'm going to get abuse complaints [14:48] and I I hope that maybe some come in [14:51] while we're on stage and I can share [14:52] them because they're [14:54] insane them and one of the things is is [14:57] people a lot of Defenders don't believe [15:00] that you are scanning the entire [15:01] internet oh yeah and so they have a they [15:04] have their company and they've got some [15:06] well-known addresses that are [15:07] identifiably belonging to them but [15:10] they've also got the secret subnet over [15:11] there that no one's supposed to know [15:13] also belongs to them and then they see [15:15] you your scan go evenly across the [15:17] entire all those ranges and so their [15:20] conclusion is oh my God they're hacking [15:22] me because they know me they're [15:24] targeting me cuz how else would they've [15:26] known to associate that sub secret [15:28] subnet to our our main sub Network and [15:31] so they're convinced that that that [15:32] we're hacking them there a really cool [15:35] story about 6 months ago I was on a [15:37] podcast uh with this guy um who was [15:41] going to be one of the hosts and the [15:43] night before I just launched a scan of [15:44] the internet and he starts tweeting how [15:47] he was woken up on emergency conference [15:49] call because they were getting [15:51] hacked and uh he had to calm him down [15:55] talk him down and go back to [15:57] sleep and now apparently says that [15:59] whenever I do a scan the the the ticket [16:01] gets opened up it immediately gets [16:03] closed is just Rob scanning [16:10] again uh this is a great story uh I [16:14] think I think this would be the best one [16:17] to tell it oh yes oh this this was this [16:20] was a good time um so going back to [16:23] abuse complaints um and dealing with um [16:26] people complaining like I said it's a [16:28] grab bag and you get a lot lot of random [16:29] stuff um I have a friend of mine who [16:31] runs the operation in which I'm hosted [16:33] and he is my ISP so he's been very kind [16:35] in letting me do this sort of scanning [16:37] not a lot of people will let you do this [16:38] if you go to any of the major providers [16:39] and say hi I want to use like 800 megc [16:42] to scan the internet they're like no um [16:46] so I wanted to work with him and be very [16:47] open about what I was doing and when I [16:49] was scanning and what I was scanning so [16:50] that if he got weird bizarre complaints [16:52] and he had to deal with the crazy that [16:54] he was better prepared to deal with the [16:55] scenario um so I did a scan for [16:58] something I think it was VNC I don't [17:00] remember it was um shukan this year in [17:03] like February and we were the three of [17:05] us were sat in like Lobby conning it [17:07] till 3: in the morning doing our scans [17:08] and the next morning um before the talk [17:10] I started getting phone calls from my [17:12] ISP and he was like hey um we got some [17:14] abuse letters and we want to insulate [17:16] you from this customer or from this [17:17] person because he's kind of belligerent [17:20] um and I said okay well what can I do he [17:22] says just add these IP addresses your [17:23] block list and done with it all right [17:24] fine so a few minutes later he called me [17:27] again and says you're we're still [17:27] getting complaints and I said that's [17:30] we do the scan and we get complaints [17:32] randomly for the next week cuz people [17:33] don't check their logs immediately right [17:35] and one guy from Australia it's got to [17:38] be an Australian right [17:41] um decided that he was so upset that I [17:44] literally sent a single sin packet to [17:47] his systems um and when he sent in his [17:51] complaint my ISP guy was cordial and [17:53] responded and said hi you know we're [17:55] doing internet research this is all open [17:56] you can see this website where this guy [17:58] has everything documented and I put it [18:00] all up on my site like here's where I'm [18:02] doing my research and here's the [18:03] intention and here's how you can contact [18:04] me and because I guess he deals with so [18:07] much random crap on his um in in Ingress [18:11] interface um we were the only people to [18:13] ever respond to uh an abuse complaint [18:15] from him he like Unleashed this torrent [18:18] of crazy on us and it was like opening [18:22] the [ __ ] floodgates and he up to and [18:25] including was screaming at these people [18:26] on the phone saying he was going to call [18:27] the internet police and I went no you're [18:29] lying to me and he's like no we swear he [18:31] was threatening to call the internet [18:33] police and I'm like [18:36] okay 3 hours later I own internet [18:38] police. us and now my scans come from [18:41] internet police. [18:44] us [18:49] so you have to know how to work the [18:51] crazy so now yeah all my scanning comes [18:54] from internet police. us and the scan [18:56] that I'm running right now that I'm [18:58] scanning the iPhone Port if you're on [19:01] internet your thing's not working what I [19:04] don't know oh didn't a break apparently [19:06] your sight's down H boo I'll fix it in a [19:08] sec yeah we should fix it um okay but um [19:10] yeah so like right now if you have um oh [19:13] and I I should also say that we're we're [19:15] also going to be doing probably several [19:17] live scans um while we're here and if [19:20] you have a Verizon device and I think [19:23] AT&T your phone is directly connected to [19:25] the internet and we will be touching you [19:29] against your will wherever your phone [19:30] may be um yeah so I found 92,000 devices [19:36] apparently responding to this port um [19:38] and I should say that um I guess Rob's [19:40] probably going to get to it the um [19:42] there's a million or so there's a 2 [19:44] million devices that respond to [19:46] everything so like that's a whole [19:48] separate Rabbit Hole of a project is [19:50] going and finding every load balancer [19:53] firewall um router and other device that [19:56] responds to absolutely everything [19:58] because [19:59] um usually when you do this kind of work [20:00] you have to do it in multiple passes so [20:02] we use Mass scan for the first sweep to [20:04] see if the port is open and then if the [20:06] port is open then there's like a [20:07] secondary process where we decide what [20:09] to do with the open port so like if [20:12] you're scanning for reddis for example [20:15] um there's a ton of open reddis [20:17] instances on the internet and from there [20:19] you connect to it and issue the monitor [20:21] command and then sometimes it asks you [20:23] for credentials in which case you ignore [20:24] it and other times it gives you credit [20:27] card numbers and Facebook session [20:29] cookies and Twitter session cookies and [20:31] what are you doing like um they have [20:34] these gnarly hardened front ends with [20:36] like 2 a SSL certificates and [20:40] credentialing and O um o um o what is it [20:43] o OA and and they really Harden the [20:46] front end but then they have this [20:47] transport mechanism that's completely [20:49] public unencrypted on the internet so [20:51] you can bypass all that and see like hey [20:52] look these are credit card what am I [20:54] doing um yeah so um in you do it in [20:59] stages right so what we found out was [21:02] when the secondary pass would go through [21:03] and we would find a substantially lower [21:06] number of things that the first sweep um [21:10] produced so the first sweep would [21:12] produce several million resultss and the [21:14] Second Sweep would say well out of those [21:16] several Million results you have like [21:18] 200,000 living hosts and we're like [21:20] that's bizarre what's the deal so we [21:22] started testing it by hand and it turns [21:23] out that there's devices that just [21:24] listen on every port and respond to [21:26] everything and I'm like it's 2014 [21:29] and people don't know what a sin flood [21:30] is and they're configuring their devices [21:33] to just answer to everything so I'm [21:35] thinking that like we're doing these in [21:37] a you know in the hotel lobby tinkering [21:39] around at 3: in the morning and [21:41] somewhere there's a guy with his head on [21:42] fire cuz his IDs went down or his [21:44] firewall went down CU somebody [21:45] configured it to I think checkpoints [21:47] guilty of this too they have these [21:48] settings where oh yeah this is going to [21:49] block nmap we'll just respond to [21:51] everything and it'll confuse the [21:52] scanners and we're like we're scanning [21:53] with like 8 gigs a [21:55] second um not good for you you might [21:58] want to you think this strategy see how [22:00] it works out for him Cotton [22:02] right so one of my favorite complaints I [22:05] get back is the one saying uh to the [22:07] effect of we've blocked you at the [22:08] firewall n [22:10] ner of like I don't care I don't even [22:12] know who you are I don't really care [22:16] yeah um one of the cool things is how [22:19] how broken organizations are there's [22:21] this um Financial worry Financial Group [22:24] which apparently is classified a [22:25] national security objective facility [22:27] Class A as a repeatedly tell me every [22:29] time I do a scan um and I it's in Korea [22:32] and I have no idea what that is but what [22:35] they usefully do is they um CC their [22:38] entire organization on the abuse emails [22:41] oh [22:43] yeah you had one [22:47] job so if you want a list of CIS admins [22:50] that you want to fish for that [22:53] organization well here's a friendly list [22:56] that [22:57] they like so nicely give [23:00] us um so yeah so work Clos with your ISP [23:03] be nice to them so that's the same story [23:05] we have here with for all of us we work [23:07] closely with the isps uh we use the [23:10] swipe or the Swip feature the shared who [23:12] is Project to get like an IP address [23:13] range assigned to us so that when you do [23:16] the reverse look up all the abuse comes [23:18] to us and not to our ISP usually usually [23:22] about half the complaints will CC our [23:23] ISP anyway even though they have our [23:26] contact info they just want to see see [23:28] everybody I got one that was cc to [23:30] postmaster at the Domain that I was [23:32] sending email that the contact info was [23:35] from which was completely unassociated [23:37] with the IPS that I was scanning from [23:40] they just they CC everyone that comes [23:43] back in any kind of a look up so expect [23:45] that you know don't use your work email [23:48] if you're the postmaster at work is [23:49] going to be worried about this okay [23:51] internet police. us is up again so [23:53] Apache wasn't running derp [24:02] okay derp indeed you're doing it wrong [24:06] it works for me there he [24:10] goes me too also um if you scroll down a [24:14] little bit there's like like it's it's a [24:15] little gr I need to fix it file a [24:17] complaint which I I need to like do [24:19] something with this cuz you can file a [24:21] complaint and it's a form that goes to [24:23] nowhere [24:26] but you should probably fix that D yeah [24:29] no no that was intentional but like I'm [24:32] now thinking like yeah I have to deal [24:33] with like silly people trying to troll [24:34] me with like shitty xss and and S ey or [24:36] whatever but like I can't imagine if [24:38] people have tried to fill this form out [24:39] and what went into it because that would [24:41] be like a whole tumbler feed like [24:43] security reactions just what goes in [24:45] that form that would be so [24:49] rad yeah so right now right now as we [24:52] speak I'm doing a scan and right now [24:54] there are assisted men's running around [24:55] scrambling screaming and the internet [24:57] police is scanning us well just wait [24:59] hopefully they hopefully they've caught [25:01] on by now and are not as I don't know [25:04] you'd be surprised or maybe you [25:08] would uh so you can also do Anonymous [25:10] VPS if you want to be a jerk and pay [25:13] with uh Bitcoin and stuff uh some will [25:16] allow you to complete your scan um and [25:20] uh before they cancel your account some [25:21] will just like line node will cancel you [25:23] very very quickly and so like your $50 [25:25] deposit you'll just get canceled [25:27] immediately line is actually pretty [25:28] friendly if you're a well-known [25:30] verifiable organization and you scan [25:32] that slow rates they actually are quite [25:34] friendly to this whole thing it's but [25:35] they're not friendly to the whole [25:36] Anonymous VPS do do bad stuff so I [25:40] wanted to quickly talk about masan [25:42] itself it's just like nmap but [25:47] not um the biggest thing is that nmap [25:50] does a what's called a synchronous scan [25:52] does a host at a time it it starts the [25:55] scan Waits the response sends re um R [25:58] tries if doesn't get back the expected [26:00] response and that's what slows it down [26:03] what masan does is it just blasts out [26:06] packets the packets and never waits for [26:08] a response and that's why I can send out [26:10] 4 billion packets because it doesn't [26:12] have 4 billion records in memory waiting [26:15] for the response it doesn't care it [26:17] doesn't know and what it's using is s [26:19] cookies so that to to validate the [26:21] responses that come back that match what [26:24] it thinks it it might have [26:26] sent so this allow you to be a thousand [26:29] times faster it's not a technology uh [26:31] thing it's just um it's a common thing [26:34] throughout like it's the same difference [26:36] as between Apache and engine X Apache is [26:38] an asynchronous server can handle a lot [26:40] more connections than Apache [26:43] can um nmap of course is a way better [26:46] scanner if you're scanning a few hosts [26:48] nmap is just totally better the only [26:51] reason that you're using mass scan is [26:52] because of you want to do million node [26:55] networks or billion node Networks [26:59] the annoying thing about masan is that [27:02] it has its own tcpip stack uh even when [27:05] you run it just as a normal mode it's [27:07] still going off and doing its own TCP IP [27:09] stack bypassing the underlying [27:12] system and so you get a little weird [27:13] things you don't notice that there's [27:15] duplicate Arps um the biggest problem is [27:17] when you're doing um Banner checking [27:20] when you want to establish a TCP [27:22] connection send an HTTP request and get [27:24] the response and record the response uh [27:26] the normal stack will uh reset those [27:28] connections so you have to um do a [27:31] firewall rule to block [27:34] that uh or use a different IP address so [27:37] all of our scans we scan from one [27:39] machine but then uh we have another IP [27:42] address that we're scanning from that's [27:44] separate from our machines it's not used [27:45] by any machine and we just use Source IP [27:48] or adapter IP and set that as our IP [27:50] address and scan from that and then we [27:52] don't have any uh firewall rules to [27:54] worry [27:56] about um so that the basic configuration [27:59] is is set your if you don't want to rely [28:01] upon the defaults if you're having [28:02] problems just set them manually with the [28:04] source IP The Source port and you have [28:06] to configure the router Mac address uh [28:09] or usually the router IP just works CU [28:11] it'll [28:14] arpit uh so Banner checking is the fun [28:16] stuff with um with Mas scan so Mas scan [28:19] will go off check the ports that's your [28:21] basic scan but usually you want to get [28:23] more data like uh SSL certificates or [28:27] HTTP headers [28:29] and that's where you need to establish [28:30] the connection and prevent the reset [28:32] from killing the connection uh we don't [28:34] support like NSE cell scripting but [28:36] there's a lot of stuff you can do if all [28:38] you want to do is check for one protocol [28:40] that's odd put the put it into a file [28:43] and then do das Das hello string that [28:45] file name and it will just shove that [28:47] data across the port when it connects [28:49] with TCP so if you got some weird [28:52] protocol like some weird industrial [28:53] control protocol in a weird Port that's [28:56] an easy way to find just that indust [28:58] control protocol uh bypass but uh [29:02] ignoring all those systems that dis [29:04] respond with a syac with [29:08] nothing um one of the cool things is [29:10] that you can do um you can break apart a [29:13] scan you can Shard it so if you got 50 [29:14] different machines you can just do Shard [29:16] one or 52 53 50 across the machines uh [29:20] you can use multiple IP addresses AR [29:22] range if you've got a class C and you [29:23] just want to use all those IP addresses [29:25] you just type all them in or type in the [29:28] range um the same thing with a port you [29:31] can do a range of source [29:33] ports um so yeah so we're sitting around [29:37] doing our three-day or our days talking [29:39] until 3:00 a.m. in the morning drinking [29:42] and we're imagining yes we can also do [29:43] this if you want to sin flood someone [29:46] with all IP addresses from the internet [29:48] that's could be your Source [29:50] range your ISP might not allow it might [29:53] do egress filtering so it might not work [29:54] but in theory the the scanner can do it [29:57] the '90s are like and well right [30:01] here uh also it can do load testing the [30:04] uh a really cool feature is [30:06] infinite which [30:08] yeah it does crash firewalls a lot I've [30:11] done that recently and um Next [30:15] Generation firewalls I do deep packet [30:17] inspection o they get [30:19] angry uh so I was at a client site [30:23] several like months ago or yeah and um [30:25] they were putting in new Fancy Pants [30:27] firewalls and I said I have an idea so [30:30] like with dinky laptop I go okay um Mass [30:34] scan to a network on the other side of [30:35] the firewall that doesn't exist um just [30:38] scan it um one [30:41] ngfw uh had active directory [30:43] authentication and um all of its little [30:46] gauges went to 100% and AD broke and it [30:49] never came back and uh another one just [30:52] went to 100% dropped a lot of packets [30:53] but as soon as I controlled seed out of [30:55] mascan it came back to life so yes this [30:58] is a wonderful firewall load testing [31:00] tool testing tool it breaks clouds too [31:04] so yeah oh um I overflowed I may have [31:06] overflowed a cam table in a switch at a [31:08] client wants with it to by [31:11] mistake like so so that's the [31:13] optimization we're doing with the whole [31:14] as asynchronous thing is if for us is a [31:18] billion Connections in a few minutes [31:19] that's no problem but the devices start [31:22] straining at 100,000 connections and so [31:25] they just everything falls over but the [31:27] infinite feature is cool because you [31:28] just type-- infinite and when it [31:30] completes the scan it'll just restart it [31:32] and if all the TP connections are open [31:34] from the previous Scan they remain open [31:36] so you can create easily 100 million I [31:38] mean yeah 100 million even uh concurrent [31:42] connections and nothing else handles [31:44] that right [31:45] now uh by the way no one ever uses this [31:49] but I always output to Binary format [31:51] that's the slob parameter and then read [31:53] it later with the dash rescan of that to [31:56] then output to XML or Json or text or [31:58] some other format uh no one ever uses [32:00] that but me but I want to mention [32:03] it um so one of the cool things uh Paul [32:06] was mentioning this when we're talking [32:07] about the talk that should work uh I'd [32:10] never done it before but um it's really [32:14] cool you can uh receive on one IP [32:16] address like a burner phone and then you [32:19] transmit from like a Colo that's got a [32:21] gigabit connection and then you spoof [32:23] the IP address from the Colo of the [32:26] phone so all the pack of go out to the [32:28] internet at a very high rate and then [32:31] the responses come back at a very low [32:32] rate to the [32:34] phone and what's cool about that is the [32:36] abuse complaints don't back to your Colo [32:38] account they go to the [32:42] phone so I did that I went out and got a [32:45] T-Mobile phone a T-Mobile um chip put it [32:49] in my little uh Ninja Telephone from two [32:52] years [32:53] ago from which I can run Mas g i [32:56] jailbroken it compil the command line [32:58] um but it uh the didn't that didn't work [33:01] because T-Mobile throws you through a [33:03] firewall I could not get all the [33:05] responses coming back through the [33:06] firewall uh clear has a [33:10] uh uh direct access to the network they [33:13] also have a firewall so uh it can't the [33:15] sins can't come in but the sin a can [33:18] come in just fine so clear works great [33:20] for that T-Mobile doesn't we don't know [33:22] about Verizon and AT&T I think Verizon [33:25] does have you directly on the internet [33:27] so that work with Verizon prepaid phones [33:29] and stuff like that but um all I've [33:33] actually verified working is is [33:36] this and and by the way it works really [33:38] cool because uh masan what you do is you [33:41] set up the same seed so masan randomizes [33:44] the parameters randomizes the uh s [33:46] cookies I just had a thought so NSA is [33:49] scanning all InterContinental traffic [33:51] you want to make him really [33:54] mad set up your phone yeah this will do [33:56] intercontinentally set up your phone on [33:58] the other side of some ocean and just [34:00] send all the results over there and [34:01] watch them what the hell is going on yes [34:06] just a thought you know so if you're [34:08] bored but you can still do the banner [34:10] checking so when so the so the device [34:12] the mask on one end because that's again [34:14] the asyr nature it gets a synac it [34:16] checks to see if it matches the seed and [34:18] if it does it will then establish the [34:20] TCP connection so you can do complicated [34:22] scans like pulling down everyone's [34:24] certificates or heart bleed scan or [34:25] something and all from this device but [34:29] the the mass of gigabit per second is on [34:31] these other servers potentially um just [34:34] blasting the whole [34:37] internet okay let's talk about some [34:40] results so uh what Paul here did and [34:43] it's really [34:44] cool uh is he uh set up a little script [34:47] to then download the [34:48] image and he um so here's an example [34:56] of so you probably can't see you [34:58] probably can't read the title of that [35:00] window it says I blanked out where it is [35:03] County warrant processing [35:06] system something or other State Police [35:09] The Derp is very [35:11] strong um this one went away pretty [35:15] quickly when I called my per contact and [35:17] said hey you know we should probably do [35:19] something about this uh but there's [35:22] stuff like this all over the [35:25] results and you know this is probably [35:27] someone who is all kinds of compliant [35:29] with all the local regs except that they [35:31] didn't seem to think that a remote [35:33] desktop protocol with no password was a [35:37] problem so Paul's got lots of cool [35:39] results we'll get hopefully get to more [35:42] um another one was um Heartbleed we do a [35:44] heart bed scan and there's still 300,000 [35:47] systems vulnerable and so here's a list [35:50] of the uh subject names coming back from [35:53] the from here and what we can see is is [35:55] they they're not websites that are [35:57] vulnerable [35:58] it's things like sonology nazes that's [36:00] the TS series Nas Down at the bottom uh [36:02] 10,000 of those uh there's also a [36:05] sonology box there's a hick Vision which [36:07] is cameras so there's all these devices [36:10] out there that are vulnerable that you [36:11] would never find if you come in via the [36:12] DNS name that you only scan via the IP [36:17] addresses uh but but there are some [36:19] websites that are vulnerable and like [36:22] one long list uh start with secure dot [36:25] some domain [36:27] uh some I think are honey pox like nanog [36:30] which is the North American Network [36:33] operators group or something um there's [36:35] a guy who's doing Mainframe scanning and [36:37] found lots of cool main frames I didn't [36:39] want to include any of his picks here [36:40] but they're they're really rad see what [36:42] main frames are on the internet that guy [36:44] has a Tumblr and his main frames like [36:47] live main frames like what do you why is [36:49] this on the [36:51] internet DMV and like pharmacies and [36:54] stuff what are you doing yeah okay so [36:55] let's try to do a live demo here how [36:59] many goats did you sacrifice to the demo [37:01] Gods the answer is always not [37:04] enough [37:11] so yeah so right before this talk for [37:13] some reason our servers have not wanted [37:16] to respond so like here's our servers [37:18] internet survey 2. arc.com that's the [37:20] one we do where most of our scans from [37:22] and it's not responding to me so I'm [37:24] going to have Paul log on to his server [37:26] and do a demo um um give me another like [37:30] five [37:31] minutes okay so well I we can I'll start [37:34] talking about what's going on while the [37:35] configuration script is running so uh I [37:40] this I lost access to the servers that I [37:42] was going to be doing this demo from and [37:44] only got it back about two hours ago so [37:48] uh my configuration scripts have been [37:49] running and installing the distributed [37:52] scanner that I built the way this works [37:54] is that it runs Mass scan from a host [37:58] that's friendly to run Mas scan on come [38:00] talk to me afterwards if you want [38:01] hosting recommendations and it scans [38:04] Port [38:05] 5900 uh which is [38:07] VNC and I started that about 15 20 [38:12] minutes ago and I think it's just about [38:14] done with the whole internet now the [38:17] follow-up [38:18] processing is a set of cloud images that [38:23] don't run sin scans what they do is they [38:27] they take the results of the mass scan [38:30] output uh through a q through a redis Q [38:34] and just shave off a result go take go [38:37] try to connect to the [38:39] VNC try you know speak the VNC protocol [38:42] if the VNC protocol [38:44] says says you may connect without [38:46] authentication because most VNC says you [38:49] need a password but if it says you may [38:51] connect without authentication it's a [38:52] very explicit thing we're not you know [38:54] hacking into something that's not [38:56] authorized then it goes and puts it back [38:58] in the queue and takes a screenshot of [39:00] it you it just logs in VNC screenshots [39:02] it and puts it back out into the queue I [39:06] the results when they start flowing in [39:09] will be available at results. survey. [39:11] tx. I don't know if they're up yet it [39:15] doesn't look like it I'm uh waiting for [39:18] the screenshot machines to come back up [39:22] tx. [39:23] a [39:26] um uh uh what what I oh you're not on [39:29] the Defcon Network you won't be able to [39:30] get to it unless you're on the Defcon [39:32] Network Defcon Network are you on the [39:34] Defcon Network I'm on this whatever this [39:35] ether cable is oh uh you're probably [39:38] coming from a different egress IP let me [39:40] fix that for [39:41] you uh so as the as the results come in [39:45] they get they just flow through this [39:47] queue and the Beautiful Thing is we can [39:49] scale this follow-up processing as wide [39:52] as we want um I normally would have [39:55] about 100 Cloud workers run [39:58] to do this process I haven't gotten it [40:00] scaled up yet CU they only just got [40:02] installed here but you know they cost me [40:06] 16 cents an hour so it's perfectly [40:08] reasonable to spin them up for a job [40:10] like this and then tear them down when [40:12] you're done with [40:13] them here if you can add that that's my [40:17] silly Verizon one so if you can't quite [40:20] do a live demo yet how about you it's [40:23] it's loading loading oh um you won't be [40:28] able to see the results you're looking [40:29] for in this right now give me another [40:32] minute [40:34] yeah D five minutes they're not ready [40:38] okay well in the meanwhile we'll just do [40:40] a scan from the Defcon Network we'll see [40:42] how much they like that oh yeah I can't [40:45] imagine they'll [40:47] notice we can do a slow scan so [40:51] masan uh do let's do like the 23 is a [40:55] big hting off the wall of [40:58] we can do like Port [41:00] 80 and um we can do a slow packet rate [41:04] of just like 10 packet per [41:09] second but it's really cool because we [41:12] start getting results immediately that's [41:14] one of the cool things about Mass scan [41:16] versus nmap um is that nmap Waits until [41:20] the entire host scan is done and it does [41:22] a ping it then does some other checks [41:24] and it takes a while so when you scan a [41:26] sub Network it takes takes a while [41:27] before you get any result you start your [41:29] end map scan you go wait for a coffee [41:31] and come back realize you made a mistake [41:32] in the configuration parameters do it [41:34] again and it's uh an inter of process [41:37] but one of the cool things with Mas scan [41:39] is because it's just a port at a time I [41:40] don't ping first I don't do anything [41:42] first I just send that that that Port [41:44] request so even at a slow L rate like [41:46] 10,000 packets per second um they just [41:49] start coming [41:53] back and if we just want to do a little [41:55] bit more obnoxiousness like 10,000 [41:57] packet per second I'm sure they won't [42:03] mind so actually it doesn't look like [42:05] it's much faster that's because this [42:07] whole screen is taking thousands of [42:11] response dumping them to the screen and [42:12] then doing the next 1 second update but [42:15] that's the little thing that reports [42:16] there at the bottom the of the leftand [42:18] side is how many packets per second [42:19] successfully doing I should probably [42:21] stop [42:24] this which is actually really bad [42:26] because 20 so 23 is the range I test [42:28] with because there's lots of Hosting [42:30] environments there's Amazon there [42:31] there's aami there's a bunch of other [42:32] web servers out there so I know that [42:34] there's always something listing on P 80 [42:36] and I don't get any abuse complaints [42:38] back from that that range so they're a [42:40] good thing to test [42:42] with but we can also do something like [42:51] this so one of the things I do with Mas [42:54] scan it's kind of boss is that [42:57] um I warn you that this you you probably [43:00] Mis fingered something and you probably [43:01] don't want to scan the entire internet [43:04] so I make you actually [43:06] exclude um one [43:14] address so so I'm now I'm doing 10,000 [43:16] 10 packets per second but even now 10 [43:19] packets per second across the entire [43:20] internet we already get back one [43:24] result those look like Microsoft minutes [43:27] [Music] [43:29] but one of the cool things is is it does [43:31] give you a time stamp a time of of how [43:34] long remaining now 10 packet per second [43:36] that remaining is going to be a long [43:38] time it's like it's like when you copy a [43:40] file in Windows 95 but it's really [43:44] cool when you you type in that [43:48] 00000000 the zero subnet meaning the the [43:52] internet um and at a much faster rate [43:56] like a million pack per second and it [43:57] tells you yeah it's about an [44:02] hour yeah for reference I'm [44:05] getting 690,000 packets a second on my [44:09] scan that's going right now and it I [44:12] started as I walked in and it was [44:13] telling me an hour and 20 minutes and [44:16] that's just on like a modest gig pipe [44:18] can we connect that to the VGA port all [44:20] I have is [44:21] HDMI so if we can sort that out somehow [44:24] can you screen that and have me log into [44:26] your machine and pop that up oh there we [44:29] go okay the results are starting to flow [44:31] in the so uh results. survey. tx. so now [44:35] I need to scale this out in the cloud uh [44:39] but we're starting to get results now um [44:41] well you might be okay what's what's [44:43] your IP [44:44] address [44:47] okay [44:51] 1728 my IP is 19216801 why can't you add [44:55] me because someone got mad last time I [44:57] did this and G exposed it to the whole [45:00] public internet so I figured I'll just [45:01] expose it to all of Defcon and then I [45:03] can't [45:08] [Music] [45:08] [Applause] [45:09] complain sure okay so what's that IP [45:12] address [45:17] 14 so by the way mascan does um one of [45:20] the thing that's also boss about M scan [45:23] um is it's just TR again uh make well [45:27] I'm getting errors here but um it [45:29] compiles a Mac OS [45:31] Windows well there's some results that [45:34] all you guys can go look at the results [45:35] yeah everybody everybody except for you [45:37] apparently can see them can can one of [45:39] you who's in the room who has a laptop [45:41] see if you can get to that yeah are you [45:44] seeing results [45:46] there [45:48] cool so so here's the thing about about [45:51] here's the rule of deathcon is we call [45:53] them the demo gods or the demo demons is [45:56] that even when you're demo is actually [45:57] working something does not work try it [46:01] now what [46:04] okay oh here we go okay okay it's [46:08] working some of you can get it but I [46:10] can't get it okay what's your what's [46:12] your IP Rob well it's um oh those Korean [46:16] Billboards again oh yeah so apparently [46:19] there's like a swath of billboards in [46:20] Korea that are advertising and 172 18 46 [46:27] down there and this is one of those [46:30] opportunities where like you think of [46:31] Hollywood movies and you're saying well [46:32] so I'm looking at a billboard that's [46:33] probably in a really big public place [46:35] and H you know oh exploitable the [46:38] trolling [46:39] opportunities [46:44] um I should stay away from Korean ranges [46:47] CU they're all the [46:48] same go through the browser I think your [46:51] routing is [46:52] funky actually here [ __ ] it we'll just [46:55] do it for my machine because we're [46:57] can we just hook up the uh yeah video [47:00] yeah do you have a [47:04] um you bring your machine up [47:07] [Music] [47:11] here so any last minute questions by the [47:18] way question over there open source yeah [47:22] it's open source I probably should have [47:23] mentioned that before and had a link to [47:25] it uh it's on GitHub so if you just [47:28] Google GitHub masan you'll probably find [47:29] it but it's GitHub SL Robert David [47:32] Graham my name/ [47:42] mascan so the question for IPv6 and the [47:45] implications are is going to not really [47:47] work there are some things we can do [47:49] knowing how IPv6 allocates your dresses [47:51] and you can maybe do Target ranges 89 [47:56] [Applause] [48:01] oh [48:03] nice 89 well done [48:11] so so to be clear these are all this the [48:14] these are all results that have been [48:15] dynamically found while we've been on [48:17] stage while they've been furiously [48:18] typing this is a train yeah we got to go [48:21] though bye so oh my God so look at the [48:24] results they're up there [48:30] [Music] [48:32] nice well [48:35] done all right [48:43] [Applause]