Skip to content

Instantly share code, notes, and snippets.

@kaganisildak
Last active November 27, 2020 11:44
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 kaganisildak/4ff8adcaba2521a28a7029d61c265d16 to your computer and use it in GitHub Desktop.
Save kaganisildak/4ff8adcaba2521a28a7029d61c265d16 to your computer and use it in GitHub Desktop.
import subprocess
def executer(args):
proc = subprocess.Popen(args,stdout=subprocess.PIPE)
return str(proc.communicate()[0])
cert = executer(["powershell.exe", "-Command","Get-ChildItem","-Recurse","Cert:CurrentUser\My"])
proc = executer(["powershell.exe","Get-Process"])
dlls = executer(["listdlls.exe","srvpost.exe","/accepteula"])
SUSDLLS = ("winanr.dll", "winsanr.dll")
if any(dll in dlls for dll in SUSDLLS): print("Any.Run Monitoring Agent Found")
if "Some Company" in cert or "srvpost" in proc:
print("ANY.RUN DETECTED")
else:
print("NOT ANY.RUN")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment