Sploitus

Metasploitable2-Exploit

githubexploit Β· 2026-07-21

Exploit Code

README184 lines
## https://sploitus.com/exploit?id=E082BBDD-8BE1-5B2F-A235-512540C16912
# Metasploitable2 Exploitation Lab

A complete penetration testing walkthrough of **Metasploitable2**, documenting the enumeration, vulnerability analysis, exploitation, and post-exploitation of each vulnerable service.

This project was created as a hands-on learning exercise to practice penetration testing methodologies in a safe lab environment. Each service is documented individually using a consistent reporting structure similar to a professional penetration testing report.

> **Disclaimer**
>
> This project was conducted against the intentionally vulnerable **Metasploitable2** virtual machine inside a private lab environment. All techniques demonstrated here are for educational purposes only.

---

# Lab Environment

| Machine | IP Address | Operating System |
|----------|------------|------------------|
| Kali Linux (Attacker) | `192.168.29.128` | Kali Linux |
| Metasploitable2 (Target) | `192.168.29.130` | Ubuntu Linux |

---

# Methodology

The assessment followed a structured penetration testing workflow:

1. Service Discovery
2. Enumeration
3. Vulnerability Identification
4. Exploitation
5. Proof of Access
6. Impact Assessment
7. Mitigation Recommendations

Each service follows the same documentation structure:

- Service Information
- Enumeration
- Vulnerability
- Exploitation
- Proof of Access
- Impact
- Mitigations
- References

---

# Services Assessed

| Port | Service | Status | Write-up |
|------:|---------|:------:|----------|
| 21 | FTP (vsftpd) | βœ… | [21-ftp.md](ports/21-ftp.md) |
| 22 | SSH | βœ… | [22-ssh.md](ports/22-ssh.md) |
| 23 | Telnet | βœ… | [23-telnet.md](ports/23-telnet.md) |
| 25 | SMTP | βœ… | [25-smtp.md](ports/25-smtp.md) |
| 53 | DNS | βœ… | [53-dns.md](ports/53-dns.md) |
| 80 | HTTP | βœ… | [80-http.md](ports/80-http.md) |
| 111 | rpcbind | βœ… | [111-rpcbind.md](ports/111-rpcbind.md) |
| 139/445 | Samba | βœ… | [139-445-smb.md](ports/139-445-smb.md) |
| 512-514 | r-services | βœ… | [512-514-rservices.md](ports/512-514-rservices.md) |
| 1099 | Java RMI | βœ… | [1099-java-rmi.md](ports/1099-java-rmi.md) |
| 1524 | Bindshell | βœ… | [1524-bindshell.md](ports/1524-bindshell.md) |
| 2049 | NFS | βœ… | [2049-nfs.md](ports/2049-nfs.md) |
| 2121 | ProFTPD | βœ… | [2121-proftpd.md](ports/2121-proftpd.md) |
| 3306 | MySQL | βœ… | [3306-mysql.md](ports/3306-mysql.md) |
| 3632 | distccd | βœ… | [3632-distccd.md](ports/3632-distccd.md) |
| 5432 | PostgreSQL | βœ… | [5432-postgresql.md](ports/5432-postgresql.md) |
| 6667 | UnrealIRCd | βœ… | [6667-unrealircd.md](ports/6667-unrealircd.md) |
| 8180 | Apache Tomcat | βœ… | [8180-tomcat.md](ports/8180-tomcat.md) |

---

# Repository Structure

```text
metasploitable2-exploit/
β”‚
β”œβ”€β”€ README.md
β”œβ”€β”€ LAB-NOTES.md
β”œβ”€β”€ TOOLS.md
β”œβ”€β”€ CHEATSHEET.md
β”‚
β”œβ”€β”€ ports/
β”‚   β”œβ”€β”€ 21-ftp.md
β”‚   β”œβ”€β”€ 22-ssh.md
β”‚   β”œβ”€β”€ 23-telnet.md
β”‚   β”œβ”€β”€ 25-smtp.md
β”‚   β”œβ”€β”€ 53-dns.md
β”‚   β”œβ”€β”€ 80-http.md
β”‚   β”œβ”€β”€ 111-rpcbind.md
β”‚   β”œβ”€β”€ 139-445-smb.md
β”‚   β”œβ”€β”€ 512-514-rservices.md
β”‚   β”œβ”€β”€ 1099-java-rmi.md
β”‚   β”œβ”€β”€ 1524-bindshell.md
β”‚   β”œβ”€β”€ 2049-nfs.md
β”‚   β”œβ”€β”€ 2121-proftpd.md
β”‚   β”œβ”€β”€ 3306-mysql.md
β”‚   β”œβ”€β”€ 3632-distccd.md
β”‚   β”œβ”€β”€ 5432-postgresql.md
β”‚   β”œβ”€β”€ 6667-unrealircd.md
β”‚   └── 8180-tomcat.md
β”‚
└── assets/
```

---

# Tools Used

- Nmap
- Netcat
- Metasploit Framework
- Hydra
- Enum4linux
- smbclient
- rpcinfo
- showmount
- dig
- nslookup
- ftp
- ssh
- telnet
- mysql
- psql
- msfvenom
- Gobuster
- Nikto

A detailed explanation of each tool can be found in **TOOLS.md**.

---

# Skills Demonstrated

- Network Enumeration
- Service Enumeration
- Banner Grabbing
- SMB Enumeration
- DNS Enumeration
- NFS Enumeration
- Database Enumeration
- Password Attacks
- Default Credential Abuse
- Remote Code Execution
- Web Application Assessment
- Tomcat Manager Exploitation
- Reverse Shell Deployment
- Post-Exploitation Enumeration
- Vulnerability Validation
- Security Reporting

---

# Key Takeaways

This project demonstrates that not every exposed service is directly exploitable.

Some services resulted in:

- Remote Code Execution (RCE)
- Weak Credential Authentication
- Information Disclosure
- Misconfiguration Abuse

Understanding the difference between these findings is an important part of penetration testing and reporting.

---

# Related Documents

- **LAB-NOTES.md** β€” Chronological walkthrough of the assessment.
- **TOOLS.md** β€” Explanation of every tool used.
- **CHEATSHEET.md** β€” Quick reference of the commands used during the lab.

---

# References

- Metasploitable2
- OWASP Testing Guide
- Nmap Documentation
- Metasploit Framework
- Rapid7 Vulnerability Database
- CVE Program