Coder Social home page Coder Social logo

weirdshark's Introduction

weirdshark

weirdshark is a cross-platform library written in Rust capable of intercepting incoming and outgoing traffic through the network interfaces.

The library allows to collect

  • IP address
  • port
  • layer 4 protocol (TCP/UDP)

of observed traffic and will generate a textual report in csv format.

The report lists for each of the network address/port pairs that have been observed and protocol, the cumulated number of bytes transmitted, the timestamp of the first and last occurrence of information exchange.

The most importat parameters defineable by the user are

  • network adapter to be inspected
  • output file to be generated
  • time interval after which a new report is generated
  • filters to apply to captured data.

Example

Basic example that captures traffic on the default interface for 10 seconds and at the end writes the report.

use weirdshark;

fn main() {
    let capturer_builder = weirdshark::CapturerBuilder::default();
    let capturer = capturer_builder.build().unwrap();
    capturer.start().unwrap();
    std::thread::sleep(std::time::Duration::from_secs(10));
    capturer.stop().unwrap();
}

A more complete example is the weirdshark-cli program itself

weirdshard-cli

Weirdshark-cli, as the name suggests, is a command line interface program that exploits most of the capabilities of weirdshark exposed before.

To have usage details run weirdshark-cli -h

Windows

There are two requirements for building on Windows:

  • You must use a version of Rust which uses the MSVC toolchain
  • You must have WinPcap or npcap installed (tested with version WinPcap 4.1.3) (If using npcap, make sure to install with the "Install Npcap in WinPcap API-compatible Mode")

weirdshark's People

Contributors

marcondiro avatar dri99 avatar

Stargazers

Aquib Javed avatar

Watchers

 avatar

weirdshark's Issues

Module structure exposure

Since the number of exposed components is limited, can we expose a plain weirdshark:: module and keep the module structure just for internal organisation?

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.