Skip to content

Instantly share code, notes, and snippets.

@evrenesat
Last active August 29, 2015 13:59
Show Gist options
  • Select an option

  • Save evrenesat/10669483 to your computer and use it in GitHub Desktop.

Select an option

Save evrenesat/10669483 to your computer and use it in GitHub Desktop.
#!/bin/env python
#This script scans for readable home dirs based on running process list (ps -ef)
#Can be used to test and warn the ignorant shared hosting users (Webfaction, I'm looking to you!)
import subprocess, os, re
psef=subprocess.Popen(['ps','-ef'], stdout=subprocess.PIPE).communicate()[0]
print filter(lambda h:os.access(h, os.R_OK), set(re.findall("(/home.?/\w*)", psef)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment