Sha256: 66554474c721b5c17c42a5935a732cfe2478cd978b4d94ed54a2bf33b60dc8b4

Contents?: true

Size: 1.03 KB

Versions: 15

Compression:

Stored size: 1.03 KB

Contents

# -*- coding: binary -*-

module Rex
module Post
module Meterpreter
module Extensions
module Priv

###
#
# This class wraps a SAM hash entry.
#
###
class SamUser

  #
  # Initializes the class from a hash string like this:
  #
  # Administrator:500:aad3b435b51404eeaadfb435b51404ee:31d6cfe0d16de931b73c59d7e0c089c0:::
  #
  def initialize(hash_str)
    self.user_name, self.user_id, self.lanman, self.ntlm = hash_str.split(/:/)

    self.hash_string = hash_str
  end

  #
  # Returns the hash string that was supplied to the constructor.
  #
  def to_s
    hash_string
  end

  #
  # The raw hash string that was passed to the class constructor.
  #
  attr_reader :hash_string
  #
  # The username from the SAM database entry.
  #
  attr_reader :user_name
  #
  # The user's unique identifier from the SAM database.
  #
  attr_reader :user_id
  #
  # The LM hash.
  #
  attr_reader :lanman
  #
  # The NTLM hash.
  #
  attr_reader :ntlm

protected

  attr_writer :hash_string, :user_name, :user_id, :lanman, :ntlm # :nodoc:

end

end; end; end; end; end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
rex-2.0.13 lib/rex/post/meterpreter/extensions/priv/passwd.rb
rex-2.0.12 lib/rex/post/meterpreter/extensions/priv/passwd.rb
rex-2.0.11 lib/rex/post/meterpreter/extensions/priv/passwd.rb
rex-2.0.10 lib/rex/post/meterpreter/extensions/priv/passwd.rb
rex-2.0.9 lib/rex/post/meterpreter/extensions/priv/passwd.rb
rex-2.0.8 lib/rex/post/meterpreter/extensions/priv/passwd.rb
rex-2.0.7 lib/rex/post/meterpreter/extensions/priv/passwd.rb
rex-2.0.5 lib/rex/post/meterpreter/extensions/priv/passwd.rb
rex-2.0.4 lib/rex/post/meterpreter/extensions/priv/passwd.rb
dstruct-0.0.1 lib/rex/post/meterpreter/extensions/priv/passwd.rb
rex-2.0.3 lib/rex/post/meterpreter/extensions/priv/passwd.rb
librex-0.0.999 lib/rex/post/meterpreter/extensions/priv/passwd.rb
rex-2.0.2 lib/rex/post/meterpreter/extensions/priv/passwd.rb
librex-0.0.71 lib/rex/post/meterpreter/extensions/priv/passwd.rb
librex-0.0.70 lib/rex/post/meterpreter/extensions/priv/passwd.rb