nodejsnpm
- before each git commit, run
npm run lintfrom thepentester-appfolder and attempt to cleanup any errors and warnings- linting will change the code so you'll likely need to
git add . ../again
- linting will change the code so you'll likely need to
- git branching isn't necessary as this is a small project. working off main is just fine. use a resonably descriptive git commit message and all is well.
sudo mkdir -p /usr/local/n
sudo chown -R $(whoami) /usr/local/n
sudo mkdir -p /usr/local/bin /usr/local/lib /usr/local/include /usr/local/share
sudo chown -R $(whoami) /usr/local/bin /usr/local/lib /usr/local/include /usr/local/share
curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n | bash -s lts
node --version
npm --version
cd pentester-app
npm install
# to update the assets required for selecting an http file to download:
# the path is an absolute path to the given location of pentesting tools that might be useful to serve over http for downloading
# on a target machine.
npm run dirtree -- '/home/kali/oscp/tools'
npm run dev
src/assets/commands.json contains the information for the commands available on the Tools page. To add or edit is mostly the same process, however a few things should be known up front.
- The web app
New Commandui does NOT write to thecommands.jsonfile. That must be done from a terminal (suggest using./json.sh). - The New Command ui has limited validation of input data. This will improve over time. Until then, consider what each value is intended for and read the relevant help section.
- To save any changes you must add the new json element to the
commands.jsonbase array, or overwrite an existing element. - Manual editing of
commands.jsondata is not suggested as the New Command ui works quite well. Be sure to test any edits before making a PR so that the entire app isn't broken due to poorly formatted json.
Here are some helpful commands for various tasks relating to updating the json.
# consider installing jq for json processing, this is not a default on kali
sudo apt install jq
# source code base directory
cd pentester-app
# using the custom json.sh script, learn about it's options via help.
# NOTE: this script mostly uses the clipboard via the xclip utility.
# this means that it flows nicely with the New Command tool by coping the new/updated json
# and then running ./json.sh with the appropriate flag.
./json.sh -h
Goal: using the existing commands, update the file-enumeration commands.
# start by finding the index of the file enumeration commands by searching for 'enum'
./json.sh -f enum
# this returns:
# "4 file-+-smb-enumeration"
#
# The '4' indicates the index, which is needed for the next commands
# copy the json (at index 4) into the clipboard
./json.sh -c 4
# goto the web browser, to the New Command section of this web app and paste the json into the textfield
# when editing is finished, copy the json from the New Command json textfield, then:
# this will insert the json into the index 4 (index of the file enumeration commands)
./json.sh -i 4
Goal: Create a new command and add it to the json properly
# start by creating the json in the web app via the New Command ui
# copy the json with the copy button on the New Command page, then:
# this will append the current clipboard json to the commands.json if it's valid json data.
./json.sh -a