OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python2.7
/
dist-packages
/
samba
Server IP: 10.0.0.4
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
07/15/2022 06:13:39 AM
rwxr-xr-x
📄
__init__.py
12.92 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
__init__.pyc
13.1 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
_glue.x86_64-linux-gnu.so
14.3 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
_ldb.x86_64-linux-gnu.so
45.16 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
auth.x86_64-linux-gnu.so
40.55 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
common.py
3.61 KB
02/07/2018 08:37:51 AM
rw-r--r--
📄
common.pyc
3.61 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
compat.py
834 bytes
07/04/2017 10:05:25 AM
rw-r--r--
📄
compat.pyc
284 bytes
02/03/2022 06:37:40 AM
rw-r--r--
📄
credentials.x86_64-linux-gnu.so
32.02 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
crypto.x86_64-linux-gnu.so
45.93 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
dbchecker.py
114.77 KB
02/07/2018 08:37:51 AM
rw-r--r--
📄
dbchecker.pyc
74.47 KB
02/03/2022 06:37:40 AM
rw-r--r--
📁
dcerpc
-
02/03/2022 06:37:40 AM
rwxr-xr-x
📄
descriptor.py
26.63 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
descriptor.pyc
23.43 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
dnsserver.py
5.98 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
dnsserver.pyc
6.65 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
drs_utils.py
13.17 KB
09/17/2017 07:15:34 PM
rw-r--r--
📄
drs_utils.pyc
11.17 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
dsdb.x86_64-linux-gnu.so
42.9 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
dsdb_dns.x86_64-linux-gnu.so
14.02 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
gensec.x86_64-linux-gnu.so
26.99 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
getopt.py
10.87 KB
09/17/2017 07:15:34 PM
rw-r--r--
📄
getopt.pyc
11.77 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
hostconfig.py
2.29 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
hostconfig.pyc
3.26 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
idmap.py
3.18 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
idmap.pyc
3.07 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
join.py
67.78 KB
09/17/2017 07:15:34 PM
rw-r--r--
📄
join.pyc
47 KB
02/03/2022 06:37:40 AM
rw-r--r--
📁
kcc
-
02/03/2022 06:37:40 AM
rwxr-xr-x
📄
messaging.x86_64-linux-gnu.so
18.65 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
ms_display_specifiers.py
4.58 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
ms_display_specifiers.pyc
3.61 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
ms_schema.py
8.1 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
ms_schema.pyc
6.97 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
ndr.py
4.76 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
ndr.pyc
4.65 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
net.x86_64-linux-gnu.so
26.62 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
netbios.x86_64-linux-gnu.so
14.46 KB
01/25/2022 03:20:03 PM
rw-r--r--
📁
netcmd
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📄
ntacls.py
10.4 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
ntacls.pyc
6.91 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
ntstatus.x86_64-linux-gnu.so
117.69 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
param.x86_64-linux-gnu.so
23.52 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
policy.x86_64-linux-gnu.so
9.99 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
posix_eadb.x86_64-linux-gnu.so
9.99 KB
01/25/2022 03:20:03 PM
rw-r--r--
📁
provision
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📄
registry.x86_64-linux-gnu.so
19.62 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
remove_dc.py
17.3 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
remove_dc.pyc
11.45 KB
02/03/2022 06:37:41 AM
rw-r--r--
📁
samba3
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📄
samdb.py
36.89 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
samdb.pyc
34.62 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
schema.py
8.16 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
schema.pyc
6.84 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
sd_utils.py
3.24 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
sd_utils.pyc
3.12 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
security.x86_64-linux-gnu.so
9.93 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
sites.py
3.94 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
sites.pyc
4.24 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
smb.x86_64-linux-gnu.so
22.63 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
subnets.py
6.76 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
subnets.pyc
5.95 KB
02/03/2022 06:37:41 AM
rw-r--r--
📁
subunit
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📄
tdb_util.py
1.46 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
tdb_util.pyc
989 bytes
02/03/2022 06:37:41 AM
rw-r--r--
📁
tests
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📁
third_party
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📄
upgrade.py
33.68 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
upgrade.pyc
24.59 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
upgradehelpers.py
31.83 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
upgradehelpers.pyc
26.92 KB
02/03/2022 06:37:41 AM
rw-r--r--
📁
web_server
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📄
werror.x86_64-linux-gnu.so
153.69 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
xattr.py
2.22 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
xattr.pyc
1.57 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
xattr_native.x86_64-linux-gnu.so
9.99 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
xattr_tdb.x86_64-linux-gnu.so
9.99 KB
01/25/2022 03:20:03 PM
rw-r--r--
Editing: ms_schema.py
Close
# create schema.ldif (as a string) from WSPP documentation # # based on minschema.py and minschema_wspp # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. """Generate LDIF from WSPP documentation.""" import re import base64 import uuid bitFields = {} # ADTS: 2.2.9 # bit positions as labeled in the docs bitFields["searchflags"] = { 'fATTINDEX': 31, # IX 'fPDNTATTINDEX': 30, # PI 'fANR': 29, # AR 'fPRESERVEONDELETE': 28, # PR 'fCOPY': 27, # CP 'fTUPLEINDEX': 26, # TP 'fSUBTREEATTINDEX': 25, # ST 'fCONFIDENTIAL': 24, # CF 'fNEVERVALUEAUDIT': 23, # NV 'fRODCAttribute': 22, # RO # missing in ADTS but required by LDIF 'fRODCFilteredAttribute': 22, # RO ? 'fCONFIDENTAIL': 24, # typo 'fRODCFILTEREDATTRIBUTE': 22 # case } # ADTS: 2.2.10 bitFields["systemflags"] = { 'FLAG_ATTR_NOT_REPLICATED': 31, 'FLAG_CR_NTDS_NC': 31, # NR 'FLAG_ATTR_REQ_PARTIAL_SET_MEMBER': 30, 'FLAG_CR_NTDS_DOMAIN': 30, # PS 'FLAG_ATTR_IS_CONSTRUCTED': 29, 'FLAG_CR_NTDS_NOT_GC_REPLICATED': 29, # CS 'FLAG_ATTR_IS_OPERATIONAL': 28, # OP 'FLAG_SCHEMA_BASE_OBJECT': 27, # BS 'FLAG_ATTR_IS_RDN': 26, # RD 'FLAG_DISALLOW_MOVE_ON_DELETE': 6, # DE 'FLAG_DOMAIN_DISALLOW_MOVE': 5, # DM 'FLAG_DOMAIN_DISALLOW_RENAME': 4, # DR 'FLAG_CONFIG_ALLOW_LIMITED_MOVE': 3, # AL 'FLAG_CONFIG_ALLOW_MOVE': 2, # AM 'FLAG_CONFIG_ALLOW_RENAME': 1, # AR 'FLAG_DISALLOW_DELETE': 0 # DD } # ADTS: 2.2.11 bitFields["schemaflagsex"] = { 'FLAG_ATTR_IS_CRITICAL': 31 } # ADTS: 3.1.1.2.2.2 oMObjectClassBER = { '1.3.12.2.1011.28.0.702' : base64.b64encode('\x2B\x0C\x02\x87\x73\x1C\x00\x85\x3E'), '1.2.840.113556.1.1.1.12': base64.b64encode('\x2A\x86\x48\x86\xF7\x14\x01\x01\x01\x0C'), '2.6.6.1.2.5.11.29' : base64.b64encode('\x56\x06\x01\x02\x05\x0B\x1D'), '1.2.840.113556.1.1.1.11': base64.b64encode('\x2A\x86\x48\x86\xF7\x14\x01\x01\x01\x0B'), '1.3.12.2.1011.28.0.714' : base64.b64encode('\x2B\x0C\x02\x87\x73\x1C\x00\x85\x4A'), '1.3.12.2.1011.28.0.732' : base64.b64encode('\x2B\x0C\x02\x87\x73\x1C\x00\x85\x5C'), '1.2.840.113556.1.1.1.6' : base64.b64encode('\x2A\x86\x48\x86\xF7\x14\x01\x01\x01\x06') } # separated by commas in docs, and must be broken up multivalued_attrs = set(["auxiliaryclass","maycontain","mustcontain","posssuperiors", "systemauxiliaryclass","systemmaycontain","systemmustcontain", "systemposssuperiors"]) def __read_folded_line(f, buffer): """ reads a line from an LDIF file, unfolding it""" line = buffer while True: l = f.readline() if l[:1] == " ": # continued line # cannot fold an empty line assert(line != "" and line != "\n") # preserves '\n ' line = line + l else: # non-continued line if line == "": line = l if l == "": # eof, definitely won't be folded break else: # marks end of a folded line # line contains the now unfolded line # buffer contains the start of the next possibly folded line buffer = l break return (line, buffer) def __read_raw_entries(f): """reads an LDIF entry, only unfolding lines""" import sys # will not match options after the attribute type attr_type_re = re.compile("^([A-Za-z]+[A-Za-z0-9-]*):") buffer = "" while True: entry = [] while True: (l, buffer) = __read_folded_line(f, buffer) if l[:1] == "#": continue if l == "\n" or l == "": break m = attr_type_re.match(l) if m: if l[-1:] == "\n": l = l[:-1] entry.append(l) else: print >>sys.stderr, "Invalid line: %s" % l, sys.exit(1) if len(entry): yield entry if l == "": break def fix_dn(dn): """fix a string DN to use ${SCHEMADN}""" # folding? if dn.find("<RootDomainDN>") != -1: dn = dn.replace("\n ", "") dn = dn.replace(" ", "") return dn.replace("CN=Schema,CN=Configuration,<RootDomainDN>", "${SCHEMADN}") else: return dn def __convert_bitfield(key, value): """Evaluate the OR expression in 'value'""" assert(isinstance(value, str)) value = value.replace("\n ", "") value = value.replace(" ", "") try: # some attributes already have numeric values o = int(value) except ValueError: o = 0 flags = value.split("|") for f in flags: bitpos = bitFields[key][f] o = o | (1 << (31 - bitpos)) return str(o) def __write_ldif_one(entry): """Write out entry as LDIF""" out = [] for l in entry: if isinstance(l[1], str): vl = [l[1]] else: vl = l[1] if l[0].lower() == 'omobjectclass': out.append("%s:: %s" % (l[0], l[1])) continue for v in vl: out.append("%s: %s" % (l[0], v)) return "\n".join(out) def __transform_entry(entry, objectClass): """Perform transformations required to convert the LDIF-like schema file entries to LDIF, including Samba-specific stuff.""" entry = [l.split(":", 1) for l in entry] cn = "" for l in entry: key = l[0].lower() l[1] = l[1].lstrip() l[1] = l[1].rstrip() if not cn and key == "cn": cn = l[1] if key in multivalued_attrs: # unlike LDIF, these are comma-separated l[1] = l[1].replace("\n ", "") l[1] = l[1].replace(" ", "") l[1] = l[1].split(",") if key in bitFields: l[1] = __convert_bitfield(key, l[1]) if key == "omobjectclass": l[1] = oMObjectClassBER[l[1].strip()] if isinstance(l[1], str): l[1] = fix_dn(l[1]) assert(cn) entry.insert(0, ["dn", "CN=%s,${SCHEMADN}" % cn]) entry.insert(1, ["objectClass", ["top", objectClass]]) entry.insert(2, ["cn", cn]) entry.insert(2, ["objectGUID", str(uuid.uuid4())]) entry.insert(2, ["adminDescription", cn]) entry.insert(2, ["adminDisplayName", cn]) for l in entry: key = l[0].lower() if key == "cn": entry.remove(l) return entry def __parse_schema_file(filename, objectClass): """Load and transform a schema file.""" out = [] f = open(filename, "rU") for entry in __read_raw_entries(f): out.append(__write_ldif_one(__transform_entry(entry, objectClass))) return "\n\n".join(out) def read_ms_schema(attr_file, classes_file, dump_attributes = True, dump_classes = True, debug = False): """Read WSPP documentation-derived schema files.""" attr_ldif = "" classes_ldif = "" if dump_attributes: attr_ldif = __parse_schema_file(attr_file, "attributeSchema") if dump_classes: classes_ldif = __parse_schema_file(classes_file, "classSchema") return attr_ldif + "\n\n" + classes_ldif + "\n\n" if __name__ == '__main__': import sys try: attr_file = sys.argv[1] classes_file = sys.argv[2] except IndexError: print >>sys.stderr, "Usage: %s attr-file.txt classes-file.txt" % (sys.argv[0]) sys.exit(1) print read_ms_schema(attr_file, classes_file)