Class: Net::NTLM::Message::Type3
Class Method Summary
collapse
Instance Method Summary
collapse
#data_edge, #data_size, decode64, #decode64, #deflag, #dump_flags, #encode64, #has_flag?, #head_size, parse, #parse, #security_buffers, #serialize, #set_flag, #size
Methods inherited from FieldSet
#[], #[]=, #disable, #enable, #has_disabled_fields?, #initialize, int16LE, int32LE, int64LE, names, opts, #parse, prototypes, security_buffer, #serialize, #size, string, types
Class Method Details
.create(arg, opt = {}) ⇒ Type3
Note:
All options must be properly encoded with either unicode or oem encoding
Builds a Type 3 packet
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/net/ntlm/message/type3.rb', line 29
def create(arg, opt ={})
t = new
t.lm_response = arg[:lm_response]
t.ntlm_response = arg[:ntlm_response]
t.domain = arg[:domain]
t.user = arg[:user]
if arg[:workstation]
t.workstation = arg[:workstation]
end
if arg[:session_key]
t.enable(:session_key)
t.session_key = arg[:session_key]
end
if arg[:flag]
t.enable(:session_key)
t.enable(:flag)
t.flag = arg[:flag]
end
t
end
|
Instance Method Details
#blank_password?(server_challenge) ⇒ Boolean
55
56
57
|
# File 'lib/net/ntlm/message/type3.rb', line 55
def blank_password?(server_challenge)
password?('', server_challenge)
end
|
12
|
# File 'lib/net/ntlm/message/type3.rb', line 12
security_buffer :domain, {:value => ""}
|
12
|
# File 'lib/net/ntlm/message/type3.rb', line 12
security_buffer :domain, {:value => ""}
|
16
|
# File 'lib/net/ntlm/message/type3.rb', line 16
int32LE :flag, {:value => 0, :active => false }
|
16
|
# File 'lib/net/ntlm/message/type3.rb', line 16
int32LE :flag, {:value => 0, :active => false }
|
10
|
# File 'lib/net/ntlm/message/type3.rb', line 10
security_buffer :lm_response, {:value => ""}
|
10
|
# File 'lib/net/ntlm/message/type3.rb', line 10
security_buffer :lm_response, {:value => ""}
|
11
|
# File 'lib/net/ntlm/message/type3.rb', line 11
security_buffer :ntlm_response, {:value => ""}
|
11
|
# File 'lib/net/ntlm/message/type3.rb', line 11
security_buffer :ntlm_response, {:value => ""}
|
#ntlm_version ⇒ Symbol
77
78
79
80
81
82
83
84
85
|
# File 'lib/net/ntlm/message/type3.rb', line 77
def ntlm_version
if ntlm_response.size == 24 && lm_response[0,8] != "\x00"*8 && lm_response[8,16] == "\x00"*16
:ntlm2_session
elsif ntlm_response.size == 24
:ntlmv1
elsif ntlm_response.size > 24
:ntlmv2
end
end
|
#os_version ⇒ String
17
|
# File 'lib/net/ntlm/message/type3.rb', line 17
string :os_version, {:size => 8, :active => false }
|
#os_version= ⇒ String
17
|
# File 'lib/net/ntlm/message/type3.rb', line 17
string :os_version, {:size => 8, :active => false }
|
#password?(password, server_challenge) ⇒ true, false
65
66
67
68
69
70
71
72
73
74
|
# File 'lib/net/ntlm/message/type3.rb', line 65
def password?(password, server_challenge)
case ntlm_version
when :ntlm2_session
ntlm2_session_password?(password, server_challenge)
when :ntlmv2
ntlmv2_password?(password, server_challenge)
else
raise
end
end
|
15
|
# File 'lib/net/ntlm/message/type3.rb', line 15
security_buffer :session_key, {:value => "", :active => false }
|
15
|
# File 'lib/net/ntlm/message/type3.rb', line 15
security_buffer :session_key, {:value => "", :active => false }
|
8
|
# File 'lib/net/ntlm/message/type3.rb', line 8
string :sign, {:size => 8, :value => SSP_SIGN}
|
8
|
# File 'lib/net/ntlm/message/type3.rb', line 8
string :sign, {:size => 8, :value => SSP_SIGN}
|
9
|
# File 'lib/net/ntlm/message/type3.rb', line 9
int32LE :type, {:value => 3}
|
9
|
# File 'lib/net/ntlm/message/type3.rb', line 9
int32LE :type, {:value => 3}
|
13
|
# File 'lib/net/ntlm/message/type3.rb', line 13
security_buffer :user, {:value => ""}
|
13
|
# File 'lib/net/ntlm/message/type3.rb', line 13
security_buffer :user, {:value => ""}
|
14
|
# File 'lib/net/ntlm/message/type3.rb', line 14
security_buffer :workstation, {:value => ""}
|
14
|
# File 'lib/net/ntlm/message/type3.rb', line 14
security_buffer :workstation, {:value => ""}
|