Skip to content

Installation

Eoghan West edited this page Sep 29, 2024 · 15 revisions

This document covers in-depth installation instructions.

Install Methods

NOTE: Before the use of PenTestDB, please install PostgreSQL either on your local machine or on a remote host (that you can access over the network). ensure that you can access the PostgreSQL instance from the machine you're running PenTestDB on.

  • Source (will work on any Linux system with cargo)
  • Arch Package (will only work on Arch and Arch-based systems)
  • AUR (will only work on Arch and Arch-based systems)
  • Crates.io (will work on any Linux system with cargo)
  • Cargo + Git (will work on any Linux system with cargo)
  • Release Page (will work for Arch and Debian-based systems)
  • Nix OS (how to install on NixOS)

Install From Source

  1. Clone the repo & cd into the progect root: git clone https://github.com/calacuda/PenTestDB.git && cd PenTestDB.
  2. Investigate and then run the install script: cat install.sh, then ./install.sh. (One can also do this manually if updating from an older version.)
  3. Add a line to source the ptdb_start.sh file from you .bashrc or .zshrc. how you do this will depend on you're system and shell configuration. If you installed PenTestDB with the install script then you'd need to add the line, source ~/.ptdb_start.sh to your shells rc file.
  4. While you're editing your shells' rc file, ensure that your cargo install directory is in your path. By default cargo installs binaries to, ~/.cargo/bin/. If the install script ran successfully then cargo's install dir is likely already in your path variable, but might as well double-check.
  5. Proced to [Ensure installation success](#ensure installation success) to verify that everything installed correctly.

Install From Custom Arch Repo

NOTE: This will only work on Arch Linux and Arch-based systems (BlackArch, Manjaro, EndeavourOS, etc.)

  1. Go here here and follow the instructions to add that repository to your packman.conf file.
  2. Install the pentestdb-git package: sudo pamcan -Syu pentestdb-git
  3. Copy the start script to your home directory: cp /etc/skel/.ptdb_start.sh ~/.ptdb_start.sh
  4. Copy the user config folder to your home directory: cp -r /etc/skel/.config/ptdb/ ~/.config/
  5. You should change the owning user and group to your user and group for the above files: chown USER:GROUP ~/.ptdb_start.sh; chown -R USER:GROUP ~/.config/ptdb/
  6. Proced to Ensure installation success to verify that everything installed correctly.

Install From AUR

The package is called pentest-db-git, and can be installed with your favorite AUR helper. Ex: paru -Syu pentest-db-git.

Install From Crates.io

Crates.io is the rust package repository. PenTestDB has not yet been packaged and uploaded to it, but this is planned.

Install With Cargo (GitHub)

The advantage of this method is that it makes updating the binary easy.

  1. Install with cargo: cargo install --git https://github.com/calacuda/PenTestDB.git
  2. Make the config files in the right location. (you can manually copy the defaults from this Wiki, or clone the repo and run the install script.)

Install From Package

NOTE: I have not yet started to ship prebuilt packages in the release tab. This section is here for the future

  1. Go to the releases tab on GitHub and download the package for your system.
  2. Install with the appropriate package manager.
  3. Proced to ensure installation success to verify that everything installed correctly.

Ensure Installation Success

Run: ptdb info then ptdb query -s ip -f hosts. If you have installed PenTestDB on your machine in the past then you know what to expect. However, if this is the first time you've installed and used PenTestDB then the output should look something like this:

$> ptdb info
database name    =>  SAMPLE-ENGAGEMENT
database host    =>  database.home
engage complete  =>  false
active status    =>  global: active | local: active
$> ptdb query -s ip -f hosts
[ERROR] could not query database. got error:
sql query returned no results :(

Install on NixOS

WIP