hashcat-util overhaul to automatically compile using make

This commit is contained in:
Justin Bollinger
2026-01-25 19:48:25 -05:00
parent 873be13df6
commit a78e291328
78 changed files with 23 additions and 268 deletions

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "hashcat-utils"]
path = hashcat-utils
url = https://github.com/hashcat/hashcat-utils.git

1
hashcat-utils Submodule

Submodule hashcat-utils added at 8bbf2baf7b

View File

@@ -1,9 +0,0 @@
* v1.1 -> v1.2
- Open Source the project
- License is MIT
- Moved repository to github: https://github.com/hashcat/hashcat-utils
- Added CHANGES
- Added LICENSE
- Added README.md

View File

@@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2015 Jens Steube
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,28 +0,0 @@
hashcat-utils
==============
Hashcat-utils are a set of small utilities that are useful in advanced password cracking
Brief description
--------------
They all are packed into multiple stand-alone binaries.
All of these utils are designed to execute only one specific function.
Since they all work with STDIN and STDOUT you can group them into chains.
Detailed description
--------------
tbd
Compile
--------------
Simply run make
Binary distribution
--------------
Binaries for Linux, Windows and OSX: https://github.com/hashcat/hashcat-utils/releases

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,71 +0,0 @@
#!/usr/bin/env perl
## Name........: seprule
## Autor.......: Jens Steube <jens.steube@gmail.com>
## License.....: MIT
use strict;
use warnings;
##
## configuration
##
my @rp = ('0'..'9', 'A'..'Z');
my $width = 3;
my $rule = "i";
my $sep = " ";
##
## code
##
my $rp_size = scalar @rp;
my $total = $rp_size ** $width;
my $db;
for (my $i = 0; $i < $total; $i++)
{
my $left = $i;
my @out;
for (my $c = 0; $c < $width; $c++)
{
my $m = $left % $rp_size;
my $d = $left / $rp_size;
push (@out, $m);
$left = $d;
}
@out = sort { $a <=> $b } @out;
my $val = join ("", @out);
next if (exists $db->{$val});
$db->{$val} = undef;
my @final;
for (my $c = 0; $c < $width; $c++)
{
my $s = sprintf ("T%s", $rp[$out[$c]]);
push (@final, $s);
}
for (my $c = 0; $c < $width; $c++)
{
my $s = sprintf ("%s%s%s", $rule, $rp[$out[$c]], $sep);
push (@final, $s);
}
print join (" ", "l", @final), "\n";
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,59 +0,0 @@
#!/usr/bin/env perl
## Name........: tmesis
## Autor.......: Jens Steube <jens.steube@gmail.com>
## License.....: MIT
use strict;
use warnings;
#tmesis will take a wordlist and produce insertion rules that would insert each word of the wordlist to preset positions.
#For example:
#Word password will create insertion rules that would insert password from position 0 to position F (15) and It will mutate the string 123456 as follows.
#password123456
#1password23456
#12password3456
#123password456
#1234password56
#12345password6
#123456password
#
#Hints:
#*Use tmesis to create rules to attack hashlists the came from the source. Run initial analysis on the cracked passwords , collect the top 10 20 words appear on the passwords and use tmesis to generate rules.
#*use tmesis generated rules in combination with best64.rules
#
# inspired by T0XlC
my $min_rule_pos = 0;
my $max_rule_pos = 15;
my $db;
my @intpos_to_rulepos = ('0'..'9', 'A'..'Z');
my $function = "i";
#my $function = "o";
while (my $word = <>)
{
chomp $word;
my $word_len = length $word;
my @word_buf = split "", $word;
for (my $rule_pos = $min_rule_pos; $rule_pos < $max_rule_pos - $word_len; $rule_pos++)
{
my @rule;
for (my $word_pos = 0; $word_pos < $word_len; $word_pos++)
{
my $function_full = $function . $intpos_to_rulepos[$rule_pos + $word_pos] . $word_buf[$word_pos];
push @rule, $function_full;
}
print join (" ", @rule), "\n";
}
}

View File

@@ -1,71 +0,0 @@
#!/usr/bin/env perl
## Name........: topmorph
## Autor.......: Jens Steube <jens.steube@gmail.com>
## License.....: MIT
use strict;
use warnings;
my @intpos_to_rulepos = ('0'..'9', 'A'..'Z');
my $function = "i";
#my $function = "o";
if (scalar @ARGV != 5)
{
print "usage: $0 dictionary depth width pos_min pos_max\n";
exit -1;
}
my ($dictionary, $depth, $width, $pos_min, $pos_max) = @ARGV;
if ($width > 20)
{
print "width > 20\n";
exit -1;
}
for (my $pos = $pos_min; $pos <= $pos_max; $pos++)
{
my $db;
open (IN, $dictionary) or die "$dictionary: $!\n";
while (my $line = <IN>)
{
chomp $line;
my $len = length $line;
next if (($len - $pos) < $width);
my $word = substr ($line, $pos, $width);
next unless defined $word;
$db->{$word}++;
}
close (IN);
my @keys = sort { $db->{$b} <=> $db->{$a} } keys %{$db};
for (my $i = 0; $i < $depth; $i++)
{
my @chars = split "", $keys[$i];
my @rule;
for (my $j = 0; $j < $width; $j++)
{
my $function_full = join "", $function, $intpos_to_rulepos[$pos + $j], $chars[$j];
push @rule, $function_full;
}
print join (" ", @rule), "\n";
}
}

View File

@@ -170,15 +170,26 @@ required_binaries = [
for binary, name in required_binaries:
binary_path = hashcat_utils_path + '/' + binary
needs_make = False
if not os.path.isfile(binary_path):
print(f'Error: {name} binary not found at {binary_path}')
print('Please ensure hashcat-utils is properly installed.')
quit(1)
# Check if binary is executable
if not os.access(binary_path, os.X_OK):
print(f'Error: {name} binary at {binary_path} is not executable')
print('Try running: chmod +x {0}'.format(binary_path))
quit(1)
print(f'Warning: {name} binary not found at {binary_path}. Attempting to build hashcat-utils...')
needs_make = True
elif not os.access(binary_path, os.X_OK):
print(f'Warning: {name} binary at {binary_path} is not executable. Attempting to build hashcat-utils...')
needs_make = True
if needs_make:
make_dir = os.path.join(hate_path, 'hashcat-utils')
try:
subprocess.run(['make'], cwd=make_dir, check=True)
print('Successfully ran make in hashcat-utils.')
except Exception as e:
print(f'Error running make in hashcat-utils: {e}')
print('Please ensure build tools are installed and try again.')
quit(1)
# Re-check after make
if not os.path.isfile(binary_path) or not os.access(binary_path, os.X_OK):
print(f'Error: {name} binary still not found or not executable at {binary_path} after make.')
quit(1)
# Test binary execution
try:
test_result = subprocess.run(