Skip to content

Instantly share code, notes, and snippets.

@afrendeiro
Created June 18, 2026 08:56
Show Gist options
  • Select an option

  • Save afrendeiro/edda0906be30fe9446ead4d30b9d16c3 to your computer and use it in GitHub Desktop.

Select an option

Save afrendeiro/edda0906be30fe9446ead4d30b9d16c3 to your computer and use it in GitHub Desktop.
Check whether Arch-based system is compromised in latest AUR hack
import re
import subprocess
import urllib.request
installed = {line.split()[0] for line in subprocess.check_output(["pacman", "-Q"]).decode().splitlines()}
html = urllib.request.urlopen("https://md.archlinux.org/s/SxbqukK6IA").read().decode()
compromised = set("".join(re.findall(r">```\n(.*?)</div>\n", html, re.DOTALL)).split("\n"))
if installed & compromised:
print("System compromised.")
else:
print("No compromised packages currently installed.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment