Skip to main content

A small CLI security toolkit

Project description

GresecML

This command-line tool analyzes network traffic from either a .pcap file or a live capture, and makes predictions using a TensorFlow model. Results can be displayed in the console and/or exported to an HTML file.


⚠️ Important

This tool was developed solely as part of an academic school project. It is intended for educational purposes only and should not be used in production environments or relied upon for professional applications.

Do not use this tool to scan network traffic unless you own it or have proper authorization.


Features

  • Analyze .pcap files or capture of live network traffic
  • Predict traffic sessions using a TensorFlow model
  • Export results to an HTML report
  • Filter sessions by probability thresholds
  • Support for lazy loading to save memory
  • Verbose mode for detailed console output

Workflow

The prediction pipeline follows these steps:

  1. Capture – Collects packets from a file or live network interface
  2. Sessions – Groups packets into sessions
  3. Prediction – Runs sessions through the TensorFlow model
  4. Output – Displays results in console and/or export to HTML

Installation

Install with pip:

pip install gresecml

Usage

Run the CLI with:

gresecml [OPTIONS] COMMAND [ARGS]...

For help:

gresecml --help

Examples with "gresecml tf predict":

  • Analyze a .pcap file with tensorflow and save results to HTML

    gresecml tf predict -i traffic.pcap -o results.html
    
  • Run live capture on default interface for 60 seconds

    gresecml tf predict
    
  • Run live capture on a specific interface with custom timeout

    gresecml tf predict -if eth0 -t 120
    
  • Enable verbose output and full HTML report

    gresecml tf predict -i traffic.pcap -o results.html -v -efo
    
  • Filter sessions with normal probability ≤ 70%

    gresecml tf predict -i traffic.pcap -pnm 70
    
  • Use lazy loading to save memory

    gresecml tf predict -i traffic.pcap -ll
    

Notes

  • If no --input is provided, the tool defaults to live capture.
  • Lazy loading is recommended for large .pcap files to reduce memory usage.
  • The HTML output provides a structured table of predictions for possible further investigation. The table is sorted by the prediction_normal column.

Example Output

When running with --verbose, predictions will be printed in the console.
If --output is specified, results will also be saved as an HTML file.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gresecml-0.2.7.tar.gz (549.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gresecml-0.2.7-py3-none-any.whl (551.7 kB view details)

Uploaded Python 3

File details

Details for the file gresecml-0.2.7.tar.gz.

File metadata

  • Download URL: gresecml-0.2.7.tar.gz
  • Upload date:
  • Size: 549.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.7 Windows/11

File hashes

Hashes for gresecml-0.2.7.tar.gz
Algorithm Hash digest
SHA256 1962c2ec36e9cb4ba77c2845c4b1c61a6a76530960d514e0e18e6294955c3b1d
MD5 0db1a708064f7cd05b03e773f0e272cc
BLAKE2b-256 521bd0a3c60b0739443643ede47631ff4c57ae5614a2b67b5529873cd6b99781

See more details on using hashes here.

File details

Details for the file gresecml-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: gresecml-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 551.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.7 Windows/11

File hashes

Hashes for gresecml-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 fd2ff84b87c14065fcc4bec60804a219db50e0a2686c7058bf901238aca83bbf
MD5 a08fb3b4e15d93ec554f6f97b0c4113e
BLAKE2b-256 a6ac29f7d024afc6953445c1acc1870bffbcbdbb4480ba066b0f7f8a44421fd6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page