posh-project -g will quietly print the full path to the project directory (useful for scripting):
# posh-project -g
/var/poshc2/domaincheck
For example, the install scripts now suggest adding the following to the bottom of your .zshrc or .bashrc file so you can use posh-dir to automatically cd to the current posh project directory:
# tail ~/.zshrc
function posh-dir(){
cd `posh-project -g`
}
# posh-dir
drwxrwxrwx - root 3 Nov 15:41 .
drwxr-xr-x - root 3 Nov 14:16 ..
drwxrwxrwx - root 3 Nov 15:00 downloads
drwxrwxrwx - root 3 Nov 15:01 payloads
drwxrwxrwx - root 3 Nov 15:00 reports
.rwxrwxrwx 80 root 3 Nov 15:39 .implant-history
.rwxrwxrwx 35 root 3 Nov 15:39 .top-history
.rwxrwxrwx 1.6k root 3 Nov 14:26 config.yml
.rwxrwxrwx 1.2k root 3 Nov 15:01 posh.crt
.rwxrwxrwx 1.7k root 3 Nov 15:01 posh.key
.rwxrwxrwx 18k root 3 Nov 15:41 poshc2_server.log
.rwxrwxrwx 106k root 3 Nov 15:41 PowershellC2.SQLite
.rwxrwxrwx 9.3k root 3 Nov 15:01 quickstart.txt
.rwxrwxrwx 3.2k root 3 Nov 15:00 rewrite-rules.txt
.rwxrwxrwx 201k root 3 Nov 15:42 webserver.log
(You have to add this to the shell init file as a function as scripts run in their own process, so changing directory has no affect on the actual current shell).
posh-project -l
now highlights which project is in use with an asterisk:posh-project -g
will quietly print the full path to the project directory (useful for scripting):For example, the install scripts now suggest adding the following to the bottom of your .zshrc or .bashrc file so you can use
posh-dir
to automaticallycd
to the current posh project directory:(You have to add this to the shell init file as a function as scripts run in their own process, so changing directory has no affect on the actual current shell).