Some checks failed
Wiki Resources Sanity Checks / ruff-checks (push) Failing after 2s
25 lines
671 B
Python
25 lines
671 B
Python
from pathlib import Path
|
|
from requests import get
|
|
|
|
def remote_pkg_list():
|
|
pkgs = get('https://raw.githubusercontent.com/lenucksi/aur-malware-check/refs/heads/master/malicious_npm_packages.txt')
|
|
ret = set()
|
|
for line in pkgs.content.decode():
|
|
if line.startswith('#'):
|
|
continue
|
|
ret.add(line)
|
|
return ret
|
|
|
|
def local_pkgs():
|
|
return set([e for e in Path(f'{Path.home()}/.bun/install/cache/').iterdir()])
|
|
|
|
if __name__ == '__main__':
|
|
remote_pkgs = remote_pkg_list()
|
|
for pkg in local_pkgs():
|
|
if pkg in remote_pkgs:
|
|
print(f'COMPROMISED - {pkg}')
|
|
else:
|
|
print(f'CLEAN - {pkg}')
|
|
|
|
|