ntlm and lm hashes

This commit is contained in:
thomashaw
2018-11-05 11:44:28 +00:00
committed by ts
parent 508506ed59
commit d2a04f8d43
19 changed files with 173 additions and 5 deletions

View File

View File

@@ -0,0 +1,16 @@
#!/usr/bin/ruby
require_relative '../../../../../lib/objects/local_hash_encoder.rb'
class LMEncoder < HashEncoder
def initialize
super
self.module_name = 'LM Hash Encoder'
end
def hash_function(string)
require 'smbhash'
Smbhash.lm_hash(string)
end
end
LMEncoder.new.run

View File

@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<encoder xmlns="http://www.github/cliffe/SecGen/encoder"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.github/cliffe/SecGen/encoder">
<name>MD5 Encoder</name>
<author>Thomas Shaw</author>
<module_license>MIT</module_license>
<description>Generates an MD5 hash for each of the strings.</description>
<type>hash</type>
<type>md5</type>
<platform>linux</platform>
<platform>windows</platform>
<read_fact>strings_to_encode</read_fact>
<read_fact>salt</read_fact>
<read_fact>return_salts</read_fact>
<output_type>string</output_type>
</encoder>

View File

@@ -0,0 +1,17 @@
#!/usr/bin/ruby
require_relative '../../../../../lib/objects/local_hash_encoder.rb'
class MySQLPasswordHashEncoder < HashEncoder
def initialize
super
self.module_name = 'MySQL Password Hash Encoder'
self.strings_to_encode = ['right']
end
def hash_function(string)
require 'digest/sha1'
"*" + Digest::SHA1.hexdigest(Digest::SHA1.digest(string)).upcase
end
end
MySQLPasswordHashEncoder.new.run

View File

@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<encoder xmlns="http://www.github/cliffe/SecGen/encoder"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.github/cliffe/SecGen/encoder">
<name>MySQL Password Hash Encoder</name>
<author>Thomas Shaw</author>
<module_license>MIT</module_license>
<description>Generates a MySQL password hash for each of the strings. '*' + sha1sum(sha1sum(password))</description>
<type>hash</type>
<type>mysql</type>
<type>mysql_password</type>
<platform>linux</platform>
<platform>windows</platform>
<read_fact>strings_to_encode</read_fact>
<read_fact>salt</read_fact>
<read_fact>return_salts</read_fact>
<output_type>string</output_type>
</encoder>

View File

View File

@@ -0,0 +1,16 @@
#!/usr/bin/ruby
require_relative '../../../../../lib/objects/local_hash_encoder.rb'
class NTLMEncoder < HashEncoder
def initialize
super
self.module_name = 'NTLM Hash Encoder'
end
def hash_function(string)
require 'smbhash'
Smbhash.ntlm_hash(string)
end
end
NTLMEncoder.new.run

View File

@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<encoder xmlns="http://www.github/cliffe/SecGen/encoder"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.github/cliffe/SecGen/encoder">
<name>MD5 Encoder</name>
<author>Thomas Shaw</author>
<module_license>MIT</module_license>
<description>Generates an MD5 hash for each of the strings.</description>
<type>hash</type>
<type>md5</type>
<platform>linux</platform>
<platform>windows</platform>
<read_fact>strings_to_encode</read_fact>
<read_fact>salt</read_fact>
<read_fact>return_salts</read_fact>
<output_type>string</output_type>
</encoder>

View File

@@ -0,0 +1,15 @@
#!/usr/bin/ruby
require_relative '../../../../../lib/objects/local_hash_encoder.rb'
class SHA1Encoder < HashEncoder
def initialize
super
self.module_name = 'SHA1 Encoder'
end
def hash_function(string)
Digest::SHA1.hexdigest(string)
end
end
SHA1Encoder.new.run

View File

@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<encoder xmlns="http://www.github/cliffe/SecGen/encoder"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.github/cliffe/SecGen/encoder">
<name>SHA1 Encoder</name>
<author>Thomas Shaw</author>
<module_license>MIT</module_license>
<description>Generates an SHA1 hash for each of the strings.</description>
<type>hash</type>
<type>sha1</type>
<platform>linux</platform>
<platform>windows</platform>
<read_fact>strings_to_encode</read_fact>
<read_fact>salt</read_fact>
<read_fact>return_salts</read_fact>
<output_type>string</output_type>
</encoder>

View File