🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

gitlab.com/mjwhitta/nutsak

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitlab.com/mjwhitta/nutsak

v1.0.3
Source
Go
Version published
Created
Source

Network Utility Swiss-Army Knife (NUtSAK)

🍪 Buy me a cookie

Go Report Card

What is this?

NUtSAK is a network utility library. Included is a client offering similar features to socat.

How to install

Open a terminal and run the following:

$ # For library usage
$ go get --ldflags "-s -w" --trimpath -u gitlab.com/mjwhitta/nutsak
$ # For cli usage
$ go install --ldflags "-s -w" --trimpath \
    gitlab.com/mjwhitta/nutsak/cmd/sak@latest

Or compile from source:

$ git clone https://gitlab.com/mjwhitta/nutsak.git
$ cd nutsak
$ git submodule update --init
$ make

Usage

CLI

To create a simple TCP listner:

$ sak tcp-listen:4444,fork stdout

To create a simple TCP client:

$ sak stdin tcp:4444

Library

package main

import (
    "time"

    sak "gitlab.com/mjwhitta/nutsak"
)

func main() {
    var a sak.NUt
    var b sak.NUt
    var e error

    // Create first NUt
    if a, e = sak.NewNUt("tcp-listen:4444,fork"); e != nil {
        panic(e)
    }

    // Create second NUt
    if b, e = sak.NewNUt("stdout"); e != nil {
        panic(e)
    }

    // Shutdown in 10 seconds
    go func() {
        time.Sleep(10 * time.Second)
        a.Down()
        b.Down()
    }()

    // Pair NUts to create two-way tunnel
    if e = sak.Pair(a, b); e != nil {
        panic(e)
    }
}
  • Source

TODO

  • Improve TCP/TLS fork option
  • EXEC process support
  • HTTP proxy support

FAQs

Package last updated on 08 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts