
JasminランサムウェアWebパネル パストラバーサル PoC
#教育目的
https://github.com/codesiddhant/Jasmin-Ransomware
JasminランサムウェアのWebパネル(CVE-2024-30851)に認証前のパストラバーサル脆弱性を発見しました。この脆弱性により、攻撃者はパネル運営者の匿名性を解除し、復号鍵をダンプできます。Jasminランサムウェアは、最近のTeamCity(CVE-2024-27198、CVE-2024-27199)悪用キャンペーン(https://twitter.com/brody_n77/status/1765145148227555826)で観測されました。
Screencast from 2024-04-04 18-51-07.webm
影響を受けるエンドポイント(Jasmin-Ransomware/Web Panel/download_file.php)は、Locationヘッダー送信後にdie()を実行しません。これにより、攻撃者は認証要件をバイパスできます。readfileへの呼び出しはサニタイズされていないため、攻撃者は任意のファイルを読み取ることができます。
<?php
session_start();
if(!isset($_SESSION['username']) ){
header("Location: login.php");
}
$file=$_GET['file'];
if(!empty($file)){
// Define headers
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=$file");
header("Content-Type: text/encoded");
header("Content-Transfer-Encoding: binary");
// Read the file
readfile($file);
また、多数のSQLインジェクションが存在し、そのうちの1つがログインをバイパスして復号鍵のファイル名を取得するために悪用されています。