Skip to content
VPNDetection

Bots scanning for .env files: who they are, and what stops them

5,116 addresses probed our web servers for .env, .git and wp-login.php in 26 days. Servers sent 95% of the probes, and a hosting rule stops them on the first.

Published 6 min read

On this page
  1. 5,116 addresses, 261,754 probes
  2. Who they are
  3. What each defense stops
  4. First, have nothing to find
  5. A rule for the routes that exist
  6. What an IP check can't see
  7. How we measured

Every site's access log has them: GET /.env, GET /.git/config, POST /xmlrpc.php, from addresses nobody on the team knows. None of our sites runs WordPress or PHP or keeps a .env where a request can reach it, so every such request to our web servers is a probe. We counted 26 days of them, October 20 to November 14, 2026, and on November 15 looked up every address that sent one in our API.

5,116 addresses, 261,754 probes

A request counts as a probe when its path asks for something none of our sites has:

What it looked forExample pathsAddressesProbes
Secrets/.env, /.git/config, /.aws/credentials, wp-config.php1,728175,293
WordPress/wp-login.php, /xmlrpc.php, /wp-admin/2,15148,156
PHP admin tools/phpmyadmin/, /vendor/phpunit/, /phpinfo.php84326,235
Routers and cameras/cgi-bin/, /boaform/, /HNAP11,0606,969
Servers and appliances/actuator, /server-status, /owa/, VPN portal logins7615,101

An address can look for several things, so the rows add up to more than 5,116. .env paths alone drew 139,290 probes from 1,169 addresses, 53% of all.

Most of them come and go. 4,083 addresses (79.8%) probed on one day only, and 2,229 sent one probe in all 26 days. A median day brought 306 probing addresses, and a median of 183 a day were new.

Who they are

The address answersAddressesShare of probes
is_hosting, confidence high2,815 (55.0%)52.6%
is_hosting, confidence medium510 (10.0%)42.7%
is_hosting3,325 (65.0%)95.3%
is_resproxy1,789 (35.0%)6.5%
is_vpn675 (13.2%)6.2%
is_cdn539 (10.5%)0.8%
is_mobproxy93 (1.8%)0.4%
is_pubproxy38 (0.7%)0.1%
is_relay29 (0.6%)0.1%
is_tor22 (0.4%)under 0.1%
Any flag4,724 (92.3%)97.1%
No flag392 (7.7%)2.9%

An address can answer several flags. "Any flag" is any of the API's is_* answers, and the share of probes is the share of all 261,754 that came from those addresses.

Servers send the volume. The busiest address sent 20,122 probes over 21 days, and the 50 busiest sent 46.5% of all probes; all 50 answered is_hosting. Of the hosting providers we name, Google Cloud's addresses sent the most probes, 68,315, and DigitalOcean had the most addresses, 418.

Residential proxies send a long tail of single probes. 855 probers (16.7%) answered is_resproxy and no hosting flag, 841 of them on ISP networks. Together they sent 1.0% of the probes, a median of one each, and 708 of them sent exactly one. A hosting rule can't see them (residential proxy detection).

Cloudflare's addresses answer is_cdn, and 525 of the 539 here answered no hosting flag. None of our sites is behind Cloudflare, so those requests came from Cloudflare's own addresses, not from visitors it relayed. A hosting rule misses them.

619 of the 675 VPN addresses answered is_hosting too: commercial VPN servers sit in datacenters, and a hosting rule already covers them (what a network list misses).

What each defense stops

We replayed the 26 days against each defense, as if it ran on every probe path. Each flag is the address's answer on November 15.

DefenseShare of probes stopped
Ban yesterday's probing addresses30.8%
Ban every address that probed on an earlier day48.0%
fail2ban's defaults: 5 failures in 10 minutes, a 10-minute ban88.3%
Block is_hosting95.3%
is_hosting, then fail2ban on the rest98.0%

