Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบเครือข่าย >> ความปลอดภัยเครือข่าย

Reconnaissance และ Penetration ในความปลอดภัยเครือข่าย: หลัง Recon มา Penetration

🔍 Reconnaissance (ขั้นสำรวจข้อมูล) คืออะไร?

Reconnaissance (Recon / Footprinting) = ขั้นตอนแรกของการโจมตี (หรือ Penetration Testing) ที่ผู้โจมตีรวบรวมข้อมูลเป้าหมาย มากที่สุดเท่าที่จะทำได้ เพื่อวางแผนการโจมตีขั้นต่อไป

เป้าหมายของ Reconnaissance

  • ระบุ Attack Surface (พื้นที่โจมตี) - IP Ranges, Domains, Subdomains, Open Ports, Services
  • ระบุ Technology Stack - OS, Web Server, CMS, Framework, Database, Cloud Provider
  • ระบุ Human Element - พนักงาน, อีเมล, โซเชียลมีเดีย, Org Chart (สำหรับ Social Engineering)
  • ระบุ Vulnerabilities - ช่องโหว่ที่ทราบ (CVE), Misconfigurations, Weak Credentials
  • ระบุ Network Topology - Firewall, IDS/IPS, Load Balancer, DMZ, Internal Segments

ประเภทของ Reconnaissance

ประเภทคำอธิบายเครื่องมือ/เทคนิคความเสี่ยงการถูกตรวจจับ
Passive Recon (OSINT)รวบรวมข้อมูลจากแหล่งสาธารณะ ไม่ส่งแพ็กเก็ตไปยังเป้าหมายโดยตรงGoogle Dorks, Shodan, Censys, VirusTotal, DNSDumpster, TheHarvester, LinkedIn, Crunchbase, Wayback Machine, SSL Certs, WHOISต่ำมาก (ไม่สัมผัส Target)
Active Reconส่งแพ็กเก็ต/Request ไปยังเป้าหมายโดยตรง เพื่อดึงข้อมูลNmap, Masscan, Nessus, OpenVAS, Nikto, Dirb/Gobuster, Enum4linux, SMBclient, SNMP Walk, Banner Grabbingสูง (โดน IDS/IPS/Firewall จับได้)
Physical Reconสำรวจสถานที่จริงDumpster Diving, Badge Cloning, Tailgating, Wireless Wardriving, Social Engineering On-siteสูง (ถูกจับกุมได้)

➡️ "After Reconnaissance Comes Penetration" หมายถึงอะไร?

คำพูดนี้สะท้อน Kill Chain / Attack Lifecycle แบบคลาสสิก (Lockheed Martin Cyber Kill Chain):

7 ขั้นตอนของ Cyber Kill Chain

  1. Reconnaissance - สำรวจข้อมูล (ข้างบน)
  2. Weaponization - สร้าง/เตรียม Payload (Malware, Exploit, Phishing Email) ตามข้อมูลที่ได้
  3. Delivery - ส่ง Payload ให้เหยื่อ (Email, Web, USB, Supply Chain)
  4. Exploitation - ใช้ช่องโหว่ (Exploit) ทำให้ Code ทำงานบน Target
  5. Installation - ติดตั้ง Malware/Backdoor/RAT ให้ Persistent
  6. Command & Control (C2) - เชื่อมต่อกลับควบคุม Victim
  7. Actions on Objectives - ทำตามเป้าหมาย (ขโมยข้อมูล, รบกวน, Ransomware, Destroy)

"Penetration" ในบริบทนี้ = Exploitation + Installation (ขั้นที่ 4-5) คือ การ "เจาะผ่าน" ป้องกันเพื่อได้ Access เข้าสู่ระบบ

🎯 Penetration Testing (Ethical Hacking) - กระบวนการมาตรฐาน

Penetration Test (Pentest) = การจำลองการโจมตีอย่างเป็นทางการ เพื่อหาช่องโหว่ก่อน Hacker จริง

