haiti-hash 1.0.0 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +2 -1
  3. data/bin/haiti +7 -17
  4. data/data/commons.json +29 -0
  5. data/data/prototypes.json +1064 -110
  6. data/lib/haiti.rb +7 -0
  7. data/lib/haiti/hash.rb +3 -0
  8. data/lib/haiti/version.rb +1 -1
  9. metadata +29 -75
  10. data/.editorconfig +0 -21
  11. data/.gitignore +0 -8
  12. data/.rubocop.yml +0 -25
  13. data/.yardopts +0 -4
  14. data/.yardopts-dev +0 -6
  15. data/Gemfile +0 -6
  16. data/Gemfile.lock +0 -56
  17. data/README.md +0 -33
  18. data/Rakefile +0 -10
  19. data/docs/.nojekyll +0 -0
  20. data/docs/CHANGELOG.md +0 -9
  21. data/docs/README.md +0 -22
  22. data/docs/_coverpage.md +0 -15
  23. data/docs/_media/logo.png +0 -0
  24. data/docs/_navbar.md +0 -2
  25. data/docs/_sidebar.md +0 -15
  26. data/docs/about.md +0 -5
  27. data/docs/index.html +0 -31
  28. data/docs/pages/demo.md +0 -3
  29. data/docs/pages/documentation.md +0 -34
  30. data/docs/pages/install.md +0 -90
  31. data/docs/pages/publishing.md +0 -39
  32. data/docs/pages/quick-start.md +0 -39
  33. data/docs/pages/usage.md +0 -58
  34. data/docs/vendor/docsify.js +0 -1
  35. data/docs/vendor/plugins/emoji.min.js +0 -1
  36. data/docs/vendor/plugins/search.min.js +0 -1
  37. data/docs/vendor/prismjs/components/prism-ruby.min.js +0 -1
  38. data/docs/vendor/themes/vue.css +0 -1
  39. data/docs/why.md +0 -35
  40. data/docs/yard/HashIdentifier.html +0 -479
  41. data/docs/yard/HashIdentifier/Chf.html +0 -590
  42. data/docs/yard/Version.html +0 -126
  43. data/docs/yard/_index.html +0 -138
  44. data/docs/yard/class_list.html +0 -51
  45. data/docs/yard/css/common.css +0 -1
  46. data/docs/yard/css/full_list.css +0 -58
  47. data/docs/yard/css/style.css +0 -496
  48. data/docs/yard/file.LICENSE.html +0 -70
  49. data/docs/yard/file.README.html +0 -106
  50. data/docs/yard/file_list.html +0 -61
  51. data/docs/yard/frames.html +0 -17
  52. data/docs/yard/index.html +0 -106
  53. data/docs/yard/js/app.js +0 -303
  54. data/docs/yard/js/full_list.js +0 -216
  55. data/docs/yard/js/jquery.js +0 -4
  56. data/docs/yard/method_list.html +0 -115
  57. data/docs/yard/top-level-namespace.html +0 -112
  58. data/test/test_haiti.rb +0 -33
data/lib/haiti.rb CHANGED
@@ -11,6 +11,7 @@ class HashIdentifier
11
11
  # Constants
12
12
  include Version
13
13
  PROTOTYPES = JSON.parse(File.read(File.join(__dir__, '../data/prototypes.json')))
14
+ COMMONS = JSON.parse(File.read(File.join(__dir__, '../data/commons.json')))
14
15
 
15
16
  # @return [String] the hash (as provided)
16
17
  # @example
@@ -26,6 +27,7 @@ class HashIdentifier
26
27
  def initialize(hash)
27
28
  @hash = hash
28
29
  @type = identify(hash)
30
+ sort_commons
29
31
  end
30
32
 
31
33
  private
@@ -46,4 +48,9 @@ class HashIdentifier
46
48
  end
47
49
  return res
48
50
  end
51
+
52
+ # Sort common hash types first
53
+ def sort_commons
54
+ @type.sort_by! { |e| COMMONS.include?(e.name) ? 0 : 1 }
55
+ end
49
56
  end
data/lib/haiti/hash.rb CHANGED
@@ -12,12 +12,15 @@ class HashIdentifier
12
12
  # @return [Boolean] Display by default or not. If true it is displayed in
13
13
  # extended mode only, mostly hash type using salt.
14
14
  attr_reader :extended
15
+ # @return [Array<String>] Examples of hashes
16
+ attr_reader :samples
15
17
 
16
18
  def initialize(mode)
17
19
  @name = mode['name']
18
20
  @john = mode['john']
19
21
  @hashcat = mode['hashcat']
20
22
  @extended = mode['extended']
23
+ @samples = mode['samples']
21
24
  end
22
25
  end
23
26
  end
data/lib/haiti/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Version
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haiti-hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre ZANNI
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-14 00:00:00.000000000 Z
11
+ date: 2021-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -30,56 +30,56 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.1'
33
+ version: '2.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.1'
40
+ version: '2.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: '2.1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.0'
54
+ version: '2.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: commonmarker
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.20'
61
+ version: '0.21'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.20'
68
+ version: '0.21'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: github-markup
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.0'
75
+ version: '4.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '3.0'
82
+ version: '4.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: minitest
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0.75'
131
+ version: '1.8'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0.75'
138
+ version: '1.8'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: yard
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -158,90 +158,44 @@ executables:
158
158
  extensions: []
159
159
  extra_rdoc_files: []
160
160
  files:
161
- - ".editorconfig"
162
- - ".gitignore"
163
- - ".rubocop.yml"
164
- - ".yardopts"
165
- - ".yardopts-dev"
166
- - Gemfile
167
- - Gemfile.lock
168
161
  - LICENSE.txt
169
- - README.md
170
- - Rakefile
171
162
  - bin/haiti
172
163
  - bin/haiti_console
164
+ - data/commons.json
173
165
  - data/prototypes.json
174
- - docs/.nojekyll
175
- - docs/CHANGELOG.md
176
- - docs/README.md
177
- - docs/_coverpage.md
178
- - docs/_media/logo.png
179
- - docs/_navbar.md
180
- - docs/_sidebar.md
181
- - docs/about.md
182
- - docs/index.html
183
- - docs/pages/demo.md
184
- - docs/pages/documentation.md
185
- - docs/pages/install.md
186
- - docs/pages/publishing.md
187
- - docs/pages/quick-start.md
188
- - docs/pages/usage.md
189
- - docs/vendor/docsify.js
190
- - docs/vendor/plugins/emoji.min.js
191
- - docs/vendor/plugins/search.min.js
192
- - docs/vendor/prismjs/components/prism-ruby.min.js
193
- - docs/vendor/themes/vue.css
194
- - docs/why.md
195
- - docs/yard/HashIdentifier.html
196
- - docs/yard/HashIdentifier/Chf.html
197
- - docs/yard/Version.html
198
- - docs/yard/_index.html
199
- - docs/yard/class_list.html
200
- - docs/yard/css/common.css
201
- - docs/yard/css/full_list.css
202
- - docs/yard/css/style.css
203
- - docs/yard/file.LICENSE.html
204
- - docs/yard/file.README.html
205
- - docs/yard/file_list.html
206
- - docs/yard/frames.html
207
- - docs/yard/index.html
208
- - docs/yard/js/app.js
209
- - docs/yard/js/full_list.js
210
- - docs/yard/js/jquery.js
211
- - docs/yard/method_list.html
212
- - docs/yard/top-level-namespace.html
213
166
  - lib/haiti.rb
214
167
  - lib/haiti/hash.rb
215
168
  - lib/haiti/version.rb
216
- - test/test_haiti.rb
217
- homepage: https://orange-cyberdefense.github.io/haiti/
169
+ homepage: https://noraj.github.io/haiti/
218
170
  licenses:
219
171
  - MIT
220
172
  metadata:
221
173
  yard.run: yard
