Skip to content

defektive/xodbox

Repository files navigation

title xodbox
linkTitle Docs
menu
main
weight
20

Network interaction listening post
Docs :: Releases :: Code
Go Tests

Purpose

Quickly determine if an application reaches out to remote network based services. Easily create custom responses to test how applications consume data from network sources.


Features

Multiple listening protocols:

  • HTTP/HTTPS
  • DNS (in dev)
  • FTP (in dev)
  • SMTP (in dev)
  • SMB (in dev)
  • IMAP
  • POP3
  • SSH (in dev)
  • TCP (in dev)

Installation

Download a release from GitHub or use Go Install:

go install github.com/defektive/xodbox@latest

Running without root (Linux)

Several handlers bind privileged ports (below 1024) by default — HTTP :80, HTTPS :443, DNS :53, and SMB :445. Instead of running xodbox as root, grant the binary the network capabilities it needs and run it as a normal user:

sudo setcap cap_net_raw,cap_net_admin,cap_net_bind_service+eip xodbox
./xodbox serve

cap_net_bind_service is what allows binding ports below 1024, and is the only capability required for the current handlers; cap_net_raw and cap_net_admin are included for forward compatibility and can be dropped if you don't need them. Re-run setcap after upgrading — replacing the binary clears its capabilities.


Configuration

./xodbox config -e > xodbox.yaml

Handler Configuration

Configuration information for each Handler is documented alongside it's code in the handlers directory.

Notifier Configuration

Configuration information for each Notifier is documented alongside it's code in the notifiers directory.


Server Usage

./xodbox

All the magic happens through configuration files in the handlers and notifiers.

Client Usage

When a client makes a connection to xodbox, the logic to respond will be processed by a Handler. Handlers are responsible for seeding their own default data.


Quick Start Guides

Linux

This little snippet will:

  • Download and extract latest release from GitHub.
  • Generate a new config file.
  • create the static and payload directories used by the config file.
wget -q $(wget -q -O - https://api.github.com/repos/defektive/xodbox/releases/latest | grep -o "https:.*Linux_x86_64\.tar\.gz")
tar -xzvf xodbox*.tar.gz
./xodbox config -e | sed 's/^#\(\s*\(payload\|static\)_dir\)/ \1/g' > xodbox.yaml
mkdir -p static payloads/httpx

Bare metal

./xodbox serve 

Docker GHCR

sudo docker run --rm -v `pwd`:/workspace --user 1000  ghcr.io/defektive/xodbox:latest

Docker alpine with downloaded release

Currently, we do not have any prebuilt Docker containers. However, you can just run a release with an Alpine container.

docker run \
  --rm \
  --expose 80 \
  -v `pwd`:/app \
  --workdir /app \
  -d alpine \
  ./xodbox serve

Feedback

I have an issue or feature request

Sweet! Open an issue to start the conversation.


Wait... I want the old node version

Really? ok we made a tag just for you.

https://github.com/defektive/xodbox/releases/tag/legacy-nodejs

About

Network interaction listening post

Topics

Resources

License

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors