SSCP Domain 7 · 14%

An ninh hệ thống & Ứng dụng

Systems & Application Security

Domain cuối của SSCP: bảo vệ endpoint, thiết bị di động, môi trường ảo hóa và ứng dụng web — từ OWASP Top 10, WAF đến API security và phân loại malware — tất cả trong một chương tổng hợp toàn diện.

Mục tiêu chương / Learning objectives

1. Lý thuyết cốt lõi / Core theory

1.1. Endpoint Security — AV, EDR, HIPS, DLP

Các lớp bảo vệ endpoint theo mức độ tiên tiến:

Fileless Malware: Malware không ghi file xuống disk — sống hoàn toàn trong RAM (reflective DLL injection, process hollowing, living-off-the-land sử dụng PowerShell/WMI). AV không phát hiện được vì không có file để scan. EDR phát hiện qua behavioral analysis của process.

1.2. Mobile Device Security — MDM, MAM, BYOD

MDM (Mobile Device Management): quản lý toàn bộ thiết bị — enforce encryption, remote wipe, certificate deployment, restrict features (camera, USB). Phù hợp với thiết bị công ty. MAM (Mobile Application Management): chỉ quản lý ứng dụng doanh nghiệp, không đụng đến dữ liệu cá nhân — phù hợp BYOD. Containerization: tạo vùng tách biệt (work profile trên Android) giữa dữ liệu cá nhân và công việc.

BYOD Policy cần quy định: thiết bị nào được phép (OS version tối thiểu, không jailbroken/rooted), ứng dụng nào được cài, network access level (chỉ truy cập email hay cả internal apps?), quy trình khi thiết bị mất/bị đánh cắp (remote wipe work profile ngay lập tức).

1.3. Virtualization Security

Các rủi ro bảo mật đặc thù môi trường ảo hóa:

1.4. OWASP Top 10, WAF & API Security

OWASP Top 10 (2021) — các lỗ hổng web phổ biến nhất:

HạngLỗ hổngVí dụ tấn côngBiện pháp
A01Broken Access ControlIDOR, path traversalServer-side authz check
A02Cryptographic FailuresDữ liệu không mã hóa, MD5TLS, AES-256, bcrypt
A03Injection (SQL/LDAP/OS)' OR 1=1--Parameterized queries
A04Insecure DesignThiếu rate limiting, business logic flawThreat modeling, secure design
A05Security MisconfigurationDefault creds, verbose errorsHardening, config review
A07XSS (Cross-Site Scripting)<script>steal cookie</script>Output encoding, CSP header
A10SSRF (Server-Side Request Forgery)Truy cập metadata AWS từ appAllowlist URLs, network segmentation

WAF (Web Application Firewall): layer 7 firewall phân tích HTTP request/response — phát hiện SQL injection, XSS, path traversal dựa trên signature và behavioral rules. API Security: OAuth2 cho authorization, API key rotation, rate limiting (chống abuse và DDoS), input validation, không expose sensitive data trong response.

1.5. Phân loại Malware (Malware Types)

2. Bài thực hành / Hands-on labs

🖥️ Nền tảng / Platform: Windows 11 + Ubuntu 22.04 LTS
🛠️ Công cụ / Tools: PowerShell 7 + Windows Defender, Bash + Nikto

Lab 1 — Endpoint Security Check với Windows Defender (PowerShell)

OS: Windows 11 · Tool: PowerShell 7 (Run as Administrator)

# Trạng thái tổng quan Windows Defender
Get-MpComputerStatus | Select-Object `
    AMServiceEnabled, AntispywareEnabled, AntivirusEnabled, `
    RealTimeProtectionEnabled, BehaviorMonitorEnabled, `
    AntivirusSignatureLastUpdated, QuickScanStartTime |
    Format-List

# Xem các mối đe dọa đã phát hiện gần đây
Get-MpThreatDetection | Select-Object `
    ActionSuccess, CleaningActionID, ThreatName, Resources, InitialDetectionTime |
    Sort-Object InitialDetectionTime -Descending | Select-Object -First 10

# Kiểm tra AppLocker policy đang active (ngăn chặn unauthorized executables)
Get-AppLockerPolicy -Effective | Format-List

# Kiểm tra Process Mitigation settings (ASLR, DEP, CFG, etc.)
Get-ProcessMitigation -System | Format-List

# Kiểm tra Exploit Protection settings
Get-ProcessMitigation -System | Select-Object ASLR, DEP, SEHOP | Format-List

# Xem controlled folder access status (ransomware protection)
Get-MpPreference | Select-Object EnableControlledFolderAccess, ControlledFolderAccessProtectedFolders

✅ Kết quả mong đợi / Expected output: Tất cả *Enabled: True cho thấy Defender đang hoạt động đầy đủ. AntivirusSignatureLastUpdated không quá 24 giờ — signature cũ = bảo vệ kém. EnableControlledFolderAccess: Enabled = ransomware protection bật. Nếu RealTimeProtectionEnabled: False → cần alert ngay. AppLocker policy trống = không có application whitelisting.

