Giter Club home page Giter Club logo

pyknock's Introduction

Please note: This respository has become staled due to relocation to GitLab. Visit https://gitlab.com/mike01/ for up-to-date versions.

General information

Pyknock is a Python based ultra flexible port knocking daemon. The Pyknock daemon listens for a special knock sequence of packets and triggers an action if the sequence matches. Knock sequences and actions are defined in simple python script named (see config.py). Rules are not limited to UDP/TCP ports, any readable packet value can be used for this like IP ids, IP source addresses, packet contents, checksums etc.

Prerequisites

Installation

Just download/unpack

Usage

  • Define conditions and actions in config.py in same directory. The following variables have to be defined: TRIGGER_STRATEGIES, TIMEOUT_RESET_SEC, IFACE_NAME.
  • Start knock daemon via python pyknock.py
  • Send knock sequence via client (e.g. hping)

Example

The following example callflow is used to open and again close a SSH port in a whitelisted firewall configuration:

  • Client sends two TCP packet with target port 1337 and 1338 and a third packet with IP id 69
  • Server detects sequence and adds iptables rules to open TCP-port 22
  • Client can now connect via SSH
  • After client has finished it sends three UDP packets in sequence having destination ports 1339, 1340 and 1341
  • Server detects sequence and closes TCP-port 22

pyknock's People

Contributors

mike01 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.