Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cfcs/hashcat-rulemin
Semi-practical toy project that implements a REPL for a subset of the Hashcat rule language
https://github.com/cfcs/hashcat-rulemin
Last synced: about 13 hours ago
JSON representation
Semi-practical toy project that implements a REPL for a subset of the Hashcat rule language
- Host: GitHub
- URL: https://github.com/cfcs/hashcat-rulemin
- Owner: cfcs
- Created: 2024-01-08T06:33:09.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-20T08:50:31.000Z (12 months ago)
- Last Synced: 2024-01-20T09:39:18.156Z (12 months ago)
- Language: Rust
- Size: 27.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hashcat rule minimizer
### About
This is a semi-practical toy project that implements a subset of the [Hashcat rule language](https://hashcat.net/wiki/doku.php?id=rule_based_attack).
Currently there's:
- [x] a parser
- [x] an evaluator
- [x] a very bare-bones rule minimizer
- [x] a terminal REPL
- [ ] Eventually it would be nice to make it analyze rulesets and minimize/deduplicate them (more effectively than `sort -u`)
- [ ] Filtering/mangling rules to ensure they stick to specific masks/character sets would also be niceIt looks like this:
```
=====================
\-- rulemin repl --/
==================
#init# eval
#dict# testWord123
#dict# MyoTHERward
#dict#
#eval# { { $A $B$C D0D0D0 K
│ { { $A $B$C D0D0D0 K │
├────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ [RotateLeft, RotateLeft, Append(65), Append(66), Append(67), Omit(0, 1), Omit(0, 1), Omit(0, 1), SwapBack] │
├────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ [RotateLeft, RotateLeft, Append(65), Append(66), Append(67), Omit(0, 3), SwapBack] │
│ testWord123 │ ord123teACB │
│ MyoTHERward │ ERwardMyACB │
#eval# l $A } $B$C D0D0 K
│ l $A } $B$C D0D0 K │
├────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ [Lowercase, Append(65), RotateRight, Append(66), Append(67), Omit(0, 1), Omit(0, 1), SwapBack] │
├────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ [Lowercase, Append(65), RotateRight, Append(66), Append(67), Omit(0, 2), SwapBack] │
│ testWord123 │ estword123CB │
│ MyoTHERward │ yotherwardCB │
```### Implemented operations:
```
# 0 operands:
:
l
u
r
d
{
}
[
]
k
K# 1 operand:
D
p
.
,
@
$
^# two operands:
*
O
x
o
i
s
```**Not** implemented:
- `%1s` `/` and `p` positions
```
# 0 operands:
c
C
t
f
q
4
6
M
Q
E# 1 operand:
L
R
+
-
y
Y
eT
'
z
Z
<
>
_
!
/
(
)# 2 operands:
=
%# 3 operands:
X
3
```### Fuzzing
```shell
# may need: cargo install cargo-fuzz
cd rulelib
cargo fuzz build
cargo fuzz run fuzz_target_1 -- -max_len=200
```