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
|
# File 'lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_netapi32.rb', line 12
def self.create_dll(dll_path = 'netapi32')
dll = DLL.new(dll_path, ApiConstants.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"],
["PDWORD","DomainControllerInfo","out"]
])
dll.add_function('NetUserDel', 'DWORD',[
["PWCHAR","servername","in"],
["PWCHAR","username","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"],
["PDWORD","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"],
["PDWORD","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"],
["PDWORD","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'],
['PDWORD','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
|