Update to 0.4.5 and other changes

This commit is contained in:
Wes Lambert
2020-07-07 02:07:01 +00:00
parent 45631ee114
commit 4372f0569a
3 changed files with 42 additions and 26 deletions

View File

@@ -1,23 +1,21 @@
FROM ubuntu:18.04 FROM ubuntu:18.04
LABEL version="Velociraptor v0.3.9" LABEL version="Velociraptor v0.4.5"
LABEL description="Velociraptor server in a Docker container" LABEL description="Velociraptor server in a Docker container"
LABEL maintainer="Wes Lambert, @therealwlambert" LABEL maintainer="Wes Lambert, @therealwlambert"
ENV VERSION="0.3.9" ENV VERSION="0.4.5"
COPY ./entrypoint . COPY ./entrypoint .
RUN chmod +x entrypoint && \ RUN chmod +x entrypoint && \
apt-get update && \ apt-get update && \
apt-get install -y wget && \ apt-get install -y wget && \
mkdir -p /velociraptor && \ # Create dirs for Velox binaries
mkdir -p /velociraptor/clients/linux && \ mkdir -p /opt/velociraptor && \
mkdir -p /velociraptor/clients/mac && \ for i in linux mac windows; do mkdir -p /opt/velociraptor/$i; done && \
mkdir -p /velociraptor/clients/windows && \ # Get Velox binaries
wget -O /velociraptor/velociraptor https://github.com/Velocidex/velociraptor/releases/download/v$VERSION/velociraptor-v$VERSION-linux-amd64 && \ wget -O /opt/velociraptor/linux/velociraptor https://github.com/Velocidex/velociraptor/releases/download/v$VERSION/velociraptor-v$VERSION-linux-amd64 && \
chmod +x /velociraptor/velociraptor && \ wget -O /opt/velociraptor/mac/velociraptor_client https://github.com/Velocidex/velociraptor/releases/download/v$VERSION/velociraptor-v$VERSION-darwin-amd64 && \
cp /velociraptor/velociraptor /velociraptor/clients/linux/velociraptor_client && \ wget -O /opt/velociraptor/windows/velociraptor_client.exe https://github.com/Velocidex/velociraptor/releases/download/v$VERSION/velociraptor-v$VERSION-windows-amd64.exe && \
wget -O /velociraptor/clients/mac/velociraptor_client https://github.com/Velocidex/velociraptor/releases/download/v$VERSION/velociraptor-v$VERSION-darwin-amd64 && \ # Clean up
wget -O /velociraptor/clients/windows/velociraptor_client.exe https://github.com/Velocidex/velociraptor/releases/download/v$VERSION/velociraptor-v$VERSION-windows-amd64.exe && \ apt-get remove -y --purge wget && \
chmod -R +x /velociraptor/clients && \
apt-get clean apt-get clean
WORKDIR /velociraptor WORKDIR /velociraptor
CMD ["/entrypoint"] CMD ["/entrypoint"]

View File

@@ -1,11 +1,14 @@
version: '2' version: '2'
services: services:
velox: velox:
container_name: velociraptor container_name: velox
image: wlambert/velociraptor image: wlambert/velociraptor
#build:
# context: ./
# dockerfile: Dockerfile
volumes: volumes:
- ./velociraptor/:/velociraptor/:rw - ./velociraptor:/velociraptor/:rw
- ./entrypoint:/entrypoint:ro #- ./entrypoint:/entrypoint:ro
ports: ports:
- "8000:8000" - "8000:8000"
- "8889:8889" - "8889:8889"

View File

