Reconnaissance sur Metasploitable 2#
La reconnaissance est la collecte d’informations sans exploitation : pas de shell, d’injection, de modification de données
1. Typologie de la reconnaissance#
| Type | Touche la cible ? | Exemples sur MS2 (lab) |
|---|---|---|
| Passive | Non (ou indirect) | OSINT domaine fictif, lecture doc fournie, nmap --script broadcast limité |
| Active légère | Oui, faible bruit | ping, arp-scan, nmap -sn |
| Active standard | Oui | Scan ports TCP/UDP, bannières, scripts NSE |
| Active approfondie | Oui, bruyant | nmap -p-, enum SMB/NFS, fuzzing web, bruteforce comptes (à encadrer) |
Dans le cadre de ce module, on fait la différence entre
- Reconnaissance → cartographier ports, services, versions, configs exposées.
- Scan de vulnérabilités → corrélation CVE/plugins (OpenVAS, Nessus).
2. Ordre recommandé (parcours TP)#
Vérif lab (ping)
→ Découverte L2 (ARP / netdiscover)
→ Découverte L3 (nmap -sn, traceroute)
→ Scan ports TCP puis UDP ciblé
→ Bannières & versions (nmap -sV, -sC)
→ Énumération par service (SNMP, SMB, NFS, HTTP…)
→ Corrélation & livrable (tableau + priorités pour le scan / l’exploitation)3. Reconnaissance réseau (couches 2–4)#
3.1 Reconnaissance niveau 2#
Utiliser l’outil arp-scan pour scanner le niveau 2 (les machines sur le même réseau)
└─$ sudo arp-scan -l
Interface: eth0, type: EN10MB, MAC: 00:0c:29:5a:e8:22, IPv4: 172.16.211.129
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
172.16.211.1 00:50:56:c0:00:08 (Unknown)
172.16.211.2 00:50:56:f0:4b:17 (Unknown)
172.16.211.128 00:0c:29:de:c8:07 (Unknown)
172.16.211.254 00:50:56:e0:5f:3b (Unknown)
4 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.10.0: 256 hosts scanned in 1.857 seconds (137.86 hosts/sec). 4 responded3.2 Reconnaissance niveau 3 & 4#
La couche 3 correspond à la reconnaissance IP, et la 4 à celle des ports
La première étape consiste à faire une reconnaissance par ping. Utiliser nmap -sn: Ping Scan - disable port scan.
└─$ nmap -sn 172.16.211.0/24
Starting Nmap 7.98 ( https://nmap.org ) at 2026-06-09 17:20 -0400
Nmap scan report for 172.16.211.1
Host is up (0.00029s latency).
MAC Address: 00:50:56:C0:00:08 (VMware)
Nmap scan report for 172.16.211.2
Host is up (0.00019s latency).
MAC Address: 00:50:56:F0:4B:17 (VMware)
Nmap scan report for 172.16.211.128
Host is up (0.000068s latency).
MAC Address: 00:0C:29:DE:C8:07 (VMware)
Nmap scan report for 172.16.211.254
Host is up (0.00021s latency).
MAC Address: 00:50:56:E0:5F:3B (VMware)
Nmap scan report for 172.16.211.129
Host is up.
Nmap done: 256 IP addresses (5 hosts up) scanned in 4.44 secondsL’adresse 172.16.211.128 est identifiée
Une reconnaissance plus poussée, des ports ouverts, est réalisée avec nmap -sSU @IP
- sS : TCP Syn
- sU : UDP
┌──(kali㉿kali)-[~]
└─$ nmap -sSU 172.16.211.128
Starting Nmap 7.98 ( https://nmap.org ) at 2026-06-09 17:26 -0400
Host is up (0.00086s latency).
Not shown: 993 closed udp ports (port-unreach), 977 closed tcp ports (reset)
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
23/tcp open telnet
25/tcp open smtp
53/tcp open domain
80/tcp open http
111/tcp open rpcbind
139/tcp open netbios-ssn
445/tcp open microsoft-ds
512/tcp open exec
513/tcp open login
514/tcp open shell
1099/tcp open rmiregistry
1524/tcp open ingreslock
2049/tcp open nfs
2121/tcp open ccproxy-ftp
3306/tcp open mysql
5432/tcp open postgresql
5900/tcp open vnc
6000/tcp open X11
6667/tcp open irc
8009/tcp open ajp13
8180/tcp open unknown
53/udp open domain
68/udp open|filtered dhcpc
69/udp open|filtered tftp
111/udp open rpcbind
137/udp open netbios-ns
138/udp open|filtered netbios-dgm
2049/udp open nfs
MAC Address: 00:0C:29:DE:C8:07 (VMware)
Nmap done: 1 IP address (1 host up) scanned in 1028.74 seconds3.3 Première analyse des services#
Netcat peut être utilisé pour obtenir les détails d’un service écoutant derrière un port
- Analyse du port ftp
└─$ nc 172.16.211.128 21
220 (vsFTPd 2.3.4)- Analyse du port ssh
└─$ nc 172.16.211.128 22
SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu13.4 Reconnaissance avancée#
Voici une commande plus complète pour la reconnaissance
nmap -sVpour l’identification des versions
└─$ sudo nmap -sV 172.16.211.128
[sudo] password for kali:
Sorry, try again.
[sudo] password for kali:
Sorry, try again.
[sudo] password for kali:
Starting Nmap 7.98 ( https://nmap.org ) at 2026-06-09 17:35 -0400
Nmap scan report for 172.16.211.128
Host is up (0.0017s latency).
Not shown: 977 closed tcp ports (reset)
PORT STATE SERVICE VERSION
21/tcp open ftp vsftpd 2.3.4
22/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1 (protocol 2.0)
23/tcp open telnet Linux telnetd
25/tcp open smtp Postfix smtpd
53/tcp open domain ISC BIND 9.4.2
80/tcp open http Apache httpd 2.2.8 ((Ubuntu) DAV/2)
111/tcp open rpcbind 2 (RPC #100000)
139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
512/tcp open exec netkit-rsh rexecd
513/tcp open login OpenBSD or Solaris rlogind
514/tcp open tcpwrapped
1099/tcp open java-rmi GNU Classpath grmiregistry
1524/tcp open bindshell Metasploitable root shell
2049/tcp open nfs 2-4 (RPC #100003)
2121/tcp open ftp ProFTPD 1.3.1
3306/tcp open mysql MySQL 5.0.51a-3ubuntu5
5432/tcp open postgresql PostgreSQL DB 8.3.0 - 8.3.7
5900/tcp open vnc VNC (protocol 3.3)
6000/tcp open X11 (access denied)
6667/tcp open irc UnrealIRCd
8009/tcp open ajp13 Apache Jserv (Protocol v1.3)
8180/tcp open http Apache Tomcat/Coyote JSP engine 1.1
MAC Address: 00:0C:29:DE:C8:07 (VMware)
Service Info: Hosts: metasploitable.localdomain, irc.Metasploitable.LAN; OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 12.02 seconds4. Récapitulatif#
À la fin de ce module, rendre un tableau (csv ou md) récapitulant les résultats de la reconnaissance, avec la méthodologie associée
IP | Port | Proto | Service | Version | Méthode (arp/nmap/snmp/enum4linux/…) | Priorité scan/exploit | NotesMinimum :
- 1 ligne par port TCP ou UDP ouvert significatif
- 5 priorités pour scan/exploit avec justification
- Captures ou extraits de commandes horodatés
5. Suite de la démarche#
Phase actuelle : Reconnaissance — ports, versions et tableau de priorités établis.
[✓] Mise en place → [✓] Reconnaissance → [●] Scan vulns → [ ] Exploitation → [ ] Post-exploit → [ ] Findings → [ ] RapportÉtape suivante : Scan de vulnérabilités — corréler CVE/plugins et affiner le tableau de priorités.