Skip to content

Commit

Permalink
Download garble and bundle with assets
Browse files Browse the repository at this point in the history
  • Loading branch information
moloch-- committed Mar 5, 2021
1 parent a206478 commit 523ab54
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 20 deletions.
19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ RUN mkdir -p /home/sliver/ && chown -R sliver:sliver /home/sliver
# > Metasploit
#

RUN curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \
chmod 755 msfinstall && \
./msfinstall
RUN mkdir -p ~/.msf4/ && touch ~/.msf4/initial_setup_complete && \
su -l sliver -c 'mkdir -p ~/.msf4/ && touch ~/.msf4/initial_setup_complete'
RUN curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall \
&& chmod 755 msfinstall \
&& ./msfinstall
RUN mkdir -p ~/.msf4/ && touch ~/.msf4/initial_setup_complete \
&& su -l sliver -c 'mkdir -p ~/.msf4/ && touch ~/.msf4/initial_setup_complete'

#
# > Sliver
Expand All @@ -49,21 +49,20 @@ RUN wget -O protoc-${PROTOC_VER}-linux-x86_64.zip https://github.com/protocolbuf
&& cp -vv ./bin/protoc /usr/local/bin

RUN wget -O protoc-gen-go.tar.gz https://github.com/golang/protobuf/archive/v${PROTOC_GEN_GO_VER}.tar.gz \
&& tar xvf protoc-gen-go.tar.gz \
&& cd protobuf-${PROTOC_GEN_GO_VER} \
&& make install
&& tar xvf protoc-gen-go.tar.gz \
&& cd protobuf-${PROTOC_GEN_GO_VER} \
&& make install

# assets
WORKDIR /go/src/github.com/bishopfox/sliver
ADD ./go-assets.sh /go/src/github.com/bishopfox/sliver/go-assets.sh
RUN ./go-assets.sh

# compile - we have to run dep after copying the code over or it bitches
ADD . /go/src/github.com/bishopfox/sliver/
RUN make linux && cp -vv sliver-server /opt/sliver-server

RUN ls -lah && /opt/sliver-server unpack --force \
&& /go/src/github.com/bishopfox/sliver/go-tests.sh
&& /go/src/github.com/bishopfox/sliver/go-tests.sh
RUN make clean \
&& rm -rf /go/src/* \
&& rm -rf /home/sliver/.sliver
Expand Down
9 changes: 9 additions & 0 deletions go-assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# Creates the static go asset archives

GO_VER="1.16"
GARBLE_VER="1.16.1"

GO_ARCH_1="amd64"
GO_ARCH_2="arm64"
BLOAT_FILES="AUTHORS CONTRIBUTORS PATENTS VERSION favicon.ico robots.txt CONTRIBUTING.md LICENSE README.md ./doc ./test ./api ./misc"
Expand Down Expand Up @@ -131,6 +133,13 @@ cp -vv windows-go.zip $OUTPUT_DIR/windows/$GO_ARCH_1/go.zip
rm -rf ./go
rm -f windows-go.zip go$GO_VER.windows-$GO_ARCH_1.zip

echo "-----------------------------------------------------------------"
echo " Garble"
echo "-----------------------------------------------------------------"
curl -L --output $OUTPUT_DIR/linux/$GO_ARCH_1/garble https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_linux
curl -L --output $OUTPUT_DIR/windows/$GO_ARCH_1/garble.exe https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_windows.exe
curl -L --output $OUTPUT_DIR/darwin/$GO_ARCH_1/garble https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_macos-$GO_ARCH_1
curl -L --output $OUTPUT_DIR/darwin/$GO_ARCH_2/garble https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_macos-$GO_ARCH_2

echo "-----------------------------------------------------------------"
echo " 3rd Party Assets"
Expand Down
2 changes: 1 addition & 1 deletion implant/go-mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/bishopfox/sliver

go 1.15
go 1.16


5 changes: 0 additions & 5 deletions implant/sliver/handlers/handlers_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ package handlers
*/

import (
// {{if .Config.Debug}}

// {{else}}
// {{end}}

"github.com/bishopfox/sliver/protobuf/sliverpb"
pb "github.com/bishopfox/sliver/protobuf/sliverpb"
)
Expand Down
2 changes: 1 addition & 1 deletion server/assets/assets_darwin_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ package assets
import "embed"

var (
//go:embed fs/*.txt fs/*.zip fs/dll/*.dll fs/darwin/amd64/go.zip
//go:embed fs/*.txt fs/*.zip fs/dll/*.dll fs/darwin/amd64/*
assetsFs embed.FS
)
2 changes: 1 addition & 1 deletion server/assets/assets_darwin_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ package assets
import "embed"

var (
//go:embed fs/*.txt fs/*.zip fs/dll/*.dll fs/darwin/arm64/go.zip
//go:embed fs/*.txt fs/*.zip fs/dll/*.dll fs/darwin/arm64/*
assetsFs embed.FS
)
2 changes: 1 addition & 1 deletion server/assets/assets_linux_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ package assets
import "embed"

var (
//go:embed fs/*.txt fs/*.zip fs/dll/*.dll fs/linux/amd64/go.zip
//go:embed fs/*.txt fs/*.zip fs/dll/*.dll fs/linux/amd64/*
assetsFs embed.FS
)
2 changes: 1 addition & 1 deletion server/assets/assets_windows_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ package assets
import "embed"

var (
//go:embed fs/*.txt fs/*.zip fs/dll/*.dll fs/windows/amd64/go.zip
//go:embed fs/*.txt fs/*.zip fs/dll/*.dll fs/windows/amd64/*
assetsFs embed.FS
)

0 comments on commit 523ab54

Please sign in to comment.