haiti-hash 1.5.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/haiti +21 -12
- data/data/commons.json +29 -28
- data/data/prototypes.json +7080 -5655
- data/lib/haiti/version.rb +1 -1
- data/lib/haiti.rb +19 -0
- data/man/haiti.1 +157 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7b5955de5a61d1e1ab59d2d6e09ca4c4be5f55b945cbf5cf587a8cfa3667d51
|
4
|
+
data.tar.gz: 033f766ccc4d8d1795176e55994472ce965bb4360382f8f3decd93d8044a8c43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c96dd859d8a3d256891002bdfce1903978da263bc1405e18f07b4fc9ee42c2c3163cdc3783593d20e2a5f5a5798b79c425341a0ffd99910d75a5217c6e3a08ee
|
7
|
+
data.tar.gz: a1346e64b98974aa355efe105f1225d0f993f3c515ff5c65ab3e404ce24b7d0f39b98c0b32d322ca2e76240c0c460db64feace71714c8ad12c3d982737a574d4
|
data/bin/haiti
CHANGED
@@ -8,18 +8,21 @@ require 'haiti'
|
|
8
8
|
require 'docopt'
|
9
9
|
require 'paint'
|
10
10
|
|
11
|
+
# NOTE: `haiti [options] <hash>` needs to be after `list` and `samples`, else `list` is caught as a hash
|
11
12
|
doc = <<~DOCOPT
|
12
13
|
#{Paint['HAITI (HAsh IdenTifIer)', '#FF69B4']} v#{Paint[HashIdentifier::VERSION, :bold]}
|
13
14
|
|
14
15
|
#{Paint['Usage:', '#00FFFF']}
|
15
|
-
haiti [options]
|
16
|
+
haiti [options] list
|
16
17
|
haiti samples (<ref> | <name>)
|
18
|
+
haiti [options] <hash>
|
17
19
|
haiti --ascii-art
|
18
20
|
haiti -h | --help
|
19
21
|
haiti --version
|
20
22
|
|
21
23
|
#{Paint['Commands:', '#00FFFF']}
|
22
24
|
samples Display hash samples for the given type
|
25
|
+
list Display a list of all the available hash types
|
23
26
|
|
24
27
|
#{Paint['Parameters:', '#00FFFF']}
|
25
28
|
<hash> Hash string to identify, read from STDIN if equal to "-"
|
@@ -32,7 +35,7 @@ doc = <<~DOCOPT
|
|
32
35
|
--short Display in a short format: do not display hashcat and john the ripper references
|
33
36
|
--hashcat-only Show only hashcat references
|
34
37
|
--john-only Show only john the ripper references
|
35
|
-
--ascii-art
|
38
|
+
--ascii-art Display the logo in colored ascii-art
|
36
39
|
--debug Display arguments
|
37
40
|
-h, --help Show this screen
|
38
41
|
--version Show version
|
@@ -49,6 +52,18 @@ doc = <<~DOCOPT
|
|
49
52
|
#{Paint['documentation', :underline]} (https://noraj.github.io/haiti)
|
50
53
|
DOCOPT
|
51
54
|
|
55
|
+
# Shared option management logic for the identify and list command
|
56
|
+
def manage_options(args, types)
|
57
|
+
types.each do |type|
|
58
|
+
next if type.extended && !args['--extended']
|
59
|
+
|
60
|
+
print Paint[type.name, :bold]
|
61
|
+
print Paint[" [HC: #{type.hashcat}]", '#00FFFF'] unless type.hashcat.nil? || args['--short'] || args['--john-only']
|
62
|
+
print Paint[" [JtR: #{type.john}]", '#FF69B4'] unless type.john.nil? || args['--short'] || args['--hashcat-only']
|
63
|
+
puts
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
52
67
|
begin
|
53
68
|
args = Docopt.docopt(doc, version: HashIdentifier::VERSION)
|
54
69
|
Paint.mode = 0 if args['--no-color']
|
@@ -61,22 +76,16 @@ begin
|
|
61
76
|
puts 'Unknown hash type'
|
62
77
|
exit(0)
|
63
78
|
end
|
64
|
-
hi.type
|
65
|
-
next if type.extended && !args['--extended']
|
66
|
-
|
67
|
-
print Paint[type.name, :bold]
|
68
|
-
unless type.hashcat.nil? || args['--short'] || args['--john-only']
|
69
|
-
print Paint[" [HC: #{type.hashcat}]", '#00FFFF']
|
70
|
-
end
|
71
|
-
print Paint[" [JtR: #{type.john}]", '#FF69B4'] unless type.john.nil? || args['--short'] || args['--hashcat-only']
|
72
|
-
puts
|
73
|
-
end
|
79
|
+
manage_options(args, hi.type)
|
74
80
|
elsif args['samples']
|
75
81
|
input = args['<ref>'] || args['<name>']
|
76
82
|
samples = HashIdentifier.samples(input)
|
77
83
|
samples.each do |sample|
|
78
84
|
puts sample
|
79
85
|
end
|
86
|
+
elsif args['list']
|
87
|
+
types = HashIdentifier.object_list
|
88
|
+
manage_options(args, types)
|
80
89
|
elsif args['--ascii-art']
|
81
90
|
puts File.read(File.join(__dir__, '../docs/_media/logo.ascii'))
|
82
91
|
end
|
data/data/commons.json
CHANGED
@@ -1,30 +1,31 @@
|
|
1
1
|
[
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
2
|
+
"MD5",
|
3
|
+
"SHA-1",
|
4
|
+
"SHA-256",
|
5
|
+
"SHA-512",
|
6
|
+
"bcrypt",
|
7
|
+
"NTLM",
|
8
|
+
"NetNTLMv2 (vanilla)",
|
9
|
+
"NetNTLMv2 (NT)",
|
10
|
+
"NetNTLMv1 / NetNTLMv1+ESS (vanilla)",
|
11
|
+
"NetNTLMv1 / NetNTLMv1+ESS (NT)",
|
12
|
+
"BLAKE2-512 (blake2b)",
|
13
|
+
"SHA3-224",
|
14
|
+
"SHA3-256",
|
15
|
+
"SHA3-512",
|
16
|
+
"Keccak-256",
|
17
|
+
"Keccak-512",
|
18
|
+
"CRC-32B",
|
19
|
+
"CRC-32",
|
20
|
+
"CRC-16",
|
21
|
+
"CRC-64",
|
22
|
+
"GOST R 34.11-94",
|
23
|
+
"Apache MD5",
|
24
|
+
"MD5 (APR)",
|
25
|
+
"md5apr1",
|
26
|
+
"Domain Cached Credentials (DCC), MS Cache",
|
27
|
+
"Domain Cached Credentials 2 (DCC2), MS Cache 2",
|
28
|
+
"LM",
|
29
|
+
"RIPEMD-160",
|
30
|
+
"scrypt"
|
30
31
|
]
|