A ban list catches the busy servers that come back and misses the new addresses, a median of 183 a day; neither list stops anything on the first day. fail2ban, with a jail that counts these 404s, stops the busy servers after their fifth probe, and again each time a ban runs out. It never banned 3,846 of the 5,116 addresses (75.2%), since they never sent 5 probes in 10 minutes. A hosting rule stops a server on its first request.

First, have nothing to find

A probe for /.env costs you nothing when the answer is a 404. The cost comes the day a deploy copies .env into the web root, or a checkout serves its .git directory. A web server rule that refuses every path with a part starting with a dot, /.well-known/ aside, closes that whatever the app does. In nginx, in front of the app below:

nginx
location ~ /\.(?!well-known/) {
    return 404;
}

location / {
    proxy_pass http://127.0.0.1:3000;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

With nginx 1.29.1, /.env, /.git/config and /static/.env got nginx's own 404, and /.well-known/security.txt reached the app. Put the rule above your other regex locations, since nginx takes the first regex that matches, and a ^~ prefix location skips regexes altogether.

A rule for the routes that exist

Probes for files you don't have need no lookup. A lookup earns its cost on routes that exist and that no one should reach from a server, such as an admin panel. In Express, with our Express middleware and a paid plan's key, since is_hosting, is_cdn and the proxy flags come with one (pricing):

bash
npm install express vpndetection-express
npm pkg set type=module
VPNDETECTION_API_KEY=<your key> node app.js
js
// app.js
import express from 'express';
import { vpndetection } from 'vpndetection-express';

const app = express();
app.set('trust proxy', 'loopback');

// Paths this site never serves: a 404 before any route runs or any lookup.
const PROBES = /\/\.(?!well-known\/)|\.php$|^\/(wp-|cgi-bin\/|actuator)/i;
app.use((req, res, next) => (PROBES.test(req.path) ? res.sendStatus(404) : next()));

app.get('/', (req, res) => res.send('Home\n'));

// Staff reach /admin from offices and homes, not from servers or proxy exits.
const screen = vpndetection({ apiKey: process.env.VPNDETECTION_API_KEY });

function staffOnly(req, res, next) {
    const r = req.vpndetection.result;
    if (r === undefined) return next(); // no answer: the sign-in still guards it
    // A private address means the proxy didn't pass the visitor's: refuse.
    if (r.isBogon) return res.status(403).send('Forbidden\n');
    // VPN servers and relay exits answer is_hosting or is_resproxy too.
    if (r.isVpn || r.isRelay) return next();
    if (r.isHosting || r.isCdn || r.isTor || r.isResproxy || r.isDcproxy ||
        r.isMobproxy || r.isPubproxy) {
        return res.status(403).send('Forbidden\n');
    }
    next();
}

app.use('/admin', screen, staffOnly, (req, res) => res.send('Admin sign-in\n'));

app.listen(3000, '127.0.0.1');

PROBES is the nginx rule plus the PHP, WordPress, router and Spring Boot paths, for a site with none of them, so the probes cost no lookups.

staffOnly lets VPN and relay users through to the sign-in. Its flags cover the senders of 90.9% of the probes, and of 97.0% without that line; our login rule gives them a second step instead. A phone on mobile data can answer is_resproxy or is_mobproxy too, since a carrier shares its addresses (mobile proxies), so staff who sign in from a phone may need that second step rather than a 403.

isBogon is how the rule notices a proxy that isn't passing the visitor's address: every request then comes from 127.0.0.1, which would otherwise answer every flag false and get in. Behind Cloudflare or a load balancer, the client address comes from elsewhere (our Express post covers both), or every visitor is a Cloudflare address and gets the 403.

Keep a rule like this off your public pages, or let verified crawlers past it first, since Googlebot comes from Google's servers (how to let them through). A paid key also checks a request's user agent against the crawler it names (the docs' guide).

We ran it on December 2, 2026, on Node.js 22.22 with Express 5.3.0, vpndetection-express 3.0.0 and that key, and sent each visitor as nginx on the same machine would:

bash
curl -s -o /dev/null -w '%{http_code}\n' 127.0.0.1:3000/admin \
    -H 'X-Forwarded-For: 34.27.0.10'
403
VisitorGET /admin
Home broadband, US cable ISP200
34.27.0.10, Google Cloud403
173.245.48.10, Cloudflare403
A residential proxy exit403
190.120.229.98, a Tor exit403
23.165.56.3, a Mullvad server200
104.28.209.115, a Cloudflare WARP exit200
172.224.226.10, an iCloud Private Relay exit200

The Google Cloud address is from Google's published ranges (us-central1), the Cloudflare one from Cloudflare's, the Mullvad server from Mullvad's list, the Tor exit from the Tor Project's and the Private Relay exit from Apple's; the WARP exit is from our WARP post. /.env, /.git/config, /static/.env, /wp-login.php, /xmlrpc.php, /cgi-bin/luci and /actuator/env each got a 404 from every visitor, and /admin with no X-Forwarded-For got the 403.

With no key, the Tor exit got the 403 and every other visitor the sign-in: is_tor comes back without one, and is_hosting, is_cdn and the proxy flags are undefined, "not in your plan", which this rule reads as "no". With a wrong key every visitor got the sign-in.

What an IP check can't see

392 probing addresses (7.7%) answered no flag, 220 of them on ISP networks and 160 on business ones, and sent 2.9% of the probes. A lookup also says nothing about a key that leaked some other way: a .env pushed to a public repository is found without a single request to your site. A key that was served once is a key to rotate.

How we measured

Every request to our public web servers from October 20 to November 14, 2026, IPv4 only, with our own servers' and tools' traffic left out. A path counted as a probe when it matched one of the five groups above, in any letter case; the table shows examples, and each group holds a few more of the same kind (/.svn/, /adminer, /goform/). We looked up each probing address once on November 15, through the API's batch endpoint, so each flag is what a check answers today, which can differ from what it would have answered on the day of the probe. The ban lists and fail2ban were replayed on each probe's timestamp.

Every flag is in the API docs.

Written by

  • Uman Shahzad

    Founder & CEO

    Uman has worked on IP data for over eight years, including as lead engineer at IPinfo. He built systems and practices that IP data companies now use to run at scale and keep their data accurate.

Get new posts by email

Or follow along in a feed reader.

RSS feed

Try it on your own traffic.

The detection these posts describe is one API call away, with SDKs for every major language.

00 · Try it

Free lookups, no sign-up.

Paste it into a terminal. Any address answers its VPN, Tor, relay and anycast flags, where it is, which network announces it and its hostname.

curl "https://api.vpndetection.io/146.70.116.130"
{
"ip": "146.70.116.130",
"is_bogon": false,
"is_vpn": true,
"is_relay": false,
"is_tor": false,
"is_anycast": false,
"relay": {},
"tor": {},
"location": {
"continent": "EU",
"continent_name": "Europe",
"country": "AT",
"country_name": "Austria",
"timezone": "Europe/Vienna",
"currency_code": "EUR",
"currency_name": "Euro",
"currency_symbol": "€",
"flag_emoji": "🇦🇹",
"flag_unicode": "U+1F1E6 U+1F1F9"
},
"asn": {
"asn": 9009,
"name": "M247 Europe SRL",
"domain": "m247global.com",
"prefix": "146.70.116.0/24",
"country": "RO",
"rpki_status": "not_found"
},
"hostname": ""
}
01 · Sign up

Detect VPNs with a free key.

A quota of 50,000 lookups a month with the VPN flag, Tor, relay, country and ASN.
Past it, lookups answer the basics until it resets.
No card and no sales call: the key is issued on signup.
The Data plan answers every field on every lookup.