The follwoig is an elaborate, step-by-step process for conducting black box penetration testing on your entity's public IP addresses from an internal perspective. In thie post I will cover only the steps, the commands and scripts will be covered in upcoming posts.
Please make ensure that before conducting the assessment you have proper signed authorisation in hand other wise you may have to phase legal consequences.
Phase 1: Pre-Engagement and Planning
Step 1: Scope Definition and Authorization
- Document all target IP addresses/ranges in scope
- Obtain written authorization (Rules of Engagement document)
- Define testing windows (time frames when testing is permitted)
- Identify critical systems that should be handled carefully
- Confirm legal compliance requirements (GDPR, HIPAA, etc.)
Step 2: Information Gathering Setup
- Set up a dedicated testing environment/workstation
- Install necessary tools required for the engagment.
- Configure logging mechanisms for all activities
- Establish secure communication channels with stakeholders
- Create project documentation structure.
Step 3: Passive Reconnaissance
Since this is black box testing, start with zero knowledge:
- DNS enumeration:
- Perform DNS lookups (A, AAAA, MX, NS, TXT, SOA records)
- Use tools:
dig,nslookup,host - Check for DNS zone transfers
- Subdomain enumeration using passive methods
- WHOIS lookups:
- Gather registration information
- Identify IP ownership and ranges
- Note administrative contacts
- Search engine reconnaissance:
- Google dorking for exposed information
- Check cached pages
- Look for exposed documents, configurations
- Public database searches:
- Shodan, Censys for exposed services
- Certificate transparency logs
- Pastebin/GitHub searches for leaked credentials
Step 4: Active Reconnaissance
- Network scanning:
- Ping sweeps to identify live hosts
- Port scanning (TCP/UDP) using
nmap - Service version detection
- OS fingerprinting
- Service enumeration:
- Banner grabbing
- Identify running services and versions
- Document all discovered services
Phase 3: Vulnerability Assessment
Step 5: Automated Vulnerability Scanning
- Run vulnerability scanners:
- Nessus, OpenVAS, or Qualys
- Configure scans appropriately (credentialed vs non-credentialed)
- Scan for known vulnerabilities (CVEs)
- Check for misconfigurations
- Web application scanning (if applicable):
- Use Burp Suite, OWASP ZAP, Nikto
- Identify web technologies
- Check for common web vulnerabilities
Step 6: Manual Vulnerability Verification
- Verify scanner findings to reduce false positives
- Prioritize vulnerabilities by severity and exploitability
- Document all findings with evidence (screenshots, logs)
Phase 4: Exploitation
Step 7: Exploit Planning
- Create attack vectors based on discovered vulnerabilities
- Prioritize targets based on:
- Critical systems
- Likelihood of success
- Potential impact
- Plan exploitation approach (manual vs automated tools)
Step 8: Exploitation Execution
Network Services:
- Exploit vulnerable services (SMB, RDP, SSH, FTP, etc.)
- Use Metasploit Framework or custom exploits
- Attempt default/weak credentials
- Brute force attacks (if authorized)
- Password spraying attacks
Web Applications:
- SQL injection testing
- Cross-Site Scripting (XSS)
- Cross-Site Request Forgery (CSRF)
- Authentication/authorization bypass
- File upload vulnerabilities
- Server-Side Request Forgery (SSRF)
- XML External Entity (XXE) attacks
- Insecure deserialization
- Business logic flaws
Wireless (if in scope):
- WPA/WPA2 cracking
- Evil twin attacks
- Rogue access point detection
Step 9: Post-Exploitation
Once access is gained:
- Establish persistence (if authorized)
- Privilege escalation:
- Linux: kernel exploits, sudo misconfigurations, SUID binaries
- Windows: token manipulation, service exploits, unquoted service paths
- Lateral movement:
- Network pivoting
- Pass-the-hash/Pass-the-ticket attacks
- Credential dumping (mimikatz, secretsdump)
- Exploit trust relationships
- Data exfiltration simulation:
- Identify sensitive data
- Test data loss prevention controls
- Document what could be accessed
Phase 5: Specific Attack Scenarios
Step 10: Test Specific Attack Vectors
Scenario A: External Perimeter Breach
- Attempt to breach firewall rules
- Test VPN vulnerabilities
- Exploit exposed management interfaces
- Check for information leakage through error messages
Scenario B: Social Engineering (if authorized)
- Phishing campaigns
- Vishing attempts
- Physical security testing
Scenario C: Denial of Service (with caution)
- Test application-level DoS vulnerabilities
- Check resource exhaustion points
- Only with explicit authorization and careful planning
Scenario D: Man-in-the-Middle
- SSL/TLS testing
- Certificate validation issues
- Protocol downgrade attacks
Scenario E: API Security Testing
- Authentication/authorization flaws
- Rate limiting issues
- Input validation problems
- Broken object level authorization
Phase 6: Analysis and Reporting
Step 11: Evidence Collection
- Compile all screenshots, logs, and proof-of-concept code
- Document exact steps to reproduce each finding
- Calculate risk ratings (CVSS scores)
- Categorize findings by severity
Step 12: Report Generation
Create comprehensive report including:
Executive Summary:
- High-level findings
- Business impact
- Risk assessment
- Strategic recommendations
Technical Details:
- Detailed methodology
- Complete findings with evidence
- Step-by-step reproduction steps
- Affected systems/assets
- CVSS scores and risk ratings
Remediation Recommendations:
- Prioritized action items
- Specific remediation steps
- Compensating controls
- Timelines for remediation
Step 13: Presentation and Debriefing
- Present findings to stakeholders
- Conduct technical debrief with IT/security teams
- Answer questions and clarify findings
- Provide remediation support guidance
Phase 7: Remediation Verification
Step 14: Retest Fixed Vulnerabilities
- Schedule retesting after remediation period
- Verify fixes are properly implemented
- Ensure no new vulnerabilities were introduced
- Document remaining risks
Step 15: Final Documentation
- Update report with retest results
- Provide final risk assessment
- Archive all testing artifacts securely
- Lessons learned documentation
Tools Checklist
Reconnaissance:
- nmap, masscan, zmap
- dnsenum, dnsrecon, subfinder
- theHarvester, Maltego
- Shodan, Censys
Vulnerability Assessment:
- Nessus, OpenVAS, Qualys
- Nikto, WPScan
- Burp Suite Professional, OWASP ZAP
Exploitation:
- Metasploit Framework
- SQLmap
- Hydra, Medusa
- John the Ripper, Hashcat
- Empire, Covenant
- Responder, Impacket
Post-Exploitation:
- Mimikatz, LaZagne
- BloodHound
- PowerSploit
- LinPEAS, WinPEAS
Reporting:
- Dradis, Serpico
- Faraday
Best Practices and Considerations
- Always maintain detailed logs of all activities
- Stay within scope - never test unauthorized systems
- Be cautious with destructive tests - understand the impact
- Maintain confidentiality of all findings
- Follow responsible disclosure practices
- Keep tools and exploit databases updated
- Use throttling to avoid overwhelming systems
- Have a rollback plan for any changes made
- Communicate regularly with stakeholders during testing
- Comply with all legal and regulatory requirements
Risk Management
- Stop testing immediately if you encounter unexpected behavior
- Have incident response procedures ready
- Document all potential impacts before exploitation
- Maintain chain of custody for all evidence
- Use secure storage for sensitive findings
This post I tried to consolidated all major scenarios in black box penetration testing. Remember that each organization's environment is unique, so adapt this methodology to your specific needs and constraints.