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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
# File 'lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb', line 12
def self.create_library(constant_manager, library_path = 'netapi32')
dll = Library.new(library_path, constant_manager)
dll.add_function('NetApiBufferFree','DWORD',[
["LPVOID","Buffer","in"]
])
dll.add_function('DsGetDcNameA', 'DWORD',[
["PWCHAR","ComputerName","in"],
["PWCHAR","DomainName","in"],
["PBLOB","DomainGuid","in"],
["PWCHAR","SiteName","in"],
["DWORD","Flags","in"],
["PLPVOID","DomainControllerInfo","out"]
])
dll.add_function('NetUserEnum', 'DWORD', [
["PWCHAR","servername","in"],
["DWORD","level","in"],
["DWORD","filter","in"],
["PLPVOID","bufptr","out"],
["DWORD","prefmaxlen","in"],
["PDWORD","entriesread","out"],
["PDWORD","totalentries","out"],
["PDWORD","ResumeHandle","inout"],
])
dll.add_function('NetLocalGroupEnum', 'DWORD', [
["PWCHAR","servername","in"],
["DWORD","level","in"],
["PLPVOID","bufptr","out"],
["DWORD","prefmaxlen","in"],
["PDWORD","entriesread","out"],
["PDWORD","totalentries","out"],
["PDWORD","ResumeHandle","inout"],
])
dll.add_function('NetGroupEnum', 'DWORD', [
["PWCHAR","servername","in"],
["DWORD","level","in"],
["PLPVOID","bufptr","out"],
["DWORD","prefmaxlen","in"],
["PDWORD","entriesread","out"],
["PDWORD","totalentries","out"],
["PDWORD","ResumeHandle","inout"],
])
dll.add_function('NetUserDel', 'DWORD',[
["PWCHAR","servername","in"],
["PWCHAR","username","in"],
])
dll.add_function('NetUserAdd', 'DWORD', [
["PWCHAR","servername","in"],
["DWORD","level","in"],
["PBLOB","buf","in"],
["PDWORD","parm_err","out"]
])
dll.add_function('NetGroupGetUsers', 'DWORD', [
["PWCHAR","servername","in"],
["PWCHAR","groupname","in"],
["DWORD","level","in"],
["PLPVOID","bufptr","out"],
["DWORD","prefmaxlen","in"],
["PDWORD","entriesread","out"],
["PDWORD","totalentries","out"],
["PDWORD","ResumeHandle","inout"],
])
dll.add_function('NetLocalGroupGetMembers', 'DWORD', [
["PWCHAR","servername","in"],
["PWCHAR","localgroupname","in"],
["DWORD","level","in"],
["PLPVOID","bufptr","out"],
["DWORD","prefmaxlen","in"],
["PDWORD","entriesread","out"],
["PDWORD","totalentries","out"],
["PDWORD","ResumeHandle","inout"],
])
dll.add_function('NetGroupAddUser', 'DWORD', [
["PWCHAR","servername","in"],
["PWCHAR","GroupName","in"],
["PWCHAR","username","in"],
])
dll.add_function('NetGroupAdd', 'DWORD', [
["PWCHAR","servername","in"],
["DWORD","level","in"],
["PBLOB","buf","in"],
["PDWORD","parm_err","out"]
])
dll.add_function('NetLocalGroupAdd', 'DWORD', [
["PWCHAR","servername","in"],
["DWORD","level","in"],
["PBLOB","buf","in"],
["PDWORD","parm_err","out"]
])
dll.add_function('NetLocalGroupAddMembers', 'DWORD', [
["PWCHAR","servername","in"],
["PWCHAR","groupname","in"],
["DWORD","level","in"],
["PBLOB","buf","in"],
["DWORD","totalentries","in"]
])
dll.add_function('NetGetJoinInformation', 'DWORD',[
["PWCHAR","lpServer","in"],
["PDWORD","lpNameBuffer","out"],
["PDWORD","BufferType","out"]
])
dll.add_function('NetServerEnum', 'DWORD',[
["PWCHAR","servername","in"],
["DWORD","level","in"],
["PLPVOID","bufptr","out"],
["DWORD","prefmaxlen","in"],
["PDWORD","entriesread","out"],
["PDWORD","totalentries","out"],
["DWORD","servertype","in"],
["PWCHAR","domain","in"],
["DWORD","resume_handle","inout"]
])
dll.add_function('NetWkstaUserEnum', 'DWORD', [
["PWCHAR","servername","in"],
["DWORD","level","in"],
["PLPVOID","bufptr","out"],
["DWORD","prefmaxlen","in"],
["PDWORD","entriesread","out"],
["PDWORD","totalentries","out"],
["DWORD","resume_handle","inout"]
])
dll.add_function('NetUserGetGroups', 'DWORD', [
["PWCHAR","servername","in"],
["PWCHAR","username","in"],
["DWORD","level","in"],
["PLPVOID","bufptr","out"],
["DWORD","prefmaxlen","in"],
["PDWORD","entriesread","out"],
["PDWORD","totalentries","out"]
])
dll.add_function('NetSessionEnum', 'DWORD',[
['PWCHAR','servername','in'],
['PWCHAR','UncClientName','in'],
['PWCHAR','username','in'],
['DWORD','level','in'],
['PLPVOID','bufptr','out'],
['DWORD','prefmaxlen','in'],
['PDWORD','entriesread','out'],
['PDWORD','totalentries','out'],
['PDWORD','resume_handle','inout']
])
dll.add_function('NetApiBufferFree', 'DWORD', [
['LPVOID','buffer','in']
])
dll.add_function('NetUserChangePassword', 'DWORD', [
["PWCHAR","domainname","in"],
["PWCHAR","username","in"],
["PWCHAR","oldpassword","in"],
["PWCHAR","newpassword","in"]
])
return dll
end
|