Global SOC / Blog
DNS Audit

THREAT RESEARCH & LABS · Yogesh · 3 November 2026

A Third of All Attacks Needed No Exploit: Detecting .env, .git and Secret-File Hunting

3,307 requests to my honeypot were plain GETs for files that hold credentials: .env, .git/config, AWS keys, database dumps. I walk through the wordlists and the AndroxGh0st follow-up, map them to the kill chain and ATT&CK, and give the Splunk and Sentinel detections, including the cloud-side rules that catch a leaked key being used.

Part of my honeypot detection series. Org A runs Splunk with CrowdStrike Falcon. Its Falcon queries use Event Search field names; on raw FDR data, apply the normalisation macro first. Org B runs Microsoft Sentinel with Defender for Endpoint. Both also run workloads in AWS. The web-layer KQL ran against the honeypot's real logs. The cloud and EDR queries are written from AndroxGh0st's published behaviour, so adapt the field names to your environment.

1. What Hit the Server

The biggest single category of attack traffic on my honeypot didn't use a vulnerability at all. 114 IPs sent 3,307 requests for 884 different paths. Every one of them was a file that would hand over credentials if it existed:

.env files2,000 .git repository359 Other config files347 Database dumps and backups165 Docker, Kubernetes, CI files110 Cloud credentials (.aws, credentials)107 wp-config.php copies90 phpinfo / server-status84 .svn / .hg29 SSH and TLS private keys16

That's one external request in three. Nothing leaked, because the honeypot's web root holds one file. But the path list is a good map of how developers actually leak secrets. Every path is on it because it has worked somewhere.

/.env alone was asked for 318 times, plus 479 variations. The variations are the clever part: .env.bak, .env.save, .env~, .env.old. A site can block /.env correctly and still serve the copy that nano left beside it. The scanners ask for the copy too.

2. The Attack, Step by Step

Recon Step 1: Calibrate, then run the wordlist

The most complete run came from 213.209.159[.]175: 327 requests in about two minutes, using a Firefox 0.8 on Windows 2000 User-Agent. Its first requests show how a good scanner works:

22:31:21  GET /site.zip HTTP/1.1  -> 404
22:31:22  GET / HTTP/1.1  -> 200
22:31:22  GET /tqzjwpy3sm89ne HTTP/1.1  -> 404
22:31:23  GET /.env HTTP/1.1  -> 404
22:31:24  GET /../.env HTTP/1.1  -> 400
22:31:24  GET /settings.json HTTP/1.1  -> 404
22:31:25  GET /assets/.env HTTP/1.1  -> 404
22:31:25  GET /assets/config.json HTTP/1.1  -> 404
22:31:25  GET /api/.env HTTP/1.1  -> 404
22:31:26  GET /backend/.env HTTP/1.1  -> 404
22:31:26  GET /sendgrid.env HTTP/1.1  -> 404
22:31:27  GET /admin/.env HTTP/1.1  -> 404
22:31:27  GET /server/.env HTTP/1.1  -> 404
22:31:27  GET /laravel/.env HTTP/1.1  -> 404
22:31:28  GET /phpinfo/ HTTP/1.1  -> 404
22:31:28  GET /.env.example HTTP/1.1  -> 404
22:31:29  GET /phpinfo.php HTTP/1.1  -> 404
22:31:29  GET /?phpinfo=-1 HTTP/1.1  -> 200
22:31:29  GET /core/.env HTTP/1.1  -> 404
22:31:30  GET /wp-config.php HTTP/1.1  -> 404
22:31:30  GET /app/.env HTTP/1.1  -> 404
22:31:30  GET /app_dev.php/_profiler/open?file=app/config/parameters.yml HTTP/1.1  -> 404
22:31:31  GET /claude.env HTTP/1.1  -> 404
22:31:31  GET /.claude/.env HTTP/1.1  -> 404
22:31:32  GET /bedrock.env HTTP/1.1  -> 404
22:31:32  GET /.bedrock/.env HTTP/1.1  -> 404
22:31:33  GET /aws.env HTTP/1.1  -> 404
22:31:33  GET /.aws/.env HTTP/1.1  -> 404
22:31:33  GET /.env.save HTTP/1.1  -> 404
22:31:34  GET /?url=.env HTTP/1.1  -> 200

/tqzjwpy3sm89ne is a calibration request. A random path that can't exist shows the scanner what "not found" looks like on this server, so a site that answers 200 to everything doesn't flood it with false hits. Then it walks the list: .env in every likely directory, cloud key files, .git/config, backups, CI files (T1595.003 Wordlist Scanning).

Credential Access Step 2: Read the file

If any path returns the real file, that's the whole attack: T1552.001 Credentials in Files. A .env typically holds the database password, SMTP login, payment keys, cloud keys and the framework's signing key. An exposed .git/ lets the attacker rebuild the whole repository, including every secret that was ever committed and later "removed" (T1213 Data from Information Repositories).