Lab 2 — Web Application Security Test (Ubuntu 22.04)

OS: Ubuntu 22.04 · Tool: Bash + Nikto · Chỉ test trên môi trường lab của chính bạn — KHÔNG test trên hệ thống không có quyền!

# Cài nikto nếu chưa có (web vulnerability scanner)
sudo apt install nikto curl -y

# Kiểm tra web server header — thông tin lộ lọt
curl -I http://localhost 2>/dev/null || curl -I http://127.0.0.1 2>/dev/null

# Chạy Nikto scan cơ bản (nếu có local web server)
# nikto -h http://localhost

# Demo SQL Injection attempt (chỉ xem HTTP response, không tấn công thật)
# Test trên local server học tập như DVWA (Damn Vulnerable Web App)
curl -s -X POST http://localhost/login \
    -d "username=admin'--&password=anything" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -v 2>&1 | grep -E "HTTP|Location|Set-Cookie|error|Error" || \
    echo "No local web server running — install DVWA for practice"

# Kiểm tra security headers của một website
curl -s -I https://google.com 2>/dev/null | grep -iE \
    "Strict-Transport-Security|Content-Security-Policy|X-Frame-Options|X-Content-Type|Referrer-Policy"

# Test SSRF vector (chỉ educational — không có target thực)
echo "SSRF prevention check: does the app validate URL inputs?"
echo "Example dangerous input: http://169.254.169.254/latest/meta-data/ (AWS metadata endpoint)"
echo "Mitigation: allowlist URLs, block private IP ranges at app level"

✅ Kết quả mong đợi / Expected output: curl -I response header tiết lộ server software (vd Server: Apache/2.4.41) — thông tin này giúp attacker tìm CVE phù hợp. Security headers check với google.com sẽ thấy Strict-Transport-Security, Content-Security-Policy — các header này bảo vệ khỏi MITM và XSS. Nếu website thiếu các header này → cần thêm vào web server config.

3. Tình huống doanh nghiệp / Real-world scenario

Bối cảnh:

Pentest team báo cáo: web application e-commerce của công ty có lỗ hổng SQL Injection trong trang tìm kiếm sản phẩm. Họ đã extract được tên và password hash của 50,000 khách hàng từ database. Ứng dụng không có WAF. Password hash dùng MD5 không có salt.

Phân tích và kế hoạch remediation:

  1. Tức thời — Containment: Offline trang tìm kiếm bị ảnh hưởng. Block IP của pentest team (và bất kỳ IP nào có pattern tương tự trong log). Thông báo cho CISO và Legal.
  2. OWASP A03 — SQL Injection fix: Thay dynamic query bằng parameterized query / prepared statements. Ví dụ: thay SELECT * FROM products WHERE name = '" + input + "'" bằng SELECT * FROM products WHERE name = ? với binding.
  3. OWASP A02 — Cryptographic Failure fix: Hash lại toàn bộ password bằng bcrypt/Argon2 (adaptive, slow hash với salt). Force reset password cho tất cả user bị ảnh hưởng.
  4. WAF deployment: Triển khai WAF (AWS WAF, ModSecurity, Cloudflare) với OWASP Core Rule Set — phát hiện và chặn SQL injection pattern.
  5. Notification: Theo GDPR/nghị định 13/2023/NĐ-CP (VN) — phải thông báo cho cơ quan chức năng trong 72 giờ và thông báo cho người dùng bị ảnh hưởng.
  6. Prevent recurrence: Mandatory SAST (Static Application Security Testing) trong CI/CD pipeline. Developer security training về OWASP Top 10.

Bài học: SQL Injection là lỗ hổng có từ 1998 nhưng vẫn xếp #3 OWASP Top 10 năm 2021. Parameterized query là fix đơn giản nhất với cost gần như bằng 0 — không có lý do để không dùng. MD5 password hash là sai lầm không thể chấp nhận trong 2026.

4. Tự kiểm tra / Knowledge check

  1. EDR vượt trội hơn AV truyền thống ở điểm gì khi đối phó với fileless malware?
  2. VM Escape và Container Breakout khác nhau như thế nào về mức độ nguy hiểm và cơ chế?
  3. OWASP A01 Broken Access Control là gì? Cho ví dụ IDOR (Insecure Direct Object Reference) cụ thể.
  4. Worm khác Virus ở điểm gì? Tại sao ransomware như WannaCry lây lan nhanh như vậy?
  5. Tại sao bcrypt tốt hơn SHA-256 để hash password? Giải thích khái niệm "adaptive" và "salt".
C06: An ninh mạng & Truyền thông Phase 3: CISSP
Thực hành trên công cụPowerShell 7 · Bash · Nikto
Nền tảngWindows 11 · Ubuntu 22.04
Thời điểm phát hànhQ2/2026
Ngày biên soạn24/05/2026
Người biên soạnTrần Văn Hòa (MCT)
Phiên bảnv1.0
Zalo