Introduction to Ethical Hacking, Reconnaissance, Footprinting, Enumeration & Scanning
Application Security — Chapter 1 / Week 1
Introduction to Ethical Hacking, Reconnaissance, Footprinting, Enumeration & Scanning
1. Disclaimer
Application Security and VAPT involve techniques that can generate traffic, trigger security controls, expose sensitive information, or potentially affect systems.
All practical security testing must be performed only against:
- ›Systems you own
- ›Systems for which you have explicit written authorization
- ›Intentionally vulnerable laboratory environments
- ›Systems explicitly included in an organization's testing scope
Examples of suitable training environments include:
- ›OWASP Juice Shop
- ›DVWA
- ›Metasploitable
- ›WebGoat
- ›Your own web application
- ›Your own virtual machines
Never assume that a publicly accessible system is automatically available for testing.
For example:
Publicly accessible
≠
Authorized to testA professional penetration tester works within:
Authorization
↓
Scope
↓
Rules of Engagement
↓
Testing
↓
Evidence
↓
Reporting
↓
Remediation
↓
Retesting2. What Do People Think When They Hear "Hacker"?
When people hear the word hacker, they often imagine:
- ›Someone sitting in a dark room
- ›A black screen with green text
- ›Extremely fast typing
- ›Breaking into systems instantly
- ›Stealing passwords
- ›Hacking social-media accounts
- ›Installing viruses
- ›Stealing money
This is largely a Hollywood representation.
The reality is considerably more technical.
A hacker is fundamentally someone who understands how a technology, system, application, or process works and finds ways to manipulate it beyond its intended behavior.
For example, suppose an application is designed like this:
Username + Password
↓
Authentication
↓
DashboardA security researcher discovers that changing a particular request allows access to the dashboard without successfully authenticating.
The researcher has discovered a security weakness.
The important distinction is not simply the technique.
It is:
Technique + Authorization + Intent + ImpactThe same technical knowledge can be used by:
- ›A penetration tester
- ›A security researcher
- ›An application security engineer
- ›A red team
- ›A malicious attacker
Therefore:
SECURITY_ADVISORYHacking knowledge itself is not inherently malicious. How and where that knowledge is applied matters.
3. What Is Hacking?
A useful definition is:
SECURITY_ADVISORYHacking is the process of understanding a system and finding ways to make it behave differently from its intended design or security assumptions.
A hacker might investigate:
- ›Applications
- ›Networks
- ›Operating systems
- ›APIs
- ›Authentication mechanisms
- ›Cloud infrastructure
- ›Identity systems
- ›Databases
- ›Hardware
- ›AI/ML systems
For Application Security, the primary focus is:
Application
↓
Requests
↓
Processing
↓
Authentication
↓
Authorization
↓
Data
↓
Business LogicThe tester asks:
SECURITY_ADVISORY"Can the application be made to do something it should not allow?"
4. Types of Hackers
The traditional classification divides hackers into three broad categories:
Hackers
|
+-----------+-----------+
| | |
White Hat Grey Hat Black Hat4.1 White Hat Hacker
A White Hat hacker is an authorized security professional.
Typical roles include:
- ›Penetration Tester
- ›VAPT Engineer
- ›Application Security Engineer
- ›Security Researcher
- ›Red Team Operator
- ›Security Consultant
The objective is generally defensive:
Find weakness
↓
Validate weakness
↓
Understand impact
↓
Report
↓
FixExample:
A company gives a penetration tester permission to assess:
https://app.example.comfrom August 1 to August 15.
The tester performs reconnaissance and identifies a vulnerable API endpoint.
The tester documents:
- ›Endpoint
- ›Vulnerability
- ›Reproduction steps
- ›Impact
- ›Evidence
- ›Remediation
This is ethical security testing.
5. Grey Hat Hacker
A Grey Hat hacker generally falls between the traditional White Hat and Black Hat classifications.
A common example is:
Researcher discovers vulnerability
↓
Tests it without authorization
↓
Reports the vulnerabilityThe researcher may not have malicious intent.
However:
SECURITY_ADVISORYGood intentions do not automatically make unauthorized security testing acceptable.
Authorization is a fundamental part of professional security testing.
6. Black Hat Hacker
Black Hat hackers perform unauthorized or malicious activities.
Potential objectives include:
- ›Financial gain
- ›Credential theft
- ›Data theft
- ›Extortion
- ›Espionage
- ›Fraud
- ›Disruption
- ›Ransomware
- ›Unauthorized access
A simplified attack chain might look like:
Reconnaissance
↓
Discovery
↓
Initial Access
↓
Privilege Escalation
↓
Persistence
↓
Data Access
↓
ImpactThe important distinction is:
Authorized security testing
vs
Unauthorized malicious activity7. What Is Ethical Hacking?
Ethical hacking is:
SECURITY_ADVISORYAuthorized security testing performed to identify, validate, and help remediate security weaknesses.
Three concepts are especially important.
Authorization
You have permission.
Scope
You know what you are allowed to test.
Objective
You understand why the testing is being performed.
For example:
Allowed:
api.example.com
Not allowed:
production-database.example.comEven if both belong to the same organization, the tester must respect the agreed scope.
8. Application Security
Application Security, commonly called AppSec, is the discipline of protecting applications throughout their lifecycle.
It includes:
- ›Security requirements
- ›Secure architecture
- ›Threat modeling
- ›Secure coding
- ›Code review
- ›Dependency security
- ›Secrets management
- ›Authentication
- ›Authorization
- ›API security
- ›Security testing
- ›Vulnerability management
- ›Runtime protection
- ›Security monitoring
Application Security should not begin when penetration testing starts.
A secure lifecycle looks like:
Requirements
↓
Architecture
↓
Design
↓
Development
↓
Security Testing
↓
Deployment
↓
Monitoring
↓
MaintenanceSecurity should be integrated throughout this lifecycle.
9. What Is VAPT?
VAPT stands for:
SECURITY_ADVISORYVulnerability Assessment and Penetration Testing.
It combines two related activities.
Vulnerability Assessment
The objective is to:
- ›Discover vulnerabilities
- ›Identify weaknesses
- ›Classify vulnerabilities
- ›Prioritize vulnerabilities
For example:
Application
↓
Security scanner
↓
Potential vulnerabilities
↓
ValidationPenetration Testing
Penetration testing goes further.
The tester attempts to validate whether a vulnerability is actually exploitable and determines its potential impact, while staying within the authorized scope.
Simplified:
Vulnerability
↓
Can it be reproduced?
↓
Can security impact be demonstrated?
↓
How serious is the impact?10. Application Security vs VAPT
Application Security is much broader than VAPT.
| Application Security | VAPT |
|---|---|
| Secure architecture | Reconnaissance |
| Threat modeling | Enumeration |
| Secure coding | Scanning |
| Code review | Vulnerability validation |
| Dependency management | Controlled exploitation |
| Secrets management | Reporting |
| Security requirements | Retesting |
| Security monitoring | Primarily assessment-focused |
Think of VAPT as one component within the larger AppSec program.
Application Security
|
+-----------------+----------------+
| | |
Secure Design Secure Code Security Testing
|
VAPT11. Traditional Phases of Hacking
A traditional penetration-testing model describes five phases:
1. Reconnaissance / Footprinting
↓
2. Scanning
↓
3. Gaining Access
↓
4. Maintaining Access
↓
5. Covering TracksLet's understand each.
12. Phase 1 — Reconnaissance / Footprinting
Reconnaissance is the process of collecting information about a target.
The objective is to understand the target before performing deeper testing.
Questions include:
- ›What domains exist?
- ›What subdomains exist?
- ›What IP addresses are associated with the organization?
- ›What technologies are being used?
- ›Which services are exposed?
- ›What web applications exist?
- ›Is there a WAF?
- ›Are there public repositories?
- ›What public information exists?
The output of reconnaissance should be an attack-surface map.
13. Passive Reconnaissance
Passive reconnaissance attempts to collect information without directly interacting with the target infrastructure, where practical.
Examples:
- ›Search engines
- ›WHOIS/RDAP
- ›Certificate Transparency logs
- ›Public GitHub repositories
- ›Public documentation
- ›Public DNS information
- ›Publicly available organizational information
Example:
Search Engine
↓
Publicly indexed information
↓
Security intelligenceAdvantages:
- ›Less likely to trigger target alerts
- ›Useful for initial intelligence gathering
- ›Can reveal information before active testing begins
14. Active Reconnaissance
Active reconnaissance involves directly interacting with the target.
Examples:
- ›DNS queries
- ›HTTP requests
- ›Port scans
- ›Technology fingerprinting
- ›Directory enumeration
- ›Service enumeration
Example:
Security Tester
↓
HTTP Request
↓
Target
↓
HTTP ResponseBecause traffic is generated, active reconnaissance may be:
- ›Logged
- ›Detected
- ›Rate-limited
- ›Blocked
- ›Alerted on
Therefore, authorization and scope are critical.
15. Understanding Domains
Suppose the organization has:
example.comA domain may have many subdomains:
example.com
│
├── www.example.com
├── api.example.com
├── mail.example.com
├── dev.example.com
├── staging.example.com
├── admin.example.com
└── vpn.example.comEach host may represent a different application or infrastructure component.
For example:
www.example.com
↓
Main website
api.example.com
↓
REST API
admin.example.com
↓
Administrative portal
dev.example.com
↓
Development environmentThis is why subdomain enumeration is important.
16. Domain vs Subdomain
Consider:
api.example.comConceptually:
api . example . com
│ │ │
host domain TLDExamples:
www.example.com
api.example.com
mail.example.com
dev.example.com
staging.example.comA security tester should not assume that every subdomain is equally secure.
Development and forgotten systems can sometimes have weaker security controls.
17. DNS — Domain Name System
DNS translates domain names into information used to locate network services.
Simplified:
www.example.com
↓
DNS
↓
93.184.216.xWithout DNS, users would generally need to remember IP addresses instead of domain names.
18. Important DNS Record Types
A Record
Maps a hostname to an IPv4 address.
example.com → 93.184.216.xCommand:
dig example.com AAAAA Record
Maps a hostname to an IPv6 address.
dig example.com AAAAMX Record
Identifies mail servers.
dig example.com MXExample:
example.com
↓
Mail server
↓
mail.example.comNS Record
Identifies authoritative name servers.
dig example.com NSTXT Record
Contains text associated with a DNS name.
It can be used for legitimate purposes such as:
- ›SPF
- ›Domain verification
- ›Email-related configuration
Command:
dig example.com TXTCNAME Record
Provides an alias to another hostname.
Example:
api.example.com
↓
CNAME
↓
api.provider.exampleSOA Record
Provides information about the authoritative DNS zone.
dig example.com SOAPTR Record
Used for reverse DNS.
dig -x 93.184.216.x19. DNS Enumeration Using dig
dig is one of the most useful DNS troubleshooting and enumeration tools.
Basic:
dig example.comA record:
dig example.com AAAAA:
dig example.com AAAAMX:
dig example.com MXNS:
dig example.com NSTXT:
dig example.com TXTSOA:
dig example.com SOAReverse DNS:
dig -x 93.184.216.xThe important principle is not memorizing commands.
Ask:
SECURITY_ADVISORYWhat question am I trying to answer?
20. host
host is another DNS lookup utility.
host example.comMX:
host -t MX example.comNS:
host -t NS example.comA record:
host -t A example.com21. nslookup
Another common DNS tool is nslookup.
nslookup example.comSpecific record:
nslookup -type=MX example.comTXT:
nslookup -type=TXT example.com22. WHOIS and RDAP
WHOIS traditionally provides registration information about domains and IP addresses.
Command:
whois example.comDepending on the registry and privacy settings, information may include:
- ›Registrar
- ›Creation date
- ›Expiration date
- ›Name servers
- ›Domain status
- ›Registry information
Modern domain-registration ecosystems increasingly use RDAP.
Privacy/proxy services can hide registrant information.
The purpose of this activity is to understand ownership and infrastructure context, not to identify private individuals.
23. IP Enumeration
Suppose:
dig example.com Areturns:
93.184.216.xYou can investigate the IP:
whois 93.184.216.xReverse DNS:
dig -x 93.184.216.xConceptually:
Domain
↓
DNS
↓
IP Address
↓
Network / Hosting
↓
ServicesThis helps build an infrastructure picture.
24. Subdomain Enumeration
Subdomain enumeration attempts to identify subdomains associated with a domain.
For example:
example.com
|
+-- www
+-- api
+-- dev
+-- staging
+-- admin
+-- mailPossible sources include:
- ›DNS
- ›Certificate Transparency
- ›Search engines
- ›Public datasets
- ›Passive DNS
- ›Public code repositories
25. Subfinder
Subfinder is a popular passive subdomain discovery tool.
Basic:
subfinder -d example.comSilent output:
subfinder -d example.com -silentSave output:
subfinder -d example.com -silent -o subdomains.txtExample output:
www.example.com
api.example.com
dev.example.com
staging.example.comThe output should be treated as potentially discovered assets, not automatically confirmed live systems.
26. Amass
OWASP Amass can also perform domain reconnaissance.
Passive enumeration:
amass enum -passive -d example.comSave results:
amass enum -passive -d example.com -o amass.txtA mature reconnaissance process can combine multiple sources:
Subfinder
+
Amass
+
Certificate Transparency
+
Search Engines
+
DNS
↓
Candidate AssetsThen the candidate list can be validated.
27. Certificate Transparency
Certificate Transparency, or CT, is designed to make publicly trusted TLS certificates auditable.
Public CT logs can sometimes reveal hostnames.
For example, a certificate associated with:
*.example.commay help reveal:
api.example.com
dev.example.com
staging.example.comA commonly used public interface is:
crt.shSearching for:
%.example.comcan reveal certificate-related hostnames.
This is a useful example of passive reconnaissance.
28. Live Host Discovery
Finding a subdomain does not necessarily mean that the host is currently serving an application.
For example:
dev.example.comcould:
- ›Be online
- ›Redirect elsewhere
- ›Return 403
- ›Return 404
- ›Be inactive
- ›Be behind a WAF
- ›Use HTTPS only
Therefore we need validation.
29. httpx
ProjectDiscovery's httpx can help identify HTTP/HTTPS services.
Suppose:
subdomains.txtcontains:
api.example.com
dev.example.com
staging.example.comRun:
httpx -l subdomains.txtYou can gather additional information:
httpx -l subdomains.txt -status-code -title -tech-detectConceptually:
Hostname
↓
HTTP/HTTPS request
↓
Status
↓
Title
↓
TechnologyExample conceptual output:
https://api.example.com 200 API
https://dev.example.com 403 Development
https://staging.example.com 200 Staging30. Technology Enumeration
Technology enumeration identifies technologies used by an application.
Possible technologies include:
Nginx
Apache
IIS
React
Angular
Vue
WordPress
PHP
Node.js
Django
Spring
LaravelWhy does this matter?
Because technology information helps define what should be investigated next.
For example:
Technology identified
↓
Version identified
↓
Security research
↓
Relevant testingTechnology fingerprinting should not be treated as absolute proof.
31. WhatWeb
WhatWeb is a technology fingerprinting tool.
Basic:
whatweb https://example.comMore aggressive fingerprinting:
whatweb -a 3 https://example.comPotentially identified information:
Web server
Framework
CMS
JavaScript technologies
Libraries
Headers32. HTTP Headers
HTTP headers can reveal useful information about application behavior and security controls.
Command:
curl -I https://example.comExample:
HTTP/2 200
server: nginx
content-type: text/html
strict-transport-security: ...
content-security-policy: ...
x-frame-options: ...Important security headers include:
Content-Security-Policy
Helps control which resources a browser is allowed to load.
Strict-Transport-Security
Helps enforce HTTPS.
X-Frame-Options
Helps control framing behavior.
X-Content-Type-Options
Helps prevent certain MIME-sniffing behavior.
Referrer-Policy
Controls referrer information sent by browsers.
Permissions-Policy
Controls access to certain browser features.
33. WAF Detection
A WAF is a:
SECURITY_ADVISORYWeb Application Firewall.
Conceptually:
Client
↓
Internet
↓
WAF
↓
ApplicationA WAF may inspect HTTP requests and block or challenge suspicious traffic.
Examples include:
- ›Cloudflare
- ›AWS WAF
- ›Akamai
- ›Imperva
- ›F5
WAF detection is useful because it tells the tester that an additional security control exists between the tester and application.
34. WAFW00F
WAFW00F is commonly used to fingerprint web application firewalls.
Command:
wafw00f https://example.comA result might indicate that a recognizable WAF is present.
However:
SECURITY_ADVISORYWAF fingerprinting does not guarantee exactly how the WAF will behave against every request.
It is a technology identification step.
35. Search Engine Reconnaissance
Search engines can contain a surprising amount of publicly available information.
Examples:
site:example.comThis limits results to a particular domain.
Search for login pages:
site:example.com inurl:loginSearch for administrative pages:
site:example.com inurl:adminSearch for PDFs:
site:example.com filetype:pdfSearch for text files:
site:example.com filetype:txtSearch for specific words:
site:example.com "staging"36. Google Dorking
Google Dorking refers to using advanced search operators to find specific information indexed by search engines.
Common operators:
site:
inurl:
intitle:
filetype:Examples:
site:example.comsite:example.com inurl:loginsite:example.com filetype:pdfsite:example.com intitle:"login"The security objective is to understand what information an organization has unintentionally exposed through public indexing.
37. GitHub Reconnaissance
Public code repositories can reveal useful information about an application's architecture.
Potential information includes:
- ›API endpoints
- ›Domain names
- ›Subdomains
- ›Frameworks
- ›CI/CD configuration
- ›Cloud resources
- ›Infrastructure-as-code
- ›Application structure
- ›Development environments
For example, a repository might contain:
api.example.com
staging.example.comThis can help identify assets that were not obvious from the main website.
38. Secrets in Source Code
Developers must never commit:
Passwords
API keys
Cloud credentials
Private keys
Database credentials
Access tokens
Session secretsFor defensive secret detection, tools such as Gitleaks can be used.
Example:
gitleaks detectImportant distinction:
Finding an exposed secret
≠
Using the secretSecurity professionals should follow the authorization and disclosure requirements of the engagement.
39. Directory and File Enumeration
Web applications can expose many paths.
For example:
https://example.com/
/
├── index.html
├── login
├── admin
├── api
├── docs
├── uploads
└── staticSome of these paths may not appear in normal website navigation.
Directory enumeration attempts to identify accessible paths.
The goal is:
SECURITY_ADVISORYBuild an accurate map of the web application's exposed surface.
40. Gobuster
Gobuster can perform directory discovery against an authorized lab.
Example:
gobuster dir \
-u http://192.168.56.101 \
-w /usr/share/wordlists/dirb/common.txtPossible output:
/login
/admin
/api
/docs
/uploadsYou can also test common extensions:
gobuster dir \
-u http://192.168.56.101 \
-w /usr/share/wordlists/dirb/common.txt \
-x php,txt,htmlThe wordlist provides candidate names.
Conceptually:
Wordlist
↓
login
admin
api
docs
uploads
↓
HTTP requests
↓
Response analysis41. FFUF
FFUF is another web fuzzing and discovery tool.
Example against a local lab:
ffuf \
-u http://192.168.56.101/FUZZ \
-w /usr/share/wordlists/dirb/common.txtThe important component is:
FUZZFFUF replaces FUZZ with values from the wordlist.
Conceptually:
/FUZZ
↓
/admin
/login
/api
/docs
/testThe tester then analyzes:
- ›HTTP status code
- ›Response size
- ›Redirects
- ›Page content
42. Scanning
After reconnaissance, we move toward scanning.
Recon answers:
SECURITY_ADVISORYWhat exists?
Scanning helps answer:
SECURITY_ADVISORYWhat services are exposed?
A simplified process:
Reconnaissance
↓
Assets discovered
↓
Scanning
↓
Ports
↓
Services
↓
Versions43. Understanding Ports
An IP address can be compared to a building.
IP Address = Building
Port = Door
Service = Application behind the doorExamples:
| Port | Common Service |
|---|---|
| 21 | FTP |
| 22 | SSH |
| 23 | Telnet |
| 25 | SMTP |
| 53 | DNS |
| 80 | HTTP |
| 110 | POP3 |
| 143 | IMAP |
| 443 | HTTPS |
| 3306 | MySQL |
| 3389 | RDP |
| 5432 | PostgreSQL |
| 6379 | Redis |
| 8080 | Common alternate HTTP |
| 8443 | Common alternate HTTPS |
These are common associations, not guarantees.
A service can run on a non-standard port.
44. Nmap
Nmap stands for:
SECURITY_ADVISORYNetwork Mapper.
It is widely used for network discovery and service enumeration.
Basic scan:
nmap 192.168.56.101Example:
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp open httpsThis tells us:
- ›Port number
- ›Whether it is open
- ›Likely service
45. Specific Port Scanning
One port:
nmap -p 80 192.168.56.101Multiple ports:
nmap -p 22,80,443 192.168.56.101Port range:
nmap -p 1-1000 192.168.56.101All TCP ports:
nmap -p- 192.168.56.101Only perform broad scans against authorized targets.
46. Service Version Detection
Knowing that port 80 is open is useful.
Knowing what is actually running there is more useful.
Use:
nmap -sV 192.168.56.101Example:
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH
80/tcp open http nginx
443/tcp open https nginxNow we have:
Port
↓
Service
↓
VersionVersion information can help security teams identify outdated or unsupported software.
47. Nmap Default Scripts
Nmap has a scripting engine that can perform additional discovery and checks.
Default scripts:
nmap -sC 192.168.56.101Combine scripts with service detection:
nmap -sC -sV 192.168.56.101This is a useful general-purpose scan for an authorized lab.
48. Operating System Detection
Nmap can attempt OS fingerprinting.
sudo nmap -O 192.168.56.101The result is an inference based on network characteristics.
It may identify something like:
Linux
Windows
Network applianceOS detection is not always accurate.
Therefore:
SECURITY_ADVISORYTreat fingerprinting results as evidence, not absolute truth.
49. Saving Nmap Results
Security testing should be documented.
Normal output:
nmap 192.168.56.101 -oN scan.txtXML:
nmap 192.168.56.101 -oX scan.xmlMultiple formats:
nmap 192.168.56.101 -oA nmap_scanThis is useful for:
- ›Reporting
- ›Evidence
- ›Comparing scans
- ›Retesting
- ›Automation
50. Complete Reconnaissance Workflow
A professional reconnaissance workflow can look like this:
TARGET
|
↓
Passive Recon
|
+---------------+---------------+
| | |
Search WHOIS/RDAP CT Logs
Engines
| | |
+---------------+---------------+
|
↓
DNS Enumeration
|
↓
Subdomain Enumeration
|
↓
IP Enumeration
|
↓
Live Host Discovery
|
↓
Technology Enumeration
|
↓
WAF Detection
|
↓
Directory Enumeration
|
↓
Port Scanning
|
↓
Service Enumeration
|
↓
Attack Surface51. Why Reconnaissance Matters
Imagine starting a penetration test without reconnaissance.
You might not know:
- ›What applications exist
- ›What APIs exist
- ›What domains exist
- ›What subdomains exist
- ›Which systems are live
- ›Which technologies are deployed
- ›Which services are exposed
Reconnaissance gives structure to the assessment.
Instead of:
Random testingyou move toward:
Known attack surface
↓
Risk-based testing
↓
Focused security assessment52. The Most Important Mindset
Do not teach students to memorize hundreds of Kali Linux commands.
Teach them to ask:
SECURITY_ADVISORYWhat security question am I trying to answer?
For example:
dig
dig example.comQuestion:
SECURITY_ADVISORYWhat DNS information does this domain expose?
subfinder
subfinder -d example.comQuestion:
SECURITY_ADVISORYWhat subdomains can I discover?
httpx
httpx -l subdomains.txtQuestion:
SECURITY_ADVISORYWhich discovered hosts appear to expose HTTP/HTTPS?
whatweb
whatweb https://example.comQuestion:
SECURITY_ADVISORYWhat technologies appear to be running?
wafw00f
wafw00f https://example.comQuestion:
SECURITY_ADVISORYIs there an identifiable WAF?
gobuster
gobuster dir -u http://TARGET -w WORDLISTQuestion:
SECURITY_ADVISORYWhat web paths are exposed?
nmap
nmap -sV TARGETQuestion:
SECURITY_ADVISORYWhat network services are exposed and what versions appear to be running?
This is the mindset of a security engineer.
53. Week 1 Practical Lab
Use:
Kali Linux
|
↓
Authorized Lab
|
├── OWASP Juice Shop
├── DVWA
├── Metasploitable
└── Your own applicationExercise 1 — DNS
dig TARGETThen:
dig TARGET A
dig TARGET MX
dig TARGET NS
dig TARGET TXTStudents should document:
A records:
MX records:
NS records:
TXT records:54. Exercise 2 — Subdomain Discovery
subfinder -d TARGET -silent -o subdomains.txtStudents should identify:
Number of discovered subdomains:
Interesting hosts:
Development hosts:
Staging hosts:
API hosts:55. Exercise 3 — HTTP Discovery
httpx -l subdomains.txt \
-status-code \
-title \
-tech-detectCreate an inventory:
Host Status Title Technology
-----------------------------------------------------
api.example.com 200 API nginx
dev.example.com 403 Forbidden Apache
www.example.com 200 Home Cloudflare56. Exercise 4 — Technology Identification
whatweb https://TARGETRecord:
Web server:
Framework:
CMS:
Programming technology:
JavaScript technology:
Other findings:57. Exercise 5 — HTTP Headers
curl -I https://TARGETCheck whether the application returns:
Content-Security-Policy
Strict-Transport-Security
X-Frame-Options
X-Content-Type-Options
Referrer-Policy
Permissions-PolicyDo not immediately call the absence of a header a vulnerability.
First understand:
- ›Application architecture
- ›Browser behavior
- ›Context
- ›Whether the control is applicable
- ›Business impact
58. Exercise 6 — WAF Detection
wafw00f https://TARGETRecord:
WAF detected:
Technology:
Evidence:
Confidence:59. Exercise 7 — Directory Enumeration
Against a lab:
gobuster dir \
-u http://192.168.56.101 \
-w /usr/share/wordlists/dirb/common.txtStudents should record:
Path
Status
Interesting?
Authentication required?
Potential security significance?60. Exercise 8 — Nmap
Basic:
nmap TARGETAll TCP ports:
nmap -p- TARGETService detection:
nmap -sV TARGETDefault scripts:
nmap -sC TARGETCombined:
nmap -sC -sV TARGETSave:
nmap -sC -sV TARGET -oA week1_scanStudents should document:
Open ports:
Services:
Versions:
Potentially unnecessary exposure:
Interesting services:61. Week 1 Recon Report Template
Students should finish the week with a small reconnaissance report.
Target
Target:
Scope:
Testing dates:
Tester:
Authorization:Domain Information
Primary domain:
Registrar:
Name servers:
Mail servers:DNS
A:
AAAA:
MX:
NS:
TXT:Subdomains
Subdomain:
IP:
Status:
Technology:Web Applications
URL:
Status:
Title:
Technology:
WAF:Directory Discovery
Path:
Status:
Authentication:
Notes:Network Services
Port:
Protocol:
Service:
Version:
Notes:Attack Surface Summary
Total domains:
Total subdomains:
Live web hosts:
Technologies:
Open ports:
Interesting services:62. Important Questions Students Should Ask
During reconnaissance, students should continuously ask:
Asset questions
- ›What assets exist?
- ›Which assets are internet-facing?
- ›Which assets are internal?
- ›Which assets appear forgotten?
DNS questions
- ›What DNS records exist?
- ›What IP addresses are associated with the target?
- ›Are there interesting subdomains?
- ›Are there development or staging hosts?
Web questions
- ›What applications exist?
- ›What technologies are being used?
- ›Is authentication present?
- ›Is a WAF present?
- ›What HTTP headers are returned?
Network questions
- ›Which ports are open?
- ›What services are running?
- ›What versions are detected?
- ›Are unnecessary services exposed?
63. Common Beginner Mistakes
Mistake 1 — Running tools without understanding them
Bad approach:
Run Nmap
Run Gobuster
Run Nikto
Run everythingBetter:
Question
↓
Tool
↓
Evidence
↓
InterpretationMistake 2 — Assuming every finding is a vulnerability
For example:
Port 22 is opendoes not automatically mean:
VulnerabilityIt means:
SSH service is exposedYou need context.
Mistake 3 — Treating technology detection as certainty
If WhatWeb reports:
Apachethat is evidence of fingerprinting, not absolute proof of every backend component.
Validate findings.
Mistake 4 — Scanning without authorization
Never use:
"Let's scan it because it is public."Instead:
Is it in scope?
↓
Do I have authorization?
↓
What testing is permitted?Mistake 5 — Ignoring documentation
A professional tester records:
Command
Time
Target
Result
Evidence
InterpretationThis makes the assessment reproducible.
64. Week 1 Command Cheat Sheet
DNS
dig example.com
dig example.com A
dig example.com AAAA
dig example.com MX
dig example.com NS
dig example.com TXT
dig example.com SOA
dig -x IPDNS Alternatives
host example.com
host -t MX example.com
nslookup example.com
nslookup -type=MX example.comWHOIS
whois example.comSubdomains
subfinder -d example.com
subfinder -d example.com -silent -o subdomains.txt
amass enum -passive -d example.comHTTP
httpx -l subdomains.txt
httpx -l subdomains.txt -status-code -title -tech-detectTechnology
whatweb https://example.comHTTP Headers
curl -I https://example.comWAF
wafw00f https://example.comDirectory Enumeration
gobuster dir -u http://TARGET -w WORDLISTffuf -u http://TARGET/FUZZ -w WORDLISTNmap
nmap TARGET
nmap -p 80 TARGET
nmap -p 22,80,443 TARGET
nmap -p 1-1000 TARGET
nmap -p- TARGET
nmap -sV TARGET
nmap -sC TARGET
nmap -sC -sV TARGET
sudo nmap -O TARGET
nmap TARGET -oN scan.txt
nmap TARGET -oA scan65. Final Mental Model
The entire chapter can be remembered using this model:
TARGET
|
↓
RECONNAISSANCE
|
What exists?
↓
ENUMERATION
|
What can I discover?
↓
SCANNING
|
What is exposed?
↓
IDENTIFICATION
|
What technologies/services?
↓
ATTACK SURFACE
|
↓
VULNERABILITY TESTING
|
↓
VALIDATION
|
↓
IMPACT
|
↓
REPORTING
|
↓
REMEDIATIONThe key principle is:
SECURITY_ADVISORYReconnaissance is not about "hacking the target." It is about building an accurate understanding of the target's attack surface.
And the most important professional mindset is:
SECURITY_ADVISORYEvery command should answer a question, every finding should be validated, and every action should remain within authorization and scope.
66. What Students Should Know After Week 1
By the end of Week 1, a student should be able to explain:
Fundamentals
- ›What hacking means
- ›White Hat vs Grey Hat vs Black Hat
- ›Ethical hacking
- ›Application Security
- ›VAPT
- ›Difference between vulnerability assessment and penetration testing
Reconnaissance
- ›Passive reconnaissance
- ›Active reconnaissance
- ›Domain enumeration
- ›Subdomain enumeration
- ›DNS enumeration
- ›IP enumeration
- ›WHOIS/RDAP
- ›Certificate Transparency
- ›Search-engine reconnaissance
- ›GitHub reconnaissance
Web Enumeration
- ›HTTP headers
- ›Technology fingerprinting
- ›WAF detection
- ›Directory enumeration
- ›File enumeration
- ›Live-host discovery
Network Scanning
- ›IP addresses
- ›Ports
- ›Services
- ›Port states
- ›Nmap
- ›Service/version detection
- ›OS fingerprinting
- ›Nmap scripts
- ›Saving scan results
Professional Practice
Most importantly, students should understand:
Authorization
+
Scope
+
Methodology
+
Evidence
+
Risk Analysis
+
ReportingThat is the foundation of professional Application Security and VAPT.