gist:6a5e632583c67dadf84d68d339cdf799 A developer built an AUR malware monitor that performs static analysis on Arch User Repository packages. The tool fetches AUR metadata, applies regex pre-filters, and retrieves git diffs via cgit to identify potentially malicious packages without executing any code. It stages suspicious candidates for human review or automated classification. | /usr/bin/env python3 | | | """AUR malware monitor — candidate dropper. | | | Static analysis only. Never runs makepkg, never sources PKGBUILDs, never | | | executes anything fetched. Fetches AUR bulk metadata, selects newly created / | | | recently modified packages, runs a cheap offline regex pre-filter, fetches the | | | git diff of each candidate over cgit HTTP, no clones , and stages the diff + | | | metadata into per-candidate folders for a human or claude -p to classify. | | | See design.md for the threat model and pipeline. | | | """ | | | from future import annotations | | | import argparse | | | import gzip | | | import json | | | import re | | | import shutil | | | import subprocess | | | import sys | | | import time | | | from concurrent.futures import ThreadPoolExecutor | | | from dataclasses import dataclass, field | | | from datetime import datetime, timezone | | | from pathlib import Path | | | import requests | | | Known-bad indicators. If any appears in a candidate's diff it's marked | | | malicious outright — no need to spend a classification call. atomic-lockfile | | | + execa were the payload pulled by the 2026 ledger-udev-bin specimen. | | | KNOWN BAD IOCS = | | | "atomic-lockfile", | | | | | | Verdicts the analyst may return, ordered clean - worst. Anything at or above | | | ALERT THRESHOLD rings the terminal bell. | | | VERDICT ORDER = "clean", "review", "suspicious", "malicious" | | | ALERT THRESHOLD = "suspicious" | | | VERDICT RANK = {v: i for i, v in enumerate VERDICT ORDER } | | | USER AGENT = "aur-malware-monitor/0.1 static-analysis; +https://github.com/local/aur-monitor " | | | META URL = "https://aur.archlinux.org/packages-meta-ext-v1.json.gz" | | | cgit patch view: latest commit as a git-format patch, including its SHA in the | | | "From