Credential Access Step 3: AndroxGh0st's debug-page trick

255 requests weren't GETs. Seven IPs, almost all in 78.153.140[.]0/24, sent this pair, always within a second:

2026-10-24 00:58:32 UTC  78.153.140[.]149 (United Kingdom)  status 404  request 242 bytes  response 485 bytes
GET /.env HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.140 Safari/537.36

2026-10-24 00:58:33 UTC  78.153.140[.]149 (United Kingdom)  status 200  request 328 bytes  response 1941 bytes
POST / HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.140 Safari/537.36
Content-Type: application/x-www-form-urlencoded

0x%5B%5D=androxgh0st

The POST body URL-decodes to 0x[]=androxgh0st. That's the published signature of AndroxGh0st (CISA/FBI advisory AA24-016A). If /.env isn't served, the tool POSTs junk to a Laravel app. With APP_DEBUG=true, Laravel answers with its debug page, and that page prints every environment variable. The legion marker in two of the bodies is a related harvester using the same trick.

78.153.140[.]149 sent the same pair on ten different days. My server is on its list, and the list gets replayed on a schedule whether or not anything was found last time.

Actions on Objectives Step 4: Use the keys

This is where most organisations would actually see it. With a leaked AWS key, AndroxGh0st checks the SES sending quota (GetSendQuota) to see whether the account can send spam. Then it creates a new IAM user, attaches an admin policy and gives it a console password (T1078.004 Cloud Accounts, T1136.003 Create Cloud Account, T1098). With a leaked Laravel APP_KEY, it can forge an encrypted cookie for remote code execution (CVE-2018-15133, T1190). SMTP and SendGrid/Twilio keys go straight to spam campaigns.

3. Pyramid of Pain

LevelIndicatorWhat I'd do with it
IP addresses114 sources; 78.153.140[.]0/24 for AndroxGh0stBlocking the /24 is reasonable, but it won't last. The wordlist runners never came back.
Network artefactsPOST body 0x[]=androxgh0st; User-Agents like l9explore or a 2004 FirefoxA free alert if you log POST bodies (most don't). User-Agents are trivial to change, and most of these sources sent normal browser strings.
ToolsThe wordlist: hundreds of secret paths in minutes, with a calibration request; GET /.env followed by POST / within secondsDetect the shape. It doesn't matter which wordlist they use, only that they asked for many secret paths at once.
TTPsA secret file actually served (T1552.001); a leaked key used from a new IP to check SES quota or create IAM usersThese are the alerts that matter, because they mean you lost something. They don't depend on the tool, the IP or the wordlist.

4. Web-Layer Detections

For Org B I've parsed the honeypot's nginx log into a WebAccess function. For Org A I've used the CIM Web data model.

let WebAccess = Syslog
| where SyslogMessage startswith "php_http: "
| extend j = parse_json(substring(SyslogMessage, 10))
| project TimeGenerated, DestHost = Computer, SrcIp = tostring(j.client), Method = tostring(j.method), Request = tostring(j.request),
          Url = tostring(j.uri), Status = toint(j.status), BytesOut = toint(j.bytes_out),
          UserAgent = tostring(j.user_agent), ContentType = tostring(j.content_type), Body = tostring(j.body);

W1. Secret-file wordlist (T1595.003)

Org B Tested: 61 ten-minute windows from 28 sources. The busiest asked for 232 distinct secret paths in ten minutes.

let SecretPath = @"(?i)(/\.env|\.git/|/\.aws/|credentials|/\.ssh/|id_rsa|wp-config\.(php\.|bak|old|txt|zip|gz|swp|orig|save|dist)|\.sql$|\.sql\.gz|backup\.(zip|tar|tgz)|docker-compose|\.kube/config|\.npmrc|sftp(-config)?\.json|terraform\.tfstate|actuator/env|phpinfo|server-status|\.htpasswd)";
WebAccess
| where Url matches regex SecretPath
| summarize SecretPaths = dcount(Url), Requests = count(), Start = min(TimeGenerated), End = max(TimeGenerated)
          by SrcIp, UserAgent, Window = bin(TimeGenerated, 10m)
| where SecretPaths >= 10

Org A

| tstats count from datamodel=Web by _time span=10m Web.src Web.dest Web.url Web.http_user_agent
| rename Web.* as *
| regex url="(?i)(/\.env|\.git/|/\.aws/|credentials|/\.ssh/|id_rsa|wp-config\.(php\.|bak|old|txt|zip|gz|swp|orig|save|dist)|\.sql$|\.sql\.gz|backup\.(zip|tar|tgz)|docker-compose|\.kube/config|\.npmrc|sftp(-config)?\.json|terraform\.tfstate|actuator/env|phpinfo|server-status|\.htpasswd)"
| stats dc(url) as secret_paths sum(count) as requests by _time src dest http_user_agent
| where secret_paths >= 10

It's informational on its own, because every public server sees this daily. Use it to enrich W2, and to spot an internal IP doing it, which would mean a compromised host or a pentester you didn't know about.

W2. A secret file was actually served (T1552.001): the one that matters

Org B Tested: 0 results, correctly. Sixteen secret-path requests got a 200, but every response was exactly the size of the home page, because they were query strings or PATH_INFO the page ignored.

let SecretPath = @"(?i)(/\.env|\.git/|/\.aws/|credentials|/\.ssh/|id_rsa|wp-config\.(php\.|bak|old|txt|zip|gz|swp|orig|save|dist)|\.sql$|\.sql\.gz|backup\.(zip|tar|tgz)|docker-compose|\.kube/config|\.npmrc|sftp(-config)?\.json|terraform\.tfstate|actuator/env|phpinfo|server-status|\.htpasswd)";
let HomeSizes = WebAccess
| where Url == "/" and Status == 200
| summarize by DestHost, BytesOut;
WebAccess
| where Url matches regex SecretPath and Status == 200
| join kind=leftanti HomeSizes on DestHost, BytesOut
| project TimeGenerated, DestHost, SrcIp, Url, Status, BytesOut, UserAgent

Org A

| tstats count from datamodel=Web where Web.status=200 by Web.dest Web.src Web.url Web.bytes_out
| rename Web.* as *
| regex url="(?i)(/\.env|\.git/|/\.aws/|credentials|/\.ssh/|id_rsa|wp-config\.(php\.|bak|old|txt|zip|gz|swp|orig|save|dist)|\.sql$|\.sql\.gz|backup\.(zip|tar|tgz)|docker-compose|\.kube/config|\.npmrc|sftp(-config)?\.json|terraform\.tfstate|actuator/env|phpinfo|server-status|\.htpasswd)"
| join type=left dest
    [| tstats values(Web.bytes_out) as home_sizes from datamodel=Web where Web.url="/" Web.status=200 by Web.dest
     | rename Web.dest as dest ]
| where isnull(mvfind(home_sizes, "^".bytes_out."$"))
| table dest src url bytes_out count

This is why I don't trust a bare "status 200" alert. It would have fired 16 times here, all false. Comparing the response size with the home page removes them. Anything left is a real file being served. High severity: rotate whatever was in it, now.

W3. GET /.env then POST / (AndroxGh0st and friends)

Org B Tested: 258 pairs from 9 sources. Three body markers: androxgh0st, legion, and a third body neither string matched. That third one is why this rule keys on the sequence, not the string.

let EnvGets = WebAccess
| where Method == "GET" and Url endswith "/.env"
| project EnvTime = TimeGenerated, SrcIp;
WebAccess
| where Method == "POST" and Url == "/"
| join kind=inner EnvGets on SrcIp
| where TimeGenerated between (EnvTime .. EnvTime + 10s)
| extend BodyMarker = case(Body has "androxgh0st", "androxgh0st", Body has "legion", "legion", "other")
| summarize Pairs = count(), Days = dcount(bin(TimeGenerated, 1d)) by SrcIp, BodyMarker

Org A

| tstats count from datamodel=Web
    where (Web.http_method="GET" Web.url="*/.env") OR (Web.http_method="POST" Web.url="/")
    by _time span=1s Web.src Web.dest Web.http_method
| rename Web.* as *
| sort 0 src _time
| streamstats current=f last(http_method) as prev_method last(_time) as prev_time by src dest
| where http_method="POST" AND prev_method="GET" AND _time - prev_time <= 10
| stats count as pairs dc(eval(strftime(_time,"%F"))) as days by src dest

Medium severity. Check the POST response size. If it's much bigger than your normal error page, you're probably serving a debug page, and that's a leak.

5. Cloud and Endpoint Detections

If a secret did leak, you won't see it used on the web server. You'll see it used in your cloud account, from someone else's IP. Org A ingests CloudTrail through the Splunk Add-on for AWS. Org B uses the Sentinel AWS connector (AWSCloudTrail).

C1. AndroxGh0st's cloud playbook (T1078.004, T1136.003)

Org B

AWSCloudTrail
| where TimeGenerated > ago(7d)
| where EventName in ("GetSendQuota", "ListIdentities", "CreateUser", "CreateLoginProfile",
                      "AttachUserPolicy", "CreateAccessKey", "RunInstances", "GetCallerIdentity")
| where UserIdentityType == "IAMUser" and isnotempty(UserIdentityAccessKeyId)
| summarize Calls = make_set(EventName), Regions = make_set(AWSRegion), SourceIps = make_set(SourceIpAddress)
          by UserIdentityAccessKeyId, UserIdentityUserName, bin(TimeGenerated, 1h)
| where Calls has "GetSendQuota" or (Calls has "CreateUser" and Calls has_any ("AttachUserPolicy", "CreateLoginProfile"))

Org A

index=aws sourcetype=aws:cloudtrail
    eventName IN ("GetSendQuota","ListIdentities","CreateUser","CreateLoginProfile",
                  "AttachUserPolicy","CreateAccessKey","RunInstances","GetCallerIdentity")
    userIdentity.type=IAMUser
| bin _time span=1h
| stats values(eventName) as calls values(awsRegion) as regions values(sourceIPAddress) as source_ips
        by _time userIdentity.accessKeyId userIdentity.userName
| where mvfind(calls, "GetSendQuota") >= 0
    OR (mvfind(calls, "CreateUser") >= 0 AND (mvfind(calls, "AttachUserPolicy") >= 0 OR mvfind(calls, "CreateLoginProfile") >= 0))

An IAM user key, as opposed to a role, calling GetSendQuota or creating a user and attaching a policy within the hour is the classic sequence. Applications rarely do either. High severity.

C2. A known key used from a new IP

Org B

let Known = AWSCloudTrail
| where TimeGenerated between (ago(30d) .. ago(1d))
| summarize by UserIdentityAccessKeyId, SourceIpAddress;
AWSCloudTrail
| where TimeGenerated > ago(1d)
| where UserIdentityType == "IAMUser" and isnotempty(UserIdentityAccessKeyId)
| join kind=leftanti Known on UserIdentityAccessKeyId, SourceIpAddress
| summarize FirstCall = min(TimeGenerated), Calls = make_set(EventName, 20) by UserIdentityAccessKeyId, UserIdentityUserName, SourceIpAddress

Org A

index=aws sourcetype=aws:cloudtrail userIdentity.type=IAMUser earliest=-30d
| eval recent=if(_time >= relative_time(now(), "-1d"), 1, 0)
| stats max(recent) as seen_recently min(_time) as first_seen values(eventName) as calls
        by userIdentity.accessKeyId userIdentity.userName sourceIPAddress
| where seen_recently=1 AND first_seen >= relative_time(now(), "-1d")

Long-lived access keys in .env files are usually used from a fixed set of servers. A first call from a new IP is worth a look, especially from a residential proxy or a hosting provider you don't use. Medium severity, raised to high if it pairs with C1.

E1. Laravel RCE after a leaked APP_KEY (T1190, T1059.004)

If the APP_KEY leaked, the next step is a forged cookie that makes PHP run a command. That looks the same as every other web RCE, so the web-server-spawns-a-shell rule from the RedTail post covers it:

Org A

index=crowdstrike event_platform=Lin event_simpleName=ProcessRollup2
    (ParentBaseFileName IN ("php","php-fpm*","apache2","httpd") OR GrandParentBaseFileName IN ("php","php-fpm*","apache2","httpd"))
    FileName IN ("sh","bash","dash","curl","wget","python*","perl")
| table _time ComputerName UserName ParentBaseFileName FileName CommandLine

Org B

DeviceProcessEvents
| where Timestamp > ago(7d)
| where InitiatingProcessFileName in~ ("php","php-fpm","apache2","httpd")
     or InitiatingProcessParentFileName in~ ("php","php-fpm","apache2","httpd")
| where FileName in~ ("sh","bash","dash","curl","wget","python3","perl")
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, FileName, ProcessCommandLine

6. When It Fires

  1. W1 or W3 only: recon. Run the W2 query for the same source to confirm nothing was served, then close it.
  2. W2 fired: a real file left your server. Open it yourself and list every credential in it. Rotate them all, starting with cloud keys and database passwords. Block the path at the web server.
  3. C1 or C2 fired: the key is in use. Disable the access key straight away, rather than deleting it, so the evidence is kept. Then look for anything it created: new IAM users and keys, login profiles, EC2 instances in unusual regions, SES identities. Org A and Org B do the same here, just through different SIEMs.
  4. E1 fired: treat the server as compromised. Org A Network-contain it in Falcon. Org B Isolate it in Defender. Then rotate APP_KEY, which also invalidates every forged cookie.
  5. Find the root cause. Work out how the file ended up in the web root: a deploy that copied the whole project directory, an editor backup, or a debug flag left on.

7. Hardening

8. IOCs

TypeValue
AndroxGh0st sources78.153.140[.]0/24 (.149 alone on 10 days)
POST bodies0x%5B%5D=androxgh0st, 0x01%5B%5D=legion
Busiest wordlist runs45.138.12[.]16, 45.138.12[.]51 (l9explore), 213.209.159[.]175, 137.23.38[.]53