landhb / DrawBridge

Layer 4 Single Packet Authentication Linux kernel module utilizing Netfilter hooks and kernel supported Berkeley Packet Filters (BPF)
GNU General Public License v3.0
112 stars 23 forks source link

Re-create the client utility in Rust #7

Closed landhb closed 4 years ago

landhb commented 4 years ago

This PR introduces db a Rust based utility that combines the keygen and auth functionality into a single binary.

There are two sub-utilities built in, the first allows you to generate keys:

db-keygen 
Generate Drawbridge Keys

USAGE:
    db keygen --alg <algorithm> --bits <bits> --out <outfile>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -a, --alg <algorithm>    Algorithm to use [default: rsa]  [possible values: rsa, ecdsa]
    -b, --bits <bits>        Key size [default: 4096]
    -o, --out <outfile>      Output file name [default: ~/.drawbridge/db_rsa]

The second is used to open ports on a remote server running Drawbridge:

db-auth 
Authenticate with a Drawbridge server

USAGE:
    db auth [OPTIONS] --dport <dport> --key <key> --server <server> --unlock <uport>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -d, --dport <dport>          Auth packet destination port
    -i, --key <key>              Private key for signing [default: ~/.drawbridge/db_rsa]
    -p, --protocol <protocol>    Auth packet protocol [default: tcp]  [possible values: tcp, udp]
    -s, --server <server>        Address of server running Drawbridge
    -u, --unlock <uport>         Port to unlock