Code Monkey home page Code Monkey logo

netlock's Introduction

Netlock

Monitor network traffic and disable hardware when a threshhold in bytes is reached.

Installation

in the repo root run;

sudo ./Netlock/setup.sh

Note: if you experience issues after installation, please restart the shell (or open a new one)

Usage

Tests

Test if interface has a network connection

netlock -t interface

netlock -t en0

Interface state

Disable all network interfaces

netlock -n

Enable all network interfaces

netlock -d

Monitoring

Monitor without limits

netlock -m interface bytes-out bytes-in

netlock -m en0

Monitor, disable network hardware when limit is reached

Note: The limit is defined in bytes.

netlock -m interface bytes-out bytes-in

netlock -m en0 5 5

Monitor, disable all network hardware when limit is reached

Note: The limit is defined in bytes.

netlock -m interface bytes-out bytes-in safe

netlock -m en0 5 5 safe

Monitor, clean output

will return an output of just the bytes, no formatting.

usefull for piping into other utilities.

netlock -c en0 out

Options

  • -v version: display version info
  • -h help: display help
  • -t test connection: test if connected to the internet
    • Arg1: Network Interface ('en0')
  • -n nuke hardware: disconnect all interfaces
  • -d denuke hardware: reconnect all interfaces
  • -m monitor traffic
    • Arg1: Network Interface
    • Arg2: (optional) Bytes Out limit (Interface will be disabled if limit is reached)
    • Arg3: (optional) Bytes In limit (Interface will be disabled if limit is reached)
    • Arg4: (optional) 'safe' turns off all network interfaces if limit is reached.
  • -c clean output: get clean output from an interface
    • Arg1: Network Interface ('en0')
    • Arg2: in or outgoing traffic ('in' 'out')

netlock's People

Contributors

remcoeijsackers avatar marineman-cyber avatar

Watchers

 avatar

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.