ขั้นตอนมาตรฐาน (PTES / NIST 800-115)

  1. Pre-engagement - Scope, Rules of Engagement (RoE), Legal Contract, Timeline
  2. Reconnaissance (Information Gathering) - Passive + Active Recon
  3. Threat Modeling & Vulnerability Analysis - วิเคราะห์ข้อมูล Recon, Rank Risk, เลือก Target
  4. Exploitation (Penetration) - พยายาม Exploit ช่องโหว่เพื่อได้ Access (Controlled, Safe)
  5. Post-Exploitation - Privilege Escalation, Lateral Movement, Data Exfiltration (Simulated), Persistence
  6. Reporting - Executive Summary, Technical Findings, Risk Rating, Remediation, Retest
  7. Remediation & Retest - ลูกค้าแก้ไข, Pentester ทดสอบใหม่

ทำไม Reconnaissance จึงสำคัญที่สุดใน Pentest?

  • 80% ของความสำเร็จอยู่ที่ Recon - ข้อมูลดี = Exploit ง่าย/แม่นยำ
  • Recon ไม่ดี = ยิงในท 어둠, ทำลายระบบโดยไม่ได้ตั้งใจ, พลาดช่องโหว่จริง
  • Recon ช่วย Scope Reduction - โฟกัสเฉพาะจุดอ่อนจริง ประหยัดเวลา/งบ

🛡️ การป้องกัน Reconnaissance (Defensive Perspective)

Recon Typeการป้องกัน/ลดทอน
Passive (OSINT)ลดข้อมูลสาธารณะ: ลบ Subdomain ไม่ใช้, ซ่อน Version Header, ใช้ CDN/WAF ซ่อน Origin IP, จำกัด WHOIS Privacy, Employee Social Media Policy
Active (Scanning)WAF/IPS บล็อก Scanner, Rate Limiting, Port Knocking, Honeypots/Deception, Network Segmentation, Disable Unused Services/Ports
PhysicalPhysical Security: Badge Access, Mantrap, Visitor Log, Shred Documents, Wireless Segmentation (Guest/Corp/IoT)

🛠️ เครื่องมือ Reconnaissance ยอดนิยม

หมวดหมู่เครื่องมือวัตถุประสงค์
OSINT / PassiveMaltego, TheHarvester, Recon-ng, SpiderFoot, Amass, Subfinder, AssetfinderDomain/Subdomain/Email/IP Enumeration
Search EnginesGoogle Dorks, Shodan, Censys, FOFA, ZoomEye, BinaryEdge, GreyNoiseInternet-facing Asset Discovery
Network ScanningNmap, Masscan, Zmap, RustScan, NaabuPort Scanning, Service Detection, OS Fingerprint
Web ReconBurp Suite, OWASP ZAP, Nikto, Dirb/Gobuster/Ffuf, WhatWeb, WappalyzerWeb App Mapping, Directory Brute-force, Tech Detection
AD/InternalBloodHound, SharpHound, Enum4linux, Ldapdomaindump, CrackMapExecActive Directory Recon, Privilege Paths
Cloud ReconCloudSploit, ScoutSuite, Prowler, Pacu, TruffleHogCloud Misconfig, IAM, Storage, Keys

⚖️ Legal & Ethical Boundary

  • Passive OSINT: มักถูกกฎหมาย (ข้อมูลสาธารณะ) แต่ข้อมูลส่วนบุคคลอาจผิด PDPA/GDPR
  • Active Scanning/Exploitation: ผิดกฎหมายหากไม่ได้รับอนุญาตเป็นลายลักษณ์อักษร (Computer Crime Act, CFAA, UK CMA)
  • Pentest ต้องมี: Signed Contract, RoE, Scope Document, Written Authorization, Insurance

สรุป

Reconnaissance = "知己知彼 百战不殆" (รู้敵รู้己 ร้อยชนะร้อย)
Penetration = การใช้ข้อมูลจาก Recon เพื่อเจาะเข้าได้จริง (Exploit)
ในมุมมองป้องกัน: ลดข้อมูลที่รั่วไหล (OSINT) + บล็อก/ตรวจจับ Active Recon (WAF/IPS/NDR/Deception) + Segment Network เพื่อให้ Hacker Recon ได้ยาก และ Penetration ได้ยากขึ้น