@@ -1,22 +1,37 @@
#!/bin/bash #!/bin/bash
VERSION="0.3.9" #VERSION="0.4.5"
BIND_ADDRESS="0.0.0.0" BIND_ADDRESS="0.0.0.0"
PUBLIC_PATH="public" PUBLIC_PATH="public"
LOG_DIR="." LOG_DIR="."
SERVER_URL="https://velociraptor:8000/" SERVER_URL="https://VelociraptorServer:8000/"
USER="admin" USER="admin"
PASSWORD="admin" PASSWORD="admin"
DATASTORE_LOCATION="." ROLE="administrator"
FILESTORE_DIRECTORY="." DATASTORE_LOCATION="./"
FILESTORE_DIRECTORY="./"
CLIENT_DIR="/velociraptor/clients"
# Move binaries into place
cp /opt/velociraptor/linux/velociraptor . && chmod +x velociraptor
mkdir -p $CLIENT_DIR/linux && cp /opt/velociraptor/linux/velociraptor /velociraptor/clients/linux/velociraptor_client
mkdir -p $CLIENT_DIR/mac && mv /opt/velociraptor/mac/velociraptor_client /velociraptor/clients/mac/velociraptor_client
mkdir -p $CLIENT_DIR/windows && mv /opt/velociraptor/windows/velociraptor_client.exe /velociraptor/clients/windows/velociraptor_client.exe
# If no existing server config, set it up
if [ ! -f server.config.yaml ]; then if [ ! -f server.config.yaml ]; then
./velociraptor config generate > server.config.yaml --merge '{"Frontend": {"public_path":"'$PUBLIC_PATH'"}, "API": { "bind_address": "'$BIND_ADDRESS'" }, "GUI": { "bind_address": "'$BIND_ADDRESS'"}, "Monitoring": {"bind_address": "'$BIND_ADDRESS'" }, "Logging": {"output_directory":"'$LOG_DIR'","separate_logs_per_component": true, "Client": { "server_urls": ["'$SERVER_URL'"]}, "Datastore": {"location": "'$DATASTORE_LOCATION'", "filestore_directory": "'$FILESTORE_DIRECTORY'"}}}' ./velociraptor config generate > server.config.yaml --merge '{"Frontend":{"public_path":"'$PUBLIC_PATH'"},"API":{"bind_address":"'$BIND_ADDRESS'"},"GUI":{"bind_address":"'$BIND_ADDRESS'"},"Monitoring":{"bind_address":"'$BIND_ADDRESS'"},"Logging":{"output_directory":"'$LOG_DIR'","separate_logs_per_component":true},"Client":{"server_urls":["'$SERVER_URL'"],"use_self_signed_ssl":true}, "Datastore":{"location":"'$DATASTORE_LOCATION'", "filestore_directory":"'$FILESTORE_DIRECTORY'"}}'
sed -i "s#https://localhost:8000/#$SERVER_URL#" server.config.yaml sed -i "s#https://localhost:8000/#$SERVER_URL#" server.config.yaml
sed -i 's#/tmp/velociraptor#.#'g server.config.yaml sed -i 's#/tmp/velociraptor#.#'g server.config.yaml
./velociraptor --config server.config.yaml user add $USER $PASSWORD ./velociraptor --config server.config.yaml user add $USER $PASSWORD --role $ROLE
./velociraptor --config server.config.yaml config client > client.config.yaml
./velociraptor config repack --exe clients/windows/velociraptor_client.exe client.config.yaml clients/windows/velociraptor_client_repacked.exe
fi fi
cd /velociraptor
#/bin/bash # Re-generate client config in case server config changed
./velociraptor --config server.config.yaml config client > client.config.yaml
# Repack clients
./velociraptor config repack --exe clients/linux/velociraptor_client client.config.yaml clients/linux/velociraptor_client_repacked
./velociraptor config repack --exe clients/mac/velociraptor_client client.config.yaml clients/mac/velociraptor_client_repacked
./velociraptor config repack --exe clients/windows/velociraptor_client.exe client.config.yaml clients/windows/velociraptor_client_repacked.exe
# Start Velocoraptor
./velociraptor --config server.config.yaml frontend -v ./velociraptor --config server.config.yaml frontend -v