-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Land #278, Support querying group memberships
Add the ability to query group memberships
- Loading branch information
Showing
6 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
lib/ruby_smb/dcerpc/samr/samr_get_members_in_group_request.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module RubySMB | ||
module Dcerpc | ||
module Samr | ||
|
||
# [3.1.5.8.3 SamrGetMembersInGroup (Opnum 25)](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-samr/3ed5030d-88a3-42ca-a6e0-8c12aa2fdfbd) | ||
class SamrGetMembersInGroupRequest < BinData::Record | ||
attr_reader :opnum | ||
|
||
endian :little | ||
|
||
sampr_handle :group_handle | ||
|
||
def initialize_instance | ||
super | ||
@opnum = SAMR_GET_MEMBERS_IN_GROUP | ||
end | ||
end | ||
|
||
end | ||
end | ||
end | ||
|
||
|
34 changes: 34 additions & 0 deletions
34
lib/ruby_smb/dcerpc/samr/samr_get_members_in_group_response.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module RubySMB | ||
module Dcerpc | ||
module Samr | ||
# [2.2.7.14 SAMPR_GET_MEMBERS_BUFFER](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-samr/225147b1-45b7-4fde-a5bf-bf420e18fa08) | ||
class SamprGetMembersBuffer < Ndr::NdrStruct | ||
default_parameter byte_align: 4 | ||
|
||
ndr_uint32 :member_count | ||
ndr_uint32_conf_array_ptr :members, type: :ndr_uint32 | ||
ndr_uint32_conf_array_ptr :attributes, type: :ndr_uint32 | ||
end | ||
|
||
class PsamprGetMembersBuffer < SamprGetMembersBuffer | ||
extend Ndr::PointerClassPlugin | ||
end | ||
|
||
# [2.1.5.8.3 SamrGetMembersInGroup (Opnum 25)](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-samr/a4adbf20-040f-4416-a960-e5b7917fdae7) | ||
class SamrGetMembersInGroupResponse < BinData::Record | ||
attr_reader :opnum | ||
|
||
endian :little | ||
|
||
psampr_get_members_buffer :members | ||
ndr_uint32 :error_status | ||
|
||
def initialize_instance | ||
super | ||
@opnum = SAMR_GET_MEMBERS_IN_GROUP | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module RubySMB | ||
module Dcerpc | ||
module Samr | ||
|
||
# [3.1.5.1.7 SamrOpenGroup (Opnum 19)](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-samr/d396e6c9-d04a-4729-b0d8-f50f2748f3c8) | ||
class SamrOpenGroupRequest < BinData::Record | ||
attr_reader :opnum | ||
|
||
endian :little | ||
|
||
sampr_handle :domain_handle | ||
# Access control on a server object: bitwise OR of common ACCESS_MASK | ||
# and user ACCESS_MASK values (see lib/ruby_smb/dcerpc/samr.rb) | ||
ndr_uint32 :desired_access | ||
ndr_uint32 :group_id | ||
|
||
def initialize_instance | ||
super | ||
@opnum = SAMR_OPEN_GROUP | ||
end | ||
end | ||
|
||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module RubySMB | ||
module Dcerpc | ||
module Samr | ||
|
||
# [3.1.5.1.7 SamrOpenGroup (Opnum 19)](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-samr/d396e6c9-d04a-4729-b0d8-f50f2748f3c8) | ||
class SamrOpenGroupResponse < BinData::Record | ||
attr_reader :opnum | ||
|
||
endian :little | ||
|
||
sampr_handle :group_handle | ||
ndr_uint32 :error_status | ||
|
||
def initialize_instance | ||
super | ||
@opnum = SAMR_OPEN_GROUP | ||
end | ||
end | ||
|
||
end | ||
end | ||
end | ||
|
||
|