Setting up npm package

This commit is contained in:
moloch--
2020-05-03 13:06:39 -05:00
commit 5c623d5abf
10 changed files with 6102 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
lib
src/pb
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
*.swp
pids
logs
results
tmp
# Build
public/css/main.css
# Coverage reports
coverage
# API keys and secrets
.env
# Dependency directory
node_modules
bower_components
# Editors
.idea
*.iml
# OS metadata
.DS_Store
Thumbs.db
# Ignore built ts files
dist/**/*
# ignore yarn.lock
yarn.lock
+5
View File
@@ -0,0 +1,5 @@
[submodule "sliver"]
path = sliver
url = https://github.com/BishopFox/sliver
[submodule "Submod"]
branch = grpc
+6
View File
@@ -0,0 +1,6 @@
src
sliver
tsconfig.json
tslint.json
protobuf.sh
View File
+5945
View File
File diff suppressed because it is too large Load Diff
+35
View File
@@ -0,0 +1,35 @@
{
"name": "sliver-script",
"version": "1.0.0",
"description": "TypeScript/JavaScript Sliver client library",
"main": "index.js",
"scripts": {
"build": "./protobuf.sh && tsc",
"test": "echo \"Error: no test specified\" && exit 1"
},
"prepublishOnly" : "npm test && npm run lint",
"files": [
"lib/**/*"
],
"keywords": [],
"author": "moloch",
"license": "GPLv3",
"repository": {
"type": "git",
"url": "https://github.com/moloch--/sliver-script"
},
"devDependencies": {
"@types/jest": "^25.2.1",
"grpc-tools": "^1.8.1",
"jest": "^25.5.4",
"ts-jest": "^25.4.0",
"ts-protoc-gen": "^0.12.0",
"typescript": "^3.8.3"
},
"dependencies": {
"@improbable-eng/grpc-web": "^0.12.0",
"@types/google-protobuf": "^3.7.2",
"google-protobuf": "^3.11.4",
"grpc": "^1.24.2"
}
}
Executable
+54
View File
@@ -0,0 +1,54 @@
#!/bin/bash
# Sliver Implant Framework
# Copyright (C) 2019 Bishop Fox
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Path to this plugin
PROTOC_GEN_TS_PATH="./node_modules/.bin/protoc-gen-ts"
PROTOC_GEN_GRPC_PATH="./node_modules/.bin/grpc_tools_node_protoc_plugin"
OUT_DIR="./src/pb"
# Directory to write generated code to (.js and .d.ts files)
mkdir -p ./src/pb
protoc \
-I sliver/protobuf \
--plugin="protoc-gen-ts=${PROTOC_GEN_TS_PATH}" \
--js_out="import_style=commonjs,binary:${OUT_DIR}" \
--ts_out="${OUT_DIR}" \
sliver/protobuf/commonpb/common.proto
protoc \
-I sliver/protobuf \
--plugin="protoc-gen-ts=${PROTOC_GEN_TS_PATH}" \
--js_out="import_style=commonjs,binary:${OUT_DIR}" \
--ts_out="${OUT_DIR}" \
sliver/protobuf/sliverpb/sliver.proto
protoc \
-I sliver/protobuf \
--plugin="protoc-gen-ts=${PROTOC_GEN_TS_PATH}" \
--js_out="import_style=commonjs,binary:${OUT_DIR}" \
--ts_out="${OUT_DIR}" \
sliver/protobuf/clientpb/client.proto
protoc \
-I sliver/protobuf \
--plugin="protoc-gen-ts=${PROTOC_GEN_TS_PATH}" \
--plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \
--js_out="import_style=commonjs,binary:${OUT_DIR}" \
--ts_out="service=grpc-node:${OUT_DIR}" \
--grpc_out="${OUT_DIR}" \
sliver/protobuf/rpcpb/services.proto
Submodule
+1
Submodule sliver added at 3599c0a7ea
View File
+11
View File
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": true,
"outDir": "./lib",
"strict": true
},
"include": ["src"],
"exclude": ["node_modules", "**/__tests__/*"]
}