Skip to content

Instantly share code, notes, and snippets.

@shuhaowu
Created September 17, 2014 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shuhaowu/286e6681d6faa473ebb0 to your computer and use it in GitHub Desktop.
Save shuhaowu/286e6681d6faa473ebb0 to your computer and use it in GitHub Desktop.
from fabric.api import run
def check_apt():
apt_sha = "cfd9d742f7c99d55214257fdad42ead547547c5a05af9d4569a256205af28fa7"
result = run("sha256sum /var/cache/apt/archives/apt_0.9.7.9+deb7u3_amd64.deb")
if apt_sha in result:
print "Everything is okay"
else:
print "Potential attack?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment