Open to everyone Reading, lesson 93 of 100, 2 min read
Reconnaissance and scanning
How testers (and attackers) start
Every attack and every test begins with reconnaissance: learning about the target.
Passive reconnaissance
Gathering information without touching the target's systems:
- the organisation's website, job adverts (which reveal technologies they use), staff profiles on professional networks;
- DNS records and subdomains;
- public certificate logs, which list domain names that received certificates;
- leaked credentials from old breaches;
- search engines and archived copies of pages.
This is called OSINT (open-source intelligence). Defenders should do it on themselves to see what attackers see: you may find old test sites, exposed documents, or staff oversharing.
Active reconnaissance and scanning
Interacting with the target's systems, which requires permission:
- host discovery: which addresses respond;
- port scanning: which ports are open on each host;
- service and version detection: what software is listening, and which version;
- operating system detection.
The best-known scanning tool is Nmap, which is free and open source. On your own practice network, a simple scan looks like this:
nmap -sV 192.168.56.0/24-sV asks Nmap to identify service versions. On the host-only lab network from module 1, it lists your practice virtual machines and what they are running.
Reading the results defensively
| Finding | Question for the defender |
|---|---|
| Port 22 open on a web server | Is SSH limited to admin addresses and using keys? |
| Port 3306 open to the network | Why is the database reachable from here? |
| An old software version | Is it patched? Is it past end of life? |
| A service nobody recognises | Who owns it? Can it be switched off? |
Tip
Scan your own home network (only your own), and ask of every open port: do I know why this is here?