
Содержание
1. Что такое Penetration Testing2. Методологии Penetration Testing
3. Подготовка к тестированию
4. Разведка и сбор информации
5. Сканирование и перечисление
6. Анализ уязвимостей
7. Эксплуатация уязвимостей
8. Пост-эксплуатация
9. Анализ и отчетность
10. Инструменты для Penetration Testing
11. Безопасность и compliance
12. Практические примеры
13. Часто задаваемые вопросы
14. Заключение
Что такое Penetration Testing
Penetration testing (pentesting) - это симуляция кибератаки на систему, сеть или приложение с целью выявления уязвимостей безопасности. Процесс проводится этичными хакерами (white hat hackers) с разрешения владельца системы.
Цели Penetration Testing
- Выявление уязвимостей до того, как ими воспользуются злоумышленники
- Оценка эффективности существующих мер безопасности
- Проверка incident response процедур
- Улучшение security posture организации
- Соответствие стандартам (PCI DSS, HIPAA, GDPR)
Типы Penetration Testing
#### По степени знания (Knowledge)
- Black Box - тестировщик не имеет информации о системе
- White Box - полная информация о системе доступна
- Gray Box - частичная информация о системе
#### По области тестирования (Scope)
- Network Penetration Testing - тестирование сети
- Web Application Testing - тестирование веб-приложений
- Wireless Network Testing - тестирование Wi-Fi сетей
- Mobile Application Testing - тестирование мобильных приложений
- Cloud Infrastructure Testing - тестирование облачных сред
- IoT Device Testing - тестирование IoT устройств
- API Testing - тестирование API
#### По степени воздействия (Impact)
- Passive Testing - без воздействия на систему
- Active Testing - с активным воздействием
- Destructive Testing - с возможностью повреждения данных
Методологии Penetration Testing
PTES (Penetration Testing Execution Standard)
1. Pre-engagement - планирование и scoping
2. Intelligence Gathering - сбор информации
3. Vulnerability Analysis - анализ уязвимостей
4. Exploitation - эксплуатация
5. Post Exploitation - пост-эксплуатация
6. Reporting - отчетность
OSSTMM (Open Source Security Testing Methodology Manual)
- Operational Security Metrics
- Trust Analysis
- Workflow Analysis
- Human Security Testing
OWASP Testing Guide
- Information Gathering
- Configuration Management Testing
- Identity Management Testing
- Authentication Testing
- Authorization Testing
- Session Management Testing
- Input Validation Testing
- Error Handling
- Cryptography
- Business Logic Testing
- Client Side Testing
Подготовка к тестированию
1. Определение scope и правил
- [ ] Определить границы тестирования (IP ranges, domains, applications)- [ ] Получить письменное разрешение (Get Out of Jail Free card)
- [ ] Определить Rules of Engagement (RoE)
- [ ] Установить контактные лица и emergency procedures
- [ ] Определить время тестирования (business hours, maintenance windows)
- [ ] Установить исключения (out of scope systems)
2. Сбор предварительной информации
- [ ] Получить network diagrams и architecture documentation- [ ] Собрать информацию о технологиях и платформах
- [ ] Получить credentials для тестирования (если white box)
- [ ] Определить critical assets и data flows
- [ ] Собрать информацию о third-party integrations
- [ ] Изучить compliance requirements
3. Настройка тестового окружения
- [ ] Настроить isolated testing environment- [ ] Установить penetration testing tools
- [ ] Настроить VPN/proxy для анонимности
- [ ] Подготовить virtual machines для testing
- [ ] Настроить logging и monitoring
- [ ] Подготовить backup plans
4. Определение success criteria
- [ ] Определить goals of engagement- [ ] Установить metrics for success
- [ ] Определить risk levels (low, medium, high, critical)
- [ ] Настроить communication channels
- [ ] Подготовить templates для отчетов
- [ ] Установить timeline и milestones
Разведка и сбор информации
5. Passive Intelligence Gathering
- [ ] Провести WHOIS lookup для доменов- [ ] Изучить DNS records (A, MX, TXT, CNAME)
- [ ] Проверить SSL certificates и chain
- [ ] Изучить job postings на LinkedIn/Glassdoor
- [ ] Найти email addresses через OSINT
- [ ] Проверить social media profiles компании
- [ ] Изучить Google Dorks для sensitive information
- [ ] Проверить Shodan для exposed services
- [ ] Изучить Wayback Machine для historical data
- [ ] Проверить public repositories (GitHub, GitLab)
6. Active Intelligence Gathering
- [ ] Провести port scanning (TCP/UDP)- [ ] Использовать service detection (banner grabbing)
- [ ] Проверить DNS enumeration
- [ ] Изучить web server headers
- [ ] Проверить SSL/TLS configurations
- [ ] Найти subdomains через brute force
- [ ] Проверить zone transfers
- [ ] Изучить email spoofing capabilities
- [ ] Проверить SPF/DKIM/DMARC records
- [ ] Найти leaked credentials в breaches
7. Network Mapping
- [ ] Создать network topology map- [ ] Идентифицировать network segments
- [ ] Определить firewall rules
- [ ] Найти DMZ configurations
- [ ] Проверить VPN endpoints
- [ ] Изучить wireless networks
- [ ] Определить network boundaries
- [ ] Найти internal vs external systems
- [ ] Проверить network segmentation
- [ ] Изучить routing configurations
8. Application Fingerprinting
- [ ] Определить web server software- [ ] Найти CMS (WordPress, Joomla, Drupal)
- [ ] Проверить framework versions
- [ ] Изучить API endpoints
- [ ] Найти third-party components
- [ ] Проверить JavaScript libraries
- [ ] Изучить mobile app certificates
- [ ] Найти API documentation
- [ ] Проверить version disclosure
- [ ] Изучить error messages
Сканирование и перечисление
9. Port Scanning
- [ ] TCP SYN scan для открытых портов- [ ] UDP scanning для UDP services
- [ ] Service version detection
- [ ] OS fingerprinting
- [ ] IPv6 scanning если применимо
- [ ] Проверить firewall evasion techniques
- [ ] Найти non-standard ports
- [ ] Проверить port knocking
- [ ] Изучить service banners
- [ ] Найти filtered ports
10. Vulnerability Scanning
- [ ] Запустить automated vulnerability scanners (Nessus, OpenVAS)- [ ] Проверить CVE databases
- [ ] Найти misconfigurations
- [ ] Проверить default credentials
- [ ] Изучить patch levels
- [ ] Найти exposed services
- [ ] Проверить SSL/TLS vulnerabilities
- [ ] Найти weak ciphers
- [ ] Проверить certificate validation
- [ ] Изучить outdated software
11. Web Application Scanning
- [ ] Crawl website для всех страниц- [ ] Найти hidden directories (/admin, /backup)
- [ ] Проверить robots.txt и sitemap.xml
- [ ] Изучить cookies и session management
- [ ] Найти API endpoints
- [ ] Проверить HTTP methods (PUT, DELETE)
- [ ] Изучить form inputs
- [ ] Найти file upload functionality
- [ ] Проверить authentication mechanisms
- [ ] Изучить authorization controls
12. Wireless Network Assessment
- [ ] Scan для wireless networks (WiFi, Bluetooth)- [ ] Проверить encryption types (WEP, WPA, WPA2, WPA3)
- [ ] Найти rogue access points
- [ ] Проверить signal strength и coverage
- [ ] Изучить wireless security configurations
- [ ] Найти WPS vulnerabilities
- [ ] Проверить deauthentication attacks
- [ ] Изучить wireless client isolation
- [ ] Найти evil twin attacks
- [ ] Проверить Bluetooth vulnerabilities
Анализ уязвимостей
13. Web Application Vulnerabilities
- [ ] SQL Injection testing- [ ] XSS (Cross-Site Scripting) testing
- [ ] CSRF (Cross-Site Request Forgery) testing
- [ ] Command Injection testing
- [ ] Directory Traversal testing
- [ ] File Inclusion vulnerabilities
- [ ] Insecure Direct Object References
- [ ] Security Misconfigurations
- [ ] Broken Authentication
- [ ] Sensitive Data Exposure
- [ ] XML External Entity (XXE) testing
- [ ] Insecure Deserialization
- [ ] Broken Access Control
- [ ] Insufficient Logging & Monitoring
- [ ] Server-Side Request Forgery (SSRF)
14. Network Vulnerabilities
- [ ] Open ports analysis- [ ] Service misconfigurations
- [ ] Weak authentication
- [ ] Unencrypted communications
- [ ] Man-in-the-Middle vulnerabilities
- [ ] ARP poisoning potential
- [ ] DNS spoofing vulnerabilities
- [ ] SNMP misconfigurations
- [ ] FTP anonymous access
- [ ] Telnet cleartext passwords
- [ ] RDP vulnerabilities
- [ ] SMB vulnerabilities
- [ ] NetBIOS issues
15. System Vulnerabilities
- [ ] Privilege escalation vectors- [ ] Buffer overflow vulnerabilities
- [ ] Race conditions
- [ ] Weak file permissions
- [ ] SUID/SGID binaries
- [ ] Kernel exploits
- [ ] Outdated software versions
- [ ] Missing security patches
- [ ] Weak password policies
- [ ] Lockout mechanisms
- [ ] Account enumeration
- [ ] Password spraying vulnerabilities
16. Database Vulnerabilities
- [ ] SQL Injection в database queries- [ ] Weak authentication to databases
- [ ] Unencrypted database connections
- [ ] Database misconfigurations
- [ ] Backup files exposure
- [ ] Database enumeration
- [ ] NoSQL Injection
- [ ] Database privilege escalation
- [ ] Weak encryption of stored data
- [ ] Database backup vulnerabilities
- [ ] Database DoS vulnerabilities
Эксплуатация уязвимостей
17. Web Exploitation
- [ ] Exploit SQL Injection для data extraction- [ ] XSS payload execution
- [ ] CSRF token bypass
- [ ] Command execution через injection
- [ ] Directory traversal для file access
- [ ] File upload vulnerabilities exploitation
- [ ] Authentication bypass techniques
- [ ] Session hijacking
- [ ] Cookie manipulation
- [ ] Parameter tampering
- [ ] HTTP Request Smuggling
- [ ] Web Cache Poisoning
- [ ] Server-Side Template Injection
18. Network Exploitation
- [ ] Buffer overflow exploits- [ ] Remote code execution
- [ ] Service exploits (SMB, RDP, etc.)
- [ ] Man-in-the-Middle attacks
- [ ] ARP spoofing для traffic interception
- [ ] DNS poisoning
- [ ] Wireless cracking (WEP, WPA)
- [ ] Bluetooth exploits
- [ ] USB Rubber Ducky attacks
- [ ] Network sniffing для credential harvesting
- [ ] VPN bypass techniques
19. System Exploitation
- [ ] Local privilege escalation- [ ] Kernel exploits execution
- [ ] DLL hijacking
- [ ] Pass-the-hash attacks
- [ ] Golden ticket attacks (Active Directory)
- [ ] Linux privilege escalation
- [ ] Windows privilege escalation
- [ ] Container escape techniques
- [ ] Hypervisor exploits
- [ ] Firmware exploits
- [ ] Bootloader vulnerabilities
20. Post-Exploitation Setup
- [ ] Establish persistent access- [ ] Install backdoors
- [ ] Create user accounts
- [ ] Modify system logs
- [ ] Disable security controls
- [ ] Establish command and control
- [ ] Data exfiltration channels
- [ ] Lateral movement preparation
- [ ] Domain escalation vectors
- [ ] Anti-forensics measures bypass
Пост-эксплуатация
21. Privilege Escalation
- [ ] Kernel exploit execution- [ ] SUID binary exploitation
- [ ] sudo misconfigurations
- [ ] Weak service permissions
- [ ] Cron job exploitation
- [ ] SetUID exploitation
- [ ] Capability exploitation
- [ ] Docker group membership
- [ ] LXD/LXC container escape
- [ ] Windows token impersonation
- [ ] Linux capability abuse
22. Lateral Movement
- [ ] Pass-the-hash techniques- [ ] Pass-the-ticket attacks
- [ ] RDP session hijacking
- [ ] SMB relay attacks
- [ ] SSH key theft
- [ ] Database link exploitation
- [ ] Wireless pivoting
- [ ] Internal network scanning
- [ ] Domain trust exploitation
- [ ] Cross-forest attacks
23. Data Exfiltration
- [ ] Identify valuable data- [ ] Establish exfiltration channels
- [ ] DNS tunneling
- [ ] HTTP/S exfiltration
- [ ] ICMP tunneling
- [ ] Cloud storage abuse
- [ ] USB device exfiltration
- [ ] Print job exfiltration
- [ ] Email exfiltration
- [ ] Encrypted exfiltration
- [ ] Anti-forensics evasion
24. Persistence Mechanisms
- [ ] Scheduled task creation- [ ] Service creation/modification
- [ ] Registry modifications (Windows)
- [ ] Cron job creation (Linux)
- [ ] Startup folder modifications
- [ ] DLL hijacking
- [ ] Netcat listeners
- [ ] Web shell installation
- [ ] Backdoor installation
- [ ] Rootkit deployment
Анализ и отчетность
25. Vulnerability Analysis
- [ ] Categorize findings by severity (Critical, High, Medium, Low)- [ ] Assess business impact
- [ ] Determine exploitability
- [ ] Check for compensating controls
- [ ] Validate false positives
- [ ] Correlate related vulnerabilities
- [ ] Assess remediation complexity
- [ ] Determine risk levels
- [ ] Check for compliance violations
- [ ] Validate vulnerability chaining
26. Risk Assessment
- [ ] Calculate CVSS scores- [ ] Assess threat actor capability
- [ ] Evaluate attack vectors
- [ ] Determine likelihood of exploitation
- [ ] Assess potential damage
- [ ] Consider business context
- [ ] Evaluate detection capabilities
- [ ] Assess remediation priority
- [ ] Determine risk tolerance
- [ ] Validate risk calculations
27. Report Writing
- [ ] Executive summary creation- [ ] Technical findings documentation
- [ ] Vulnerability details description
- [ ] Proof-of-concept inclusion
- [ ] Remediation recommendations
- [ ] Risk assessment inclusion
- [ ] Compliance mapping
- [ ] Timeline and methodology
- [ ] Appendices with raw data
- [ ] Report formatting and presentation
28. Remediation Validation
- [ ] Verify fixes implementation- [ ] Re-test vulnerabilities
- [ ] Confirm compensating controls
- [ ] Validate configuration changes
- [ ] Test patch effectiveness
- [ ] Confirm monitoring improvements
- [ ] Validate access control changes
- [ ] Test incident response procedures
- [ ] Confirm backup integrity
- [ ] Validate disaster recovery
Инструменты для Penetration Testing
29. Information Gathering
- [ ] Maltego для OSINT- [ ] Recon-ng для automated reconnaissance
- [ ] theHarvester для email harvesting
- [ ] Shodan для IoT search
- [ ] Censys для certificate search
- [ ] Amass для DNS enumeration
- [ ] Sublist3r для subdomain enumeration
- [ ] Dirbuster/Gobuster для directory brute force
- [ ] WhatWeb для web technology detection
- [ ] Wappalyzer для technology stack analysis
30. Scanning Tools
- [ ] Nmap для port scanning- [ ] Masscan для fast scanning
- [ ] ZMap для internet-wide scanning
- [ ] Nessus для vulnerability scanning
- [ ] OpenVAS для open source scanning
- [ ] Nikto для web server scanning
- [ ] OWASP ZAP для web app scanning
- [ ] Burp Suite для web proxy
- [ ] SQLMap для SQL injection
- [ ] Dirb/Dirbuster для directory brute force
31. Exploitation Frameworks
- [ ] Metasploit Framework- [ ] Cobalt Strike
- [ ] Empire
- [ ] Covenant
- [ ] Silent Trinity
- [ ] Merlin
- [ ] Brute Ratel
- [ ] Havoc
- [ ] Sliver
- [ ] Phoenix
32. Wireless Tools
- [ ] Aircrack-ng suite- [ ] Kismet для wardriving
- [ ] Wireshark для packet analysis
- [ ] Fern WiFi Cracker
- [ ] Reaver для WPS cracking
- [ ] Pixie Dust для WPS attacks
- [ ] MDK4 для wireless attacks
- [ ] Hostapd для rogue AP
- [ ] Bettercap для MITM
- [ ] Evil Twin frameworks
Безопасность и compliance
33. Legal Compliance
- [ ] Получить written authorization- [ ] Define clear scope and boundaries
- [ ] Establish Rules of Engagement
- [ ] Comply with local laws
- [ ] Respect international boundaries
- [ ] Protect sensitive data discovered
- [ ] Maintain chain of custody
- [ ] Follow ethical guidelines
- [ ] Report findings responsibly
- [ ] Maintain professional conduct
34. Data Protection
- [ ] Encrypt sensitive data in transit- [ ] Secure storage of findings
- [ ] Implement access controls
- [ ] Use secure communication channels
- [ ] Protect client confidentiality
- [ ] Follow data minimization principles
- [ ] Implement secure deletion
- [ ] Maintain audit trails
- [ ] Comply with GDPR requirements
- [ ] Protect PII and sensitive information
35. Operational Security
- [ ] Use VPN for all testing activities- [ ] Implement proper logging
- [ ] Maintain situational awareness
- [ ] Follow least privilege principle
- [ ] Implement secure configurations
- [ ] Use encrypted communications
- [ ] Maintain operational discipline
- [ ] Implement proper cleanup
- [ ] Document all activities
- [ ] Maintain professional standards
36. Incident Management
- [ ] Establish emergency contacts- [ ] Define incident response procedures
- [ ] Implement monitoring and alerting
- [ ] Prepare rollback procedures
- [ ] Define communication protocols
- [ ] Establish escalation procedures
- [ ] Implement damage control measures
- [ ] Prepare post-incident analysis
- [ ] Document lessons learned
- [ ] Implement preventive measures
Практические примеры
37. Web Application Testing Example
target
: example.com
1. Information Gathering: WHOIS, DNS enumeration, Shodan
2. Scanning: Nmap port scan, Nikto web scan
3. Vulnerability Analysis: SQLMap, XSS testing
4. Exploitation: SQL injection payload execution
5. Post-exploitation: Data extraction, privilege escalation
6. Reporting: Detailed findings with PoC
38. Network Penetration Example
target
: 192.168.1.0/24
1. Passive recon: Public IP enumeration
2. Active scanning: Nmap comprehensive scan
3. Service enumeration: Banner grabbing, version detection
4. Vulnerability scanning: Nessus/OpenVAS
5. Exploitation: Metasploit modules execution
6. Lateral movement: Pass-the-hash techniques
7. Data exfiltration: Encrypted channels
39. Wireless Network Testing Example
target
: Corporate WiFi network
1. Wardriving: Kismet for network discovery
2. Signal analysis: Aircrack-ng survey
3. Encryption testing: WEP/WPA cracking attempts
4. Rogue AP detection: Evil twin identification
5. Client isolation testing: Deauthentication attacks
6. WPS testing: Pixie Dust attacks
7. Bluetooth assessment: BlueBorne vulnerabilities
40. Mobile Application Testing Example
target
: Android/iOS app
1. Static analysis: APK/IPA reverse engineering
2. Dynamic analysis: Runtime behavior monitoring
3. Network traffic analysis: Burp Suite proxy
4. API testing: Endpoint enumeration and testing
5. Data storage analysis: SQLite database inspection
6. Certificate pinning bypass: SSL pinning removal
7. Jailbreak/root detection bypass
Часто задаваемые вопросы
Основы Penetration Testing
Что такое penetration testing?Это симуляция реальной кибератаки для выявления уязвимостей в системах безопасности.
Зачем нужен penetration testing?
Для проактивного выявления уязвимостей до того, как ими воспользуются злоумышленники.
Кто проводит penetration testing?
Сертифицированные ethical hackers с опытом в кибербезопасности.
Как часто нужно проводить pentesting?
Рекомендуется ежегодно, или после значительных изменений в инфраструктуре.
Технические вопросы
Какие навыки нужны для pentesting?Знание сетевых технологий, программирования, операционных систем, уязвимостей и инструментов.
Сколько стоит penetration testing?
От $5,000 до $50,000+ в зависимости от scope и complexity.
Какой timeframe для pentesting?
От 1 недели для small scope до нескольких месяцев для enterprise assessment.
Нужно ли разрешение для pentesting?
Обязательно! Без письменного разрешения это незаконно.
Compliance и Standards
Какие стандарты регулируют pentesting?OSSTMM, PTES, OWASP, NIST, PCI DSS, HIPAA.
Обязателен ли pentesting для compliance?
Для многих индустрий (финансы, healthcare) - да.
Кто может заказать pentesting?
Любая организация, заботящаяся о безопасности.
Можно ли pentesting проводить самостоятельно?
Да, но профессиональный аудит предпочтительнее.
Заключение
Этот чек-лист охватывает все ключевые аспекты penetration testing - от подготовки до отчетности. Следование этой методологии гарантирует всестороннюю оценку безопасности вашей инфраструктуры.
Ключевые принципы успешного pentesting:
1. Подготовка - четкое определение scope и получение разрешения
2. Методичность - следование proven methodologies
3. Документация - детальная запись всех действий и findings
4. Этичность - соблюдение законов и professional standards
5. Непрерывность - регулярное проведение и обновление навыков
Рекомендации:
- Начинайте с обучения - получите сертификации (CEH, OSCP, GPEN)- Практикуйте на labs - HackTheBox, TryHackMe, VulnHub
- Следуйте ethical guidelines - всегда работайте с разрешения
- Обновляйте знания - уязвимости и техники постоянно эволюционируют
- Сотрудничайте - делитесь знаниями в сообществе
Помните: penetration testing - это не просто поиск уязвимостей, а комплексный подход к улучшению безопасности организации.
---
**⚠️ Дисклеймер:** Статья носит информационно-образовательный характер и не содержит инструкций для совершения противоправных действий.