222
- bug_tracker_uri: https://github.com/Orange-Cyberdefense/haiti/issues
223
- changelog_uri: https://github.com/Orange-Cyberdefense/haiti/blob/master/docs/CHANGELOG.md
224
- documentation_uri: https://orange-cyberdefense.github.io/haiti/
225
- homepage_uri: https://orange-cyberdefense.github.io/haiti/
226
- source_code_uri: https://github.com/Orange-Cyberdefense/haiti/
227
- post_install_message:
174
+ bug_tracker_uri: https://github.com/noraj/haiti/issues
175
+ changelog_uri: https://github.com/noraj/haiti/blob/master/docs/CHANGELOG.md
176
+ documentation_uri: https://noraj.github.io/haiti/
177
+ homepage_uri: https://noraj.github.io/haiti/
178
+ source_code_uri: https://github.com/noraj/haiti/
179
+ post_install_message:
228
180
  rdoc_options: []
229
181
  require_paths:
230
182
  - lib
231
183
  required_ruby_version: !ruby/object:Gem::Requirement
232
184
  requirements:
233
- - - "~>"
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: 2.4.0
188
+ - - "<"
234
189
  - !ruby/object:Gem::Version
235
- version: '2.4'
190
+ version: '3.1'
236
191
  required_rubygems_version: !ruby/object:Gem::Requirement
237
192
  requirements:
238
193
  - - ">="
239
194
  - !ruby/object:Gem::Version
240
195
  version: '0'
241
196
  requirements: []
242
- rubygems_version: 3.0.1
243
- signing_key:
197
+ rubygems_version: 3.2.15
198
+ signing_key:
244
199
  specification_version: 4
245
200
  summary: HAsh IdenTifIer
