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
- Requirements: ADB, Python 3, USB/Wireless debugging. App must be debuggable (emulator with `ro.debuggable=1`, rooted device with `resetprop`, or rebuild manifest).
Run the script with `frida -U -f <package> -l disable-flag-secure.js --no-pause`, interact with the UI, and screenshots/recordings will work again. Because everything happens on the UI thread there is no flicker, and you can still combine the hook with HTTP Toolkit/Burp to capture the traffic that revealed the `/channel` PIN leak.
287
287
288
+
## Dynamic DEX dumping / unpacking with clsdumper (Frida)
289
+
290
+
`clsdumper` is a Frida-based dynamic **DEX/class dumper** that survives hardened apps by combining an anti-Frida pre-stage with native and Java discovery strategies (works even if `Java.perform()` dies). Requirements: Python 3.10+, rooted device with `frida-server` running, USB or `--host` TCP connection.
Tip: protected apps often load code from several sources (in-memory payload, vdex/oat, custom loaders). Running with the default multi-strategy set plus `--spawn` maximizes coverage; enable `--deep-scan` only when needed to avoid performance hits.
- Get the domain SID bytes with `SELECT SUSER_SID('DOMAIN\\Domain Users');` (RID = last 4 bytes, little endian). Map/brute RIDs with `nxc mssql ... --rid-brute` to find a group granting sysadmin (e.g., RID `1105`).
399
+
- Forge a silver ticket for the MSSQL SPN with the privileged group RID injected in the PAC:
- Enable `xp_cmdshell` if needed; commands run as the SQL Server service account even when impersonating via the forged ticket.
407
+
387
408
### Abusing MSSQL trusted Links
388
409
389
410
[**Read this post**](../../windows-hardening/active-directory-methodology/abusing-ad-mssql.md) **to find more information about how to abuse this feature:**
@@ -710,6 +731,7 @@ You probably will be able to **escalate to Administrator** following one of thes
710
731
## References
711
732
712
733
- [Unit 42 – Phantom Taurus: WMI-driven direct SQL collection via batch/sqlcmd](https://unit42.paloaltonetworks.com/phantom-taurus/)
734
+
- [HTB: Signed - MSSQL coercion to silver ticket sysadmin](https://0xdf.gitlab.io/2026/02/07/htb-signed.html)
You can also use the [**Burp Extension SignSaboteur**](https://github.com/d0ge/sign-saboteur) to launch JWT attacks from Burp.
29
29
30
+
### Practical JWT assessment workflow
31
+
32
+
-**Scope the session control**: Pick a user-specific request (e.g., profile, billing). Remove cookies/headers one at a time until the request is rejected to isolate which token(s) actually gate authorization.
33
+
-**Locate JWTs in traffic**: They often sit in `Authorization: Bearer <JWT>`, but also appear in custom headers or cookies. If Burp doesn’t highlight them, use Target → Site map → Engagement tools → Search with regex patterns such as:
-**Decode and enumerate**: Use Burp **JWT Editor** or `python3 jwt_tool.py <JWT>` to read header/payload. Note `alg`, `exp`/token lifetime, and authn/authz-driving claims (`role`, `id`, `username`, `email`, etc.).
38
+
-**Signature enforcement sanity check**: Flip or delete a few bytes in the signature portion and replay. Acceptance implies missing signature validation and you can directly tamper payload claims.
39
+
-**Goal**: Modify payload claims to escalate privileges; every attack below aims to get the server to accept a tampered payload by abusing weak verification, weak secrets, or unsafe key selection.
40
+
30
41
### Tamper data without modifying anything
31
42
32
43
You can just tamper with the data leaving the signature as is and check if the server is checking the signature. Try to change your username to "admin" for example.
@@ -54,6 +65,15 @@ Check if the token lasts more than 24h... maybe it never expires. If there is a
54
65
55
66
[**See this page.**](../generic-hacking/brute-force.md#jwt)
56
67
68
+
If the header uses **HS256**, dump the token to a file and try offline cracking:
69
+
70
+
```bash
71
+
python3 jwt_tool.py <JWT> -C -d wordlist.txt
72
+
hashcat -a 0 -m 16500 jwt.txt /path/to/wordlist.txt -r /usr/share/hashcat/rules/best64.rule
73
+
```
74
+
75
+
Once the secret is recovered, load it as a symmetric key in Burp JWT Editor and re-sign modified claims.
76
+
57
77
### Derive JWT secrets from leaked config + DB data
58
78
59
79
If an arbitrary file read (or backup leak) exposes both **application encryption material** and **user records**, you can sometimes recreate the JWT signing secret and forge session cookies without knowing any plaintext passwords. Example pattern observed in workflow automation stacks:
Using Burp **JWT Editor**, import the RSA public key (from `/.well-known/jwks.json` or a PEM) and run **Attack → HMAC Key Confusion Attack** to automate the HS256 re-sign attempt.
114
+
93
115
### New public key inside the header
94
116
95
117
An attacker embeds a new key in the header of the token and the server uses this new key to verify the signature (CVE-2018-0114).
By targeting files with predictable content, it's possible to forge a valid JWT. For instance, the `/proc/sys/kernel/randomize_va_space` file in Linux systems, known to contain the value **2**, can be used in the `kid` parameter with **2** as the symmetric password for JWT generation.
135
157
158
+
A practical pattern for brittle file-system key loading is to generate an HS256 key with JWK `k`set to `AA==`, set`kid` to a traversal like `../../../../../../../dev/null`, and re-sign—some implementations treat the empty file as a valid HMAC secret and will accept forged tokens.
159
+
136
160
#### SQL Injection via "kid"
137
161
138
162
If the `kid` claim's content is employed to fetch a password from a database, an SQL injection could be facilitated by modifying the `kid` payload. An example payload that uses SQL injection to alter the JWT signing process includes:
@@ -175,6 +199,8 @@ print("n:", hex(key.n))
175
199
print("e:", hex(key.e))
176
200
```
177
201
202
+
If the verifier fetches key material remotely, embed a Burp Collaborator URL in `jku`/`x5u` using **JWT Editor → Attack → Embed Collaborator payload**. Any callback confirms SSRF-style key retrieval; then host your own JWKS/PEM at that URL and re-sign with your private key so the service validates attacker-minted tokens.
203
+
178
204
#### x5u
179
205
180
206
X.509 URL. A URI pointing to a set of X.509 (a certificate format standard) public certificates encoded in PEM form. The first certificate in the set must be the one used to sign this JWT. The subsequent certificates each sign the previous one, thus completing the certificate chain. X.509 is defined in RFC 52807 . Transport security is required to transfer the certificates.
@@ -281,6 +307,10 @@ The token's expiry is checked using the "exp" Payload claim. Given that JWTs are
Copy file name to clipboardExpand all lines: src/pentesting-web/xss-cross-site-scripting/README.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1673,6 +1673,29 @@ When a backend **builds a shared SDK by concatenating JS strings with user-contr
1673
1673
- Example pattern (Meta CAPIG): server appends `cbq.config.set("<pixel>","IWLParameters",{params: <user JSON>});` directly into `capig-events.js`.
1674
1674
- Injecting `'` or `"]}` closes the literal/object and adds attacker JS, creating **stored XSS**in the distributed SDKfor every site that loads it (first-party and third-party).
1675
1675
1676
+
### Stored XSSin generated reports when escaping is disabled
1677
+
1678
+
If uploaded files are parsed and their metadata is printed into HTML reports with escaping disabled (`|safe`, custom renderers), that metadata is a **stored XSS sink**. Example flow:
Rendered with`|safe`, the report outputs `<img ...>` and fires JS on view.
1696
+
1697
+
**Hunting:** look for report/notification builders that reuse parsed fields in`%s`/f-strings and disable auto-escape. One encoded tag in an uploaded manifest/log/archive persists XSSfor every viewer.
1698
+
1676
1699
### Abusing Service Workers
1677
1700
1678
1701
@@ -2036,5 +2059,6 @@ other-js-tricks.md
2036
2059
- [From "Low-Impact"RXSS to Credential Stealer:AJS-in-JS Walkthrough](https://r3verii.github.io/bugbounty/2025/08/25/rxss-credential-stealer.html)
0 commit comments