-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor projects to ~/.poshc2, add posh-project script for managing …
…projects
- Loading branch information
1 parent
681d063
commit c8d7c9a
Showing
20 changed files
with
255 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
# From the Kali Linux base image | ||
FROM kalilinux/kali-rolling | ||
|
||
ENV TERM="xterm" | ||
# Update and apt install programs | ||
RUN apt-get update && apt-get full-upgrade -y && apt-get autoremove -y && apt-get install -y git | ||
RUN apt-get update && apt-get full-upgrade -y && apt-get autoremove -y | ||
RUN apt-get install -y curl gnupg | ||
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | ||
RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/dotnetdev.list | ||
RUN apt-get update | ||
RUN apt-get install -y git screen python3 python3-dev python3-pip build-essential mingw-w64-tools mingw-w64 mingw-w64-x86-64-dev mingw-w64-i686-dev mingw-w64-common espeak graphviz mono-complete apt-transport-https vim nano python2.7 libpq-dev sudo sqlite3 dotnet-runtime-2.2 dotnet-hostfxr-2.2 dotnet-host libssl1.1 libicu63 | ||
|
||
# Install PoshC2 | ||
# Install PoshC2 | ||
ADD . /opt/PoshC2 | ||
RUN /opt/PoshC2/Install.sh | ||
RUN /opt/PoshC2/Install.sh | ||
|
||
# Working directory | ||
WORKDIR /opt/PoshC2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
#!/bin/bash | ||
|
||
if [[ -z "${POSHC2_DIR}" ]]; then | ||
POSH_DIR="/opt/PoshC2" | ||
else | ||
POSH_DIR=${POSHC2_DIR} | ||
POSH_PROJECT=`cat $HOME/.poshc2/CURRENT_PROJECT 2>/dev/null` | ||
if [ -z "$POSH_PROJECT" ]; then | ||
echo "No PoshC2 project set, please run posh-project" | ||
exit 1 | ||
fi | ||
|
||
POSH_PROJECT_DIR="$HOME/.poshc2/$POSH_PROJECT" | ||
if [ ! -d "$POSH_PROJECT_DIR" ]; then | ||
echo "No PoshC2 project directory, please run posh-project" | ||
exit 1 | ||
fi | ||
|
||
if [[ "$EDITOR" != "" ]]; then | ||
sudo $EDITOR "$POSH_DIR/config.yml" | ||
sudo $EDITOR "$POSH_PROJECT_DIR/config.yml" | ||
elif [[ "$*" == *"--nano"* ]]; then | ||
sudo nano "$POSH_DIR/config.yml" | ||
sudo nano "$POSH_PROJECT_DIR/config.yml" | ||
else | ||
sudo vim "$POSH_DIR/config.yml" | ||
sudo vim "$POSH_PROJECT_DIR/config.yml" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
#!/bin/bash | ||
|
||
if [[ -z "${POSHC2_DIR}" ]]; then | ||
POSH_DIR="/opt/PoshC2" | ||
else | ||
POSH_DIR="${POSHC2_DIR}" | ||
fi | ||
|
||
POSH_PROJECT_DIR=`cat $POSH_DIR/config.yml | grep "PoshProjectDirectory: " | cut -d "\"" -f 2` | ||
|
||
if [[ ! -d "$POSH_PROJECT_DIR" ]]; then | ||
sudo mkdir -p "$POSH_PROJECT_DIR" | ||
fi | ||
|
||
sudo -E docker run -ti --rm -v "$POSH_PROJECT_DIR:$POSH_PROJECT_DIR" -v "$POSH_DIR:$POSH_DIR" -e POSHC2_DIR="${POSH_DIR}" nettitude/poshc2 /usr/bin/posh "$@" | ||
sudo -E docker run -ti --rm -v "$HOME/.poshc2:/root/.poshc2" m0rv4i/poshc2 /usr/bin/posh "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,4 @@ | ||
#!/bin/bash | ||
|
||
if [[ "$1" -ne "" ]]; then | ||
port="$1" | ||
else | ||
port="443" | ||
fi | ||
|
||
if [[ -z "${POSHC2_DIR}" ]]; then | ||
POSH_DIR="/opt/PoshC2" | ||
else | ||
POSH_DIR="${POSHC2_DIR}" | ||
fi | ||
|
||
POSH_PROJECT_DIR=`cat $POSH_DIR/config.yml | grep "PoshProjectDirectory: " | cut -d "\"" -f 2` | ||
|
||
if [[ ! -d "$POSH_PROJECT_DIR" ]]; then | ||
mkdir -p "$POSH_PROJECT_DIR" | ||
fi | ||
|
||
sudo -E docker run -ti --rm -v "$POSH_PROJECT_DIR:$POSH_PROJECT_DIR" -v "$POSH_DIR:$POSH_DIR" -e POSHC2_DIR="${POSH_DIR}" nettitude/poshc2 /bin/bash | ||
sudo -E docker run -ti --rm -v "$HOME/.poshc2:/root/.poshc2" m0rv4i/poshc2 /bin/bash | ||
|
Oops, something went wrong.