-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/brun0ne/CyberChef
- Loading branch information
Showing
4 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* @author brun0ne [[email protected]] | ||
* @copyright Crown Copyright 2022 | ||
* @license Apache-2.0 | ||
*/ | ||
|
||
import Operation from "../Operation.mjs"; | ||
|
||
import cptable from "codepage"; | ||
import {runHash} from "../lib/Hash.mjs"; | ||
|
||
/** | ||
* NTLM operation | ||
*/ | ||
class NTLM extends Operation { | ||
|
||
/** | ||
* NTLM constructor | ||
*/ | ||
constructor() { | ||
super(); | ||
|
||
this.name = "NTLM"; | ||
this.module = "Crypto"; | ||
this.description = "Performs NTLM hashing on the input. It works by running MD4 on UTF16LE-encoded input. NTLM hashes are considered weak because they can be brute-forced very easily with modern hardware."; | ||
this.infoURL = "https://en.wikipedia.org/wiki/NT_LAN_Manager"; | ||
this.inputType = "string"; | ||
this.outputType = "string"; | ||
this.args = []; | ||
} | ||
|
||
/** | ||
* @param {string} input | ||
* @param {Object[]} args | ||
* @returns {string} | ||
*/ | ||
run(input, args) { | ||
const format = 1200; | ||
const encoded = cptable.utils.encode(format, input); | ||
const hashed = runHash("md4", encoded); | ||
|
||
return hashed.toUpperCase(); | ||
} | ||
} | ||
|
||
export default NTLM; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* NTLM test. | ||
* | ||
* @author brun0ne [[email protected]] | ||
* @copyright Crown Copyright 2022 | ||
* @license Apache-2.0 | ||
*/ | ||
import TestRegister from "../../lib/TestRegister.mjs"; | ||
|
||
TestRegister.addTests([ | ||
{ | ||
name: "NTLM Hashing", | ||
input: "QWERTYUIOPASDFGHJKLZXCVBNM1234567890!@#$%^&*()_+.,?/", | ||
expectedOutput: "C5FA1C40E55734A8E528DBFE21766D23", | ||
recipeConfig: [ | ||
{ | ||
op: "NTLM", | ||
args: [], | ||
}, | ||
], | ||
} | ||
]); |