Metasploit Exploit und Payload (Samba)
Schwachstelle suchen
- Mittels nmap einen Port suchen. In diesem Fall Samba.
- Befehl: root@kali:~# nmap -sV 10.82.1.101
Starting Nmap 7.80 ( https://nmap.org ) at 2020-11-02 12:48 CET Nmap scan report for 10.82.1.101 Host is up (0.00015s latency). Not shown: 977 closed ports 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 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 514/tcp open tcpwrapped 1099/tcp open java-rmi GNU Classpath grmiregistry 1524/tcp open bindshell Metasploitable root shell 2049/tcp open rpcbind 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
Genaue Version
Durch nmap kann die genaue Version von Samba nicht gesehen werden. Deshalb wird ein Modul von Metasploit benötigt.
- Es wird folgender Befehl in der msfconsole abgesetzt um das Versions Module zu nutzen:
- msf5 > use auxiliary/scanner/smb/smb_version
- Nun wird noch die RHOSTS (Die IP des Opfers) benötigt:
- msf5 auxiliary(scanner/smb/smb_version) > set RHOSTS 10.82.1.101
- Durch den Befehl show options werden die momentanen Einstellung gezeigt:
- msf5 auxiliary(scanner/smb/smb_version) > show options
Module options (auxiliary/scanner/smb/smb_version): Name Current Setting Required Description ---- --------------- -------- ----------- RHOSTS 10.82.1.101 yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>' SMBDomain . no The Windows domain to use for authentication SMBPass no The password for the specified username SMBUser no The username to authenticate as THREADS 1 yes The number of concurrent threads (max one per host)
- Durch das absetzen von dem Befehl run kann nun die genaue Samba Version ermittelt werden
- msf5 auxiliary(scanner/smb/smb_version) > run
[*] 10.82.1.101:445 - Host could not be identified: Unix (Samba 3.0.20-Debian)