haiti-hash 1.2.3 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a38c6a3b6284bdebac65517413040a0510e08ff0a58888a9bccb82a2995e1948
4
- data.tar.gz: 78e2f48fa2c65b3c988a2e26fe19205a3b953fb2a75ad019d88f73b3c5d55e83
3
+ metadata.gz: f2e7a6b60ddba680ddca4da6e2590476df6892ce48fe6558435f88cd93f6f6f7
4
+ data.tar.gz: 2d507b8def07e98025e1bf8165ba96f0f0dc703c5136e98a019220915e4d6a2c
5
5
  SHA512:
6
- metadata.gz: fcdfb62387c7b67dc582ff467df1f9aaece5ff95fb76e40e2af70c4c56e9ce4f3e7b4c8f28bdfa7d2c0199aa1007fa6bf99e3079cc6db8f5969093705e11b074
7
- data.tar.gz: cbf443bbca44347d0774ca847c3e50eb365b642b405549c8d43a4ed80fa3c59f680169c77032c9d33d24f8f1496d44d13d3d60c433cc331353adf70b0ebf519b
6
+ metadata.gz: aab1cda69c1f598173545c62b3010a7feeaffd11470cb892e14c7ddda04e977dc7fff3cefe66b6f424f2521123c7cd8b7858fcc10832365fd44d817fc481b9ca
7
+ data.tar.gz: 3f1e6a4a2dcde7d4e21accdd65f2932bd346913ca4876b1754b2f167611606c48faf486fa3b6f23b6fcc5d258dba91b1073552b81a68200698139ee5aea50aef
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020-2020 Alexandre ZANNI
3
+ Copyright (c) 2020-2022 Alexandre ZANNI (independent)
4
4
  Copyright (c) 2019-2020 Alexandre ZANNI at Orange Cyberdefense
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
data/bin/haiti CHANGED
@@ -10,13 +10,22 @@ require 'docopt'
10
10
  require 'paint'
11
11
 
12
12
  doc = <<~DOCOPT
13
- HAITI (HAsh IdenTifIer)
13
+ HAITI (HAsh IdenTifIer) v#{HashIdentifier::VERSION}
14
14
 
15
15
  Usage:
16
16
  haiti [options] <hash>
17
+ haiti samples (<ref> | <name>)
17
18
  haiti -h | --help
18
19
  haiti --version
19
20
 
21
+ Commands:
22
+ samples Display hash samples for the given type
23
+
24
+ Parameters:
25
+ <hash> Hash string to identify, read from STDIN if equal to "-"
26
+ <ref> hashcat or john the ripper reference
27
+ <name> Hash type name
28
+
20
29
  Options:
21
30
  --no-color Disable colorized output
22
31
  -e, --extended List all possible hash algorithms including ones using salt
@@ -30,6 +39,8 @@ doc = <<~DOCOPT
30
39
  Examples:
31
40
  haiti -e d41d8cd98f00b204e9800998ecf8427e
32
41
  haiti --no-color --short d41d8cd98f00b204e9800998ecf8427e
42
+ b2sum /etc/os-release | awk '{print $1}' | haiti -
43
+ haiti samples crc32
33
44
  DOCOPT
34
45
 
35
46
  begin
@@ -38,6 +49,7 @@ begin
38
49
  pp args if args['--debug']
39
50
  # use case 1, using the tool
40
51
  if args['<hash>']
52
+ args['<hash>'] = $stdin.read.chomp if args['<hash>'] == '-'
41
53
  hi = HashIdentifier.new(args['<hash>'])
42
54
  if hi.type.empty?
43
55
  puts 'Unknown hash type'
@@ -51,6 +63,12 @@ begin
51
63
  print Paint[" [JtR: #{type.john}]", :green] unless type.john.nil? || args['--short'] || args['--hashcat-only']
52
64
  puts
53
65
  end
66
+ elsif args['samples']
67
+ input = args['<ref>'] || args['<name>']
68
+ samples = HashIdentifier.samples(input)
69
+ samples.each do |sample|
70
+ puts sample
71
+ end
54
72
  end
55
73
  # use case 2, help: already handled by docopt
56
74
  # use case 3, version: already handled by docopt