Linux anchor 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
Apache/2.4.18 (Ubuntu)
Server IP : 10.10.100.4 & Your IP : 216.73.217.150
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
samba /
Delete
Unzip
Name
Size
Permission
Date
Action
addshare.py
1.13
KB
-rwxr-xr-x
2021-04-14 18:00
panic-action
2.01
KB
-rwxr-xr-x
2021-04-14 18:00
setoption.py
1.3
KB
-rwxr-xr-x
2021-04-14 18:00
smb.conf
9.32
KB
-rw-r--r--
2021-04-14 18:00
Save
Rename
#!/usr/bin/python # Helper to set a global option in the samba configuration file # Eventually this should be replaced by a call to samba-tool, but # for the moment that doesn't support setting individual configuration options. import optparse import os import re import shutil import stat import tempfile parser = optparse.OptionParser() parser.add_option("--configfile", type=str, metavar="CONFFILE", help="Configuration file to use", default="/etc/samba/smb.conf") (opts, args) = parser.parse_args() if len(args) != 2: parser.print_usage() (key, value) = args inglobal = False done = False inf = open(opts.configfile, 'r') (fd, fn) = tempfile.mkstemp() outf = os.fdopen(fd, 'w') for l in inf.readlines(): m = re.match(r"^\s*\[([^]]+)\]$", l) if m: if inglobal and not done: outf.write(" %s = %s\n" % (key, value)) done = True inglobal = (m.groups(1)[0] in ("global", "globals")) elif inglobal and re.match(r"^(\s*)" + key + r"(\s*)=.*$", l): l = re.sub(r"^(\s*)" + key + r"(\s*)=.*$", r"\1" + key + r"\2=\2" + value, l) done = True outf.write(l) if not done: outf.write("%s = %s\n" % (key, value)) os.fchmod(fd, stat.S_IMODE(os.stat(opts.configfile).st_mode)) outf.close() shutil.move(fn, opts.configfile)