Coder Social home page Coder Social logo

lmangani / stenoread.js Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 1.0 118 KB

Stenographer API packet reader + proxy in Node, piping out steaming hot PCAP data

JavaScript 82.04% HTML 17.96%
stenographer packet-capture nodejs reader stenoread pcap packet-sniffer node pcap-files time-machine

stenoread.js's Introduction

Stenographer API packet reader in Node, piping out steaming hot PCAP data


Requirements

  • stenographer
    • configuration in /etc/stenographer/config
    • pem certificates in certPath (optional)
  • nodejs 14-16.x

Setup

npm install -g stenoread

CLI Usage

stenoread.js "port 5060 and after 1m ago" | tshark -r /dev/stdin

WEB/API Usage

A simple UI can be served to run http/s queries via web (optional certPath)

stenoserve.js --port 443 --token 1234pcap --certPath /etc/letsencrypt/live/my.domain

Service Usage

Serve and manage the API as a system service using pm2

npm install -g stenoread pm2
pm2 start stenoserve.js -- --port `9069 --token 1234pcap
pm2 save
pm2 startup

Usage Examples

     _                     __                _    _     
 ___| |_ ___ _ __   ___   /__\ ___  __ _  __| |  (_)___ 
/ __| __/ _ \ '_ \ / _ \ / \/// _ \/ _` |/ _` |  | / __|
\__ \ ||  __/ | | | (_) / _  \  __/ (_| | (_| |_ | \__ \
|___/\__\___|_| |_|\___/\/ \_/\___|\__,_|\__,_(_)/ |___/
                                               |__/     
                                               
Query Usecase
host 8.8.8.8 Single IP address (hostnames not allowed)
net 10.0.0.0/8 Network with CIDR
port 23 Port number (UDP or TCP)
icmp Specific protocol
before 2019-04-01T11:05:00Z Packets before a specific time (UTC)
after 2019-04-01T11:05:00-0700 Packets after a specific time (with TZ)
before 45m ago Packets before a relative time
after 10m ago Packets after a relative time

API

PCAP data can be requested via insecure GET/POST requests

/{query}/pcap

Examples:

POST
curl 'http://localhost:1235/query' --data-raw 'query=port 22 and after 1m ago' | tshark -r /dev/stdin
GET
wget -qO- "http://localhost:1235/port 22 and after 1m ago/pcap | tshark -r /dev/stdin
Credits

stenoread.js's People

Contributors

adubovikov avatar dependabot[bot] avatar lmangani avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tawawhite

stenoread.js's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.