Fix Credentials Harvester on darwin platform to perform chown on harvested txt file

This commit is contained in:
Du Yizhuo 2015-09-27 17:58:13 +08:00
parent c1dc6747d9
commit bf8b92ce2b

View file

@ -444,7 +444,12 @@ def run():
filewrite = file("%s/harvester_%s.txt" % (logpath,now), "w") filewrite = file("%s/harvester_%s.txt" % (logpath,now), "w")
filewrite.write("") filewrite.write("")
filewrite.close() filewrite.close()
subprocess.Popen("chown www-data:www-data '%s/harvester_%s.txt'" % (logpath,now), shell=True).wait()
# Check sys platform to perform chown
if sys.platform == "darwin":
subprocess.Popen("chown _www:_www '%s/harvester_%s.txt'" % (logpath,now), shell=True).wait()
else:
subprocess.Popen("chown www-data:www-data '%s/harvester_%s.txt'" % (logpath,now), shell=True).wait()
# if we are using webjacking, etc. # if we are using webjacking, etc.
if os.path.isfile(setdir + "/web_clone/index2.html"): if os.path.isfile(setdir + "/web_clone/index2.html"):