246
- test_files:
247
- - test/test_haiti.rb
201
+ test_files: []
data/.editorconfig DELETED
@@ -1,21 +0,0 @@
1
- # EditorConfig: https://EditorConfig.org
2
-
3
- # top-most EditorConfig file
4
- root = true
5
-
6
- # Unix-style newlines with a newline ending every file
7
- [*]
8
- end_of_line = lf
9
- insert_final_newline = true
10
-
11
- # ruby
12
- [*.rb]
13
- charset = utf-8
14
- indent_style = space
15
- indent_size = 2
16
- trim_trailing_whitespace = true
17
-
18
- # keep source format
19
- [data/prototypes.json]
20
- indent_style = space
21
- indent_size = 4
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- .yardoc
2
- *.gem
3
- /pkg
4
- /doc
5
- /vendor
6
- .bundle/
7
- /node_modules
8
- .git
data/.rubocop.yml DELETED
@@ -1,25 +0,0 @@
1
- # Metrics
2
- AllCops:
3
- TargetRubyVersion: 2.4
4
-
5
- Layout/AlignHash:
6
- Include:
7
- - 'lib/**/*.rb'
8
- Metrics/AbcSize:
9
- Enabled: false
10
- Metrics/ClassLength:
11
- Max: 200
12
- Metrics/CyclomaticComplexity:
13
- Enabled: false
14
- Metrics/LineLength:
15
- Include:
16
- - 'lib/**/*.rb'
17
- Metrics/BlockNesting:
18
- Exclude:
19
- - 'bin/*'
20
- Metrics/MethodLength:
21
- Max: 25
22
- Metrics/PerceivedComplexity:
23
- Max: 10
24
- Style/RedundantReturn:
25
- Enabled: false
data/.yardopts DELETED
@@ -1,4 +0,0 @@
1
- --output-dir docs/yard
2
- -
3
- --main README.md
4
- LICENSE.txt
data/.yardopts-dev DELETED
@@ -1,6 +0,0 @@
1
- --output-dir docs/yard
2
- --protected
3
- --private
4
- -
5
- --main README.md
6
- LICENSE.txt
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in .gemspec
6
- gemspec
data/Gemfile.lock DELETED
@@ -1,56 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- haiti-hash (0.0.1)
5
- docopt (~> 0.6)
6
- paint (~> 2.1)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- ast (2.4.0)
12
- commonmarker (0.20.1)
13
- ruby-enum (~> 0.5)
14
- concurrent-ruby (1.1.5)
15
- docopt (0.6.1)
16
- github-markup (3.0.4)
17
- i18n (1.7.0)
18
- concurrent-ruby (~> 1.0)
19
- jaro_winkler (1.5.3)
20
- minitest (5.13.0)
21
- paint (2.1.1)
22
- parallel (1.18.0)
23
- parser (2.6.5.0)
24
- ast (~> 2.4.0)
25
- rainbow (3.0.0)
26
- rake (13.0.1)
27
- redcarpet (3.5.0)
28
- rubocop (0.76.0)
29
- jaro_winkler (~> 1.5.1)
30
- parallel (~> 1.10)
31
- parser (>= 2.6)
32
- rainbow (>= 2.2.2, < 4.0)
33
- ruby-progressbar (~> 1.7)
34
- unicode-display_width (>= 1.4.0, < 1.7)
35
- ruby-enum (0.7.2)
36
- i18n
37
- ruby-progressbar (1.10.1)
38
- unicode-display_width (1.6.0)
39
- yard (0.9.20)
40
-
41
- PLATFORMS
42
- ruby
43
-
44
- DEPENDENCIES
45
- bundler (~> 2.0)
46
- commonmarker (~> 0.20)
47
- github-markup (~> 3.0)
48
- haiti-hash!
49
- minitest (~> 5.12)
50
- rake (~> 13.0)
51
- redcarpet (~> 3.5)
52
- rubocop (~> 0.75)
53
- yard (~> 0.9)
54
-
55
- BUNDLED WITH
56
- 2.0.2
data/README.md DELETED
@@ -1,33 +0,0 @@
1
- # HAITI
2
-
3
- [![Gem Version](https://badge.fury.io/rb/haiti-hash.svg)](https://badge.fury.io/rb/haiti-hash)
4
- ![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/Orange-Cyberdefense/haiti)
5
- [![GitHub forks](https://img.shields.io/github/forks/Orange-Cyberdefense/haiti)](https://github.com/Orange-Cyberdefense/haiti/network)
6
- [![GitHub stars](https://img.shields.io/github/stars/Orange-Cyberdefense/haiti)](https://github.com/Orange-Cyberdefense/haiti/stargazers)
7
- [![GitHub license](https://img.shields.io/github/license/Orange-Cyberdefense/haiti)](https://github.com/Orange-Cyberdefense/haiti/blob/master/LICENSE.txt)
8
- [![Rawsec's CyberSecurity Inventory](https://inventory.rawsec.ml/img/badges/Rawsec-inventoried-FF5050_flat.svg)](https://inventory.rawsec.ml/tools.html#Haiti)
9
-
10
- [![Packaging status](https://repology.org/badge/vertical-allrepos/haiti.svg)](https://repology.org/project/haiti/versions)
11
-
12
- ![](https://orange-cyberdefense.github.io/haiti/_media/logo.png)
13
-
14
- > _**HA**sh **I**den**T**if**I**er_
15
-
16
- ## What is it?
17
-
18
- A CLI tool to identify the hash type of a given hash.
19
-
20
- ## Features
21
-
22
- - 270+ hash types detected
23
- - Hashcat and John the Ripper references
24
- - CLI tool & library
25
- - Hackable
26
-
27
- ## References
28
-
29
- Homepage / Documentation: https://orange-cyberdefense.github.io/haiti/
30
-
31
- ## Author
32
-
33
- Made by Alexandre ZANNI ([@noraj](https://github.com/noraj)), pentester from Orange Cyberdefense.
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require 'rake/testtask'
2
- require 'bundler/gem_tasks'
3
-
4
- Rake::TestTask.new do |t|
5
- t.libs << 'test'
6
- end
7
-
8
- desc 'Run tests'
9
- task default: :test
10
-
data/docs/.nojekyll DELETED
File without changes
data/docs/CHANGELOG.md DELETED
@@ -1,9 +0,0 @@
1
- ## [1.0.0]
2
-
3
- - lib: Fix a file loading path of prototypes
4
- - doc: Fix gem name
5
- - bin: remove useless haiti_setup
6
-
7
- ## [0.0.1]
8
-
9
- - Initial version