Giter Club home page Giter Club logo

tarpit's Introduction

Tarpit command application that may slow down malicious attempts to scan a system.

Supported Protocols:

  • SSH
  • HTTP

Building and Running

$ make linux-amd64
GOOS=linux GOARCH=amd64 go build -o "build/tarpit-linux-amd64"

This command will build the application in build/tarpit-linux-amd64. We can then run the tarpit on an unprivileged port (e.g. 2222).

$ ./build/tarpit-linux-amd64 -P ssh -p 2222

Or you can run it on a privileged port with sudo.

$ sudo ./build/tarpit-linux-amd64 -P ssh -p 22

Options

Usage of ./tarpit:
  -b, --bind-address string   address to bind the socket to
  -d, --delay string          delay between the tarpit keep-alive data packets (default "10s")
  -g, --gid uint16            setgid, after creating a listening socket
  -p, --port uint16           TCP port, leave it 0 for service default
  -P, --proto string          protocol to tarpit (default "ssh")
  -u, --uid uint16            setuid, after creating a listening socket
  -v, --version               show current version

Using privileged ports

The ports < 1024 require superuser privileges. The command allows to drop superuser privileges (using setuid/setgid), right after it acquires a listening socket. Thus, allowing to bind to a privileged port and start serving as a regular unprivileged user. This is done by running the command as a superuser (e.g. with sudo) and setting the -u/--uid <uid> and -g/--gid <gid> command line flags.

$ sudo ./build/tarpit-linux-amd64 -P ssh -p 22 -u "$(id -u)" -g "$(id -g)"

Acknowledgements

Thanks to nullprogram.com / @skeeto for the article about tarpits that served as an inspiration for this application.

tarpit's People

Contributors

metala avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

tarpit's Issues

Suggestion: make a release and attach binaries

I don't have a Go compiler toolchain installed (and the Go compiler is pretty huge the last time I checked), so it would be cool if there was a release with attached binaries that I could use.

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.