Skip to content

Commit

Permalink
colors and help
Browse files Browse the repository at this point in the history
  • Loading branch information
noraj committed Feb 18, 2023
1 parent e5a753f commit f3fee9c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
23 changes: 14 additions & 9 deletions bin/haiti
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ require 'docopt'
require 'paint'

doc = <<~DOCOPT
HAITI (HAsh IdenTifIer) v#{HashIdentifier::VERSION}
#{Paint['HAITI (HAsh IdenTifIer)', 'orange red']} v#{Paint[HashIdentifier::VERSION, :bold]}
Usage:
#{Paint['Usage:', 'orange']}
haiti [options] <hash>
haiti samples (<ref> | <name>)
haiti -h | --help
haiti --version
Commands:
#{Paint['Commands:', 'orange']}
samples Display hash samples for the given type
Parameters:
#{Paint['Parameters:', 'orange']}
<hash> Hash string to identify, read from STDIN if equal to "-"
<ref> hashcat or john the ripper reference
<name> Hash type name
Options:
--no-color Disable colorized output
#{Paint['Options:', 'orange']}
--no-color Disable colorized output (NO_COLOR environment variable is respected too)
-e, --extended List all possible hash algorithms including ones using salt
--short Display in a short format: do not display hashcat and john the ripper references
--hashcat-only Show only hashcat references
Expand All @@ -35,11 +35,16 @@ doc = <<~DOCOPT
-h, --help Show this screen
--version Show version
Examples:
#{Paint['Examples:', 'orange']}
haiti -e d41d8cd98f00b204e9800998ecf8427e
haiti --no-color --short d41d8cd98f00b204e9800998ecf8427e
b2sum /etc/os-release | awk '{print $1}' | haiti -
haiti samples crc32
#{Paint['Project:', 'orange']}
#{Paint['author', :underline]} (https://pwn.by/noraj / https://twitter.com/noraj_rawsec)
#{Paint['source', :underline]} (https://github.com/noraj/haiti)
#{Paint['documentation', :underline]} (https://noraj.github.io/haiti)
DOCOPT

begin
Expand All @@ -58,8 +63,8 @@ begin
next if type.extended && !args['--extended']

print Paint[type.name, :bold]
print Paint[" [HC: #{type.hashcat}]", :blue] unless type.hashcat.nil? || args['--short'] || args['--john-only']
print Paint[" [JtR: #{type.john}]", :green] unless type.john.nil? || args['--short'] || args['--hashcat-only']
print Paint[" [HC: #{type.hashcat}]", 'orange'] unless type.hashcat.nil? || args['--short'] || args['--john-only']
print Paint[" [JtR: #{type.john}]", 'orange red'] unless type.john.nil? || args['--short'] || args['--hashcat-only']
puts
end
elsif args['samples']
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
- Streebog-256
- Streebog-512
- **Enhancements**:
- **Colors**:
- help message is colored
- change reference colors to match the same theme
- NTLM:
- Add recognition for common dump format
- Add samples
Expand Down Expand Up @@ -52,6 +55,7 @@
- All regexp will now use `\A` and `\Z` instead of `^` and `$` to prevent multi-line false positives
- **Chore**:
- Add support for Ruby 3.2
- Add project reference in help message

## [1.4.1]

Expand Down

0 comments on commit f3fee9c

Please sign in to comment.