@@ -5,73 +5,47 @@ module NTDS
5
5
# priv extension.
6
6
class Account
7
7
8
- # @!attribute description
9
- # @return [String] The AD Account Description
8
+ #@return [String] The AD Account Description
10
9
attr_accessor :description
11
- # @!attribute disabled
12
- # @return [TrueClass] If the AD account is disabled
13
- # @return [FalseClass] If the AD account is not disabled
10
+ #@return [Boolean] If the AD account is disabled
14
11
attr_accessor :disabled
15
- # @!attribute expired
16
- # @return [TrueClass] If the AD account password is expired
17
- # @return [FalseClass] If the AD account password is not expired
12
+ #@return [Boolean] If the AD account password is expired
18
13
attr_accessor :expired
19
- # @!attribute expiry_date
20
- # @return [String] Human Readable Date for the account's password expiration
14
+ #@return [String] Human Readable Date for the account's password expiration
21
15
attr_accessor :expiry_date
22
- # @!attribute lm_hash
23
- # @return [String] The LM Hash of the current password
16
+ #@return [String] The LM Hash of the current password
24
17
attr_accessor :lm_hash
25
- # @!attribute lm_history
26
- # @return [Array<String>] The LM hashes for previous passwords, up to 24
18
+ #@return [Array<String>] The LM hashes for previous passwords, up to 24
27
19
attr_accessor :lm_history
28
- # @!attribute lm_history_count
29
- # @return [Fixnum] The count of historical LM hashes
20
+ #@return [Fixnum] The count of historical LM hashes
30
21
attr_accessor :lm_history_count
31
- # @!attribute locked
32
- # @return [TrueClass] If the AD account is locked
33
- # @return [FalseClass] If the AD account is not locked
22
+ #@return [Boolean] If the AD account is locked
34
23
attr_accessor :locked
35
- # @!attribute logon_count
36
- # @return [Fixnum] The number of times this account has logged in
24
+ #@return [Fixnum] The number of times this account has logged in
37
25
attr_accessor :logon_count
38
- # @!attribute logon_date
39
- # @return [String] Human Readable Date for the last time the account logged in
26
+ #@return [String] Human Readable Date for the last time the account logged in
40
27
attr_accessor :logon_date
41
- # @!attribute logon_time
42
- # @return [String] Human Readable Time for the last time the account logged in
28
+ #@return [String] Human Readable Time for the last time the account logged in
43
29
attr_accessor :logon_time
44
- # @!attribute name
45
- # @return [String] The samAccountName of the account
30
+ #@return [String] The samAccountName of the account
46
31
attr_accessor :name
47
- # @!attribute no_expire
48
- # @return [TrueClass] If the AD account password does not expire
49
- # @return [FalseClass] If the AD account password does expire
32
+ #@return [Boolean] If the AD account password does not expire
50
33
attr_accessor :no_expire
51
- # @!attribute no_pass
52
- # @return [TrueClass] If the AD account does not require a password
53
- # @return [FalseClass] If the AD account does require a password
34
+ #@return [Boolean] If the AD account does not require a password
54
35
attr_accessor :no_pass
55
- # @!attribute nt_hash
56
- # @return [String] The NT Hash of the current password
36
+ #@return [String] The NT Hash of the current password
57
37
attr_accessor :nt_hash
58
- # @!attribute nt_history
59
- # @return [Array<String>] The NT hashes for previous passwords, up to 24
38
+ #@return [Array<String>] The NT hashes for previous passwords, up to 24
60
39
attr_accessor :nt_history
61
- # @!attribute nt_history_count
62
- # @return [Fixnum] The count of historical NT hashes
40
+ #@return [Fixnum] The count of historical NT hashes
63
41
attr_accessor :nt_history_count
64
- # @!attribute pass_date
65
- # @return [String] Human Readable Date for the last password change
42
+ #@return [String] Human Readable Date for the last password change
66
43
attr_accessor :pass_date
67
- # @!attribute pass_time
68
- # @return [String] Human Readable Time for the last password change
44
+ #@return [String] Human Readable Time for the last password change
69
45
attr_accessor :pass_time
70
- # @!attribute rid
71
- # @return [Fixnum] The Relative ID of the account
46
+ #@return [Fixnum] The Relative ID of the account
72
47
attr_accessor :rid
73
- # @!attribute sid
74
- # @return [String] Byte String for the Account's SID
48
+ #@return [String] Byte String for the Account's SID
75
49
attr_accessor :sid
76
50
77
51
# @param raw_data [String] the raw 3948 byte string from the wire
@@ -105,17 +79,17 @@ def initialize(raw_data)
105
79
106
80
# @return [String] String representation of the account data
107
81
def to_s
108
- <<EOS
109
- #{ @name } (#{ @description } )
110
- #{ ntlm_hash }
111
- Password Expires: #{ @expiry_date }
112
- Last Password Change: #{ @pass_time } #{ @pass_date }
113
- Last Logon: #{ @logon_time } #{ @logon_date }
114
- Logon Count: #{ @logon_count }
115
- #{ uac_string }
116
- Hash History:
117
- #{ hash_history }
118
- EOS
82
+ <<- EOS . strip_heredoc
83
+ #{ @name } (#{ @description } )
84
+ #{ ntlm_hash }
85
+ Password Expires: #{ @expiry_date }
86
+ Last Password Change: #{ @pass_time } #{ @pass_date }
87
+ Last Logon: #{ @logon_time } #{ @logon_date }
88
+ Logon Count: #{ @logon_count }
89
+ #{ uac_string }
90
+ Hash History:
91
+ #{ hash_history }
92
+ EOS
119
93
end
120
94
121
95
# @return [String] the NTLM hash string for the current password
0 commit comments