ruby_smb 2.0.12 → 3.0.2
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/auth_capture.rb +28 -0
- data/examples/dump_secrets_from_sid.rb +207 -0
- data/examples/enum_domain_users.rb +75 -0
- data/examples/file_server.rb +76 -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/create_actions.rb +21 -0
- 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/encrypting_file_system/efs_rpc_encrypt_file_srv_request.rb +20 -0
- data/lib/ruby_smb/dcerpc/encrypting_file_system/efs_rpc_encrypt_file_srv_response.rb +20 -0
- data/lib/ruby_smb/dcerpc/encrypting_file_system/efs_rpc_open_file_raw_request.rb +21 -0
- data/lib/ruby_smb/dcerpc/encrypting_file_system/efs_rpc_open_file_raw_response.rb +21 -0
- data/lib/ruby_smb/dcerpc/encrypting_file_system.rb +44 -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/print_system/rpc_add_printer_driver_ex_request.rb +22 -0
- data/lib/ruby_smb/dcerpc/print_system/rpc_add_printer_driver_ex_response.rb +20 -0
- data/lib/ruby_smb/dcerpc/print_system/rpc_enum_printer_drivers_request.rb +24 -0
- data/lib/ruby_smb/dcerpc/print_system/rpc_enum_printer_drivers_response.rb +23 -0
- data/lib/ruby_smb/dcerpc/print_system/rpc_get_printer_driver_directory_request.rb +24 -0
- data/lib/ruby_smb/dcerpc/print_system/rpc_get_printer_driver_directory_response.rb +22 -0
- data/lib/ruby_smb/dcerpc/print_system.rb +69 -0
- 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 +43 -13
- data/lib/ruby_smb/field/file_time.rb +1 -1
- data/lib/ruby_smb/field/nt_status.rb +20 -1
- data/lib/ruby_smb/field/string16.rb +5 -1
- data/lib/ruby_smb/fscc/file_information/file_ea_information.rb +14 -0
- data/lib/ruby_smb/fscc/file_information/file_network_open_information.rb +22 -0
- data/lib/ruby_smb/fscc/file_information/file_stream_information.rb +16 -0
- data/lib/ruby_smb/fscc/file_information.rb +29 -0
- data/lib/ruby_smb/fscc/file_system_information/file_fs_attribute_information.rb +46 -0
- data/lib/ruby_smb/fscc/file_system_information/file_fs_volume_information.rb +19 -0
- data/lib/ruby_smb/fscc/file_system_information.rb +22 -0
- data/lib/ruby_smb/fscc.rb +1 -0
- data/lib/ruby_smb/generic_packet.rb +6 -0
- data/lib/ruby_smb/gss/provider/authenticator.rb +4 -0
- data/lib/ruby_smb/gss/provider/ntlm.rb +13 -3
- data/lib/ruby_smb/ntlm.rb +18 -2
- data/lib/ruby_smb/server/server_client/negotiation.rb +0 -2
- data/lib/ruby_smb/server/server_client/session_setup.rb +43 -32
- data/lib/ruby_smb/server/server_client/share_io.rb +28 -0
- data/lib/ruby_smb/server/server_client/tree_connect.rb +60 -0
- data/lib/ruby_smb/server/server_client.rb +214 -24
- data/lib/ruby_smb/server/session.rb +71 -0
- data/lib/ruby_smb/server/share/provider/disk.rb +437 -0
- data/lib/ruby_smb/server/share/provider/pipe.rb +27 -0
- data/lib/ruby_smb/server/share/provider/processor.rb +76 -0
- data/lib/ruby_smb/server/share/provider.rb +38 -0
- data/lib/ruby_smb/server/share.rb +11 -0
- data/lib/ruby_smb/server.rb +35 -3
- data/lib/ruby_smb/signing.rb +37 -11
- data/lib/ruby_smb/smb1/commands.rb +4 -0
- data/lib/ruby_smb/smb1/pipe.rb +4 -0
- data/lib/ruby_smb/smb1.rb +0 -1
- data/lib/ruby_smb/smb2/bit_field/smb2_header_flags.rb +2 -1
- data/lib/ruby_smb/smb2/commands.rb +4 -0
- data/lib/ruby_smb/smb2/create_context/request.rb +64 -0
- data/lib/ruby_smb/smb2/create_context/response.rb +62 -0
- data/lib/ruby_smb/smb2/create_context.rb +74 -22
- data/lib/ruby_smb/smb2/packet/create_request.rb +44 -11
- data/lib/ruby_smb/smb2/packet/create_response.rb +17 -3
- data/lib/ruby_smb/smb2/packet/query_directory_request.rb +1 -1
- data/lib/ruby_smb/smb2/packet/query_directory_response.rb +2 -2
- data/lib/ruby_smb/smb2/packet/query_info_request.rb +43 -0
- data/lib/ruby_smb/smb2/packet/query_info_response.rb +23 -0
- data/lib/ruby_smb/smb2/packet/tree_connect_response.rb +1 -1
- data/lib/ruby_smb/smb2/packet/tree_disconnect_response.rb +1 -0
- data/lib/ruby_smb/smb2/packet.rb +2 -0
- data/lib/ruby_smb/smb2/pipe.rb +4 -0
- data/lib/ruby_smb/smb2.rb +11 -0
- data/lib/ruby_smb/smb_error.rb +110 -0
- data/lib/ruby_smb/version.rb +1 -1
- data/lib/ruby_smb.rb +2 -0
- data/ruby_smb.gemspec +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/encrypting_file_system/efs_rpc_encrypt_file_srv_request_spec.rb +30 -0
- data/spec/lib/ruby_smb/dcerpc/encrypting_file_system/efs_rpc_encrypt_file_srv_response_spec.rb +30 -0
- data/spec/lib/ruby_smb/dcerpc/encrypting_file_system/efs_rpc_open_file_raw_request_spec.rb +38 -0
- data/spec/lib/ruby_smb/dcerpc/encrypting_file_system/efs_rpc_open_file_raw_response_spec.rb +38 -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/print_system/driver_container_spec.rb +41 -0
- data/spec/lib/ruby_smb/dcerpc/print_system/driver_info2_spec.rb +64 -0
- data/spec/lib/ruby_smb/dcerpc/print_system/rpc_add_printer_driver_ex_request_spec.rb +59 -0
- data/spec/lib/ruby_smb/dcerpc/print_system/rpc_add_printer_driver_ex_response_spec.rb +30 -0
- data/spec/lib/ruby_smb/dcerpc/print_system/rpc_enum_printer_drivers_request_spec.rb +62 -0
- data/spec/lib/ruby_smb/dcerpc/print_system/rpc_enum_printer_drivers_response_spec.rb +54 -0
- data/spec/lib/ruby_smb/dcerpc/print_system/rpc_get_printer_driver_directory_request_spec.rb +62 -0
- data/spec/lib/ruby_smb/dcerpc/print_system/rpc_get_printer_driver_directory_response_spec.rb +46 -0
- 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/nt_status_spec.rb +6 -2
- data/spec/lib/ruby_smb/field/string16_spec.rb +22 -0
- data/spec/lib/ruby_smb/gss/provider/ntlm/authenticator_spec.rb +4 -0
- data/spec/lib/ruby_smb/gss/provider/ntlm/os_version_spec.rb +1 -1
- data/spec/lib/ruby_smb/server/server_client_spec.rb +36 -53
- data/spec/lib/ruby_smb/server/session_spec.rb +38 -0
- data/spec/lib/ruby_smb/server/share/provider/disk_spec.rb +61 -0
- data/spec/lib/ruby_smb/server/share/provider/pipe_spec.rb +31 -0
- data/spec/lib/ruby_smb/server/share/provider_spec.rb +13 -0
- data/spec/lib/ruby_smb/smb1/pipe_spec.rb +18 -37
- data/spec/lib/ruby_smb/smb2/bit_field/header_flags_spec.rb +8 -2
- data/spec/lib/ruby_smb/smb2/{create_context_spec.rb → create_context/create_context_request_spec.rb} +1 -1
- data/spec/lib/ruby_smb/smb2/packet/create_request_spec.rb +5 -5
- data/spec/lib/ruby_smb/smb2/packet/create_response_spec.rb +9 -5
- data/spec/lib/ruby_smb/smb2/packet/query_directory_response_spec.rb +3 -2
- 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 +165 -10
- metadata.gz.sig +0 -0
- data/lib/ruby_smb/dcerpc/rrp_unicode_string.rb +0 -38
- data/lib/ruby_smb/smb1/create_actions.rb +0 -20
- data/spec/lib/ruby_smb/dcerpc/rrp_unicode_string_spec.rb +0 -135
@@ -0,0 +1,76 @@
|
|
1
|
+
module RubySMB
|
2
|
+
module Dcerpc
|
3
|
+
module Drsr
|
4
|
+
|
5
|
+
# [4.1.4.1.4 DS_NAME_RESULT_ITEMW](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/e174fead-5a37-4a11-a0f6-69086e8dd4e9)
|
6
|
+
class DsNameResultItemw < Ndr::NdrStruct
|
7
|
+
default_parameter byte_align: 4
|
8
|
+
endian :little
|
9
|
+
|
10
|
+
ndr_uint32 :status
|
11
|
+
ndr_wide_stringz_ptr :p_domain
|
12
|
+
ndr_wide_stringz_ptr :p_name
|
13
|
+
end
|
14
|
+
|
15
|
+
class DsNameResultItemwArrayPtr < Ndr::NdrConfArray
|
16
|
+
default_parameters type: :ds_name_result_itemw
|
17
|
+
extend Ndr::PointerClassPlugin
|
18
|
+
end
|
19
|
+
|
20
|
+
# [4.1.4.1.5 DS_NAME_RESULTW](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/0076d241-3f79-4b0b-8e07-8ccfaff8bd4c)
|
21
|
+
class DsNameResultw < Ndr::NdrStruct
|
22
|
+
default_parameter byte_align: 4
|
23
|
+
endian :little
|
24
|
+
|
25
|
+
ndr_uint32 :c_items
|
26
|
+
ds_name_result_itemw_array_ptr :r_items
|
27
|
+
end
|
28
|
+
|
29
|
+
class DsNameResultwPtr < DsNameResultw
|
30
|
+
default_parameters referent_byte_align: 4
|
31
|
+
extend Ndr::PointerClassPlugin
|
32
|
+
end
|
33
|
+
|
34
|
+
#[4.1.4.1.7 DRS_MSG_CRACKREPLY_V1](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/3419de89-0d54-462e-98ac-fb77292c91e7)
|
35
|
+
class DrsMsgCrackreplyV1 < Ndr::NdrStruct
|
36
|
+
default_parameter byte_align: 4
|
37
|
+
endian :little
|
38
|
+
|
39
|
+
ds_name_resultw_ptr :p_result
|
40
|
+
end
|
41
|
+
|
42
|
+
# [4.1.4.1.6 DRS_MSG_CRACKREPLY](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/1dc605fe-dd85-481d-84a4-f4c5da812d57)
|
43
|
+
class DrsMsgCrackreply < Ndr::NdrStruct
|
44
|
+
default_parameter byte_align: 4
|
45
|
+
endian :little
|
46
|
+
|
47
|
+
ndr_uint32 :switch_type
|
48
|
+
choice :msg_crack, selection: :switch_type, byte_align: 4 do
|
49
|
+
drs_msg_crackreply_v1 1
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# [4.1.4 IDL_DRSCrackNames (Opnum 12)](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/9b4bfb44-6656-4404-bcc8-dc88111658b3)
|
54
|
+
class DrsCrackNamesResponse < BinData::Record
|
55
|
+
attr_reader :opnum
|
56
|
+
|
57
|
+
endian :little
|
58
|
+
|
59
|
+
ndr_uint32 :dw_out_version
|
60
|
+
drs_msg_crackreply :pmsg_out
|
61
|
+
ndr_uint32 :error_status
|
62
|
+
|
63
|
+
def initialize_instance
|
64
|
+
super
|
65
|
+
@opnum = DRS_CRACK_NAMES
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module RubySMB
|
2
|
+
module Dcerpc
|
3
|
+
module Drsr
|
4
|
+
|
5
|
+
#[4.1.5.1.2 DRS_MSG_DCINFOREQ_V1](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/18b23122-a1c2-4367-a677-592e0d4eef18)
|
6
|
+
class DrsMsgDcinforeqV1 < Ndr::NdrStruct
|
7
|
+
default_parameter byte_align: 4
|
8
|
+
endian :little
|
9
|
+
|
10
|
+
ndr_wide_stringz_ptr :domain
|
11
|
+
ndr_uint32 :info_level
|
12
|
+
end
|
13
|
+
|
14
|
+
# [4.1.5.1.1 DRS_MSG_DCINFOREQ](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/6ac9ec30-5bfb-4970-860c-3971eb815930)
|
15
|
+
class DrsMsgDcinforeq < Ndr::NdrStruct
|
16
|
+
default_parameter byte_align: 4
|
17
|
+
endian :little
|
18
|
+
|
19
|
+
ndr_uint32 :switch_type, initial_value: 1
|
20
|
+
choice :msg_dcinfo, selection: :switch_type, byte_align: 4 do
|
21
|
+
drs_msg_dcinforeq_v1 1
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# [4.1.5 IDL_DRSDomainControllerInfo (Opnum 16)](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/668abdc8-1db7-4104-9dea-feab05ff1736)
|
26
|
+
class DrsDomainControllerInfoRequest < BinData::Record
|
27
|
+
attr_reader :opnum
|
28
|
+
|
29
|
+
endian :little
|
30
|
+
|
31
|
+
drs_handle :h_drs
|
32
|
+
ndr_uint32 :dw_in_version, initial_value: 1
|
33
|
+
drs_msg_dcinforeq :pmsg_in
|
34
|
+
|
35
|
+
def initialize_instance
|
36
|
+
super
|
37
|
+
@opnum = DRS_DOMAIN_CONTROLLER_INFO
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
|
@@ -0,0 +1,168 @@
|
|
1
|
+
module RubySMB
|
2
|
+
module Dcerpc
|
3
|
+
module Drsr
|
4
|
+
|
5
|
+
# [4.1.5.1.8 DS_DOMAIN_CONTROLLER_INFO_1W](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/b30c5951-ccb1-4fb6-ba9a-5699d5d78759)
|
6
|
+
class DsDomainControllerInfo1w < Ndr::NdrStruct
|
7
|
+
default_parameter byte_align: 4
|
8
|
+
endian :little
|
9
|
+
|
10
|
+
ndr_wide_stringz_ptr :netbios_name
|
11
|
+
ndr_wide_stringz_ptr :dns_host_name
|
12
|
+
ndr_wide_stringz_ptr :site_name
|
13
|
+
ndr_wide_stringz_ptr :computer_object_name
|
14
|
+
ndr_wide_stringz_ptr :server_object_name
|
15
|
+
ndr_boolean :f_is_pdc
|
16
|
+
ndr_boolean :f_ds_enabled
|
17
|
+
end
|
18
|
+
|
19
|
+
class DsDomainControllerInfo1wPtr < Ndr::NdrConfVarArray
|
20
|
+
default_parameters type: :ds_domain_controller_info1w
|
21
|
+
extend Ndr::PointerClassPlugin
|
22
|
+
end
|
23
|
+
|
24
|
+
#[4.1.5.1.4 DRS_MSG_DCINFOREPLY_V1](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/f71a8f6c-5426-4628-aa91-aeabef2c086f)
|
25
|
+
class DrsMsgDcinforeplyV1 < Ndr::NdrStruct
|
26
|
+
default_parameter byte_align: 4
|
27
|
+
endian :little
|
28
|
+
|
29
|
+
ndr_uint32 :c_items
|
30
|
+
ds_domain_controller_info1w_ptr :r_items
|
31
|
+
end
|
32
|
+
|
33
|
+
# [4.1.5.1.9 DS_DOMAIN_CONTROLLER_INFO_2W](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/a9c9fd50-24b5-4ff7-b336-8e23ac0622de)
|
34
|
+
class DsDomainControllerInfo2w < Ndr::NdrStruct
|
35
|
+
default_parameter byte_align: 4
|
36
|
+
endian :little
|
37
|
+
|
38
|
+
ndr_wide_stringz_ptr :netbios_name
|
39
|
+
ndr_wide_stringz_ptr :dns_host_name
|
40
|
+
ndr_wide_stringz_ptr :site_name
|
41
|
+
ndr_wide_stringz_ptr :site_object_name
|
42
|
+
ndr_wide_stringz_ptr :computer_object_name
|
43
|
+
ndr_wide_stringz_ptr :server_object_name
|
44
|
+
ndr_wide_stringz_ptr :ntds_dsa_object_name
|
45
|
+
ndr_boolean :f_is_pdc
|
46
|
+
ndr_boolean :f_ds_enabled
|
47
|
+
ndr_boolean :f_is_gc
|
48
|
+
uuid :site_object_guid
|
49
|
+
uuid :computer_object_guid
|
50
|
+
uuid :server_object_guid
|
51
|
+
uuid :ntds_dsa_object_guid
|
52
|
+
end
|
53
|
+
|
54
|
+
class DsDomainControllerInfo2wPtr < Ndr::NdrConfArray
|
55
|
+
default_parameters type: :ds_domain_controller_info2w
|
56
|
+
extend Ndr::PointerClassPlugin
|
57
|
+
end
|
58
|
+
|
59
|
+
#[4.1.5.1.5 DRS_MSG_DCINFOREPLY_V2](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/f567e605-01fe-4228-960e-14647c29f668)
|
60
|
+
class DrsMsgDcinforeplyV2 < Ndr::NdrStruct
|
61
|
+
default_parameter byte_align: 4
|
62
|
+
endian :little
|
63
|
+
|
64
|
+
ndr_uint32 :c_items
|
65
|
+
ds_domain_controller_info2w_ptr :r_items
|
66
|
+
end
|
67
|
+
|
68
|
+
# [4.1.5.1.10 DS_DOMAIN_CONTROLLER_INFO_3W](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/08f99ee7-8235-482b-bfe5-c6170f133cd4)
|
69
|
+
class DsDomainControllerInfo3w < Ndr::NdrStruct
|
70
|
+
default_parameter byte_align: 4
|
71
|
+
endian :little
|
72
|
+
|
73
|
+
ndr_wide_stringz_ptr :netbios_name
|
74
|
+
ndr_wide_stringz_ptr :dns_host_name
|
75
|
+
ndr_wide_stringz_ptr :site_name
|
76
|
+
ndr_wide_stringz_ptr :site_object_name
|
77
|
+
ndr_wide_stringz_ptr :computer_object_name
|
78
|
+
ndr_wide_stringz_ptr :server_object_name
|
79
|
+
ndr_wide_stringz_ptr :ntds_dsa_object_name
|
80
|
+
ndr_boolean :f_is_pdc
|
81
|
+
ndr_boolean :f_ds_enabled
|
82
|
+
ndr_boolean :f_is_gc
|
83
|
+
ndr_boolean :f_is_rodc
|
84
|
+
uuid :site_object_guid
|
85
|
+
uuid :computer_object_guid
|
86
|
+
uuid :server_object_guid
|
87
|
+
uuid :ntds_dsa_object_guid
|
88
|
+
end
|
89
|
+
|
90
|
+
class DsDomainControllerInfo3wPtr < Ndr::NdrConfVarArray
|
91
|
+
default_parameters type: :ds_domain_controller_info3w
|
92
|
+
extend Ndr::PointerClassPlugin
|
93
|
+
end
|
94
|
+
|
95
|
+
#[4.1.5.1.6 DRS_MSG_DCINFOREPLY_V3](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/cafc7232-c6da-4784-84d7-e5d8c804c2d9)
|
96
|
+
class DrsMsgDcinforeplyV3 < Ndr::NdrStruct
|
97
|
+
default_parameter byte_align: 4
|
98
|
+
endian :little
|
99
|
+
|
100
|
+
ndr_uint32 :c_items
|
101
|
+
ds_domain_controller_info3w_ptr :r_items
|
102
|
+
end
|
103
|
+
|
104
|
+
# [4.1.5.1.11 DS_DOMAIN_CONTROLLER_INFO_FFFFFFFFW](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/38259d46-11e6-4e74-8e0c-0b0f9ce2dab4)
|
105
|
+
class DsDomainControllerInfoFfffffffw < Ndr::NdrStruct
|
106
|
+
default_parameter byte_align: 4
|
107
|
+
endian :little
|
108
|
+
|
109
|
+
ndr_uint32 :ip_address
|
110
|
+
ndr_uint32 :notification_count
|
111
|
+
ndr_uint32 :sec_time_connected
|
112
|
+
ndr_uint32 :flags
|
113
|
+
ndr_uint32 :total_requests
|
114
|
+
ndr_uint32 :reserved1
|
115
|
+
ndr_wide_stringz_ptr :user_name
|
116
|
+
end
|
117
|
+
|
118
|
+
class DsDomainControllerInfoFfffffffwPtr < Ndr::NdrConfVarArray
|
119
|
+
default_parameters type: :ds_domain_controller_info_ffffffffw
|
120
|
+
extend Ndr::PointerClassPlugin
|
121
|
+
end
|
122
|
+
|
123
|
+
#[4.1.5.1.7 DRS_MSG_DCINFOREPLY_VFFFFFFFF](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/625c5133-cb5b-440a-9f53-232ae1b2dc3f)
|
124
|
+
class DrsMsgDcinforeplyVffffffff < Ndr::NdrStruct
|
125
|
+
default_parameter byte_align: 4
|
126
|
+
endian :little
|
127
|
+
|
128
|
+
ndr_uint32 :c_items
|
129
|
+
ds_domain_controller_info_ffffffffw_ptr :r_items
|
130
|
+
end
|
131
|
+
|
132
|
+
# [4.1.5.1.3 DRS_MSG_DCINFOREPLY](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/034282e5-7828-4353-ad6e-2688c65ab9fb)
|
133
|
+
class DrsMsgDcinforeply < Ndr::NdrStruct
|
134
|
+
default_parameter byte_align: 4
|
135
|
+
endian :little
|
136
|
+
|
137
|
+
ndr_uint32 :switch_type
|
138
|
+
choice :msg_dcinfo, selection: :switch_type, byte_align: 4 do
|
139
|
+
drs_msg_dcinforeply_v1 1
|
140
|
+
drs_msg_dcinforeply_v2 2
|
141
|
+
drs_msg_dcinforeply_v3 3
|
142
|
+
drs_msg_dcinforeply_vffffffff 0xFFFFFFFF
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
# [4.1.5 IDL_DRSDomainControllerInfo (Opnum 16)](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/668abdc8-1db7-4104-9dea-feab05ff1736)
|
147
|
+
class DrsDomainControllerInfoResponse < BinData::Record
|
148
|
+
attr_reader :opnum
|
149
|
+
|
150
|
+
endian :little
|
151
|
+
|
152
|
+
ndr_uint32 :dw_out_version
|
153
|
+
drs_msg_dcinforeply :pmsg_out
|
154
|
+
ndr_uint32 :error_status
|
155
|
+
|
156
|
+
def initialize_instance
|
157
|
+
super
|
158
|
+
@opnum = DRS_DOMAIN_CONTROLLER_INFO
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module RubySMB
|
2
|
+
module Dcerpc
|
3
|
+
module Drsr
|
4
|
+
|
5
|
+
# [5.39 DRS_EXTENSIONS_INT](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/3ee529b1-23db-4996-948a-042f04998e91)
|
6
|
+
class DrsExtensionsInt < Ndr::NdrStruct
|
7
|
+
default_parameter byte_align: 4
|
8
|
+
endian :little
|
9
|
+
|
10
|
+
ndr_uint32 :cb, initial_value: -> { num_bytes - 4 }
|
11
|
+
ndr_uint32 :dw_flags
|
12
|
+
uuid :site_obj_guid
|
13
|
+
int32 :pid, byte_align: 4
|
14
|
+
ndr_uint32 :dw_repl_epoch
|
15
|
+
ndr_uint32 :dw_flags_ext
|
16
|
+
uuid :config_obj_guid
|
17
|
+
ndr_uint32 :dw_ext_caps
|
18
|
+
end
|
19
|
+
|
20
|
+
# [5.38 DRS_EXTENSIONS](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/ed0c5dc1-7566-48b3-be08-4c5e26ba60c4)
|
21
|
+
class DrsExtensions < Ndr::NdrStruct
|
22
|
+
default_parameter byte_align: 4
|
23
|
+
endian :little
|
24
|
+
|
25
|
+
ndr_uint32 :cb, initial_value: -> { self.rgb.size }
|
26
|
+
ndr_conf_array :rgb, type: :ndr_uint8
|
27
|
+
|
28
|
+
def assign(val)
|
29
|
+
case val
|
30
|
+
when String
|
31
|
+
self.rgb.assign(val.bytes)
|
32
|
+
when Array
|
33
|
+
self.rgb.assign(val.to_ary)
|
34
|
+
when DrsExtensionsInt
|
35
|
+
self.rgb.assign(val.to_binary_s[4..-1].bytes)
|
36
|
+
when Hash
|
37
|
+
if (field_names & val.keys).empty?
|
38
|
+
# Cannot assign this hash to the structrue, it is likely
|
39
|
+
# DrsExtensionsInt hash values we need to transform in byte array.
|
40
|
+
drs_ext = DrsExtensionsInt.new(val).to_binary_s
|
41
|
+
self.rgb.assign(drs_ext[4..-1].bytes)
|
42
|
+
end
|
43
|
+
else
|
44
|
+
super
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class DrsExtensionsPtr < DrsExtensions
|
50
|
+
extend Ndr::PointerClassPlugin
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
@@ -0,0 +1,121 @@
|
|
1
|
+
require 'openssl'
|
2
|
+
|
3
|
+
module RubySMB
|
4
|
+
module Dcerpc
|
5
|
+
module Drsr
|
6
|
+
|
7
|
+
#[4.1.10.2.2 DRS_MSG_GETCHGREQ_V3](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/6a2a056c-ac7f-47d0-9e6d-9023a4e5947c)
|
8
|
+
class DrsMsgGetchgreqV3 < Ndr::NdrStruct
|
9
|
+
include AttrtypRequestPlugin
|
10
|
+
default_parameter byte_align: 8
|
11
|
+
|
12
|
+
uuid :uuid_dsa_obj_dest
|
13
|
+
uuid :uuid_invoc_id_src
|
14
|
+
ds_name_ptr :p_nc
|
15
|
+
usn_vector :usnvec_from
|
16
|
+
uptodate_vector_v1_ext_ptr :p_up_to_date_vec_dest_v1
|
17
|
+
partial_attr_vector_v1_ext_ptr :p_partial_attr_vec_dest_v1
|
18
|
+
schema_prefix_table :prefix_table_dest
|
19
|
+
ndr_uint32 :ul_flags
|
20
|
+
ndr_uint32 :c_max_objects
|
21
|
+
ndr_uint32 :c_max_bytes
|
22
|
+
ndr_uint32 :ul_extended_op
|
23
|
+
end
|
24
|
+
|
25
|
+
# [4.1.10.2.3 DRS_MSG_GETCHGREQ_V4](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/9db4db21-8ccd-4c81-8662-6e2baff8426c)
|
26
|
+
class DrsMsgGetchgreqV4 < Ndr::NdrStruct
|
27
|
+
default_parameter byte_align: 8
|
28
|
+
|
29
|
+
uuid :uuid_transport_obj
|
30
|
+
mtx_addr_ptr :pmtx_return_address
|
31
|
+
drs_msg_getchgreq_v3 :v3
|
32
|
+
end
|
33
|
+
|
34
|
+
#[4.1.10.2.4 DRS_MSG_GETCHGREQ_V5](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/fd24b73c-7b81-43af-8c77-65bc2e3181b7)
|
35
|
+
class DrsMsgGetchgreqV5 < Ndr::NdrStruct
|
36
|
+
default_parameter byte_align: 8
|
37
|
+
|
38
|
+
uuid :uuid_dsa_obj_dest
|
39
|
+
uuid :uuid_invoc_id_src
|
40
|
+
ds_name_ptr :p_nc
|
41
|
+
usn_vector :usnvec_from
|
42
|
+
uptodate_vector_v1_ext_ptr :p_up_to_date_vec_dest_v1
|
43
|
+
ndr_uint32 :ul_flags
|
44
|
+
ndr_uint32 :c_max_objects
|
45
|
+
ndr_uint32 :c_max_bytes
|
46
|
+
ndr_uint32 :ul_extended_op
|
47
|
+
ndr_uint64 :li_fsmo_info
|
48
|
+
end
|
49
|
+
|
50
|
+
#[4.1.10.2.5 DRS_MSG_GETCHGREQ_V7](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/5ef4f597-a397-4f6f-a98b-7a034247d886)
|
51
|
+
class DrsMsgGetchgreqV7 < DrsMsgGetchgreqV4
|
52
|
+
include AttrtypRequestPlugin
|
53
|
+
default_parameter byte_align: 8
|
54
|
+
|
55
|
+
partial_attr_vector_v1_ext_ptr :p_partial_attr_set
|
56
|
+
partial_attr_vector_v1_ext_ptr :p_partial_attr_set_ex
|
57
|
+
schema_prefix_table :prefix_table_dest
|
58
|
+
end
|
59
|
+
|
60
|
+
#[4.1.10.2.6 DRS_MSG_GETCHGREQ_V8](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/4304bb4a-e9b5-4c8a-8731-df4d6f9ab567)
|
61
|
+
class DrsMsgGetchgreqV8 < DrsMsgGetchgreqV5
|
62
|
+
include AttrtypRequestPlugin
|
63
|
+
default_parameter byte_align: 8
|
64
|
+
|
65
|
+
partial_attr_vector_v1_ext_ptr :p_partial_attr_set
|
66
|
+
partial_attr_vector_v1_ext_ptr :p_partial_attr_set_ex
|
67
|
+
schema_prefix_table :prefix_table_dest
|
68
|
+
end
|
69
|
+
|
70
|
+
#[4.1.10.2.7 DRS_MSG_GETCHGREQ_V10](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/92b1b77d-2058-46e0-9e8c-6664b96a0cf9)
|
71
|
+
class DrsMsgGetchgreqV10 < DrsMsgGetchgreqV8
|
72
|
+
default_parameter byte_align: 8
|
73
|
+
|
74
|
+
ndr_uint32 :ul_more_flags
|
75
|
+
end
|
76
|
+
|
77
|
+
#[4.1.10.2.8 DRS_MSG_GETCHGREQ_V11](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/cb2bab15-950b-48f8-af00-118e186a1311)
|
78
|
+
class DrsMsgGetchgreqV11 < DrsMsgGetchgreqV10
|
79
|
+
default_parameter byte_align: 8
|
80
|
+
|
81
|
+
uuid :correlation_id
|
82
|
+
var_size_buffer_with_version_ptr :p_reserved_buffer
|
83
|
+
end
|
84
|
+
|
85
|
+
# [4.1.10.2.1 DRS_MSG_GETCHGREQ](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/6a2a056c-ac7f-47d0-9e6d-9023a4e5947c)
|
86
|
+
class DrsMsgGetchgreq < Ndr::NdrStruct
|
87
|
+
default_parameter byte_align: 8
|
88
|
+
|
89
|
+
ndr_uint32 :switch_type, initial_value: -> { @obj.parent.parent.dw_in_version.to_i }
|
90
|
+
choice :msg_getchg, selection: :switch_type, byte_align: 8 do
|
91
|
+
drs_msg_getchgreq_v4 4
|
92
|
+
drs_msg_getchgreq_v5 5
|
93
|
+
drs_msg_getchgreq_v7 7
|
94
|
+
drs_msg_getchgreq_v8 8
|
95
|
+
drs_msg_getchgreq_v10 10
|
96
|
+
drs_msg_getchgreq_v11 11
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
# [4.1.10 IDL_DRSGetNCChanges (Opnum 3)](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/b63730ac-614c-431c-9501-28d6aca91894)
|
101
|
+
class DrsGetNcChangesRequest < BinData::Record
|
102
|
+
attr_reader :opnum
|
103
|
+
|
104
|
+
drs_handle :h_drs
|
105
|
+
ndr_uint32 :dw_in_version
|
106
|
+
drs_msg_getchgreq :pmsg_in
|
107
|
+
|
108
|
+
def initialize_instance
|
109
|
+
super
|
110
|
+
@opnum = DRS_GET_NC_CHANGES
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
@@ -0,0 +1,118 @@
|
|
1
|
+
module RubySMB
|
2
|
+
module Dcerpc
|
3
|
+
module Drsr
|
4
|
+
|
5
|
+
#[4.1.10.2.10 DRS_MSG_GETCHGREPLY_V1](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/bd70a9c3-c1d3-48cf-9c24-503a5567d09c)
|
6
|
+
class DrsMsgGetchgreplyV1 < Ndr::NdrStruct
|
7
|
+
include AttrtypResponsePlugin
|
8
|
+
default_parameter byte_align: 8
|
9
|
+
|
10
|
+
uuid :uuid_dsa_obj_src
|
11
|
+
uuid :uuid_invoc_id_src
|
12
|
+
ds_name_ptr :p_nc
|
13
|
+
usn_vector :usnvec_from
|
14
|
+
usn_vector :usnvec_to
|
15
|
+
uptodate_vector_v1_ext_ptr :p_up_to_date_vec_src_v1
|
16
|
+
schema_prefix_table :prefix_table_src
|
17
|
+
ndr_uint32 :ul_extended_ret
|
18
|
+
ndr_uint32 :c_num_objects
|
19
|
+
ndr_uint32 :c_num_bytes
|
20
|
+
replentinflist_ptr :p_objects
|
21
|
+
ndr_boolean :f_more_data
|
22
|
+
end
|
23
|
+
|
24
|
+
# [4.1.10.2.11 DRS_MSG_GETCHGREPLY_V2](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/677d8fab-6aa1-4327-9b6f-62a6ad7fcfa3)
|
25
|
+
class DrsMsgGetchgreplyV2 < Ndr::NdrStruct
|
26
|
+
default_parameter byte_align: 4
|
27
|
+
|
28
|
+
drs_compressed_blob :compressed_v1
|
29
|
+
end
|
30
|
+
|
31
|
+
# [4.1.10.2.12 DRS_MSG_GETCHGREPLY_V6](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/1317a654-5dd6-45ff-af73-919cbc7fbb45)
|
32
|
+
class DrsMsgGetchgreplyV6 < Ndr::NdrStruct
|
33
|
+
include AttrtypResponsePlugin
|
34
|
+
default_parameter byte_align: 8
|
35
|
+
|
36
|
+
uuid :uuid_dsa_obj_src
|
37
|
+
uuid :uuid_invoc_id_src
|
38
|
+
ds_name_ptr :p_nc
|
39
|
+
usn_vector :usnvec_from
|
40
|
+
usn_vector :usnvec_to
|
41
|
+
uptodate_vector_v2_ext_ptr :p_up_to_date_vec_src
|
42
|
+
schema_prefix_table :prefix_table_src
|
43
|
+
ndr_uint32 :ul_extended_ret
|
44
|
+
ndr_uint32 :c_num_objects
|
45
|
+
ndr_uint32 :c_num_bytes
|
46
|
+
replentinflist_ptr :p_objects
|
47
|
+
ndr_boolean :f_more_data
|
48
|
+
ndr_uint32 :c_num_nc_size_objects
|
49
|
+
ndr_uint32 :c_num_nc_size_values
|
50
|
+
ndr_uint32 :c_num_values
|
51
|
+
replvalinf_v1_array_ptr :rg_values
|
52
|
+
ndr_uint32 :dw_drs_error
|
53
|
+
end
|
54
|
+
|
55
|
+
# [4.1.10.2.13 DRS_MSG_GETCHGREPLY_V7](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/26eaca61-0f19-47e7-b304-2580e9870aa8)
|
56
|
+
class DrsMsgGetchgreplyV7 < Ndr::NdrStruct
|
57
|
+
default_parameter byte_align: 4
|
58
|
+
|
59
|
+
ndr_uint32 :dw_compressed_version
|
60
|
+
drs_comp_alg_type :compression_alg
|
61
|
+
drs_compressed_blob :compressed_any
|
62
|
+
end
|
63
|
+
|
64
|
+
# [4.1.10.2.14 DRS_MSG_GETCHGREPLY_V9](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/b9564a19-4500-444b-a99b-0da1b08cdb6f)
|
65
|
+
class DrsMsgGetchgreplyV9 < Ndr::NdrStruct
|
66
|
+
include AttrtypResponsePlugin
|
67
|
+
default_parameter byte_align: 8
|
68
|
+
|
69
|
+
uuid :uuid_dsa_obj_src
|
70
|
+
uuid :uuid_invoc_id_src
|
71
|
+
ds_name_ptr :p_nc
|
72
|
+
usn_vector :usnvec_from
|
73
|
+
usn_vector :usnvec_to
|
74
|
+
uptodate_vector_v2_ext_ptr :p_up_to_date_vec_src
|
75
|
+
schema_prefix_table :prefix_table_src
|
76
|
+
ndr_uint32 :ul_extended_ret
|
77
|
+
ndr_uint32 :c_num_objects
|
78
|
+
ndr_uint32 :c_num_bytes
|
79
|
+
replentinflist_ptr :p_objects
|
80
|
+
ndr_boolean :f_more_data
|
81
|
+
ndr_uint32 :c_num_nc_size_objects
|
82
|
+
ndr_uint32 :c_num_nc_size_values
|
83
|
+
ndr_uint32 :c_num_values
|
84
|
+
replvalinf_v3_array_ptr :rg_values
|
85
|
+
ndr_uint32 :dw_drs_error
|
86
|
+
end
|
87
|
+
|
88
|
+
# [4.1.10.2.9 DRS_MSG_GETCHGREPLY](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/65a5cb42-c25f-4378-b06e-f87341b21f93)
|
89
|
+
class DrsMsgGetchgreply < Ndr::NdrStruct
|
90
|
+
default_parameter byte_align: 4
|
91
|
+
|
92
|
+
ndr_uint32 :switch_type, initial_value: -> { @obj.parent.parent.pdw_out_version.to_i }
|
93
|
+
choice :msg_getchg, selection: :switch_type, byte_align: 4 do
|
94
|
+
drs_msg_getchgreply_v1 1
|
95
|
+
drs_msg_getchgreply_v2 2
|
96
|
+
drs_msg_getchgreply_v6 6
|
97
|
+
drs_msg_getchgreply_v7 7
|
98
|
+
drs_msg_getchgreply_v9 9
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# [4.1.10 IDL_DRSGetNCChanges (Opnum 3)](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/b63730ac-614c-431c-9501-28d6aca91894)
|
103
|
+
class DrsGetNcChangesResponse < BinData::Record
|
104
|
+
attr_reader :opnum
|
105
|
+
|
106
|
+
ndr_uint32 :pdw_out_version
|
107
|
+
drs_msg_getchgreply :pmsg_out
|
108
|
+
ndr_uint32 :error_status
|
109
|
+
|
110
|
+
def initialize_instance
|
111
|
+
super
|
112
|
+
@opnum = DRS_GET_NC_CHANGES
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module RubySMB
|
2
|
+
module Dcerpc
|
3
|
+
module Drsr
|
4
|
+
|
5
|
+
# [4.1.25 IDL_DRSUnbind (Opnum 1)](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/49eb17c9-b6a9-4cea-bef8-66abda8a7850)
|
6
|
+
class DrsUnbindRequest < BinData::Record
|
7
|
+
attr_reader :opnum
|
8
|
+
|
9
|
+
endian :little
|
10
|
+
|
11
|
+
drs_handle :ph_drs
|
12
|
+
|
13
|
+
def initialize_instance
|
14
|
+
super
|
15
|
+
@opnum = DRS_UNBIND
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module RubySMB
|
2
|
+
module Dcerpc
|
3
|
+
module Drsr
|
4
|
+
|
5
|
+
# [4.1.25 IDL_DRSUnbind (Opnum 1)](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-drsr/49eb17c9-b6a9-4cea-bef8-66abda8a7850)
|
6
|
+
class DrsUnbindResponse < BinData::Record
|
7
|
+
attr_reader :opnum
|
8
|
+
|
9
|
+
endian :little
|
10
|
+
|
11
|
+
drs_handle :ph_drs
|
12
|
+
ndr_uint32 :error_status
|
13
|
+
|
14
|
+
def initialize_instance
|
15
|
+
super
|
16
|
+
@opnum = DRS_UNBIND
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|