dependabot[bot] 4ff3c584e8 Bump actions/checkout from 1 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 1 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v1...v3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-05 18:14:42 +00:00
2022-09-05 18:14:42 +00:00
2022-07-15 10:53:58 -07:00
2022-09-05 11:06:40 -07:00
2022-09-05 11:07:26 -07:00
2022-09-05 11:07:26 -07:00
2020-05-03 13:06:39 -05:00
2020-06-15 16:47:14 -05:00
2020-05-03 13:15:26 -05:00
2020-11-02 09:51:38 -06:00
2022-02-13 13:03:47 -06:00

Sliver Script

Sliver-script is a TypeScript/JavaScript client library for Sliver, it can be used to automate any operator interaction with Sliver. Sliver-script uses existing Sliver client configuration files and connects to servers using gRPC over Mutual-TLS. It also provides RxJS abstractions for easy interactions with real-time components.

⚠️ Support for Sliver v1.5+ is a work in progress.

NPM Publish License: GPL v3

Install

Node v14 or later is required for this package, and it can be installed via npm:

npm install sliver-script

TypeScript Example

Basic

import { SliverClient, ParseConfigFile } from 'sliver-script'

(async function() {
    
    const config = await ParseConfigFile('./moloch_localhost.cfg')
    const client = new SliverClient(config)

    console.log(`Connecting to ${client.host()} ...`)
    await client.connect()

    const sessions = await client.sessions()
    console.log(sessions)

})()

Monitor Events in Real-time

import { SliverClient, ParseConfigFile } from 'sliver-script'

(async function() {

    const config = await ParseConfigFile('./moloch_localhost.cfg')

    const client = new SliverClient(config)
    await client.connect()
    client.event$.subscribe((event) => {
        console.log(event)
    })

})()

Automatically Interact with New Sessions

import { SliverClient, ParseConfigFile } from 'sliver-script'


(async function() {

    const config = await ParseConfigFile('moloch_localhost.cfg')
    const client = new SliverClient(config);
    await client.connect()

    console.log('Waiting for new sessions ...')
    client.session$.subscribe(async (event) => {
        console.log(`New session #${event.getSession().getId()}!`)
        const session = await client.interactWith(event.getSession())
        const ls = await session.ls()
        console.log(`Path: ${ls.getPath()}`)
        ls.getFilesList().forEach(file => {
            console.log(`Name: ${file.getName()} (Size: ${file.getSize()})`)
        })
    })

})()

JavaScript Example

const sliver = require('sliver-script')

(async function() { 

    const config = await sliver.ParseConfigFile('./moloch_localhost.cfg')
    const client = new sliver.SliverClient(config)
    await client.connect()

    console.log('Waiting for new sessions ...')

    client.session$.subscribe(async (event) => {

        console.log(`New session #${event.getSession().getId()}!`)

        const session = await client.interactWith(event.getSession())
        const ls = await session.ls()
        console.log(`Path: ${ls.getPath()}`)
        ls.getFilesList().forEach(file => {
            console.log(`Name: ${file.getName()} (Size: ${file.getSize()})`)
        })
        
    })

})()
S
Description
Automated archival mirror of github.com/moloch--/sliver-script
Readme Multiple Licenses 2.9 MiB
Languages
TypeScript 98.7%
JavaScript 1.2%
Shell 0.1%