Skip to content

Commit

Permalink
If on Mac then docker volume is under /private
Browse files Browse the repository at this point in the history
  • Loading branch information
riskydissonance committed Aug 17, 2020
1 parent e9c4382 commit e6934e4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
11 changes: 9 additions & 2 deletions Install-for-Docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,15 @@ chmod +x /usr/local/bin/posh-docker-clean
chmod +x /usr/local/bin/posh-stop-server
chmod +x /usr/local/bin/posh-docker-debug

mkdir -p "/var/poshc2"
curl https://raw.githubusercontent.com/nettitude/PoshC2/$GIT_BRANCH/resources/config-template.yml -o "/var/poshc2/config-template.yml" >/dev/null

if [ "$(uname)" == "Darwin" ]; then
POSH_PROJECTS_DIR="/private/var/poshc2"
else
POSH_PROJECTS_DIR="/var/poshc2"
fi

mkdir -p "$POSH_PROJECTS_DIR"
curl https://raw.githubusercontent.com/nettitude/PoshC2/$GIT_BRANCH/resources/config-template.yml -o "$POSH_PROJECTS_DIR/config-template.yml" >/dev/null
curl https://raw.githubusercontent.com/nettitude/PoshC2/$GIT_BRANCH/resources/scripts/poshc2.service -o /lib/systemd/system/poshc2.service >/dev/null

echo ""
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ You can also run PoshC2 using Docker, this allows more stable and running and en

The Docker install does not clone PoshC2 as the PoshC2 images on Docker Hub are used, so only a minimal install of some dependencies and scripts are performed.

To start with, install Docker on the host and then add the PoshC2 projects directory to Docker as a shared directory if required for your OS. By default this is **/var/poshc2** on *nix.
To start with, install Docker on the host and then add the PoshC2 projects directory to Docker as a shared directory if required for your OS. By default this is **/var/poshc2** on *nix and **/private/var/poshc2** on Mac.

### Kali based hosts

Expand Down
6 changes: 5 additions & 1 deletion resources/scripts/_posh-common
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash

get_posh_projects_dir(){
POSH_PROJECTS_DIR="/var/poshc2"
if [ "$(uname)" == "Darwin" ]; then
POSH_PROJECTS_DIR="/private/var/poshc2"
else
POSH_PROJECTS_DIR="/var/poshc2"
fi
}

get_docker_posh_projects_dir(){
Expand Down
2 changes: 1 addition & 1 deletion resources/scripts/posh-project
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ elif [ "$1" == "-l" ]; then
fi

echo "[*] Listing PoshC2 Projects in $POSH_PROJECTS_DIR"
command ls -dl /var/poshc2/*/ 2>/dev/null | cut -d '/' -f 4
command ls -dl $POSH_PROJECTS_DIR/*/ 2>/dev/null | cut -d '/' -f 4

elif [ "$1" == "-c" ]; then

Expand Down

0 comments on commit e6934e4

Please sign in to comment.