Scanned Today, Attacked Tomorrow

By

At 05:48 UTC on November 9, a single IP began pulling /.env files from a set of honeypot sensors. In fifty minutes, it collected them from ten hosts. Then it went quiet.

Eighty-five minutes later, a different IP on a different network authenticated to the mail service on one of those hosts using credentials that existed in exactly one place: the file the first IP had taken. Four minutes after that, it did the same thing on a second host. The second IP never retrieved the file. Instead, the credentials stored within it were relayed to that node.

Nothing about this behavior is exotic, but it shows something about how opportunistic attacks work that most security programs are not prepared to prevent. The attack you eventually see is the last step of a process that started days, weeks, or months earlier — and from a different source. The best means of prevention begins with blocking the reconnaissance phase from gathering valuable information.

Recon is the first contact

Honeypot sensors are a clean way to see this. Set up a host that looks like an ordinary internet-facing server and have it serve a decoy /.env file containing a unique, high-entropy credential that exists nowhere else. The decoy is the only way to learn that credential, so whenever it is later used against an enabled service, the method of the attack is known.

In three months of sensor data we reviewed, sensors served those decoys 29,652 times to 910 distinct IPs. In the last thirty days alone, nine sensors logged more than 51,000 probes for .env files from 434 addresses. That is one file path, on hosts with no known real existence. Reconnaissance is not a one-time event, but the climate of security.

It also starts the moment your services are public. When one new sensor came online, its mail hostname was hit two seconds after its TLS certificate was issued, pulled straight from Certificate Transparency logs. On that first afternoon, 241 of 247 web requests used the hostname rather than the IP. A coordinated group of datacenter ranges has been visiting new certificate names since July, requesting only the root domain. This is how future attackers build their current inventory.

On another sensor's first day, 419 new IPs showed up. Only 37 of them tried a credential. The other 382 were there to observe headers or banners.

One node looks, another attacks

The handoff in the opening story is a recurring pattern. Of 116 sensor-and-IP pairs where a harvested credential was replayed, 21 involved an IP that had never fetched the decoy itself. In ten of those, a neighbor in the same /24 had done the fetching. In the other eleven, the fetch came from a different network entirely, sometimes a different country.

In one case, an Azure host fetched a decoy over HTTPS. Five seconds later, an IP on a Moroccan mobile carrier was trying the credential against SMTP. In another, a credential harvested in late August was used from a neighboring address 47 days later.

The division of labor shows up in the traffic profile too. The IPs that only perform recon are loud: a third of them trip IDS signatures, forty percent appear on multiple sensors, and most have a threat-intel history. The IPs that only replay credentials are nearly silent. Of the twenty observed, one triggered an IDS alert, one was seen on a second sensor, and more than half had no threat-intel history at all.

While the sample is narrow in scope and intent is ambiguous, the separation is real. The noisy infrastructure does the looking while the clean infrastructure begins exploitation. If your strategy is to identify the attacker and block them, you are identifying the wrong node.

The catalog

Here is the part that matters most for anyone defending a real network. Most harvested credentials were tested fast. The median gap between fetch and first use was 36 seconds, which is a pipeline of automated behavior. Fifteen credentials were first used between an hour and a day later. Thirteen waited more than a day. The longest gap was 18 days for a single IP, and 47 days across the split pairs.

That tail exists because the data is being stored. What a scanner learns about you, whether open ports, service banners, version strings or exposed files, does not get used once and discarded. It goes into a database, and when a new vulnerability drops for a product you run, nobody needs to scan the internet to find you. They just run a query.

One sensor provided direct attestation. By default, its firewall blocked traffic from countries outside of its geographic region. When the firewall was opened to allow that traffic, port-22 traffic didn't move: 38 source IPs after the change, compared with 34 to 40 before. Meanwhile, of the 150 scanners that hit four or more of the other sensors, only five ever reached this one. On a control sensor, the figure was 68 percent.

The cause can't be proven, but the simplest explanation fits everything in the data. Prior geographic blocking had kept that sensor’s address off of target lists. The large SSH campaigns weren't scanning for open ports, they were working from a list built by earlier recon. Being absent from that list mattered more than what was actually exposed.

Since the firewall changes were made, traffic has increased by approximately 60%.

Why blocking the attacker comes too late

Every instinct in a SOC points toward the exploitation attempt. It's the alert that fires, the IP that shows up in the log, the thing that looks like an attack. But by the time it appears, exploitation has already begun and defenders are chasing a cheetah.

Block the IP that logged in with the credential, and the feeder still has the credential and can hand it to another node. Block the feeder after it fetched the file, and the data is already out, on its way to a database that will outlive the IP for as long as the attacker’s budget allows.

The only intervention that removes the whole chain is denying the reconnaissance itself. Deny the initial information-gathering traffic, and there is no retargeting after the fact.

Of the 95 IPs that fetched a decoy and later used it, 63 had never touched any of the sensors before. IP reputation would have caught about a third of the harvesters, including the feeder in the opening story, which had been sweeping the sensors with web requests for 55 days before it took anything. But two thirds arrived clean. For those, the only thing that works is blocking the behavior.

Stay out of the catalog

Prevention-first security is usually pitched as patching faster or detecting sooner. Those are sound security fundamentals and work well as part of a defense-in-depth strategy. Unfortunately, if those are your primary defenses, your network is already profiled. And that profile is what opportunistic attackers are shopping from.

The more useful goal is to be expensive to profile. Use threat intelligence to block reconnaissance requests before they happen, serve as little as possible to unauthenticated strangers, and return nothing useful to illegitimate window shoppers trying to inventory your systems. Strip version information from banners and treat a request that only makes sense as reconnaissance as hostile, because it probably is.

None of this stops a determined adversary who has time and resources on their side. Defenders must be right all of the time, while attackers only have to get lucky once. Reduce the odds of them getting lucky by denying them information, and you’re going to be right more often.

Nobody attacks a host they haven't scanned. Make the scan fail, and most of what follows never starts.

Stay up to date with our intelligence team’s research by reading our latest threat briefs.

Know what’s coming. Stop what’s next.

Sign up for updates and see how Centripetal is defining cyber defense.

The Cybercrime Barrier Your Organization Deserves

Sign up for a custom demonstration from our security team of how we bring together the best minds and most complete collection of threat intelligence to provide you with a shocking level of relief.