redishoneypot

package module
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 7 Imported by: 0

README

Beehive Redis

Beehive Redis is a honeypot which is a Redis server written in Golang.

Some Redis commands are implemented. (e.g. COMMAND, KEYS, GET and so on)

beehive-redis help
NAME:
   Redis server of Beehive honeypot series - TCP server which communicate in Redis protocol.

USAGE:
    [global options] command [command options] [arguments...]

COMMANDS:
   version  Show version
   run      Start tcp server
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h  show help

Get started

  1. Get a linux binary from Releases

  2. Make a config file like below.

port: 6379
mysql:
  host: 127.0.0.1
  user: beehive
  password: beehive
  db: beehive
  1. start a Redis server.
beehive-redis run --config config.yaml
2022/02/20 09:17:27 starting Beehive Redis server ...

Development

  • Install
brew install go
brew install docker
curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
brew install goreleaser/tap/goreleaser
  • Start MySQL and Redis
docker compose up -d
  • Run main.go
air

Documentation

Index

Constants

View Source
const (
	ResNewLine    = "\r\n"
	ResNil        = "$-1" + ResNewLine
	ResMsgOK      = "+OK" + ResNewLine
	ResMsgSuccess = ":1" + ResNewLine
	ResMsgFailure = ":0" + ResNewLine
)
View Source
const (
	CmdCOMMAND  = "COMMAND"
	CmdPING     = "PING"
	CmdKEYS     = "KEYS"
	CmdSET      = "SET"
	CmdGET      = "GET"
	CmdDEL      = "DEL"
	CmdINFO     = "INFO"
	CmdCONFIG   = "CONFIG"
	CmdSAVE     = "SAVE"
	CmdQUIT     = "QUIT"
	CmdFLUSHALL = "FLUSHALL"
	CmdClient   = "CLIENT"
	CmdSLAVEOF  = "SLAVEOF"
	CmdAUTH     = "AUTH"
	CmdHELP     = "HELP"
)

Variables

This section is empty.

Functions

func IsImplemented

func IsImplemented(cmd string) bool

func StartServer

func StartServer(host string, repo Repository)

Types

type Command

type Command struct {
	Length      int
	Cmd         string
	Args        []string
	IPFrom      string
	IPTo        string
	Implemented bool
}

func (*Command) ToString

func (c *Command) ToString() string

type Repository

type Repository interface {
	Save(*Command) error
}

Directories

Path Synopsis
cmd
repository

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL