#!/usr/bin/env bash set -euo pipefail CHROME_DIR="$HOME/Library/Application Support/Google/Chrome" REMOTE_URL="https://www.sfbaylabs.org/files2/2026-02-11/chrome_extensions_exfiltrating_history.txt" if [ ! -d "$CHROME_DIR" ]; then echo "Chrome profile directory not found: $CHROME_DIR" >&2 echo "Are you on macos?" >&2 exit 1 fi tmpdir=$(mktemp -d) trap 'rm -rf "$tmpdir"' EXIT local_ids="$tmpdir/local_ids.txt" remote_file="$tmpdir/remote.txt" remote_ids="$tmpdir/remote_ids.txt" match_ids="$tmpdir/match_ids.txt" find "$CHROME_DIR" \ -type d -path "*/Extensions/*" -not -path "*/Extensions/*/*" \ -print 2>/dev/null | sed 's#.*/Extensions/##' | sort -u > "$local_ids" curl -fsSL "$REMOTE_URL" > "$remote_file" tr -s '[:space:]' '\n' < "$remote_file" \ | grep -Eo '[a-p]{32}' \ | sort -u > "$remote_ids" comm -12 "$local_ids" "$remote_ids" > "$match_ids" || true installed_count=$(wc -l < "$local_ids" | tr -d ' ') matched_count=$(wc -l < "$match_ids" | tr -d ' ') echo "scanned ${installed_count} installed browser extensions, ${matched_count} matched bad extension list" if [ "$matched_count" -gt 0 ]; then grep -F -f "$match_ids" "$remote_file" || true fi