ruby_smb 2.0.12 → 2.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/verify.yml +1 -1
- data/examples/dump_secrets_from_sid.rb +207 -0
- data/examples/enum_domain_users.rb +75 -0
- data/examples/get_computer_info.rb +42 -0
- data/examples/query_service_status.rb +42 -4
- data/lib/ruby_smb/client.rb +3 -14
- data/lib/ruby_smb/dcerpc/bind.rb +28 -20
- data/lib/ruby_smb/dcerpc/bind_ack.rb +29 -28
- data/lib/ruby_smb/dcerpc/client.rb +542 -0
- data/lib/ruby_smb/dcerpc/drsr/drs_bind_request.rb +24 -0
- data/lib/ruby_smb/dcerpc/drsr/drs_bind_response.rb +26 -0
- data/lib/ruby_smb/dcerpc/drsr/drs_crack_names_request.rb +57 -0
- data/lib/ruby_smb/dcerpc/drsr/drs_crack_names_response.rb +76 -0
- data/lib/ruby_smb/dcerpc/drsr/drs_domain_controller_info_request.rb +46 -0
- data/lib/ruby_smb/dcerpc/drsr/drs_domain_controller_info_response.rb +168 -0
- data/lib/ruby_smb/dcerpc/drsr/drs_extensions.rb +56 -0
- data/lib/ruby_smb/dcerpc/drsr/drs_get_nc_changes_request.rb +121 -0
- data/lib/ruby_smb/dcerpc/drsr/drs_get_nc_changes_response.rb +118 -0
- data/lib/ruby_smb/dcerpc/drsr/drs_unbind_request.rb +24 -0
- data/lib/ruby_smb/dcerpc/drsr/drs_unbind_response.rb +26 -0
- data/lib/ruby_smb/dcerpc/drsr.rb +909 -0
- data/lib/ruby_smb/dcerpc/epm/epm_ept_map_request.rb +26 -0
- data/lib/ruby_smb/dcerpc/epm/epm_ept_map_response.rb +25 -0
- data/lib/ruby_smb/dcerpc/epm/epm_twrt.rb +211 -0
- data/lib/ruby_smb/dcerpc/epm.rb +75 -0
- data/lib/ruby_smb/dcerpc/error.rb +17 -0
- data/lib/ruby_smb/dcerpc/ndr.rb +1159 -297
- data/lib/ruby_smb/dcerpc/netlogon/netr_server_authenticate3_request.rb +3 -13
- data/lib/ruby_smb/dcerpc/netlogon/netr_server_authenticate3_response.rb +3 -3
- data/lib/ruby_smb/dcerpc/netlogon/netr_server_password_set2_request.rb +3 -13
- data/lib/ruby_smb/dcerpc/netlogon/netr_server_password_set2_response.rb +1 -1
- data/lib/ruby_smb/dcerpc/netlogon/netr_server_req_challenge_request.rb +3 -11
- data/lib/ruby_smb/dcerpc/netlogon/netr_server_req_challenge_response.rb +1 -1
- data/lib/ruby_smb/dcerpc/netlogon.rb +5 -4
- data/lib/ruby_smb/dcerpc/p_syntax_id_t.rb +4 -3
- data/lib/ruby_smb/dcerpc/pdu_header.rb +7 -7
- data/lib/ruby_smb/dcerpc/ptypes.rb +1 -0
- data/lib/ruby_smb/dcerpc/request.rb +79 -32
- data/lib/ruby_smb/dcerpc/response.rb +45 -10
- data/lib/ruby_smb/dcerpc/rpc_auth3.rb +28 -0
- data/lib/ruby_smb/dcerpc/rpc_security_attributes.rb +11 -11
- data/lib/ruby_smb/dcerpc/rrp_rpc_unicode_string.rb +118 -0
- data/lib/ruby_smb/dcerpc/samr/rpc_sid.rb +150 -0
- data/lib/ruby_smb/dcerpc/samr/samr_close_handle_request.rb +23 -0
- data/lib/ruby_smb/dcerpc/samr/samr_close_handle_response.rb +24 -0
- data/lib/ruby_smb/dcerpc/samr/samr_connect_request.rb +32 -0
- data/lib/ruby_smb/dcerpc/samr/samr_connect_response.rb +23 -0
- data/lib/ruby_smb/dcerpc/samr/samr_enumerate_users_in_domain_request.rb +26 -0
- data/lib/ruby_smb/dcerpc/samr/samr_enumerate_users_in_domain_response.rb +55 -0
- data/lib/ruby_smb/dcerpc/samr/samr_get_alias_membership_request.rb +48 -0
- data/lib/ruby_smb/dcerpc/samr/samr_get_alias_membership_response.rb +38 -0
- data/lib/ruby_smb/dcerpc/samr/samr_get_groups_for_user_request.rb +23 -0
- data/lib/ruby_smb/dcerpc/samr/samr_get_groups_for_user_response.rb +48 -0
- data/lib/ruby_smb/dcerpc/samr/samr_lookup_domain_in_sam_server_request.rb +24 -0
- data/lib/ruby_smb/dcerpc/samr/samr_lookup_domain_in_sam_server_response.rb +25 -0
- data/lib/ruby_smb/dcerpc/samr/samr_open_domain_request.rb +27 -0
- data/lib/ruby_smb/dcerpc/samr/samr_open_domain_response.rb +24 -0
- data/lib/ruby_smb/dcerpc/samr/samr_open_user_request.rb +26 -0
- data/lib/ruby_smb/dcerpc/samr/samr_open_user_response.rb +24 -0
- data/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request.rb +23 -0
- data/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_response.rb +23 -0
- data/lib/ruby_smb/dcerpc/samr.rb +613 -0
- data/lib/ruby_smb/dcerpc/sec_trailer.rb +26 -0
- data/lib/ruby_smb/dcerpc/srvsvc/net_share_enum_all.rb +56 -79
- data/lib/ruby_smb/dcerpc/srvsvc.rb +27 -4
- data/lib/ruby_smb/dcerpc/svcctl/change_service_config_w_request.rb +13 -25
- data/lib/ruby_smb/dcerpc/svcctl/change_service_config_w_response.rb +2 -2
- data/lib/ruby_smb/dcerpc/svcctl/close_service_handle_response.rb +1 -1
- data/lib/ruby_smb/dcerpc/svcctl/control_service_request.rb +1 -1
- data/lib/ruby_smb/dcerpc/svcctl/control_service_response.rb +1 -1
- data/lib/ruby_smb/dcerpc/svcctl/open_sc_manager_w_request.rb +4 -14
- data/lib/ruby_smb/dcerpc/svcctl/open_sc_manager_w_response.rb +1 -1
- data/lib/ruby_smb/dcerpc/svcctl/open_service_w_request.rb +3 -11
- data/lib/ruby_smb/dcerpc/svcctl/open_service_w_response.rb +1 -1
- data/lib/ruby_smb/dcerpc/svcctl/query_service_config_w_request.rb +1 -1
- data/lib/ruby_smb/dcerpc/svcctl/query_service_config_w_response.rb +12 -11
- data/lib/ruby_smb/dcerpc/svcctl/query_service_status_response.rb +1 -1
- data/lib/ruby_smb/dcerpc/svcctl/service_status.rb +9 -8
- data/lib/ruby_smb/dcerpc/svcctl/start_service_w_request.rb +3 -3
- data/lib/ruby_smb/dcerpc/svcctl/start_service_w_response.rb +1 -1
- data/lib/ruby_smb/dcerpc/svcctl.rb +1 -3
- data/lib/ruby_smb/dcerpc/uuid.rb +3 -0
- data/lib/ruby_smb/dcerpc/winreg/close_key_response.rb +2 -2
- data/lib/ruby_smb/dcerpc/winreg/create_key_request.rb +2 -13
- data/lib/ruby_smb/dcerpc/winreg/create_key_response.rb +3 -3
- data/lib/ruby_smb/dcerpc/winreg/enum_key_request.rb +3 -20
- data/lib/ruby_smb/dcerpc/winreg/enum_key_response.rb +3 -20
- data/lib/ruby_smb/dcerpc/winreg/enum_value_request.rb +5 -14
- data/lib/ruby_smb/dcerpc/winreg/enum_value_response.rb +5 -14
- data/lib/ruby_smb/dcerpc/winreg/open_key_request.rb +1 -9
- data/lib/ruby_smb/dcerpc/winreg/open_key_response.rb +4 -3
- data/lib/ruby_smb/dcerpc/winreg/open_root_key_request.rb +5 -6
- data/lib/ruby_smb/dcerpc/winreg/open_root_key_response.rb +2 -2
- data/lib/ruby_smb/dcerpc/winreg/query_info_key_response.rb +9 -18
- data/lib/ruby_smb/dcerpc/winreg/query_value_request.rb +4 -14
- data/lib/ruby_smb/dcerpc/winreg/query_value_response.rb +7 -15
- data/lib/ruby_smb/dcerpc/winreg/regsam.rb +3 -1
- data/lib/ruby_smb/dcerpc/winreg/save_key_request.rb +0 -9
- data/lib/ruby_smb/dcerpc/winreg/save_key_response.rb +1 -1
- data/lib/ruby_smb/dcerpc/winreg.rb +10 -14
- data/lib/ruby_smb/dcerpc/wkssvc/netr_wksta_get_info_request.rb +26 -0
- data/lib/ruby_smb/dcerpc/wkssvc/netr_wksta_get_info_response.rb +88 -0
- data/lib/ruby_smb/dcerpc/wkssvc.rb +65 -0
- data/lib/ruby_smb/dcerpc.rb +41 -11
- data/lib/ruby_smb/field/file_time.rb +1 -1
- data/lib/ruby_smb/field/string16.rb +5 -1
- data/lib/ruby_smb/ntlm.rb +18 -2
- data/lib/ruby_smb/smb1/pipe.rb +4 -0
- data/lib/ruby_smb/smb2/pipe.rb +4 -0
- data/lib/ruby_smb/version.rb +1 -1
- data/spec/lib/ruby_smb/client_spec.rb +1 -2
- data/spec/lib/ruby_smb/dcerpc/bind_ack_spec.rb +69 -41
- data/spec/lib/ruby_smb/dcerpc/bind_spec.rb +75 -21
- data/spec/lib/ruby_smb/dcerpc/client_spec.rb +714 -0
- data/spec/lib/ruby_smb/dcerpc/drsr_spec.rb +2169 -0
- data/spec/lib/ruby_smb/dcerpc/ndr_spec.rb +3792 -1373
- data/spec/lib/ruby_smb/dcerpc/netlogon/netr_server_authenticate3_request_spec.rb +4 -4
- data/spec/lib/ruby_smb/dcerpc/netlogon/netr_server_password_set2_request_spec.rb +4 -4
- data/spec/lib/ruby_smb/dcerpc/netlogon/netr_server_req_challenge_request_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/netlogon/netr_server_req_challenge_response_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/p_syntax_id_t_spec.rb +18 -4
- data/spec/lib/ruby_smb/dcerpc/pdu_header_spec.rb +27 -1
- data/spec/lib/ruby_smb/dcerpc/request_spec.rb +76 -11
- data/spec/lib/ruby_smb/dcerpc/response_spec.rb +99 -9
- data/spec/lib/ruby_smb/dcerpc/rpc_auth3_spec.rb +75 -0
- data/spec/lib/ruby_smb/dcerpc/rpc_security_attributes_spec.rb +29 -28
- data/spec/lib/ruby_smb/dcerpc/rrp_rpc_unicode_string_spec.rb +340 -0
- data/spec/lib/ruby_smb/dcerpc/samr/rpc_sid_spec.rb +116 -0
- data/spec/lib/ruby_smb/dcerpc/samr/samr_close_handle_request_spec.rb +40 -0
- data/spec/lib/ruby_smb/dcerpc/samr/samr_close_handle_response_spec.rb +48 -0
- data/spec/lib/ruby_smb/dcerpc/samr/samr_connect_request_spec.rb +56 -0
- data/spec/lib/ruby_smb/dcerpc/samr/samr_connect_response_spec.rb +47 -0
- data/spec/lib/ruby_smb/dcerpc/samr/samr_enumerate_users_in_domain_request_spec.rb +63 -0
- data/spec/lib/ruby_smb/dcerpc/samr/samr_enumerate_users_in_domain_response_spec.rb +265 -0
- data/spec/lib/ruby_smb/dcerpc/samr/samr_lookup_domain_in_sam_server_request_spec.rb +52 -0
- data/spec/lib/ruby_smb/dcerpc/samr/samr_lookup_domain_in_sam_server_response_spec.rb +36 -0
- data/spec/lib/ruby_smb/dcerpc/samr/samr_open_domain_request_spec.rb +56 -0
- data/spec/lib/ruby_smb/dcerpc/samr/samr_open_domain_response_spec.rb +48 -0
- data/spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb +48 -0
- data/spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_response_spec.rb +42 -0
- data/spec/lib/ruby_smb/dcerpc/samr_spec.rb +420 -0
- data/spec/lib/ruby_smb/dcerpc/sec_trailer_spec.rb +92 -0
- data/spec/lib/ruby_smb/dcerpc/srvsvc/net_share_enum_all_spec.rb +149 -110
- data/spec/lib/ruby_smb/dcerpc/srvsvc_spec.rb +21 -17
- data/spec/lib/ruby_smb/dcerpc/svcctl/change_service_config_w_request_spec.rb +56 -79
- data/spec/lib/ruby_smb/dcerpc/svcctl/change_service_config_w_response_spec.rb +4 -4
- data/spec/lib/ruby_smb/dcerpc/svcctl/close_service_handle_response_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/svcctl/control_service_request_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/svcctl/control_service_response_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/svcctl/open_sc_manager_w_request_spec.rb +19 -29
- data/spec/lib/ruby_smb/dcerpc/svcctl/open_sc_manager_w_response_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/svcctl/open_service_w_request_spec.rb +9 -15
- data/spec/lib/ruby_smb/dcerpc/svcctl/open_service_w_response_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/svcctl/query_service_config_w_request_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/svcctl/query_service_config_w_response_spec.rb +22 -22
- data/spec/lib/ruby_smb/dcerpc/svcctl/query_service_status_response_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/svcctl/service_status_spec.rb +18 -14
- data/spec/lib/ruby_smb/dcerpc/svcctl/start_service_w_request_spec.rb +5 -4
- data/spec/lib/ruby_smb/dcerpc/svcctl/start_service_w_response_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/svcctl_spec.rb +1 -5
- data/spec/lib/ruby_smb/dcerpc/uuid_spec.rb +15 -23
- data/spec/lib/ruby_smb/dcerpc/winreg/close_key_response_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/winreg/create_key_request_spec.rb +4 -41
- data/spec/lib/ruby_smb/dcerpc/winreg/create_key_response_spec.rb +4 -4
- data/spec/lib/ruby_smb/dcerpc/winreg/enum_key_request_spec.rb +4 -52
- data/spec/lib/ruby_smb/dcerpc/winreg/enum_key_response_spec.rb +4 -56
- data/spec/lib/ruby_smb/dcerpc/winreg/enum_value_request_spec.rb +10 -34
- data/spec/lib/ruby_smb/dcerpc/winreg/enum_value_response_spec.rb +10 -34
- data/spec/lib/ruby_smb/dcerpc/winreg/open_key_request_spec.rb +2 -26
- data/spec/lib/ruby_smb/dcerpc/winreg/open_key_response_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/winreg/open_root_key_request_spec.rb +17 -25
- data/spec/lib/ruby_smb/dcerpc/winreg/open_root_key_response_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/winreg/query_info_key_response_spec.rb +20 -44
- data/spec/lib/ruby_smb/dcerpc/winreg/query_value_request_spec.rb +8 -32
- data/spec/lib/ruby_smb/dcerpc/winreg/query_value_response_spec.rb +10 -22
- data/spec/lib/ruby_smb/dcerpc/winreg/regsam_spec.rb +4 -0
- data/spec/lib/ruby_smb/dcerpc/winreg/save_key_request_spec.rb +0 -12
- data/spec/lib/ruby_smb/dcerpc/winreg/save_key_response_spec.rb +2 -2
- data/spec/lib/ruby_smb/dcerpc/winreg_spec.rb +18 -47
- data/spec/lib/ruby_smb/dcerpc/wkssvc/netr_wksta_get_info_request_spec.rb +43 -0
- data/spec/lib/ruby_smb/dcerpc/wkssvc/netr_wksta_get_info_response_spec.rb +410 -0
- data/spec/lib/ruby_smb/dcerpc/wkssvc_spec.rb +70 -0
- data/spec/lib/ruby_smb/field/string16_spec.rb +22 -0
- data/spec/lib/ruby_smb/gss/provider/ntlm/os_version_spec.rb +1 -1
- data/spec/lib/ruby_smb/smb1/pipe_spec.rb +18 -37
- data/spec/lib/ruby_smb/smb2/pipe_spec.rb +18 -16
- data/spec/support/bin_helper.rb +9 -0
- data.tar.gz.sig +0 -0
- metadata +96 -5
- metadata.gz.sig +0 -0
- data/lib/ruby_smb/dcerpc/rrp_unicode_string.rb +0 -38
- data/spec/lib/ruby_smb/dcerpc/rrp_unicode_string_spec.rb +0 -135
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_smb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Metasploit Hackers
|
@@ -97,7 +97,7 @@ cert_chain:
|
|
97
97
|
EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
|
98
98
|
9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
|
99
99
|
-----END CERTIFICATE-----
|
100
|
-
date: 2021-12-
|
100
|
+
date: 2021-12-28 00:00:00.000000000 Z
|
101
101
|
dependencies:
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: redcarpet
|
@@ -261,8 +261,11 @@ files:
|
|
261
261
|
- examples/auth_capture.rb
|
262
262
|
- examples/authenticate.rb
|
263
263
|
- examples/delete_file.rb
|
264
|
+
- examples/dump_secrets_from_sid.rb
|
265
|
+
- examples/enum_domain_users.rb
|
264
266
|
- examples/enum_registry_key.rb
|
265
267
|
- examples/enum_registry_values.rb
|
268
|
+
- examples/get_computer_info.rb
|
266
269
|
- examples/list_directory.rb
|
267
270
|
- examples/negotiate.rb
|
268
271
|
- examples/negotiate_with_netbios_service.rb
|
@@ -290,6 +293,23 @@ files:
|
|
290
293
|
- lib/ruby_smb/dcerpc.rb
|
291
294
|
- lib/ruby_smb/dcerpc/bind.rb
|
292
295
|
- lib/ruby_smb/dcerpc/bind_ack.rb
|
296
|
+
- lib/ruby_smb/dcerpc/client.rb
|
297
|
+
- lib/ruby_smb/dcerpc/drsr.rb
|
298
|
+
- lib/ruby_smb/dcerpc/drsr/drs_bind_request.rb
|
299
|
+
- lib/ruby_smb/dcerpc/drsr/drs_bind_response.rb
|
300
|
+
- lib/ruby_smb/dcerpc/drsr/drs_crack_names_request.rb
|
301
|
+
- lib/ruby_smb/dcerpc/drsr/drs_crack_names_response.rb
|
302
|
+
- lib/ruby_smb/dcerpc/drsr/drs_domain_controller_info_request.rb
|
303
|
+
- lib/ruby_smb/dcerpc/drsr/drs_domain_controller_info_response.rb
|
304
|
+
- lib/ruby_smb/dcerpc/drsr/drs_extensions.rb
|
305
|
+
- lib/ruby_smb/dcerpc/drsr/drs_get_nc_changes_request.rb
|
306
|
+
- lib/ruby_smb/dcerpc/drsr/drs_get_nc_changes_response.rb
|
307
|
+
- lib/ruby_smb/dcerpc/drsr/drs_unbind_request.rb
|
308
|
+
- lib/ruby_smb/dcerpc/drsr/drs_unbind_response.rb
|
309
|
+
- lib/ruby_smb/dcerpc/epm.rb
|
310
|
+
- lib/ruby_smb/dcerpc/epm/epm_ept_map_request.rb
|
311
|
+
- lib/ruby_smb/dcerpc/epm/epm_ept_map_response.rb
|
312
|
+
- lib/ruby_smb/dcerpc/epm/epm_twrt.rb
|
293
313
|
- lib/ruby_smb/dcerpc/error.rb
|
294
314
|
- lib/ruby_smb/dcerpc/ndr.rb
|
295
315
|
- lib/ruby_smb/dcerpc/netlogon.rb
|
@@ -304,8 +324,30 @@ files:
|
|
304
324
|
- lib/ruby_smb/dcerpc/ptypes.rb
|
305
325
|
- lib/ruby_smb/dcerpc/request.rb
|
306
326
|
- lib/ruby_smb/dcerpc/response.rb
|
327
|
+
- lib/ruby_smb/dcerpc/rpc_auth3.rb
|
307
328
|
- lib/ruby_smb/dcerpc/rpc_security_attributes.rb
|
308
|
-
- lib/ruby_smb/dcerpc/
|
329
|
+
- lib/ruby_smb/dcerpc/rrp_rpc_unicode_string.rb
|
330
|
+
- lib/ruby_smb/dcerpc/samr.rb
|
331
|
+
- lib/ruby_smb/dcerpc/samr/rpc_sid.rb
|
332
|
+
- lib/ruby_smb/dcerpc/samr/samr_close_handle_request.rb
|
333
|
+
- lib/ruby_smb/dcerpc/samr/samr_close_handle_response.rb
|
334
|
+
- lib/ruby_smb/dcerpc/samr/samr_connect_request.rb
|
335
|
+
- lib/ruby_smb/dcerpc/samr/samr_connect_response.rb
|
336
|
+
- lib/ruby_smb/dcerpc/samr/samr_enumerate_users_in_domain_request.rb
|
337
|
+
- lib/ruby_smb/dcerpc/samr/samr_enumerate_users_in_domain_response.rb
|
338
|
+
- lib/ruby_smb/dcerpc/samr/samr_get_alias_membership_request.rb
|
339
|
+
- lib/ruby_smb/dcerpc/samr/samr_get_alias_membership_response.rb
|
340
|
+
- lib/ruby_smb/dcerpc/samr/samr_get_groups_for_user_request.rb
|
341
|
+
- lib/ruby_smb/dcerpc/samr/samr_get_groups_for_user_response.rb
|
342
|
+
- lib/ruby_smb/dcerpc/samr/samr_lookup_domain_in_sam_server_request.rb
|
343
|
+
- lib/ruby_smb/dcerpc/samr/samr_lookup_domain_in_sam_server_response.rb
|
344
|
+
- lib/ruby_smb/dcerpc/samr/samr_open_domain_request.rb
|
345
|
+
- lib/ruby_smb/dcerpc/samr/samr_open_domain_response.rb
|
346
|
+
- lib/ruby_smb/dcerpc/samr/samr_open_user_request.rb
|
347
|
+
- lib/ruby_smb/dcerpc/samr/samr_open_user_response.rb
|
348
|
+
- lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request.rb
|
349
|
+
- lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_response.rb
|
350
|
+
- lib/ruby_smb/dcerpc/sec_trailer.rb
|
309
351
|
- lib/ruby_smb/dcerpc/srvsvc.rb
|
310
352
|
- lib/ruby_smb/dcerpc/srvsvc/net_share_enum_all.rb
|
311
353
|
- lib/ruby_smb/dcerpc/svcctl.rb
|
@@ -347,6 +389,9 @@ files:
|
|
347
389
|
- lib/ruby_smb/dcerpc/winreg/regsam.rb
|
348
390
|
- lib/ruby_smb/dcerpc/winreg/save_key_request.rb
|
349
391
|
- lib/ruby_smb/dcerpc/winreg/save_key_response.rb
|
392
|
+
- lib/ruby_smb/dcerpc/wkssvc.rb
|
393
|
+
- lib/ruby_smb/dcerpc/wkssvc/netr_wksta_get_info_request.rb
|
394
|
+
- lib/ruby_smb/dcerpc/wkssvc/netr_wksta_get_info_response.rb
|
350
395
|
- lib/ruby_smb/dialect.rb
|
351
396
|
- lib/ruby_smb/dispatcher.rb
|
352
397
|
- lib/ruby_smb/dispatcher/base.rb
|
@@ -542,6 +587,8 @@ files:
|
|
542
587
|
- spec/lib/ruby_smb/crypto_spec.rb
|
543
588
|
- spec/lib/ruby_smb/dcerpc/bind_ack_spec.rb
|
544
589
|
- spec/lib/ruby_smb/dcerpc/bind_spec.rb
|
590
|
+
- spec/lib/ruby_smb/dcerpc/client_spec.rb
|
591
|
+
- spec/lib/ruby_smb/dcerpc/drsr_spec.rb
|
545
592
|
- spec/lib/ruby_smb/dcerpc/ndr_spec.rb
|
546
593
|
- spec/lib/ruby_smb/dcerpc/netlogon/netr_server_authenticate3_request_spec.rb
|
547
594
|
- spec/lib/ruby_smb/dcerpc/netlogon/netr_server_authenticate3_response_spec.rb
|
@@ -553,8 +600,24 @@ files:
|
|
553
600
|
- spec/lib/ruby_smb/dcerpc/pdu_header_spec.rb
|
554
601
|
- spec/lib/ruby_smb/dcerpc/request_spec.rb
|
555
602
|
- spec/lib/ruby_smb/dcerpc/response_spec.rb
|
603
|
+
- spec/lib/ruby_smb/dcerpc/rpc_auth3_spec.rb
|
556
604
|
- spec/lib/ruby_smb/dcerpc/rpc_security_attributes_spec.rb
|
557
|
-
- spec/lib/ruby_smb/dcerpc/
|
605
|
+
- spec/lib/ruby_smb/dcerpc/rrp_rpc_unicode_string_spec.rb
|
606
|
+
- spec/lib/ruby_smb/dcerpc/samr/rpc_sid_spec.rb
|
607
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_close_handle_request_spec.rb
|
608
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_close_handle_response_spec.rb
|
609
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_connect_request_spec.rb
|
610
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_connect_response_spec.rb
|
611
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_enumerate_users_in_domain_request_spec.rb
|
612
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_enumerate_users_in_domain_response_spec.rb
|
613
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_lookup_domain_in_sam_server_request_spec.rb
|
614
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_lookup_domain_in_sam_server_response_spec.rb
|
615
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_open_domain_request_spec.rb
|
616
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_open_domain_response_spec.rb
|
617
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
|
618
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_response_spec.rb
|
619
|
+
- spec/lib/ruby_smb/dcerpc/samr_spec.rb
|
620
|
+
- spec/lib/ruby_smb/dcerpc/sec_trailer_spec.rb
|
558
621
|
- spec/lib/ruby_smb/dcerpc/srvsvc/net_share_enum_all_spec.rb
|
559
622
|
- spec/lib/ruby_smb/dcerpc/srvsvc_spec.rb
|
560
623
|
- spec/lib/ruby_smb/dcerpc/svcctl/change_service_config_w_request_spec.rb
|
@@ -596,6 +659,9 @@ files:
|
|
596
659
|
- spec/lib/ruby_smb/dcerpc/winreg/save_key_request_spec.rb
|
597
660
|
- spec/lib/ruby_smb/dcerpc/winreg/save_key_response_spec.rb
|
598
661
|
- spec/lib/ruby_smb/dcerpc/winreg_spec.rb
|
662
|
+
- spec/lib/ruby_smb/dcerpc/wkssvc/netr_wksta_get_info_request_spec.rb
|
663
|
+
- spec/lib/ruby_smb/dcerpc/wkssvc/netr_wksta_get_info_response_spec.rb
|
664
|
+
- spec/lib/ruby_smb/dcerpc/wkssvc_spec.rb
|
599
665
|
- spec/lib/ruby_smb/dcerpc_spec.rb
|
600
666
|
- spec/lib/ruby_smb/dispatcher/base_spec.rb
|
601
667
|
- spec/lib/ruby_smb/dispatcher/socket_spec.rb
|
@@ -609,6 +675,7 @@ files:
|
|
609
675
|
- spec/lib/ruby_smb/field/smb_fea_spec.rb
|
610
676
|
- spec/lib/ruby_smb/field/smb_gea_list_spec.rb
|
611
677
|
- spec/lib/ruby_smb/field/smb_gea_spec.rb
|
678
|
+
- spec/lib/ruby_smb/field/string16_spec.rb
|
612
679
|
- spec/lib/ruby_smb/field/stringz16_spec.rb
|
613
680
|
- spec/lib/ruby_smb/field/utime_spec.rb
|
614
681
|
- spec/lib/ruby_smb/fscc/ea_info_array_spec.rb
|
@@ -751,6 +818,7 @@ files:
|
|
751
818
|
- spec/lib/ruby_smb/smb2/tree_spec.rb
|
752
819
|
- spec/lib/ruby_smb_spec.rb
|
753
820
|
- spec/spec_helper.rb
|
821
|
+
- spec/support/bin_helper.rb
|
754
822
|
- spec/support/mock_socket_dispatcher.rb
|
755
823
|
- spec/support/shared/examples/bit_field_single_flag.rb
|
756
824
|
homepage: https://github.com/rapid7/ruby_smb
|
@@ -783,6 +851,8 @@ test_files:
|
|
783
851
|
- spec/lib/ruby_smb/crypto_spec.rb
|
784
852
|
- spec/lib/ruby_smb/dcerpc/bind_ack_spec.rb
|
785
853
|
- spec/lib/ruby_smb/dcerpc/bind_spec.rb
|
854
|
+
- spec/lib/ruby_smb/dcerpc/client_spec.rb
|
855
|
+
- spec/lib/ruby_smb/dcerpc/drsr_spec.rb
|
786
856
|
- spec/lib/ruby_smb/dcerpc/ndr_spec.rb
|
787
857
|
- spec/lib/ruby_smb/dcerpc/netlogon/netr_server_authenticate3_request_spec.rb
|
788
858
|
- spec/lib/ruby_smb/dcerpc/netlogon/netr_server_authenticate3_response_spec.rb
|
@@ -794,8 +864,24 @@ test_files:
|
|
794
864
|
- spec/lib/ruby_smb/dcerpc/pdu_header_spec.rb
|
795
865
|
- spec/lib/ruby_smb/dcerpc/request_spec.rb
|
796
866
|
- spec/lib/ruby_smb/dcerpc/response_spec.rb
|
867
|
+
- spec/lib/ruby_smb/dcerpc/rpc_auth3_spec.rb
|
797
868
|
- spec/lib/ruby_smb/dcerpc/rpc_security_attributes_spec.rb
|
798
|
-
- spec/lib/ruby_smb/dcerpc/
|
869
|
+
- spec/lib/ruby_smb/dcerpc/rrp_rpc_unicode_string_spec.rb
|
870
|
+
- spec/lib/ruby_smb/dcerpc/samr/rpc_sid_spec.rb
|
871
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_close_handle_request_spec.rb
|
872
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_close_handle_response_spec.rb
|
873
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_connect_request_spec.rb
|
874
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_connect_response_spec.rb
|
875
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_enumerate_users_in_domain_request_spec.rb
|
876
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_enumerate_users_in_domain_response_spec.rb
|
877
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_lookup_domain_in_sam_server_request_spec.rb
|
878
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_lookup_domain_in_sam_server_response_spec.rb
|
879
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_open_domain_request_spec.rb
|
880
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_open_domain_response_spec.rb
|
881
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
|
882
|
+
- spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_response_spec.rb
|
883
|
+
- spec/lib/ruby_smb/dcerpc/samr_spec.rb
|
884
|
+
- spec/lib/ruby_smb/dcerpc/sec_trailer_spec.rb
|
799
885
|
- spec/lib/ruby_smb/dcerpc/srvsvc/net_share_enum_all_spec.rb
|
800
886
|
- spec/lib/ruby_smb/dcerpc/srvsvc_spec.rb
|
801
887
|
- spec/lib/ruby_smb/dcerpc/svcctl/change_service_config_w_request_spec.rb
|
@@ -837,6 +923,9 @@ test_files:
|
|
837
923
|
- spec/lib/ruby_smb/dcerpc/winreg/save_key_request_spec.rb
|
838
924
|
- spec/lib/ruby_smb/dcerpc/winreg/save_key_response_spec.rb
|
839
925
|
- spec/lib/ruby_smb/dcerpc/winreg_spec.rb
|
926
|
+
- spec/lib/ruby_smb/dcerpc/wkssvc/netr_wksta_get_info_request_spec.rb
|
927
|
+
- spec/lib/ruby_smb/dcerpc/wkssvc/netr_wksta_get_info_response_spec.rb
|
928
|
+
- spec/lib/ruby_smb/dcerpc/wkssvc_spec.rb
|
840
929
|
- spec/lib/ruby_smb/dcerpc_spec.rb
|
841
930
|
- spec/lib/ruby_smb/dispatcher/base_spec.rb
|
842
931
|
- spec/lib/ruby_smb/dispatcher/socket_spec.rb
|
@@ -850,6 +939,7 @@ test_files:
|
|
850
939
|
- spec/lib/ruby_smb/field/smb_fea_spec.rb
|
851
940
|
- spec/lib/ruby_smb/field/smb_gea_list_spec.rb
|
852
941
|
- spec/lib/ruby_smb/field/smb_gea_spec.rb
|
942
|
+
- spec/lib/ruby_smb/field/string16_spec.rb
|
853
943
|
- spec/lib/ruby_smb/field/stringz16_spec.rb
|
854
944
|
- spec/lib/ruby_smb/field/utime_spec.rb
|
855
945
|
- spec/lib/ruby_smb/fscc/ea_info_array_spec.rb
|
@@ -992,5 +1082,6 @@ test_files:
|
|
992
1082
|
- spec/lib/ruby_smb/smb2/tree_spec.rb
|
993
1083
|
- spec/lib/ruby_smb_spec.rb
|
994
1084
|
- spec/spec_helper.rb
|
1085
|
+
- spec/support/bin_helper.rb
|
995
1086
|
- spec/support/mock_socket_dispatcher.rb
|
996
1087
|
- spec/support/shared/examples/bit_field_single_flag.rb
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'ruby_smb/dcerpc/ndr'
|
2
|
-
|
3
|
-
module RubySMB
|
4
|
-
module Dcerpc
|
5
|
-
|
6
|
-
# A RRP_UNICODE_STRING structure as defined in
|
7
|
-
# [2.2.4 RRP_UNICODE_STRING](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rrp/c0c90f11-a4c4-496a-ac09-8a8a3697ceef)
|
8
|
-
class RrpUnicodeString < BinData::Primitive
|
9
|
-
endian :little
|
10
|
-
|
11
|
-
uint16 :buffer_length
|
12
|
-
uint16 :maximum_length
|
13
|
-
ndr_lp_str :buffer
|
14
|
-
|
15
|
-
def get
|
16
|
-
self.buffer
|
17
|
-
end
|
18
|
-
|
19
|
-
def set(buf)
|
20
|
-
self.buffer = buf
|
21
|
-
self.buffer_length = self.buffer == :null ? 0 : self.buffer.referent.actual_count * 2
|
22
|
-
# Don't reset maximum_length if the buffer is NULL to make sure we can
|
23
|
-
# set it independently of the buffer size
|
24
|
-
return if self.maximum_length > 0 && self.buffer == :null
|
25
|
-
self.maximum_length = self.buffer.referent.max_count * 2
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
# A pointer to a RRP_UNICODE_STRING structure
|
30
|
-
class PrrpUnicodeString < Ndr::NdrPointer
|
31
|
-
endian :little
|
32
|
-
|
33
|
-
rrp_unicode_string :referent, onlyif: -> { self.referent_id != 0 }
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
@@ -1,135 +0,0 @@
|
|
1
|
-
RSpec.describe RubySMB::Dcerpc::RrpUnicodeString do
|
2
|
-
subject(:packet) { described_class.new }
|
3
|
-
|
4
|
-
it { is_expected.to respond_to :buffer_length }
|
5
|
-
it { is_expected.to respond_to :maximum_length }
|
6
|
-
it { is_expected.to respond_to :buffer }
|
7
|
-
|
8
|
-
it 'is little endian' do
|
9
|
-
expect(described_class.fields.instance_variable_get(:@hints)[:endian]).to eq :little
|
10
|
-
end
|
11
|
-
|
12
|
-
describe '#buffer_length' do
|
13
|
-
it 'should be a 16-bit unsigned integer' do
|
14
|
-
expect(packet.buffer_length).to be_a BinData::Uint16le
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe '#maximum_length' do
|
19
|
-
it 'should be a 16-bit unsigned integer' do
|
20
|
-
expect(packet.maximum_length).to be_a BinData::Uint16le
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe '#buffer' do
|
25
|
-
it 'should be a NdrLpStr' do
|
26
|
-
expect(packet.buffer).to be_a RubySMB::Dcerpc::Ndr::NdrLpStr
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
describe '#get' do
|
31
|
-
it 'returns #buffer' do
|
32
|
-
packet.buffer = 'spec_test'
|
33
|
-
expect(packet.get).to eq(RubySMB::Dcerpc::Ndr::NdrLpStr.new('spec_test'))
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
describe '#set' do
|
38
|
-
it 'sets #buffer to the expected value' do
|
39
|
-
packet.set('spec_test')
|
40
|
-
expect(packet.buffer).to eq(RubySMB::Dcerpc::Ndr::NdrLpStr.new('spec_test'))
|
41
|
-
end
|
42
|
-
|
43
|
-
it 'sets #buffer_length to the expected value' do
|
44
|
-
packet.set('spec_test')
|
45
|
-
expect(packet.buffer_length).to eq(('spec_test'.size + 1) * 2)
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'sets #maximum_length to the expected value' do
|
49
|
-
packet.set('spec_test')
|
50
|
-
expect(packet.maximum_length).to eq(('spec_test'.size + 1) * 2)
|
51
|
-
end
|
52
|
-
|
53
|
-
context 'when the value is :null' do
|
54
|
-
it 'sets #buffer_length to 0' do
|
55
|
-
packet.buffer_length = 33
|
56
|
-
packet.set(:null)
|
57
|
-
expect(packet.buffer_length).to eq(0)
|
58
|
-
end
|
59
|
-
|
60
|
-
it 'does not set #maximum_length if it has already been set' do
|
61
|
-
packet.maximum_length = 33
|
62
|
-
packet.set(:null)
|
63
|
-
expect(packet.maximum_length).to eq(33)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
describe '#read' do
|
69
|
-
context 'with a null pointer' do
|
70
|
-
it 'reads its own binary representation' do
|
71
|
-
raw = packet.to_binary_s
|
72
|
-
expect(described_class.read(raw)).to eq(packet)
|
73
|
-
expect(described_class.read(raw).to_binary_s).to eq(raw)
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
context 'with a normal string' do
|
78
|
-
it 'reads its own binary representation' do
|
79
|
-
packet.assign('my_test')
|
80
|
-
raw = packet.to_binary_s
|
81
|
-
expect(described_class.read(raw)).to eq(packet)
|
82
|
-
expect(described_class.read(raw).to_binary_s).to eq(raw)
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
RSpec.describe RubySMB::Dcerpc::PrrpUnicodeString do
|
89
|
-
it 'is NdrPointer subclass' do
|
90
|
-
expect(described_class).to be < RubySMB::Dcerpc::Ndr::NdrPointer
|
91
|
-
end
|
92
|
-
|
93
|
-
subject(:packet) { described_class.new }
|
94
|
-
|
95
|
-
it { is_expected.to respond_to :referent }
|
96
|
-
|
97
|
-
it 'is little endian' do
|
98
|
-
expect(described_class.fields.instance_variable_get(:@hints)[:endian]).to eq :little
|
99
|
-
end
|
100
|
-
|
101
|
-
describe '#referent' do
|
102
|
-
it 'is a RrpUnicodeString' do
|
103
|
-
expect(packet.referent).to be_a RubySMB::Dcerpc::RrpUnicodeString
|
104
|
-
end
|
105
|
-
|
106
|
-
it 'exists if superclass #referent_identifier is not zero' do
|
107
|
-
packet.referent_id = 0xCCCC
|
108
|
-
expect(packet.referent?).to be true
|
109
|
-
end
|
110
|
-
|
111
|
-
it 'does not exist if superclass #referent_identifier is zero' do
|
112
|
-
packet.referent_id = 0
|
113
|
-
expect(packet.referent?).to be false
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
describe '#read' do
|
118
|
-
context 'with a null pointer' do
|
119
|
-
it 'reads its own binary representation' do
|
120
|
-
raw = packet.to_binary_s
|
121
|
-
expect(described_class.read(raw)).to eq(packet)
|
122
|
-
expect(described_class.read(raw).to_binary_s).to eq(raw)
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
context 'with a normal string' do
|
127
|
-
it 'reads its own binary representation' do
|
128
|
-
packet.assign('my_test')
|
129
|
-
raw = packet.to_binary_s
|
130
|
-
expect(described_class.read(raw)).to eq(packet)
|
131
|
-
expect(described_class.read(raw).to_binary_s).to eq(raw)
|
132
|
-
end
|
133
|
-
end
|
134
|
-
end
|
135
|
-
end
|