Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Neumenon/cowrie/llms.txt
Use this file to discover all available pages before exploring further.
Cowrie is available for five languages, each with both Gen1 and Gen2 support. Choose your language below for installation instructions.
Install via go get
go get github.com/Neumenon/cowrie/gen1
go get github.com/Neumenon/cowrie/gen2
Import in your code
import (
"github.com/Neumenon/cowrie/gen1"
"github.com/Neumenon/cowrie/gen2"
)
Requirements
- Go 1.21 or later
- github.com/klauspost/compress (automatically installed)
Building from source
git clone https://github.com/Neumenon/cowrie
cd cowrie-final/go
go build ./...
go test ./...
Rust
Add to Cargo.toml
[dependencies]
cowrie-codec = "0.1.0"
Or for specific features:[dependencies]
cowrie-codec = { version = "0.1.0", features = ["gen1", "gen2", "zstd"] }
Import in your code
use cowrie::{gen1, gen2};
Features
gen1: Enable Gen1 codec (included by default)
gen2: Enable Gen2 codec (included by default)
zstd: Enable zstd compression support for Gen2
Building from source
git clone https://github.com/Neumenon/cowrie
cd cowrie-final/rust
cargo build
cargo test
Python
Import in your code
from cowrie import gen1, gen2
Verify installation
python -c "from cowrie import gen1, gen2; print('Cowrie installed successfully')"
Requirements
- Python 3.8 or later
- No external dependencies required
Building from source
git clone https://github.com/Neumenon/cowrie
cd cowrie-final/python
pip install -e .
pytest tests/
Use -e flag for editable installation during development.
TypeScript / Node.js
Usage
Import in your TypeScript/JavaScript code
import { gen1, gen2 } from 'cowrie';
Or with CommonJS:const { gen1, gen2 } = require('cowrie');
Verify installation
node -e "const {gen1} = require('cowrie'); console.log('Cowrie installed')"
Requirements
- Node.js 16 or later
- Optional: fzstd for zstd compression support (auto-installed)
Building from source
git clone https://github.com/Neumenon/cowrie
cd cowrie-final/typescript
npm install
npm run build
npm test
C installation requires building from source with CMake.
Install dependencies
# Ubuntu/Debian
sudo apt-get install build-essential cmake zlib1g-dev libzstd-dev
# macOS
brew install cmake zlib zstd
# Fedora/RHEL
sudo dnf install gcc cmake zlib-devel libzstd-devel
Build with CMake
git clone https://github.com/Neumenon/cowrie
cd cowrie-final/c
mkdir build && cd build
cmake ..
make
Include in your project
#include <cowrie_gen1.h>
#include <cowrie_gen2.h>
CMake integration
Add to your CMakeLists.txt:
find_package(cowrie REQUIRED)
target_link_libraries(your_target cowrie_gen1 cowrie_gen2)
Requirements
- C11-compatible compiler (GCC 7+, Clang 5+, MSVC 2019+)
- CMake 3.10 or later
- zlib (required for Gen2)
- libzstd (optional for Gen2 zstd compression)
zstd support is optional. If libzstd is not found, Cowrie will build without zstd compression support.
Cowrie includes a command-line tool for encoding/decoding from the terminal:
Build the CLI
cd go
go build -o cowrie ./cmd/cowrie
Encode JSON to Cowrie
echo '{"name":"Alice","age":30}' | ./cowrie encode --gen2 > data.cowrie
Decode Cowrie to JSON
./cowrie decode < data.cowrie
Inspect Cowrie files
./cowrie info < data.cowrie
CLI options
# Encode with Gen1
cowrie encode --gen1 < input.json > output.cowrie
# Encode with Gen2 and compression
cowrie encode --gen2 --compress --compression=zstd < input.json > output.cowrie
# Decode to pretty-printed JSON
cowrie decode --pretty < input.cowrie
# Show file info (format, size, compression)
cowrie info < input.cowrie
Docker
Run Cowrie in a container:
docker run -it --rm \
-v $(pwd):/data \
ghcr.io/phenomenon0/cowrie:latest \
encode --gen2 < /data/input.json > /data/output.cowrie
Docker images are built from the Go implementation only. For other languages, install natively.
Verification
After installation, verify Cowrie is working correctly:
cd go
go test ./gen1 ./gen2
All tests should pass. If you encounter issues, check that you have the required dependencies installed.
Next steps
Quickstart
Encode your first message with Cowrie
API Reference
Explore the full API documentation
Getting help
If you encounter installation issues:
- Check the GitHub Issues for known problems
- Verify you have the required language version and dependencies
- Try building from source for the latest fixes
- Open a new issue with your error message and environment details