Skip to content

Instantly share code, notes, and snippets.

View tannerli's full-sized avatar

Marco Tanner tannerli

View GitHub Profile
@tannerli
tannerli / check_compromised.sh
Last active November 12, 2021 12:38
Check for compromised versions of npm packages 'rc' and 'coa'
#!/bin/bash
echo "Searching for rc packages..."
matches=$(find / -type d -path "*/node_modules/rc" 2>/dev/null)
echo -e "Checking for compromised versions...\\n"
for match in $matches
do
egrep 'version\":\s*\"((1.2.9)|(1.3.9)|(2.3.9))' "$match/package.json" && echo -e $match\\n
done