haiti-hash 1.3.0 → 1.4.1

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: c8666ca33015b9d177521ed2dbf2c57cf4d5d368916448acae67b0709b08e54d
4
+ data.tar.gz: 6c623a158e316ecdb438d8e470614dbd152e59620954ca697d8e74681095b0e5
5
5
  SHA512:
6
- metadata.gz: 9165678fa5e1aedbb4934e034a995433a4227bcdb535b4d8ed44e2e87ad8c5d2e6b727595ad4c1253d47bc9c4eb35d660c96551062f25e839b95928457d23bfb
7
- data.tar.gz: 8ceb8fad343101dbf487e0d006047bfcaf08ff609f67c28c4db5678ab3d81b745f634ab24c8f514667a5fad183cb7eef1dfbb333c6489905e1bafd3e0115f5b3
6
+ metadata.gz: e668334fd140646b1a64df1ecec7353a5111d8fa9873888bbad88f8420fbeda50b08abb97ef53ac901c6bf3c0d6a87d1171df32d12b1b4869e20c5a94d9a92fc
7
+ data.tar.gz: 36eba5ecad7673002acc91d1c3230ecca973bf1257a1aa3e2932433fd1cc83ac7fc574bc132e6818c7c6e2ca84069fee03b6fae22d59d84b120e2cc712f86aeb
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