-
Notifications
You must be signed in to change notification settings - Fork 154
Using Custom Wordlists Rules
NPK supports the use of custom wordlists & rules, but requires you to deploy the supporting infrastructure and use provided scripts in order to do so.
The terraform-selfhost
directory contains all the artifacts you'll use to host your own wordlists and rules files, and uses the same terraform/npk-settings.json
configuration file to get the necessary information. Simply running ./deploy-selfhost.sh
from the terraform-selfhost
directory will provision the necessary components.
npk/terraform-selfhost$ ./deploy-selfhost.sh
This will create the buckets you'll use to store your custom files, and will overwrite the config files in the terraform
directory telling NPK to use self-hosted locations instead of the community-hosted ones. To complete the transition, it will automatically execute terraform/deploy.sh
from the terraform
directory on your behalf, which will push the changes to your current deployment.
When you first switch to self-hosted storage, NPK will automatically sync the community buckets with your newly-created ones, after which you can add new files as you see fit. This is done using the upload_npkfile.sh
script. The syntax is as follows:
upload_npkfile.sh <wordlist|rules> <file> [awscli options...]
Here are a couple examples of its use, assuming that your AWSCLI profile for NPK is 'npk':
# Upload a wordlist
npk/terraform-selfhost$ ./upload_npkfile.sh wordlist ~/Downloads/Top-1M.txt --profile npk
# Upload a rules file
npk/terraform-selfhost$ ./upload_npkfile.sh rules ~/Downloads/d3adh0b0.txt --profile npk
There are a few rules you should follow when uploading wordlists and rules files:
- Uploaded files must be simple text documents, one entry per line.
- You can't rename the files after they're uploaded (at least, not easily), and the filename minus the extension is what is shown in the UI, so make sure the filename is representative of the file before you upload it. For example, uploading 'd3adh0b0.txt' will create an entry called
d3adh0b0
.
If you'd like to switch back to the community-hosted buckets, simply run the ./switch_to_community_buckets.sh
script in the terraform-selfhost
folder. Accepting the accompanying warning prompt will reset your NPK installation to use the community-hosted buckets, and immediately affect a deployment on your NPK installation to cause the changes to take effect.