📄 netlogon.idl
字号:
/* netlogon interface much of this was derived from the ethereal sources - thanks to everyone who contributed!*/import "misc.idl", "lsa.idl", "samr.idl", "security.idl", "nbt.idl";#include "idl_types.h"[ uuid("12345678-1234-abcd-ef00-01234567cffb"), version(1.0), endpoint("ncacn_np:[\\pipe\\netlogon]","ncacn_ip_tcp:","ncalrpc:"), pointer_default(unique)]interface netlogon{ typedef bitmap samr_AcctFlags samr_AcctFlags; typedef bitmap samr_GroupAttrs samr_GroupAttrs; /*****************/ /* Function 0x00 */ typedef struct { [string,charset(UTF16)] uint16 *account_name; uint32 priv; uint32 auth_flags; uint32 logon_count; uint32 bad_pw_count; time_t last_logon; time_t last_logoff; time_t logoff_time; time_t kickoff_time; uint32 password_age; time_t pw_can_change; time_t pw_must_change; [string,charset(UTF16)] uint16 *computer; [string,charset(UTF16)] uint16 *domain; [string,charset(UTF16)] uint16 *script_path; uint32 unknown; } netr_UasInfo; WERROR netr_LogonUasLogon( [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] [string,charset(UTF16)] uint16 account_name[], [in] [string,charset(UTF16)] uint16 workstation[], [out,unique] netr_UasInfo *info ); /*****************/ /* Function 0x01 */ typedef struct { uint32 duration; uint16 logon_count; } netr_UasLogoffInfo; WERROR netr_LogonUasLogoff( [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] [string,charset(UTF16)] uint16 account_name[], [in] [string,charset(UTF16)] uint16 workstation[], [out] netr_UasLogoffInfo info ); /*****************/ /* Function 0x02 */ /* in netr_AcctLockStr size seems to be be 24, and rrenard thinks that the structure of the bindata looks like this: dlong lockout_duration; udlong reset_count; uint32 bad_attempt_lockout; uint32 dummy; but it doesn't look as though this structure is reflected at the NDR level. Maybe it is left to the application to decode the bindata array. */ typedef struct { uint16 size; uint16 length; [size_is(size/2),length_is(length/2)] uint16 *bindata; } netr_AcctLockStr; typedef [public,bitmap32bit] bitmap { MSV1_0_CLEARTEXT_PASSWORD_ALLOWED = 0x00000002, MSV1_0_UPDATE_LOGON_STATISTICS = 0x00000004, MSV1_0_RETURN_USER_PARAMETERS = 0x00000008, MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT = 0x00000020, MSV1_0_RETURN_PROFILE_PATH = 0x00000200, MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT = 0x00000800 } netr_LogonParameterControl; typedef struct { lsa_String domain_name; netr_LogonParameterControl parameter_control; /* see MSV1_0_* */ uint32 logon_id_low; uint32 logon_id_high; lsa_String account_name; lsa_String workstation; } netr_IdentityInfo; typedef struct { netr_IdentityInfo identity_info; samr_Password lmpassword; samr_Password ntpassword; } netr_PasswordInfo; typedef [flag(NDR_PAHEX)] struct { uint16 length; [value(length)] uint16 size; [size_is(length),length_is(length)] uint8 *data; } netr_ChallengeResponse; typedef [flag(NDR_PAHEX)] struct { netr_IdentityInfo identity_info; uint8 challenge[8]; netr_ChallengeResponse nt; netr_ChallengeResponse lm; } netr_NetworkInfo; typedef [public,switch_type(uint16)] union { [case(1)] netr_PasswordInfo *password; [case(2)] netr_NetworkInfo *network; [case(3)] netr_PasswordInfo *password; [case(5)] netr_PasswordInfo *password; [case(6)] netr_NetworkInfo *network; } netr_LogonLevel; typedef [public,flag(NDR_PAHEX)] struct { uint8 key[16]; } netr_UserSessionKey; typedef [public,flag(NDR_PAHEX)] struct { uint8 key[8]; } netr_LMSessionKey; /* Flags for user_flags below */ typedef [public,bitmap32bit] bitmap { NETLOGON_GUEST = 0x0001, NETLOGON_NOENCRYPTION = 0x0002, NETLOGON_CACHED_ACCOUNT = 0x0004, NETLOGON_USED_LM_PASSWORD = 0x0008, NETLOGON_EXTRA_SIDS = 0x0020, NETLOGON_SUBAUTH_SESSION_KEY = 0x0040, NETLOGON_SERVER_TRUST_ACCOUNT = 0x0080, NETLOGON_NTLMV2_ENABLED = 0x0100, NETLOGON_RESOURCE_GROUPS = 0x0200, NETLOGON_PROFILE_PATH_RETURNED = 0x0400 } netr_UserFlags; typedef struct { NTTIME last_logon; NTTIME last_logoff; NTTIME acct_expiry; NTTIME last_password_change; NTTIME allow_password_change; NTTIME force_password_change; lsa_String account_name; lsa_String full_name; lsa_String logon_script; lsa_String profile_path; lsa_String home_directory; lsa_String home_drive; uint16 logon_count; uint16 bad_password_count; uint32 rid; uint32 primary_gid; samr_RidWithAttributeArray groups; netr_UserFlags user_flags; netr_UserSessionKey key; lsa_StringLarge logon_server; lsa_StringLarge domain; dom_sid2 *domain_sid; netr_LMSessionKey LMSessKey; samr_AcctFlags acct_flags; uint32 unknown[7]; } netr_SamBaseInfo; typedef struct { netr_SamBaseInfo base; } netr_SamInfo2; typedef struct { dom_sid2 *sid; samr_GroupAttrs attributes; } netr_SidAttr; typedef [public] struct { netr_SamBaseInfo base; uint32 sidcount; [size_is(sidcount)] netr_SidAttr *sids; } netr_SamInfo3; typedef struct { netr_SamBaseInfo base; uint32 sidcount; [size_is(sidcount)] netr_SidAttr *sids; lsa_String forest; lsa_String principle; uint32 unknown4[20]; } netr_SamInfo6; typedef struct { uint32 pac_size; [size_is(pac_size)] uint8 *pac; lsa_String logon_domain; lsa_String logon_server; lsa_String principal_name; uint32 auth_size; [size_is(auth_size)] uint8 *auth; netr_UserSessionKey user_session_key; uint32 expansionroom[10]; lsa_String unknown1; lsa_String unknown2; lsa_String unknown3; lsa_String unknown4; } netr_PacInfo; typedef [public,switch_type(uint16)] union { [case(2)] netr_SamInfo2 *sam2; [case(3)] netr_SamInfo3 *sam3; [case(4)] netr_PacInfo *pac; [case(5)] netr_PacInfo *pac; [case(6)] netr_SamInfo6 *sam6; } netr_Validation; typedef [public, flag(NDR_PAHEX)] struct { uint8 data[8]; } netr_Credential; typedef [public] struct { netr_Credential cred; time_t timestamp; } netr_Authenticator; NTSTATUS netr_LogonSamLogon( [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,unique] [string,charset(UTF16)] uint16 *computer_name, [in,unique] netr_Authenticator *credential, [in,out,unique] netr_Authenticator *return_authenticator, [in] uint16 logon_level, [in] [switch_is(logon_level)] netr_LogonLevel logon, [in] uint16 validation_level, [out] [switch_is(validation_level)] netr_Validation validation, [out] uint8 authoritative ); /*****************/ /* Function 0x03 */ NTSTATUS netr_LogonSamLogoff( [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,unique] [string,charset(UTF16)] uint16 *computer_name, [in,unique] netr_Authenticator *credential, [in,out,unique] netr_Authenticator *return_authenticator, [in] uint16 logon_level, [in] [switch_is(logon_level)] netr_LogonLevel logon ); /*****************/ /* Function 0x04 */ [public] NTSTATUS netr_ServerReqChallenge( [in,unique,string,charset(UTF16)] uint16 *server_name, [in,string,charset(UTF16)] uint16 computer_name[], [in,out,ref] netr_Credential *credentials ); /*****************/ /* Function 0x05 */ typedef enum netr_SchannelType netr_SchannelType; NTSTATUS netr_ServerAuthenticate( [in,unique,string,charset(UTF16)] uint16 *server_name, [in,string,charset(UTF16)] uint16 account_name[], [in] netr_SchannelType secure_channel_type, [in,string,charset(UTF16)] uint16 computer_name[], [in,out,ref] netr_Credential *credentials ); /*****************/ /* Function 0x06 */ NTSTATUS netr_ServerPasswordSet( [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] [string,charset(UTF16)] uint16 account_name[], [in] netr_SchannelType secure_channel_type, [in] [string,charset(UTF16)] uint16 computer_name[], [in] netr_Authenticator credential, [in] samr_Password new_password, [out] netr_Authenticator return_authenticator ); /*****************/ /* Function 0x07 */ typedef enum netr_SamDatabaseID netr_SamDatabaseID; typedef struct { [string,charset(UTF16)] uint16 *account_name; lsa_String unknown1; lsa_String unknown2; lsa_String unknown3; lsa_String unknown4; uint32 unknown5; uint32 unknown6; uint32 unknown7; uint32 unknown8; } netr_DELTA_DELETE_USER; typedef struct { uint16 length; [value(length)] uint16 size; uint32 flags; samr_Password pwd; } netr_USER_KEY16; typedef struct { uint16 nt_length; [value(nt_length)] uint16 nt_size; uint32 nt_flags; uint16 lm_length; [value(lm_length)] uint16 lm_size; uint32 lm_flags; uint8 nt_history[nt_length]; uint8 lm_history[lm_length]; } netr_PasswordHistory; typedef struct { netr_USER_KEY16 lmpassword; netr_USER_KEY16 ntpassword; netr_PasswordHistory history; } netr_USER_KEYS2; typedef struct { /* TODO: make this a union! */ netr_USER_KEYS2 keys2; } netr_USER_KEY_UNION; typedef [public] struct { uint32 version; netr_USER_KEY_UNION keys; } netr_USER_KEYS; typedef struct { boolean8 SensitiveDataFlag; uint32 DataLength; /* netr_USER_KEYS encrypted with the session key */ [size_is(DataLength)][flag(NDR_PAHEX)] uint8 *SensitiveData; } netr_USER_PRIVATE_INFO; typedef struct { lsa_String account_name; lsa_String full_name; uint32 rid; uint32 primary_gid; lsa_String home_directory; lsa_String home_drive; lsa_String logon_script; lsa_String description; lsa_String workstations; NTTIME last_logon; NTTIME last_logoff; samr_LogonHours logon_hours; uint16 bad_password_count; uint16 logon_count; NTTIME last_password_change; NTTIME acct_expiry; samr_AcctFlags acct_flags; samr_Password lmpassword; samr_Password ntpassword; boolean8 nt_password_present; boolean8 lm_password_present; boolean8 password_expired; lsa_String comment; lsa_String parameters; uint16 country_code; uint16 code_page; netr_USER_PRIVATE_INFO user_private_info; uint32 SecurityInformation; sec_desc_buf sdbuf; lsa_String profile_path; lsa_String unknown2; lsa_String unknown3; lsa_String unknown4; uint32 unknown5; uint32 unknown6; uint32 unknown7; uint32 unknown8; } netr_DELTA_USER; typedef struct { lsa_String domain_name; lsa_String comment; dlong force_logoff_time; uint16 min_password_length; uint16 password_history_length; /* yes, these are signed. They are in negative 100ns */ dlong max_password_age; dlong min_password_age; udlong sequence_num; NTTIME domain_create_time; uint32 SecurityInformation; sec_desc_buf sdbuf; netr_AcctLockStr account_lockout; lsa_String unknown2; lsa_String unknown3; lsa_String unknown4; uint32 logon_to_chgpass; uint32 unknown6; uint32 unknown7; uint32 unknown8; } netr_DELTA_DOMAIN; typedef struct { lsa_String group_name; uint32 rid; uint32 attributes; lsa_String description; uint32 SecurityInformation; sec_desc_buf sdbuf; lsa_String unknown1; lsa_String unknown2; lsa_String unknown3; lsa_String unknown4; uint32 unknown5; uint32 unknown6; uint32 unknown7; uint32 unknown8; } netr_DELTA_GROUP; typedef struct { lsa_String OldName; lsa_String NewName;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -