Last active
August 29, 2015 13:59
-
-
Save evrenesat/10669483 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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