Class: Rex::Post::Meterpreter::Extensions::Priv::SamUser

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/post/meterpreter/extensions/priv/passwd.rb

Overview

This class wraps a SAM hash entry.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash_str) ⇒ SamUser

Initializes the class from a hash string like this:

Administrator:500:aad3b435b51404eeaadfb435b51404ee:31d6cfe0d16de931b73c59d7e0c089c0:


22
23
24
25
26
# File 'lib/rex/post/meterpreter/extensions/priv/passwd.rb', line 22

def initialize(hash_str)
	self.user_name, self.user_id, self.lanman, self.ntlm = hash_str.split(/:/)

	self.hash_string = hash_str
end

Instance Attribute Details

#hash_stringObject

The raw hash string that was passed to the class constructor.



38
39
40
# File 'lib/rex/post/meterpreter/extensions/priv/passwd.rb', line 38

def hash_string
  @hash_string
end

#lanmanObject

The LM hash.



50
51
52
# File 'lib/rex/post/meterpreter/extensions/priv/passwd.rb', line 50

def lanman
  @lanman
end

#ntlmObject

The NTLM hash.



54
55
56
# File 'lib/rex/post/meterpreter/extensions/priv/passwd.rb', line 54

def ntlm
  @ntlm
end

#user_idObject

The user’s unique identifier from the SAM database.



46
47
48
# File 'lib/rex/post/meterpreter/extensions/priv/passwd.rb', line 46

def user_id
  @user_id
end

#user_nameObject

The username from the SAM database entry.



42
43
44
# File 'lib/rex/post/meterpreter/extensions/priv/passwd.rb', line 42

def user_name
  @user_name
end

Instance Method Details

#to_sObject

Returns the hash string that was supplied to the constructor.



31
32
33
# File 'lib/rex/post/meterpreter/extensions/priv/passwd.rb', line 31

def to_s
	hash_string
end