npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hashcat-rules-js

v1.0.9

Published

An implementation of the hashcat rules engine in javascript

Downloads

100

Readme

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

|Name|Function|Description|Example Rule|Input Word|Output Word| | --- | --- | --- | --- | --- | --- | |Nothing|:|Do nothing (passthrough)|:|p@ssW0rd|p@ssW0rd| |Lowercase| l|Lowercase all letters| l|p@ssW0rd |p@ssw0rd | |Uppercase|u|Uppercase all letters |u|p@ssW0rd |P@SSW0RD| |Capitalize| c|Capitalize the first letter and lower the rest |c|p@ssW0rd | P@ssw0rd| |Invert Capitalize |C|Lowercase first found character, uppercase the rest |C|p@ssW0rd |p@SSW0RD| |Toggle Case | t|Toggle the case of all characters in word. |t|p@ssW0rd |P@SSw0RD | |Toggle @ |TN|Toggle the case of characters at position N |T3|p@ssW0rd |p@sSW0rd | |Reverse| r|Reverse the entire word |r|p@ssW0rd |dr0Wss@p | |Duplicate|d|Duplicate entire word |d|p@ssW0rd |p@ssW0rdp@ssW0rd | |Duplicate N |pN|Append duplicated word N times |p2|p@ssW0rd |p@ssW0rdp@ssW0rdp@ssW0rd | |Reflect|f|Duplicate word reversed |f|p@ssW0rd |p@ssW0rddr0Wss@p | |Rotate Left |{|Rotate the word left. | {|p@ssW0rd |@ssW0rdp | |Rotate Right |}|Rotate the word right |}|p@ssW0rd |dp@ssW0r | |Append Character |$X |Append character X to end |$1 |p@ssW0rd |p@ssW0rd1 | |Prepend Character |^X |Prepend character X to front |^1 |p@ssW0rd |1p@ssW0rd | |Truncate left |[|Delete first character |[|p@ssW0rd |@ssW0rd | |Trucate right |]|Delete last character | ]|p@ssW0rd |p@assW0r | |Delete @ N |DN|Delete character at position N |D3|p@ssW0rd |p@sW0rd | |Extract range |xNM|Extract M characters, starting at position N |x04|p@ssW0rd |p@ss | |Omit range |ONM|Delete M characters, starting at position N |O12|p@ssW0rd |psW0rd | |Insert @ N |iNX|Insert character X at position N |i4! |p@ssW0rd |p@ss!W0rd | |Overwrite @ N |oNX|Overwrite character at position N with X |o3$ |p@ssW0rd |p@s$W0rd | |Truncate @ N |'N |Truncate word at position N |'6 |p@ssW0rd |p@ssW0 | |Replace |sXY|Replace all instances of X with Y |ss$ |p@ssW0rd |p@$$W0rd | |Purge |@X |Purge all instances of X |@s |p@ssW0rd |p@W0rd | |Duplicate first N|zN |Duplicate first character N times |z2|p@ssW0rd |ppp@ssW0rd | |Duplicate last N|ZN|Duplicate last character N times |Z2|p@ssW0rd |p@ssW0rddd | |Duplicate all|q|Duplicate every character |q|p@ssW0rd |pp@@ssssWW00rrdd |