Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vaguue/over-the-wire
Network inspection library for Node
https://github.com/vaguue/over-the-wire
javascript network network-programming network-security nodejs packet-crafting packet-sniffing pcap pcap-analyzer pcap-parser pcapng security security-tools
Last synced: 7 days ago
JSON representation
Network inspection library for Node
- Host: GitHub
- URL: https://github.com/vaguue/over-the-wire
- Owner: vaguue
- License: gpl-3.0
- Created: 2024-02-02T17:49:54.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-11-06T20:38:43.000Z (3 months ago)
- Last Synced: 2025-01-08T14:30:59.316Z (14 days ago)
- Topics: javascript, network, network-programming, network-security, nodejs, packet-crafting, packet-sniffing, pcap, pcap-analyzer, pcap-parser, pcapng, security, security-tools
- Language: JavaScript
- Homepage: https://vaguue.github.io/over-the-wire
- Size: 947 KB
- Stars: 60
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Over-the-wire [![GitHub license](https://img.shields.io/github/license/vaguue/over-the-wire?style=flat)](https://github.com/vaguue/over-the-wire/blob/main/LICENSE) [![npm](https://img.shields.io/npm/v/over-the-wire)](https://www.npmjs.com/package/over-the-wire) ![Development Status](https://img.shields.io/badge/status-in_development-orange)
*The project is currently under active development.*
## Overview
`over-the-wire` is a Node.js packet manipulation library supporting:
- Packet crafting and parsing
- Capturing network traffic and sending packets in all formats
- Parsing and serializing pcap and pcapng file formats
- Creating custom non-TCP/UDP socket instances## System Requirements
- Libpcap/WinPcap/Npcap library installed (if Wireshark is installed on your system, you are good to go)
- Node.js version 16.10.0 or higher recommended
- C++ compiler, if there are no prebuilt bindings for your system## Installation
```bash
npm install over-the-wire --save
```## Getting started
```javascript
const fs = require('fs');
const { Pcap, Packet } = require('over-the-wire');const dev = new Pcap.LiveDevice({
iface: 'en0',
direction: 'inout',
filter: 'src port 443',
});// Get info about interface
console.log('[*] Interface: ', dev.iface);// Save captured packets to a pcapng file
const dump = Pcap.createWriteStream({ format: 'pcapng' });
dump.pipe(fs.createWriteStream('dump.pcapng'));dev.on('data', pkt => {
if (pkt.layers.IPv4) {
console.log(`[*] ${pkt.layers.IPv4.src} -> ${pkt.layers.IPv4.dst}`);
}
dump.write(pkt);
});// Create and inject a packet
const pkt = new Packet({ iface: dev.iface })
.Ethernet()
.IPv4({ dst: '192.168.1.1' })
.ICMP();
dev.write(pkt);
```## Documentation
[Here :)](https://vaguue.github.io/over-the-wire)
## Questions or Suggestions
Feel free to open any issue in the Issues section of this repository. Currently, there are no restrictions on the format.