Exploit database

GH-932f957c1c5fcd40cfd32b2f54d9c82c

686f6c61/poc-aiowpm-cve-2026-19949

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-19949

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files11
686f6c61/poc-aiowpm-cve-2026-19949Revision 9df2e9a8d419

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

exploit/wpress.py

Python · 2,539 bytes
#!/usr/bin/env python3
"""
Lectura y escritura de archivos .wpress de All-in-One WP Migration.

Formato (según lib/vendor/servmask/archiver/class-ai1wm-archiver.php):
  Por cada archivo: bloque de cabecera de 4377 bytes + contenido del archivo.
    offset 0     nombre de archivo (a255, relleno con NUL)
    offset 255   tamaño del contenido en bytes (a14, ASCII decimal)
    offset 269   mtime (a12, ASCII decimal)
    offset 281   prefijo/ruta sin barras finales (a4088)
    offset 4369  crc32 del contenido (a8, hex; opcional)
  Bloque EOF final de 4377 bytes: v1 = todo NUL (sin CRC).
"""

HEADER_SIZE = 4377


def _fields(block: bytes):
    name = block[0:255].rstrip(b"\x00").decode("utf-8", "replace")
    size = int(block[255:269].rstrip(b"\x00 ") or b"0")
    mtime = int(block[269:281].rstrip(b"\x00 ") or b"0")
    prefix = block[281:4089].rstrip(b"\x00").decode("utf-8", "replace")
    return name, size, mtime, prefix


def read_archive(path):
    """Itera (ruta_completa, contenido) de un .wpress."""
    with open(path, "rb") as f:
        data = f.read()
    files, i = [], 0
    while i + HEADER_SIZE <= len(data):
        block = data[i:i + HEADER_SIZE]
        if block == b"\x00" * HEADER_SIZE:
            break  # EOF v1
        name, size, mtime, prefix = _fields(block)
        content = data[i + HEADER_SIZE:i + HEADER_SIZE + size]
        files.append((f"{prefix}/{name}" if prefix else name, content))
        i += HEADER_SIZE + size
    return files


def make_entry(name: str, prefix: str, content: bytes) -> bytes:
    block = bytearray(HEADER_SIZE)

    def put(offset: int, value: bytes, width: int):
        # relleno con NUL hasta la anchura exacta del campo (bytearray[x:y] = v
        # con longitud distinta REDIMENSIONA el bloque y desalinea el formato)
        chunk = value[:width].ljust(width, b"\x00")
        block[offset:offset + width] = chunk

    put(0, name.encode(), 255)
    put(255, str(len(content)).encode(), 14)
    put(269, b"1757260800", 12)  # mtime fijo para reproducibilidad
    put(281, prefix.encode(), 4088)
    return bytes(block) + content


def write_archive(path, entries):
    """entries: lista de (nombre, prefijo, contenido). Escribe EOF v1 (sin CRC)."""
    with open(path, "wb") as f:
        for name, prefix, content in entries:
            f.write(make_entry(name, prefix, content))
        f.write(b"\x00" * HEADER_SIZE)


if __name__ == "__main__":
    import sys
    for full, content in read_archive(sys.argv[1]):
        print(f"{len(content):>10}  {full}")