forked from sud0Ru/NauthNRPC
-
Notifications
You must be signed in to change notification settings - Fork 1
/
constants.py
111 lines (104 loc) · 4.18 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#source of constants is <dsgetdc.h> and <>
# Define the DsrGetDcNameEx response flag constants
DS_PDC_FLAG = 0x00000001
DS_GC_FLAG = 0x00000004
DS_LDAP_FLAG = 0x00000008
DS_DS_FLAG = 0x00000010
DS_KDC_FLAG = 0x00000020
DS_TIMESERV_FLAG = 0x00000040
DS_CLOSEST_FLAG = 0x00000080
DS_WRITABLE_FLAG = 0x00000100
DS_GOOD_TIMESERV_FLAG = 0x00000200
DS_NDNC_FLAG = 0x00000400
DS_SELECT_SECRET_DOMAIN_6_FLAG = 0x00000800
DS_FULL_SECRET_DOMAIN_6_FLAG = 0x00001000
DS_WS_FLAG = 0x00002000
DS_DS_8_FLAG = 0x00004000
DS_DS_9_FLAG = 0x00008000
DS_DS_10_FLAG = 0x00010000
DS_KEY_LIST_FLAG = 0x00020000
DS_PING_FLAGS = 0x000FFFFF
DS_DNS_CONTROLLER_FLAG = 0x20000000
DS_DNS_DOMAIN_FLAG = 0x40000000
DS_DNS_FOREST_FLAG = 0x80000000
# Dictionary to map flag constants to their names
DcNameEx_flag_mapping = {
DS_PDC_FLAG: "DS_PDC_FLAG",
DS_GC_FLAG: "DS_GC_FLAG",
DS_LDAP_FLAG: "DS_LDAP_FLAG",
DS_DS_FLAG: "DS_DS_FLAG",
DS_KDC_FLAG: "DS_KDC_FLAG",
DS_TIMESERV_FLAG: "DS_TIMESERV_FLAG",
DS_CLOSEST_FLAG: "DS_CLOSEST_FLAG",
DS_WRITABLE_FLAG: "DS_WRITABLE_FLAG",
DS_GOOD_TIMESERV_FLAG: "DS_GOOD_TIMESERV_FLAG",
DS_NDNC_FLAG: "DS_NDNC_FLAG",
DS_SELECT_SECRET_DOMAIN_6_FLAG: "DS_SELECT_SECRET_DOMAIN_6_FLAG",
DS_FULL_SECRET_DOMAIN_6_FLAG: "DS_FULL_SECRET_DOMAIN_6_FLAG",
DS_WS_FLAG: "DS_WS_FLAG",
DS_DS_8_FLAG: "DS_DS_8_FLAG",
DS_DS_9_FLAG: "DS_DS_9_FLAG",
DS_DS_10_FLAG: "DS_DS_10_FLAG",
DS_KEY_LIST_FLAG: "DS_KEY_LIST_FLAG",
DS_PING_FLAGS: "DS_PING_FLAGS",
DS_DNS_CONTROLLER_FLAG: "DS_DNS_CONTROLLER_FLAG",
DS_DNS_DOMAIN_FLAG: "DS_DNS_DOMAIN_FLAG",
DS_DNS_FOREST_FLAG: "DS_DNS_FOREST_FLAG"
}
# Define trust response flag constants
DS_DOMAIN_IN_FOREST = 0x0001
DS_DOMAIN_DIRECT_OUTBOUND = 0x0002
DS_DOMAIN_TREE_ROOT = 0x0004
DS_DOMAIN_PRIMARY = 0x0008
DS_DOMAIN_NATIVE_MODE = 0x0010
DS_DOMAIN_DIRECT_INBOUND = 0x0020
trust_flag_mapping = {
DS_DOMAIN_IN_FOREST : "DS_DOMAIN_IN_FOREST",
DS_DOMAIN_DIRECT_OUTBOUND : "DS_DOMAIN_DIRECT_OUTBOUND",
DS_DOMAIN_TREE_ROOT : "DS_DOMAIN_TREE_ROOT",
DS_DOMAIN_PRIMARY : "DS_DOMAIN_PRIMARY",
DS_DOMAIN_NATIVE_MODE : "DS_DOMAIN_NATIVE_MODE",
DS_DOMAIN_DIRECT_INBOUND : "DS_DOMAIN_DIRECT_INBOUND"
}
# Define trust type constants
TRUST_TYPE_DOWNLEVEL= 0x00000001
TRUST_TYPE_UPLEVEL = 0x00000002
TRUST_TYPE_MIT= 0x00000003
TRUST_TYPE_DCE= 0x00000004
TRUST_TYPE_AAD = 0x00000005
trust_type_mapping = {
TRUST_TYPE_DOWNLEVEL: "TRUST_TYPE_DOWNLEVEL",
TRUST_TYPE_UPLEVEL: "TRUST_TYPE_UPLEVEL",
TRUST_TYPE_MIT: "TRUST_TYPE_MIT",
TRUST_TYPE_DCE: "TRUST_TYPE_DCE",
TRUST_TYPE_AAD: "TRUST_TYPE_AAD"
}
# Define the trust attribute constants
TRUST_ATTRIBUTE_NON_TRANSITIVE = 0x00000001
TRUST_ATTRIBUTE_UPLEVEL_ONLY = 0x00000002
TRUST_ATTRIBUTE_FILTER_SIDS = 0x00000004
TRUST_ATTRIBUTE_TREE_PARENT = 0x00400000
TRUST_ATTRIBUTE_TREE_ROOT = 0x00800000
TRUST_ATTRIBUTE_FOREST_TRANSITIVE = 0x00000008
TRUST_ATTRIBUTE_CROSS_ORGANIZATION = 0x00000010
TRUST_ATTRIBUTE_WITHIN_FOREST = 0x00000020
TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL = 0x00000040
TRUST_ATTRIBUTE_TRUST_USES_RC4_ENCRYPTION = 0x00000080
TRUST_ATTRIBUTE_TRUST_USES_AES_KEYS = 0x00000100
TRUST_ATTRIBUTE_CROSS_ORGANIZATION_NO_TGT_DELEGATION = 0x00000200
TRUST_ATTRIBUTE_PIM_TRUST = 0x00000400
trust_attribute_mapping = {
TRUST_ATTRIBUTE_NON_TRANSITIVE: "TRUST_ATTRIBUTE_NON_TRANSITIVE",
TRUST_ATTRIBUTE_UPLEVEL_ONLY: "TRUST_ATTRIBUTE_UPLEVEL_ONLY",
TRUST_ATTRIBUTE_FILTER_SIDS: "TRUST_ATTRIBUTE_FILTER_SIDS",
TRUST_ATTRIBUTE_TREE_PARENT: "TRUST_ATTRIBUTE_TREE_PARENT",
TRUST_ATTRIBUTE_TREE_ROOT: "TRUST_ATTRIBUTE_TREE_ROOT",
TRUST_ATTRIBUTE_FOREST_TRANSITIVE: "TRUST_ATTRIBUTE_FOREST_TRANSITIVE",
TRUST_ATTRIBUTE_CROSS_ORGANIZATION: "TRUST_ATTRIBUTE_CROSS_ORGANIZATION",
TRUST_ATTRIBUTE_WITHIN_FOREST: "TRUST_ATTRIBUTE_WITHIN_FOREST",
TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL: "TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL",
TRUST_ATTRIBUTE_TRUST_USES_RC4_ENCRYPTION: "TRUST_ATTRIBUTE_TRUST_USES_RC4_ENCRYPTION",
TRUST_ATTRIBUTE_TRUST_USES_AES_KEYS: "TRUST_ATTRIBUTE_TRUST_USES_AES_KEYS",
TRUST_ATTRIBUTE_CROSS_ORGANIZATION_NO_TGT_DELEGATION: "TRUST_ATTRIBUTE_CROSS_ORGANIZATION_NO_TGT_DELEGATION",
TRUST_ATTRIBUTE_PIM_TRUST: "TRUST_ATTRIBUTE_PIM_TRUST"
}