Skip to content

Step by step Installation

Brad Woodward edited this page Mar 27, 2022 · 8 revisions

NPK Installation

NPK was built to be easy to install, but it still has a lot of moving parts that can take a little effort to get working just right. Here's a full breakdown of all the steps needed to get NPK fully up and running for production workloads.

Cloudshell deployment (easiest)

To get started, log into the AWS account that you want to deploy NPK to, and click the AWS CloudShell icon in the top right corner.

cloudshell_icon

This will open a web-based terminal that you will use. It may take 2-3 minutes to start, but once it does, paste or type the following command into the terminal:

source <(curl https://npkproject.io/cloudshell_install.sh)

cloudshell_oneliner

Your CloudShell will install all the prerequisites and kick off the interactive setup. Fill in the details based on how you'd like your deployment configured, and then enter 'Y' when asked if you want to deploy immediately. When finished, you'll be dropped to a custom prompt that you can use to interact with NPK:

deployed_prompt

(If you hit 'no', or need to deploy again later, you can do so with npm run deploy)

After configuring interactively, NPK takes about 20 minutes to deploy on average, but you'll receive an email afterward with the link to your deployment, as well as the credentials for the first user. Note that when changing your password after first login, the password must be at least 12 characters long.

Manual deployment (harder)

  1. Install node.js 17 or higher, cmake 3 or higher, a C++ compiler compatible with your distribution.
  2. Clone the repo. We'll refer to the cloned folder as the npk folder.
  3. Inside the npk folder, run npm install
  4. Configure your AWS credential source so that aws sts get-caller-identity shows the account you want to use.
  5. Run npm run deploy.

You are permitted zero GPU spot instances across all types and regions

By default, AWS is very restrictive about the number of GPU-powered instances you can run on new accounts. NPK will check your current account limits during deployment, and you may be told to increase to your limits. You can submit an instance limit raise request following link: https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-ec2-spot-instances

limit_raise_request

**Note: ** As of December 2021, many limit raise requests are being rejected even for very minimal increases. If you are attempting to deploy NPK for a company, you can often get better results by engaging your AWS account manager to advocate on your behalf.

You'll receive an email from AWS when the request has been processed. Once the limit has been raised, you'll need to re-run the installation script (there's no need to destroy your environment first) to pick up your new limits.

Creating Campaigns

Campaigns in NPK are particularly easy to assemble and give you a great deal of control over how your hash cracking is run, but it's important to assemble your campaigns correctly. There are a few things you should be aware of before you begin.

Wordlist attacks

To include dictionary and rule files in your attack, click 'Enable' next to Wordlist Attacks when creating your campaign. If enabled, you MUST select a dictionary file, but rule files are optional. Rules have a multiplicative effect on the keyspace, which means they can substantially increase the duration of the campaign. The estimated duration will reflect this appropriately.

Mask attacks

Mask attacks can be used alone or in combination with wordlist attacks. To build your target mask, click the buttons to add the desired mask character to the list. When used with a wordlist, these characters will be APPENDED to candidates generated by the wordlist/rule attacks.

Manual Arguments and Custom Masks

New in NPK v2, you can specify custom arguments and directly provide masks without using the mask builder. While arguments can be combined with other attack types, a manual mask can only be executed independently. Since this can fundamentally alter how Hashcat runs, a field at the bottom shows the exact command that NPK will run. Before using a new argument or mask for the first time, it is strongly recommended that you copy/paste the 'Cracking Command' into a local terminal to verify that there are no errors.

Image

Target Hash Files

In order for NPK to properly use hash files, each file must ONLY contain one type of hash, with one hash per line.

The most common mistake folks make is uploading files in 'username:hash' format. NPK doesn't allow this. Each line must be the hash alone, exactly as shown on the hashcat site: https://hashcat.net/wiki/doku.php?id=example_hashes

Campaign coverage

While building your campaign, the estimated attack duration under 'Attack Breakdown' will update automatically. It's important to keep this in mind when building your campaign, since you don't want to end your cracking job early. It's better to let a simpler campaign complete than to stop a more sophisticated campaign before it's finished.

Keep in mind that these durations are estimates. It's recommended that you always resource your campaigns to 200% coverage. NPK will stop if the campaign finishes early, but you can't resume the campaign if you run out of time.

Viewing results

Immediately after a campaign starts, the cracking nodes will start posting results to the 'File Management' page.

Image

'cracked-hashes' contains hashes where plaintext values were recovered. 'debug.log' contains the detailed logging from the cracking node. If there are any errors with your hash file or campaign configuration which cause the node to fail, they will show up at the very bottom of this file.