haiti-hash 1.3.0 → 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: 6b121a228ce3192d528056cbb865c6979c71ac409e48bb96c640756edb2dfd8b
4
- data.tar.gz: a3d8f47d4680930e1b93469e18aa70432ac6ece81f31e7aa971d3f613af698ae
3
+ metadata.gz: f2e7a6b60ddba680ddca4da6e2590476df6892ce48fe6558435f88cd93f6f6f7
4
+ data.tar.gz: 2d507b8def07e98025e1bf8165ba96f0f0dc703c5136e98a019220915e4d6a2c
5
5
  SHA512:
6
- metadata.gz: 9165678fa5e1aedbb4934e034a995433a4227bcdb535b4d8ed44e2e87ad8c5d2e6b727595ad4c1253d47bc9c4eb35d660c96551062f25e839b95928457d23bfb
7
- data.tar.gz: 8ceb8fad343101dbf487e0d006047bfcaf08ff609f67c28c4db5678ab3d81b745f634ab24c8f514667a5fad183cb7eef1dfbb333c6489905e1bafd3e0115f5b3
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