1.0.9 • Published 8 months ago

hashcat-rules-js v1.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

hashcat-rules-js

An implementation of the hashcat rules engine in JavaScript. More information about rule-based attacks and the rules themselves can be found on the Hashcat wiki.

Installation

npm install hashcat-rules-js

Compiles and minifies for production

npm run build

Usage

const hashcatRule = require('hashcat-rules-js');
const password="hashcat";
const rule="$1";
const result= hashcatRule.applyRule(password,rule)

Parameters

The applyRule function takes the following options:

  • password (required): The password to which the rules will be applied.
  • rule (required): Rules compatible with the Hashcat rules engine.

Return Value

The applyRule function returns a string with the applied rules.

  • if rule is an empty string, false will be returned
  • if rule starts with # (hash), false will be returned

Example

const hashcatRule = require('hashcat-rules-js');
const result= hashcatRule.applyRule("hashcat","$1")
console.log(result);//hashcat1

Rules and output

NameFunctionDescriptionExample RuleInput WordOutput Word
Nothing:Do nothing (passthrough):p@ssW0rdp@ssW0rd
LowercaselLowercase all letterslp@ssW0rdp@ssw0rd
UppercaseuUppercase all lettersup@ssW0rdP@SSW0RD
CapitalizecCapitalize the first letter and lower the restcp@ssW0rdP@ssw0rd
Invert CapitalizeCLowercase first found character, uppercase the restCp@ssW0rdp@SSW0RD
Toggle CasetToggle the case of all characters in word.tp@ssW0rdP@SSw0RD
Toggle @TNToggle the case of characters at position NT3p@ssW0rdp@sSW0rd
ReverserReverse the entire wordrp@ssW0rddr0Wss@p
DuplicatedDuplicate entire worddp@ssW0rdp@ssW0rdp@ssW0rd
Duplicate NpNAppend duplicated word N timesp2p@ssW0rdp@ssW0rdp@ssW0rdp@ssW0rd
ReflectfDuplicate word reversedfp@ssW0rdp@ssW0rddr0Wss@p
Rotate Left{Rotate the word left.{p@ssW0rd@ssW0rdp
Rotate Right}Rotate the word right}p@ssW0rddp@ssW0r
Append Character$XAppend character X to end$1p@ssW0rdp@ssW0rd1
Prepend Character^XPrepend character X to front^1p@ssW0rd1p@ssW0rd
Truncate left[Delete first character[p@ssW0rd@ssW0rd
Trucate right]Delete last character]p@ssW0rdp@assW0r
Delete @ NDNDelete character at position ND3p@ssW0rdp@sW0rd
Extract rangexNMExtract M characters, starting at position Nx04p@ssW0rdp@ss
Omit rangeONMDelete M characters, starting at position NO12p@ssW0rdpsW0rd
Insert @ NiNXInsert character X at position Ni4!p@ssW0rdp@ss!W0rd
Overwrite @ NoNXOverwrite character at position N with Xo3$p@ssW0rdp@s$W0rd
Truncate @ N'NTruncate word at position N'6p@ssW0rdp@ssW0
ReplacesXYReplace all instances of X with Yss$p@ssW0rdp@$$W0rd
Purge@XPurge all instances of X@sp@ssW0rdp@W0rd
Duplicate first NzNDuplicate first character N timesz2p@ssW0rdppp@ssW0rd
Duplicate last NZNDuplicate last character N timesZ2p@ssW0rdp@ssW0rddd
Duplicate allqDuplicate every characterqp@ssW0rdpp@@ssssWW00rrdd
1.0.9

8 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago