Exploit database

GH-33b88d3e589b16e617bb4e6cf6e0cc40

dinosn/proftpd-cve-2026-42167-analysis

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-42167

5 sources

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

Repository files6
dinosn/proftpd-cve-2026-42167-analysisRevision b02298cc5b7c

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

render_screenshot.py

Python · 2,059 bytes
#!/usr/bin/env python3
"""Render a terminal log file to a PNG screenshot using PIL."""
import sys
from pathlib import Path
from PIL import Image, ImageDraw, ImageFont

FONT_PATH = "/System/Library/Fonts/Menlo.ttc"
FONT_SIZE = 14
LINE_HEIGHT = 18
PAD = 18
BG = (24, 24, 28)
FG = (220, 220, 220)
TITLE_BG = (60, 80, 110)
TITLE_FG = (235, 235, 235)
PROMPT = (95, 200, 110)
HOSTLINE = (100, 160, 220)
ERR = (235, 95, 95)
OK = (95, 200, 110)
DIM = (140, 140, 140)


def colorize(line: str):
    s = line.rstrip("\n")
    if s.startswith("[+]"):
        return OK
    if s.startswith("[-]"):
        return ERR
    if s.startswith("[*]"):
        return HOSTLINE
    if s.startswith("=== ") or s.startswith("==="):
        return DIM
    if s.startswith("$ ") or s.startswith("# "):
        return PROMPT
    return FG


def render(title: str, log_path: Path, png_path: Path, max_cols: int = 160):
    raw = log_path.read_text(errors="replace").splitlines()
    lines = []
    for line in raw:
        # wrap long lines
        if len(line) <= max_cols:
            lines.append(line)
        else:
            for i in range(0, len(line), max_cols):
                lines.append(line[i:i + max_cols])

    title_h = 32
    img_h = PAD * 2 + title_h + LINE_HEIGHT * len(lines)
    img_w = PAD * 2 + max_cols * 8  # approximate

    img = Image.new("RGB", (img_w, img_h), BG)
    draw = ImageDraw.Draw(img)
    font = ImageFont.truetype(FONT_PATH, FONT_SIZE)

    # title bar
    draw.rectangle((0, 0, img_w, title_h), fill=TITLE_BG)
    draw.text((PAD, 8), title, fill=TITLE_FG, font=font)

    y = PAD + title_h
    for line in lines:
        draw.text((PAD, y), line, fill=colorize(line), font=font)
        y += LINE_HEIGHT

    img.save(png_path)
    print(f"wrote {png_path} ({img_w}x{img_h}, {len(lines)} lines)")


def main():
    if len(sys.argv) != 4:
        print("usage: render_screenshot.py <title> <log> <png>", file=sys.stderr)
        sys.exit(2)
    render(sys.argv[1], Path(sys.argv[2]), Path(sys.argv[3]))


if __name__ == "__main__":
    main()