[ SEA-GHOST MINI SHELL]
Path : /proc/2/root/var/lib/zabbix/ |
|
Current File : //proc/2/root/var/lib/zabbix/cpanel_check_missing_domains.py |
#!/usr/bin/env python
import sys
user_domains="/etc/userdomains"
local_domains="/etc/localdomains"
remote_domains="/etc/remotedomains"
if (len(sys.argv) == 2) and (sys.argv[1] == "-v"):
mode = "verbose"
elif (len(sys.argv) == 1):
mode = "generic"
else:
print "bad input"
sys.exit()
user_domains_array = []
f = open(user_domains, 'r')
for line in f:
if "syrahost.com" not in line and line != "*: nobody\n":
user_domains_array.append(line.split(": ")[0])
f.close()
local_domains_array = []
f = open(local_domains, 'r')
for line in f:
if "syrahost.com" not in line:
local_domains_array.append(line.replace("\n",""))
f.close()
remote_domains_array = []
f = open(remote_domains, 'r')
for line in f:
if "syrahost.com" not in line:
remote_domains_array.append(line.replace("\n",""))
f.close()
local_and_remote = local_domains_array + remote_domains_array
if len(list(set(user_domains_array) - set(local_and_remote))) != 0 or len(list(set(local_and_remote) - set(user_domains_array))) != 0:
if mode == "generic":
print 0
sys.exit()
if mode == "verbose":
if len(list(set(user_domains_array) - set(local_and_remote))) != 0:
print "These lines are missing in /etc/localdomains or /etc/remotedomains:"
print list(set(user_domains_array) - set(local_and_remote))
if len(list(set(local_and_remote) - set(user_domains_array))) != 0:
print "These lines are missing in /etc/userdomains:"
print list(set(local_and_remote) - set(user_domains_array))
sys.exit()
print 1
SEA-GHOST - SHELL CODING BY SEA-GHOST