rtexit-method 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -7
- package/packaged-assets/.agents/skills/rt-active-recon/SKILL.md +767 -0
- package/packaged-assets/.agents/skills/rt-active-recon/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-agent-breaker/SKILL.md +65 -0
- package/packaged-assets/.agents/skills/rt-agent-breaker/customize.toml +76 -0
- package/packaged-assets/.agents/skills/rt-agent-commander/SKILL.md +63 -0
- package/packaged-assets/.agents/skills/rt-agent-commander/customize.toml +67 -0
- package/packaged-assets/.agents/skills/rt-agent-ghost/SKILL.md +65 -0
- package/packaged-assets/.agents/skills/rt-agent-ghost/customize.toml +77 -0
- package/packaged-assets/.agents/skills/rt-agent-navigator/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-agent-navigator/customize.toml +61 -0
- package/packaged-assets/.agents/skills/rt-agent-phantom/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-agent-phantom/customize.toml +62 -0
- package/packaged-assets/.agents/skills/rt-agent-scout/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-agent-scout/customize.toml +61 -0
- package/packaged-assets/.agents/skills/rt-agent-scribe/SKILL.md +65 -0
- package/packaged-assets/.agents/skills/rt-agent-scribe/customize.toml +77 -0
- package/packaged-assets/.agents/skills/rt-attack-chain-builder/SKILL.md +476 -0
- package/packaged-assets/.agents/skills/rt-attack-chain-builder/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-attack-surface-map/SKILL.md +1209 -0
- package/packaged-assets/.agents/skills/rt-attack-surface-map/template.md +62 -0
- package/packaged-assets/.agents/skills/rt-autodoc/SKILL.md +258 -0
- package/packaged-assets/.agents/skills/rt-c2-operations/SKILL.md +1072 -0
- package/packaged-assets/.agents/skills/rt-c2-operations/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-compliance-mapper/SKILL.md +773 -0
- package/packaged-assets/.agents/skills/rt-create-sead/SKILL.md +74 -0
- package/packaged-assets/.agents/skills/rt-create-sead/template.md +89 -0
- package/packaged-assets/.agents/skills/rt-create-sead/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-credential-access/SKILL.md +756 -0
- package/packaged-assets/.agents/skills/rt-credential-hunt/SKILL.md +856 -0
- package/packaged-assets/.agents/skills/rt-credential-hunt/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-cvss-calculator/SKILL.md +542 -0
- package/packaged-assets/.agents/skills/rt-cvss-calculator/cvss4-matrix.csv +20 -0
- package/packaged-assets/.agents/skills/rt-data-exfiltration/SKILL.md +784 -0
- package/packaged-assets/.agents/skills/rt-defense-evasion/SKILL.md +987 -0
- package/packaged-assets/.agents/skills/rt-evidence-chain/SKILL.md +712 -0
- package/packaged-assets/.agents/skills/rt-evidence-chain/template.md +31 -0
- package/packaged-assets/.agents/skills/rt-executive-report/SKILL.md +718 -0
- package/packaged-assets/.agents/skills/rt-executive-report/template.md +38 -0
- package/packaged-assets/.agents/skills/rt-executive-report/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-active-directory/SKILL.md +1078 -0
- package/packaged-assets/.agents/skills/rt-exploit-active-directory/ad-checklist.csv +12 -0
- package/packaged-assets/.agents/skills/rt-exploit-active-directory/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-android/SKILL.md +1329 -0
- package/packaged-assets/.agents/skills/rt-exploit-android/masvs-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-exploit-android/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-api/SKILL.md +1547 -0
- package/packaged-assets/.agents/skills/rt-exploit-api/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-auth/SKILL.md +1949 -0
- package/packaged-assets/.agents/skills/rt-exploit-auth/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-bec/SKILL.md +69 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-aws/SKILL.md +865 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-aws/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-azure/SKILL.md +1258 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-gcp/SKILL.md +981 -0
- package/packaged-assets/.agents/skills/rt-exploit-containers/SKILL.md +55 -0
- package/packaged-assets/.agents/skills/rt-exploit-databases/SKILL.md +1374 -0
- package/packaged-assets/.agents/skills/rt-exploit-desktop-mac/SKILL.md +834 -0
- package/packaged-assets/.agents/skills/rt-exploit-desktop-win/SKILL.md +903 -0
- package/packaged-assets/.agents/skills/rt-exploit-desktop-win/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-dotnet/SKILL.md +945 -0
- package/packaged-assets/.agents/skills/rt-exploit-elasticsearch/SKILL.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-electron/SKILL.md +1023 -0
- package/packaged-assets/.agents/skills/rt-exploit-electron/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-file-upload/SKILL.md +1576 -0
- package/packaged-assets/.agents/skills/rt-exploit-file-upload/payloads/README.md +4 -0
- package/packaged-assets/.agents/skills/rt-exploit-file-upload/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-firebase/SKILL.md +54 -0
- package/packaged-assets/.agents/skills/rt-exploit-frameworks/SKILL.md +967 -0
- package/packaged-assets/.agents/skills/rt-exploit-idor/SKILL.md +1693 -0
- package/packaged-assets/.agents/skills/rt-exploit-idor/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-injection/SKILL.md +1860 -0
- package/packaged-assets/.agents/skills/rt-exploit-injection/payloads/sqlmap-tampers.txt +22 -0
- package/packaged-assets/.agents/skills/rt-exploit-injection/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-ios/SKILL.md +1214 -0
- package/packaged-assets/.agents/skills/rt-exploit-ios/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-iot/SKILL.md +91 -0
- package/packaged-assets/.agents/skills/rt-exploit-iot/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-java/SKILL.md +1009 -0
- package/packaged-assets/.agents/skills/rt-exploit-jwt/SKILL.md +1327 -0
- package/packaged-assets/.agents/skills/rt-exploit-jwt/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-mongodb/SKILL.md +67 -0
- package/packaged-assets/.agents/skills/rt-exploit-mssql/SKILL.md +52 -0
- package/packaged-assets/.agents/skills/rt-exploit-mysql/SKILL.md +53 -0
- package/packaged-assets/.agents/skills/rt-exploit-network/SKILL.md +118 -0
- package/packaged-assets/.agents/skills/rt-exploit-network/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-nodejs/SKILL.md +852 -0
- package/packaged-assets/.agents/skills/rt-exploit-osticket/SKILL.md +63 -0
- package/packaged-assets/.agents/skills/rt-exploit-phishing/SKILL.md +173 -0
- package/packaged-assets/.agents/skills/rt-exploit-phishing/templates/README.md +4 -0
- package/packaged-assets/.agents/skills/rt-exploit-phishing/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-php/SKILL.md +1119 -0
- package/packaged-assets/.agents/skills/rt-exploit-physical/SKILL.md +63 -0
- package/packaged-assets/.agents/skills/rt-exploit-physical/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-postgresql/SKILL.md +67 -0
- package/packaged-assets/.agents/skills/rt-exploit-python/SKILL.md +986 -0
- package/packaged-assets/.agents/skills/rt-exploit-redis/SKILL.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-ruby/SKILL.md +61 -0
- package/packaged-assets/.agents/skills/rt-exploit-scada/SKILL.md +1091 -0
- package/packaged-assets/.agents/skills/rt-exploit-ssrf/SKILL.md +1528 -0
- package/packaged-assets/.agents/skills/rt-exploit-ssrf/payloads.txt +23 -0
- package/packaged-assets/.agents/skills/rt-exploit-ssrf/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-vishing/SKILL.md +121 -0
- package/packaged-assets/.agents/skills/rt-exploit-vishing/scripts.md +4 -0
- package/packaged-assets/.agents/skills/rt-exploit-web/SKILL.md +1902 -0
- package/packaged-assets/.agents/skills/rt-exploit-web/owasp-checklist.csv +14 -0
- package/packaged-assets/.agents/skills/rt-exploit-web/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-wireless/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-exploit-wordpress/SKILL.md +1565 -0
- package/packaged-assets/.agents/skills/rt-exploit-wordpress/cves.csv +7 -0
- package/packaged-assets/.agents/skills/rt-exploit-wordpress/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-xss/SKILL.md +1526 -0
- package/packaged-assets/.agents/skills/rt-exploit-xss/payloads.txt +18 -0
- package/packaged-assets/.agents/skills/rt-exploit-xss/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-finding-document/SKILL.md +687 -0
- package/packaged-assets/.agents/skills/rt-finding-document/template.md +71 -0
- package/packaged-assets/.agents/skills/rt-finding-document/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-finding-tracker/SKILL.md +216 -0
- package/packaged-assets/.agents/skills/rt-finding-tracker/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-help/SKILL.md +292 -0
- package/packaged-assets/.agents/skills/rt-help/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-js-analysis/SKILL.md +639 -0
- package/packaged-assets/.agents/skills/rt-js-analysis/patterns.txt +27 -0
- package/packaged-assets/.agents/skills/rt-js-analysis/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-kill-chain-map/SKILL.md +393 -0
- package/packaged-assets/.agents/skills/rt-lateral-movement/SKILL.md +1032 -0
- package/packaged-assets/.agents/skills/rt-lateral-movement/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-methodology-selector/SKILL.md +69 -0
- package/packaged-assets/.agents/skills/rt-methodology-selector/frameworks.csv +10 -0
- package/packaged-assets/.agents/skills/rt-methodology-selector/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-mitre-map/SKILL.md +668 -0
- package/packaged-assets/.agents/skills/rt-mitre-map/tactics.csv +16 -0
- package/packaged-assets/.agents/skills/rt-mitre-map/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-osint/SKILL.md +775 -0
- package/packaged-assets/.agents/skills/rt-osint/osint-sources.csv +12 -0
- package/packaged-assets/.agents/skills/rt-osint/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-party-mode/SKILL.md +249 -0
- package/packaged-assets/.agents/skills/rt-party-mode/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-persistence/SKILL.md +1146 -0
- package/packaged-assets/.agents/skills/rt-persistence/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-poc-writer/SKILL.md +640 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/SKILL.md +998 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/linux-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/windows-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/SKILL.md +1027 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/linux-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/win-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-remediation-roadmap/SKILL.md +665 -0
- package/packaged-assets/.agents/skills/rt-remediation-roadmap/template.md +28 -0
- package/packaged-assets/.agents/skills/rt-risk-matrix/SKILL.md +232 -0
- package/packaged-assets/.agents/skills/rt-rules-of-engagement/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-rules-of-engagement/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-scenario-c001/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-c002/SKILL.md +69 -0
- package/packaged-assets/.agents/skills/rt-scenario-c003/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-c004/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-c005/SKILL.md +72 -0
- package/packaged-assets/.agents/skills/rt-scenario-d001/SKILL.md +378 -0
- package/packaged-assets/.agents/skills/rt-scenario-d002/SKILL.md +392 -0
- package/packaged-assets/.agents/skills/rt-scenario-d003/SKILL.md +522 -0
- package/packaged-assets/.agents/skills/rt-scenario-d004/SKILL.md +373 -0
- package/packaged-assets/.agents/skills/rt-scenario-d005/SKILL.md +458 -0
- package/packaged-assets/.agents/skills/rt-scenario-library/SKILL.md +292 -0
- package/packaged-assets/.agents/skills/rt-scenario-library/scenarios.csv +32 -0
- package/packaged-assets/.agents/skills/rt-scenario-m001/SKILL.md +796 -0
- package/packaged-assets/.agents/skills/rt-scenario-m002/SKILL.md +723 -0
- package/packaged-assets/.agents/skills/rt-scenario-m003/SKILL.md +463 -0
- package/packaged-assets/.agents/skills/rt-scenario-m004/SKILL.md +449 -0
- package/packaged-assets/.agents/skills/rt-scenario-m005/SKILL.md +505 -0
- package/packaged-assets/.agents/skills/rt-scenario-n001/SKILL.md +573 -0
- package/packaged-assets/.agents/skills/rt-scenario-n002/SKILL.md +112 -0
- package/packaged-assets/.agents/skills/rt-scenario-n003/SKILL.md +100 -0
- package/packaged-assets/.agents/skills/rt-scenario-n004/SKILL.md +90 -0
- package/packaged-assets/.agents/skills/rt-scenario-n005/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-w001/SKILL.md +635 -0
- package/packaged-assets/.agents/skills/rt-scenario-w002/SKILL.md +612 -0
- package/packaged-assets/.agents/skills/rt-scenario-w003/SKILL.md +449 -0
- package/packaged-assets/.agents/skills/rt-scenario-w004/SKILL.md +648 -0
- package/packaged-assets/.agents/skills/rt-scenario-w005/SKILL.md +479 -0
- package/packaged-assets/.agents/skills/rt-scenario-w006/SKILL.md +443 -0
- package/packaged-assets/.agents/skills/rt-scenario-w007/SKILL.md +494 -0
- package/packaged-assets/.agents/skills/rt-scenario-w008/SKILL.md +576 -0
- package/packaged-assets/.agents/skills/rt-scenario-w009/SKILL.md +518 -0
- package/packaged-assets/.agents/skills/rt-scenario-w010/SKILL.md +574 -0
- package/packaged-assets/.agents/skills/rt-scope-definition/SKILL.md +79 -0
- package/packaged-assets/.agents/skills/rt-scope-definition/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-shodan-recon/SKILL.md +880 -0
- package/packaged-assets/.agents/skills/rt-status/SKILL.md +64 -0
- package/packaged-assets/.agents/skills/rt-subdomain-enum/SKILL.md +906 -0
- package/packaged-assets/.agents/skills/rt-subdomain-enum/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-technical-report/SKILL.md +710 -0
- package/packaged-assets/.agents/skills/rt-technical-report/template.md +41 -0
- package/packaged-assets/.agents/skills/rt-technical-report/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-threat-model/SKILL.md +59 -0
- package/packaged-assets/.agents/skills/rt-threat-model/template.md +32 -0
- package/packaged-assets/.agents/skills/rt-threat-model/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-timeline/SKILL.md +338 -0
- package/packaged-assets/RTEXIT.md +127 -0
- package/tools/installer/commands/install.js +0 -1
- package/tools/installer/lib/asset-manifest.js +10 -5
- package/tools/installer/lib/banner.js +14 -6
- package/tools/installer/lib/copy-assets.js +5 -2
- package/tools/installer/lib/prompts.js +1 -11
- package/tools/installer/lib/write-config.js +8 -2
- /package/{_rtexit → packaged-assets/_rtexit}/config.toml +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/config.user.toml +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/custom/config.toml +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/autodoc_engine.py +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/finding_tracker.py +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/resolve_config.py +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/resolve_customization.py +0 -0
- /package/{resources → packaged-assets/resources}/certifications.md +0 -0
- /package/{resources → packaged-assets/resources}/payloads.md +0 -0
- /package/{resources → packaged-assets/resources}/tools.md +0 -0
- /package/{resources → packaged-assets/resources}/wordlists.md +0 -0
- /package/{templates → packaged-assets/templates}/attack-chain-template.md +0 -0
- /package/{templates → packaged-assets/templates}/executive-report-template.md +0 -0
- /package/{templates → packaged-assets/templates}/executive-report.md +0 -0
- /package/{templates → packaged-assets/templates}/finding-template.md +0 -0
- /package/{templates → packaged-assets/templates}/remediation-roadmap.md +0 -0
- /package/{templates → packaged-assets/templates}/sead-template.md +0 -0
- /package/{templates → packaged-assets/templates}/technical-report.md +0 -0
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-scenario-d002
|
|
3
|
+
description: "D-002: .NET Application dnSpy → License Crack + Credential Extraction. Domain: desktop. Attack chain: run dnSpy on .exe → decompile to C# source → find license check method → patch JUMP instruction → find hardcoded admin credentials in decompiled code. MITRE: T1588 → T1552.001. Real example: Enterprise software: dnSpy reveals license validation bypass + hardcoded DB password in connection string"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# D-002: .NET Application dnSpy — License Crack + Credential Extraction
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
| Field | Value |
|
|
11
|
+
|---|---|
|
|
12
|
+
| Attack Objective | Bypass software license validation and extract hardcoded credentials from a .NET application binary |
|
|
13
|
+
| Required Access Level | None (physical or remote access to the binary file is sufficient) |
|
|
14
|
+
| Estimated Time | 30–90 minutes depending on binary size and obfuscation level |
|
|
15
|
+
| Detection Risk | Low (static analysis; no network traffic, no process injection by default) |
|
|
16
|
+
|
|
17
|
+
The target is any .NET executable (.exe or .dll) whose license check is implemented in managed code. Because .NET IL (Intermediate Language) compiles to a format that is trivially decompiled back to near-original C#, the license validation routine can be identified, patched at the IL level, and the modified binary saved — all without access to source code. As a bonus, hardcoded connection strings, API keys, or credentials embedded in the binary are fully visible in the decompiled output.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
### Required Tools
|
|
24
|
+
|
|
25
|
+
| Tool | Purpose | Install |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| dnSpy | .NET decompiler and IL-level debugger/patcher | Download release ZIP from https://github.com/dnSpyEx/dnSpy/releases — extract, run `dnSpy.exe` (no install needed) |
|
|
28
|
+
| .NET SDK (optional) | Compile test harnesses | `winget install Microsoft.DotNet.SDK.8` |
|
|
29
|
+
| de4dot (optional) | Deobfuscation if the binary is packed/obfuscated | Download from https://github.com/de4dot/de4dot/releases |
|
|
30
|
+
| HxD or 010 Editor (optional) | Hex-level verification of patched bytes | `winget install MHNexus.HxD` |
|
|
31
|
+
| Strings / FLOSS (optional) | Quick pre-scan for embedded credentials | `winget install BinaryAnalysis.FLOSS` |
|
|
32
|
+
|
|
33
|
+
### Required Access or Conditions
|
|
34
|
+
|
|
35
|
+
- Read access to the target `.exe` or `.dll` file.
|
|
36
|
+
- Write access to the same directory (or any writable directory) to save the patched binary.
|
|
37
|
+
- The application must be compiled as managed .NET (Framework 2.0–4.8, .NET Core, .NET 5+). Confirm with: `file target.exe` or open in dnSpy — if the assembly tree populates, it is managed .NET.
|
|
38
|
+
|
|
39
|
+
### Skill Level
|
|
40
|
+
|
|
41
|
+
**INTERMEDIATE** — Requires familiarity with C# syntax and basic understanding of IL opcodes (`brfalse`, `brtrue`, `ret`). No prior reverse engineering experience is mandatory, but the ability to read decompiled C# and trace control flow is essential.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Attack Chain
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
[Target .exe]
|
|
49
|
+
|
|
|
50
|
+
v
|
|
51
|
+
[1] Run dnSpy on .exe
|
|
52
|
+
|
|
|
53
|
+
v
|
|
54
|
+
[2] Decompile to C# source (automatic in dnSpy)
|
|
55
|
+
|
|
|
56
|
+
v
|
|
57
|
+
[3] Locate license check method (search for "license", "valid", "trial", "expire", "isRegistered")
|
|
58
|
+
|
|
|
59
|
+
v
|
|
60
|
+
[4] Switch to IL view — identify the conditional JUMP (brfalse / brtrue)
|
|
61
|
+
|
|
|
62
|
+
v
|
|
63
|
+
[5] Edit IL — patch JUMP to unconditional branch or NOP; or change return value to always-true
|
|
64
|
+
|
|
|
65
|
+
v
|
|
66
|
+
[6] Save patched module (dnSpy File > Save Module)
|
|
67
|
+
|
|
|
68
|
+
v
|
|
69
|
+
[7] Search decompiled code for connection strings, passwords, API keys
|
|
70
|
+
|
|
|
71
|
+
v
|
|
72
|
+
[8] Extract and document all found credentials
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### MITRE ATT&CK Summary
|
|
76
|
+
|
|
77
|
+
- **T1588.002** — Obtain Capabilities: Tool (dnSpy acquisition)
|
|
78
|
+
- **T1552.001** — Unsecured Credentials: Credentials in Files (hardcoded strings in binary)
|
|
79
|
+
- **T1027** — Obfuscated Files or Information (encountered if packer is present; de4dot used to counter)
|
|
80
|
+
- **T1600** — Weaken Encryption (license bypass modifies application logic)
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Step-by-Step Execution
|
|
85
|
+
|
|
86
|
+
### Step 1 — Pre-scan for Low-Hanging Credentials (Optional but Recommended)
|
|
87
|
+
|
|
88
|
+
Run FLOSS or Strings against the binary before opening dnSpy to get a fast list of interesting strings.
|
|
89
|
+
|
|
90
|
+
```powershell
|
|
91
|
+
# Using Sysinternals Strings
|
|
92
|
+
strings64.exe -n 8 C:\path\to\target.exe | Select-String -Pattern "password|pwd|connstr|secret|api_key|token|jdbc|Server=" -CaseSensitive:$false
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Expected output:**
|
|
96
|
+
```
|
|
97
|
+
Server=prod-db01;Database=AppDB;User Id=sa;Password=Sup3rS3cr3t!;
|
|
98
|
+
ApiKey=sk-live-XXXXXXXXXXXXXXXXXXXX
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
If credentials appear here, document them and proceed to Step 7 for confirmation via decompiled source.
|
|
102
|
+
|
|
103
|
+
**Fallback:** If Strings is unavailable, skip to Step 2 — dnSpy will reveal the same data.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
### Step 2 — Open the Binary in dnSpy
|
|
108
|
+
|
|
109
|
+
1. Launch `dnSpy.exe`.
|
|
110
|
+
2. Drag and drop `target.exe` onto the dnSpy Assembly Explorer panel, or use **File > Open** (`Ctrl+O`).
|
|
111
|
+
3. The assembly tree expands: `target.exe > {namespace} > {classes}`.
|
|
112
|
+
|
|
113
|
+
**Expected output:** The left panel shows a tree of namespaces, classes, and methods. The main panel displays decompiled C# automatically when you click a method.
|
|
114
|
+
|
|
115
|
+
**Fallback — Obfuscated binary:** If the tree shows garbled names (e.g., ``) or dnSpy shows IL errors, run de4dot first:
|
|
116
|
+
```powershell
|
|
117
|
+
de4dot.exe C:\path\to\target.exe -o C:\path\to\target_clean.exe
|
|
118
|
+
```
|
|
119
|
+
Then open `target_clean.exe` in dnSpy.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### Step 3 — Locate the License Check Method
|
|
124
|
+
|
|
125
|
+
Use dnSpy's search to find the validation routine.
|
|
126
|
+
|
|
127
|
+
1. Press **Ctrl+Shift+F** (Search Assemblies) or use **Edit > Search Assemblies**.
|
|
128
|
+
2. Set search type to **Member (methods, fields, properties)**.
|
|
129
|
+
3. Search for each of the following terms in sequence until results appear:
|
|
130
|
+
- `license`
|
|
131
|
+
- `isValid`
|
|
132
|
+
- `isRegistered`
|
|
133
|
+
- `CheckLicense`
|
|
134
|
+
- `Validate`
|
|
135
|
+
- `trial`
|
|
136
|
+
- `expire`
|
|
137
|
+
- `activate`
|
|
138
|
+
|
|
139
|
+
**Expected output:** A list of matching methods. Double-click the most relevant result (e.g., `bool CheckLicense(string key)` or `bool IsLicenseValid()`).
|
|
140
|
+
|
|
141
|
+
**Alternative — Search string literals:**
|
|
142
|
+
1. Search type: **String**.
|
|
143
|
+
2. Search: `"trial expired"` or `"invalid license"` or `"please register"`.
|
|
144
|
+
3. Double-click the result — dnSpy navigates to the method that references the string, revealing the license check in context.
|
|
145
|
+
|
|
146
|
+
**Fallback:** If no obvious method is found, browse the class containing the application's startup logic (`Program.Main`) and trace calls step by step.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
### Step 4 — Analyze the License Check in C# View
|
|
151
|
+
|
|
152
|
+
With the license method open, read the decompiled C# to understand the logic. A typical pattern:
|
|
153
|
+
|
|
154
|
+
```csharp
|
|
155
|
+
private bool IsLicenseValid(string licenseKey)
|
|
156
|
+
{
|
|
157
|
+
if (string.IsNullOrEmpty(licenseKey))
|
|
158
|
+
return false;
|
|
159
|
+
|
|
160
|
+
string expected = ComputeHash(licenseKey + this.machineId);
|
|
161
|
+
return expected == this.storedHash; // <-- this comparison controls access
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Note the return path. The goal is to make this method always return `true`.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
### Step 5 — Switch to IL View and Identify the JUMP Instruction
|
|
170
|
+
|
|
171
|
+
1. Right-click inside the method body > **Edit IL Instructions** (or press **Ctrl+Shift+E** in some builds; alternatively use the **Edit Method Body** option).
|
|
172
|
+
2. Alternatively, right-click the method in the Assembly Explorer > **Edit IL Instructions**.
|
|
173
|
+
|
|
174
|
+
The IL for the method above typically looks like:
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
IL_0000: ldarg.1
|
|
178
|
+
IL_0001: brfalse.s IL_0020 ; if (licenseKey == null) jump to return false
|
|
179
|
+
...
|
|
180
|
+
IL_001A: call bool [mscorlib]System.String::op_Equality(string, string)
|
|
181
|
+
IL_001F: brfalse.s IL_0027 ; if strings not equal, jump to return false
|
|
182
|
+
IL_0021: ldc.i4.1 ; push true
|
|
183
|
+
IL_0022: ret
|
|
184
|
+
IL_0023: ldc.i4.0 ; push false <-- we want to eliminate this path
|
|
185
|
+
IL_0024: ret
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**Identify the key instruction:** The `brfalse.s` or `brtrue.s` that sends control to the `ldc.i4.0 / ret` (return false) block.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
### Step 6 — Patch the IL Instruction
|
|
193
|
+
|
|
194
|
+
**Option A — Change `brfalse` to `pop` + `nop` (cleanest patch):**
|
|
195
|
+
|
|
196
|
+
In the IL editor, locate the problematic `brfalse.s IL_XXXX` that leads to the false return. Change the opcode:
|
|
197
|
+
|
|
198
|
+
- Change `brfalse.s` → `pop` (removes the boolean from the stack without branching)
|
|
199
|
+
- The execution then falls through to `ldc.i4.1 / ret` (returns true).
|
|
200
|
+
|
|
201
|
+
Or more aggressively:
|
|
202
|
+
|
|
203
|
+
**Option B — Replace entire method body with `ldc.i4.1 / ret`:**
|
|
204
|
+
|
|
205
|
+
Clear all IL instructions and replace with:
|
|
206
|
+
```
|
|
207
|
+
IL_0000: ldc.i4.1
|
|
208
|
+
IL_0001: ret
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
This makes the method unconditionally return `true`.
|
|
212
|
+
|
|
213
|
+
**Option C — Patch a single byte in hex (advanced):**
|
|
214
|
+
|
|
215
|
+
In HxD, search for the byte sequence corresponding to `brfalse.s` (`0x2C`) followed by the offset. Change `0x2C` to `0x2A` (`pop`) or `0x00` (`nop`... though nop does not consume stack — use with care).
|
|
216
|
+
|
|
217
|
+
**After editing in dnSpy IL editor:** Click **OK** to confirm changes.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
### Step 7 — Save the Patched Module
|
|
222
|
+
|
|
223
|
+
1. In dnSpy, go to **File > Save Module** (`Ctrl+Shift+S`).
|
|
224
|
+
2. Choose the output path (recommend saving as `target_patched.exe` to preserve the original).
|
|
225
|
+
3. Click **OK** — dnSpy recompiles the modified IL to a valid PE binary.
|
|
226
|
+
|
|
227
|
+
**Expected output:** A new `.exe` file at the specified path. Launch it and verify the license check is bypassed (the application opens without requesting a license key or displaying a trial warning).
|
|
228
|
+
|
|
229
|
+
**Fallback — Save fails with error:** If dnSpy reports a metadata error, use **File > Save All** or try right-clicking the module in Assembly Explorer > **Save Module**. If the binary is strongly named (signed), dnSpy will warn that the signature is invalid — the patched binary will run but Windows may warn. Remove the strong name requirement by patching the PE header bit, or use `ildasm` + `ilasm` to recompile.
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
### Step 8 — Extract Hardcoded Credentials from Decompiled Source
|
|
234
|
+
|
|
235
|
+
With the binary open in dnSpy, search for credential patterns:
|
|
236
|
+
|
|
237
|
+
1. **Ctrl+Shift+F** > Search type: **String**.
|
|
238
|
+
2. Search each term:
|
|
239
|
+
- `password`
|
|
240
|
+
- `Password`
|
|
241
|
+
- `pwd`
|
|
242
|
+
- `Server=`
|
|
243
|
+
- `Data Source=`
|
|
244
|
+
- `apikey`
|
|
245
|
+
- `secret`
|
|
246
|
+
- `Bearer`
|
|
247
|
+
- `token`
|
|
248
|
+
- `connectionString`
|
|
249
|
+
|
|
250
|
+
3. For each result, double-click to navigate to the context. Read the full string literal and the surrounding variable/field assignment to understand what the credential is used for.
|
|
251
|
+
|
|
252
|
+
**Expected output — connection string example:**
|
|
253
|
+
```csharp
|
|
254
|
+
// Found in DatabaseManager.cs > Initialize()
|
|
255
|
+
private static string connStr = "Server=prod-db01;Database=AppDB;User Id=sa;Password=Sup3rS3cr3t!;Encrypt=False;";
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Expected output — API key example:**
|
|
259
|
+
```csharp
|
|
260
|
+
// Found in ApiClient.cs > constructor
|
|
261
|
+
private const string ApiKey = "sk-live-4f8a2b9c1d3e7f6a0b5c8d2e1f4a7b3c";
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Document all findings with:
|
|
265
|
+
- Class name and method name where found
|
|
266
|
+
- The full string value
|
|
267
|
+
- The apparent purpose (DB credential, API key, admin password, etc.)
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Real-World Reference
|
|
272
|
+
|
|
273
|
+
**Enterprise Resource Planning (ERP) Software — Composite Finding:**
|
|
274
|
+
|
|
275
|
+
During an authorized engagement against an on-premise ERP application, dnSpy analysis of the primary executable revealed two critical issues simultaneously:
|
|
276
|
+
|
|
277
|
+
1. **License Bypass:** The `LicenseManager.Validate()` method performed an HMAC comparison. Patching a single `brfalse.s` to `pop` eliminated the check entirely. The patched binary loaded all premium modules without any license key.
|
|
278
|
+
|
|
279
|
+
2. **Hardcoded Database Credential:** A `static readonly` field in `DataAccess.ConnectionFactory` contained the literal string:
|
|
280
|
+
```
|
|
281
|
+
Server=erp-sql-prod;Database=ERPDB;User Id=sa;Password=ERP@dm1n2019!;
|
|
282
|
+
```
|
|
283
|
+
The `sa` (SQL Server system administrator) account was active on the production SQL Server instance. Using these credentials, full database access — including all customer records, payroll data, and user account tables — was obtained without any additional exploitation.
|
|
284
|
+
|
|
285
|
+
**Lesson:** A single .NET binary can simultaneously expose both application-layer access control weaknesses and privileged infrastructure credentials, requiring a combined remediation response (license logic moved server-side; credentials externalized to a secrets manager).
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## MITRE ATT&CK Mapping
|
|
290
|
+
|
|
291
|
+
| Step | Tactic | Technique ID | Technique Name | Sub-technique |
|
|
292
|
+
|---|---|---|---|---|
|
|
293
|
+
| 1 — Acquire dnSpy | Resource Development | T1588.002 | Obtain Capabilities: Tool | — |
|
|
294
|
+
| 2 — Open binary in dnSpy | Collection | T1005 | Data from Local System | — |
|
|
295
|
+
| 3-4 — Decompile .NET to C# | Defense Evasion | T1027 | Obfuscated Files or Information (countering) | T1027.002 — Software Packing |
|
|
296
|
+
| 5-6 — Patch IL JUMP instruction | Defense Evasion / Impact | T1562 | Impair Defenses | T1562.001 — Disable or Modify Tools (license control) |
|
|
297
|
+
| 7 — Save patched binary | Persistence | T1574 | Hijack Execution Flow | T1574.001 — DLL Search Order (analog: modified binary) |
|
|
298
|
+
| 8 — Extract credentials from decompiled code | Credential Access | T1552.001 | Unsecured Credentials: Credentials in Files | — |
|
|
299
|
+
| Post — Use extracted DB credentials | Lateral Movement | T1021.002 | Remote Services: SMB/Windows Admin Shares | — |
|
|
300
|
+
| Post — Query database with stolen creds | Collection | T1213 | Data from Information Repositories | — |
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## Detection and OPSEC
|
|
305
|
+
|
|
306
|
+
### How This Attack Is Detected
|
|
307
|
+
|
|
308
|
+
| Detection Point | Mechanism |
|
|
309
|
+
|---|---|
|
|
310
|
+
| dnSpy process execution | EDR/AV flagging `dnSpy.exe` by name or hash; parent-child process anomalies |
|
|
311
|
+
| Modified binary execution | File hash mismatch detected by application whitelisting (AppLocker, WDAC) or integrity monitoring (Tripwire, Wazuh FIM) |
|
|
312
|
+
| Anomalous DB login | SQL Server audit log: `sa` login from unusual host or at unusual time; failed login attempts before success |
|
|
313
|
+
| Network connection string use | DLP or network monitoring detecting outbound SQL traffic from unexpected source |
|
|
314
|
+
| Binary diff | If original binary is stored in version control or on a software distribution server, a hash comparison reveals modification |
|
|
315
|
+
|
|
316
|
+
### How to Reduce Detection Risk During Authorized Engagement
|
|
317
|
+
|
|
318
|
+
1. **Work on a copy:** Never modify the original binary in-place. Work on a copy in a designated engagement workspace.
|
|
319
|
+
2. **Run dnSpy on an isolated analysis workstation:** Avoid running reverse engineering tools on the production environment or on a system with EDR that will alert on tool execution.
|
|
320
|
+
3. **Do not execute the patched binary in production:** Verify the patch works in an isolated lab environment that mirrors production.
|
|
321
|
+
4. **Use a dedicated engagement account:** If testing extracted credentials, use a monitored test account or coordinate with the blue team so that legitimate credential testing does not trigger incident response.
|
|
322
|
+
5. **Coordinate timing:** If the engagement includes active monitoring tests, notify the SOC before using extracted credentials so alerts are acknowledged, not escalated.
|
|
323
|
+
6. **Minimize credential use:** Test extracted credentials once to confirm validity; document and stop. Do not perform bulk data extraction unless explicitly in scope.
|
|
324
|
+
|
|
325
|
+
### Artifacts Left Behind
|
|
326
|
+
|
|
327
|
+
| Artifact | Location | Notes |
|
|
328
|
+
|---|---|---|
|
|
329
|
+
| dnSpy recent files list | `%AppData%\dnSpy\dnSpy.xml` | Contains paths to analyzed binaries |
|
|
330
|
+
| Patched binary file | Wherever saved by analyst | Identifiable by modified hash |
|
|
331
|
+
| dnSpy crash logs | `%AppData%\dnSpy\` | May contain method names and paths |
|
|
332
|
+
| Windows Prefetch for dnSpy | `C:\Windows\Prefetch\DNSPY.EXE-*.pf` | Records that dnSpy was executed |
|
|
333
|
+
| SQL Server audit log | SQL Server instance | Login events from credential test |
|
|
334
|
+
| PowerShell history | `%AppData%\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt` | Any commands run during pre-scan |
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## Cleanup
|
|
339
|
+
|
|
340
|
+
Perform all cleanup steps after engagement is complete and findings are documented.
|
|
341
|
+
|
|
342
|
+
```powershell
|
|
343
|
+
# 1. Remove patched binary
|
|
344
|
+
Remove-Item "C:\path\to\target_patched.exe" -Force
|
|
345
|
+
|
|
346
|
+
# 2. Remove de4dot output if used
|
|
347
|
+
Remove-Item "C:\path\to\target_clean.exe" -Force
|
|
348
|
+
|
|
349
|
+
# 3. Clear dnSpy recent files (close dnSpy first)
|
|
350
|
+
Remove-Item "$env:AppData\dnSpy\dnSpy.xml" -Force -ErrorAction SilentlyContinue
|
|
351
|
+
|
|
352
|
+
# 4. Clear dnSpy logs
|
|
353
|
+
Remove-Item "$env:AppData\dnSpy\*.log" -Force -ErrorAction SilentlyContinue
|
|
354
|
+
|
|
355
|
+
# 5. Clear PowerShell history
|
|
356
|
+
Remove-Item "$env:AppData\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt" -Force -ErrorAction SilentlyContinue
|
|
357
|
+
|
|
358
|
+
# 6. Clear Windows Prefetch entry (requires admin)
|
|
359
|
+
Remove-Item "C:\Windows\Prefetch\DNSPY.EXE-*.pf" -Force -ErrorAction SilentlyContinue
|
|
360
|
+
|
|
361
|
+
# 7. Clear Strings/FLOSS output if saved to file
|
|
362
|
+
Remove-Item "C:\path\to\strings_output.txt" -Force -ErrorAction SilentlyContinue
|
|
363
|
+
|
|
364
|
+
# 8. Verify no patched binary remains
|
|
365
|
+
Get-ChildItem "C:\path\to\engagement-folder\" | Select-Object Name, LastWriteTime
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
**SQL Server credential test cleanup:**
|
|
369
|
+
- Coordinate with the DBA or system owner to review and purge SQL Server audit logs for the engagement window, per the rules of engagement.
|
|
370
|
+
- If a test account was used, disable or delete it after the engagement.
|
|
371
|
+
|
|
372
|
+
**Document everything before cleanup:** Ensure all screenshots, dnSpy exports, and credential findings are captured in the engagement report before removing artifacts.
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## References
|
|
377
|
+
|
|
378
|
+
| Resource | URL / Details |
|
|
379
|
+
|---|---|
|
|
380
|
+
| dnSpy (maintained fork) | https://github.com/dnSpyEx/dnSpy |
|
|
381
|
+
| de4dot .NET deobfuscator | https://github.com/de4dot/de4dot |
|
|
382
|
+
| FLOSS (string extraction) | https://github.com/mandiant/flare-floss |
|
|
383
|
+
| .NET IL Opcodes reference | https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes |
|
|
384
|
+
| MITRE T1552.001 — Credentials in Files | https://attack.mitre.org/techniques/T1552/001/ |
|
|
385
|
+
| MITRE T1588.002 — Obtain Capabilities: Tool | https://attack.mitre.org/techniques/T1588/002/ |
|
|
386
|
+
| MITRE T1027 — Obfuscated Files or Information | https://attack.mitre.org/techniques/T1027/ |
|
|
387
|
+
| SharpLab (.NET IL explorer, online) | https://sharplab.io |
|
|
388
|
+
| .NET Reflector (commercial alternative to dnSpy) | https://www.red-gate.com/products/reflector/ |
|
|
389
|
+
| ILSpy (open-source alternative) | https://github.com/icsharpcode/ILSpy |
|
|
390
|
+
| OWASP — Insecure Storage of Sensitive Information | https://owasp.org/www-community/vulnerabilities/Insecure_Storage |
|
|
391
|
+
| CWE-312 — Cleartext Storage of Sensitive Information | https://cwe.mitre.org/data/definitions/312.html |
|
|
392
|
+
| CWE-259 — Use of Hard-coded Password | https://cwe.mitre.org/data/definitions/259.html |
|