2023-06-04 23:25:43 +02:00
# Beelzebub
2022-06-13 23:56:23 +02:00
2023-06-04 23:21:22 +02:00
[](https://github.com/mariocandela/beelzebub/actions/workflows/ci.yml) [](https://github.com/mariocandela/beelzebub/actions/workflows/docker-image.yml) [](https://github.com/mariocandela/beelzebub/actions/workflows/codeql.yml)
2023-10-11 23:35:58 +02:00
[](https://goreportcard.com/report/github.com/mariocandela/beelzebub/v3)
2023-10-09 01:16:53 +02:00
[](https://codecov.io/gh/mariocandela/beelzebub)
2023-10-11 23:35:58 +02:00
[](https://pkg.go.dev/github.com/mariocandela/beelzebub/v3)
2023-10-30 12:29:34 +01:00
[](https://github.com/avelino/awesome-go)
2022-05-14 19:04:44 +02:00
2023-06-04 23:21:22 +02:00
## Overview
2023-08-30 23:04:35 +02:00
Beelzebub is an advanced honeypot framework designed to provide a highly secure environment for detecting and analyzing cyber attacks. It offers a low code approach for easy implementation and utilizes virtualization techniques powered by OpenAI Generative Pre-trained Transformer.
2023-06-04 23:21:22 +02:00
2023-08-31 16:38:05 +02:00
< img src = "https://beelzebub.netlify.app/go-beelzebub.png" alt = "Beelzebub Logo" width = "200" / >
2023-06-04 23:21:22 +02:00
2024-06-23 10:55:06 +02:00
## LLM Honeypot
2023-06-04 23:21:22 +02:00
2024-06-23 10:55:06 +02:00
Learn how to integrate Beelzebub with LLM OpenAI by referring to our comprehensive guide on Medium: [Medium Article ](https://medium.com/@mario.candela.personal/how-to-build-a-highly-effective-honeypot-with-beelzebub-and-chatgpt-a2f0f05b3e1 )
2023-06-04 23:21:22 +02:00
## Telegram Bot for Real-Time Attacks
2023-03-31 20:03:42 +02:00
2023-06-04 23:21:22 +02:00
Stay updated on real-time attacks by joining our dedicated Telegram channel: [Telegram Channel ](https://t.me/beelzebubhoneypot )
2023-03-09 07:32:36 +01:00
2023-06-04 23:21:22 +02:00
## Examples
2022-06-14 11:51:32 +02:00
2023-06-04 23:21:22 +02:00
To better understand the capabilities of Beelzebub, you can explore our example repository: [mariocandela/beelzebub-example ](https://github.com/mariocandela/beelzebub-example )
2022-06-14 11:51:32 +02:00
2022-05-14 19:04:44 +02:00
## Quick Start
2023-06-04 23:21:22 +02:00
We provide two quick start options for build and run Beelzebub: using Docker Compose or the Go compiler.
2022-05-14 19:04:44 +02:00
2023-06-04 23:21:22 +02:00
### Using Docker Compose
2022-05-14 19:04:44 +02:00
2023-06-04 23:21:22 +02:00
1. Build the Docker images:
2022-05-14 19:04:44 +02:00
2023-06-04 23:21:22 +02:00
```bash
$ docker-compose build
```
2. Start Beelzebub in detached mode:
```bash
$ docker-compose up -d
```
### Using Go Compiler
2022-05-14 19:04:44 +02:00
2023-06-04 23:21:22 +02:00
1. Download the necessary Go modules:
```bash
$ go mod download
```
2. Build the Beelzebub executable:
```bash
$ go build
```
3. Run Beelzebub:
```bash
$ ./beelzebub
```
2023-09-21 23:19:56 +02:00
### Deploy on kubernetes cluster using helm
1. Install helm
2. Deploy beelzebub:
```bash
$ helm install beelzebub ./beelzebub-chart
```
3. Next release
```bash
$ helm upgrade beelzebub ./beelzebub-chart
```
2023-06-04 23:21:22 +02:00
## Testing
We provide two types of tests: unit tests and integration tests.
### Unit Tests
To run unit tests:
2022-07-03 17:15:38 +02:00
```bash
2023-02-26 18:04:05 +01:00
$ make test.unit
2023-06-04 23:21:22 +02:00
```
### Integration Tests
2022-07-03 17:15:38 +02:00
2023-06-04 23:21:22 +02:00
To run integration tests:
2023-02-26 18:04:05 +01:00
```bash
2023-10-09 01:16:53 +02:00
$ make test.dependencies.start
2023-02-26 18:04:05 +01:00
$ make test.integration
2023-10-09 01:16:53 +02:00
$ make test.dependencies.down
2023-06-04 23:21:22 +02:00
```
2023-02-26 18:04:05 +01:00
2023-06-04 23:21:22 +02:00
## Key Features
2023-02-26 18:04:05 +01:00
2023-06-04 23:21:22 +02:00
Beelzebub offers a wide range of features to enhance your honeypot environment:
2022-12-21 00:12:43 +01:00
2023-09-21 23:19:56 +02:00
- OpenAI Generative Pre-trained Transformer act as Linux virtualization
2022-12-21 00:12:43 +01:00
- SSH Honeypot
- HTTP Honeypot
- TCP Honeypot
2023-06-04 23:21:22 +02:00
- Prometheus openmetrics integration
- Docker integration
2022-12-21 00:12:43 +01:00
- RabbitMQ integration
2023-09-21 23:19:56 +02:00
- kubernetes
2022-12-21 00:12:43 +01:00
2023-06-04 23:21:22 +02:00
## Example Configuration
2022-05-14 19:04:44 +02:00
2023-06-04 23:21:22 +02:00
Beelzebub allows easy configuration for different services and ports. Simply create a new file for each service/port within the `/configurations/services` directory.
2022-05-14 19:04:44 +02:00
2023-06-04 23:21:22 +02:00
To execute Beelzebub with your custom path, use the following command:
```bash
$ ./beelzebub --confCore ./configurations/beelzebub.yaml --confServices ./configurations/services/
```
Here are some example configurations for different honeypot scenarios:
#### Example HTTP Honeypot on Port 80
2022-05-14 19:04:44 +02:00
2022-05-14 19:10:18 +02:00
###### http-80.yaml
2022-05-14 19:04:44 +02:00
```yaml
apiVersion: "v1"
protocol: "http"
address: ":80"
2022-06-02 12:49:33 +02:00
description: "Wordpress 6.0"
2022-05-14 19:04:44 +02:00
commands:
2023-06-04 23:21:22 +02:00
- regex: "^(/index.php|/index.html|/)$"
handler:
< html >
< header >
< title > Wordpress 6 test page< / title >
< / header >
< body >
< h1 > Hello from Wordpress< / h1 >
< / body >
< / html >
2022-05-14 19:04:44 +02:00
headers:
- "Content-Type: text/html"
2022-06-02 12:49:33 +02:00
- "Server: Apache/2.4.53 (Debian)"
- "X-Powered-By: PHP/7.4.29"
2022-05-14 19:04:44 +02:00
statusCode: 200
2023-06-04 23:21:22 +02:00
- regex: "^(/wp-login.php|/wp-admin)$"
handler:
< html >
< header >
< title > Wordpress 6 test page< / title >
< / header >
< body >
< form action = "" method = "post" >
< label for = "uname" > < b > Username< / b > < / label >
< input type = "text" placeholder = "Enter Username" name = "uname" required >
< label for = "psw" > < b > Password< / b > < / label >
< input type = "password" placeholder = "Enter Password" name = "psw" required >
< button type = "submit" > Login< / button >
< / form >
< / body >
< / html >
2022-05-14 19:04:44 +02:00
headers:
- "Content-Type: text/html"
2022-06-02 12:49:33 +02:00
- "Server: Apache/2.4.53 (Debian)"
- "X-Powered-By: PHP/7.4.29"
statusCode: 200
2023-06-04 23:21:22 +02:00
- regex: "^.*$"
handler:
< html >
< header >
< title > 404< / title >
< / header >
< body >
< h1 > Not found!< / h1 >
< / body >
< / html >
headers:
- "Content-Type: text/html"
- "Server: Apache/2.4.53 (Debian)"
- "X-Powered-By: PHP/7.4.29"
statusCode: 404
```
2022-06-02 12:49:33 +02:00
2023-06-04 23:21:22 +02:00
#### Example HTTP Honeypot on Port 8080
2022-05-14 19:04:44 +02:00
2022-05-14 19:10:18 +02:00
###### http-8080.yaml
2022-05-14 19:04:44 +02:00
```yaml
apiVersion: "v1"
protocol: "http"
address: ":8080"
2022-06-02 12:49:33 +02:00
description: "Apache 401"
2022-05-14 19:04:44 +02:00
commands:
2022-06-02 12:49:33 +02:00
- regex: ".*"
2022-05-14 19:04:44 +02:00
handler: "Unauthorized"
headers:
2022-06-02 12:49:33 +02:00
- "www-Authenticate: Basic"
- "server: Apache"
2022-05-14 19:04:44 +02:00
statusCode: 401
2023-06-04 23:21:22 +02:00
```
2022-05-14 19:04:44 +02:00
2023-06-04 23:21:22 +02:00
#### Example SSH Honeypot
2022-06-02 12:49:33 +02:00
2023-06-04 23:21:22 +02:00
###### Honeypot with GPT-3 on Port 2222
2022-12-16 23:02:16 +01:00
```yaml
apiVersion: "v1"
protocol: "ssh"
address: ":2222"
description: "SSH interactive ChatGPT"
commands:
- regex: "^(.+)$"
2023-01-22 13:00:52 +01:00
plugin: "OpenAIGPTLinuxTerminal"
2022-12-16 23:02:16 +01:00
serverVersion: "OpenSSH"
serverName: "ubuntu"
passwordRegex: "^(root|qwerty|Smoker666|123456|jenkins|minecraft|sinus|alex|postgres|Ly123456)$"
deadlineTimeoutSeconds: 60
plugin:
2023-06-04 23:21:22 +02:00
openAPIChatGPTSecretKey: "Your OpenAI Secret Key"
```
###### SSH Honeypot on Port 22
2022-12-16 23:02:16 +01:00
2022-05-14 19:10:18 +02:00
###### ssh-22.yaml
2022-05-14 19:04:44 +02:00
```yaml
apiVersion: "v1"
protocol: "ssh"
address: ":22"
2023-06-04 23:21:22 +02:00
2022-06-02 12:49:33 +02:00
description: "SSH interactive"
2022-05-14 19:04:44 +02:00
commands:
- regex: "^ls$"
2023-06-04 23:21:22 +02:00
handler: "Documents Images Desktop Downloads .m2 .kube .ssh .docker"
2022-05-14 19:04:44 +02:00
- regex: "^pwd$"
handler: "/home/"
- regex: "^uname -m$"
handler: "x86_64"
- regex: "^docker ps$"
2023-06-04 23:21:22 +02:00
handler: "CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES"
2022-05-14 19:04:44 +02:00
- regex: "^docker .*$"
handler: "Error response from daemon: dial unix docker.raw.sock: connect: connection refused"
- regex: "^uname$"
handler: "Linux"
- regex: "^ps$"
2023-06-04 23:21:22 +02:00
handler: "PID TTY TIME CMD\n21642 ttys000 0:00.07 /bin/dockerd"
2022-05-14 19:04:44 +02:00
- regex: "^(.+)$"
handler: "command not found"
serverVersion: "OpenSSH"
serverName: "ubuntu"
2022-06-02 12:49:33 +02:00
passwordRegex: "^(root|qwerty|Smoker666)$"
2022-05-14 19:04:44 +02:00
deadlineTimeoutSeconds: 60
2023-06-04 23:21:22 +02:00
```
2022-06-02 12:49:33 +02:00
2023-08-30 23:04:35 +02:00
[](https://asciinema.org/a/604522)
2022-05-14 19:04:44 +02:00
2023-06-04 23:21:22 +02:00
## Roadmap
2022-07-03 17:15:38 +02:00
2023-06-04 23:21:22 +02:00
Our future plans for Beelzebub include developing it into a robust PaaS platform.
2022-05-14 19:04:44 +02:00
## Contributing
2023-06-04 23:21:22 +02:00
The Beelzebub team welcomes contributions and project participation. Whether you want to report bugs, contribute new features, or have any questions, please refer to our [Contributor Guide ](CONTRIBUTING.md ) for detailed information. We encourage all participants and maintainers to adhere to our [Code of Conduct ](CODE_OF_CONDUCT.md ) and foster a supportive and respectful community.
2022-05-14 19:04:44 +02:00
Happy hacking!
## License
2023-08-30 23:04:35 +02:00
Beelzebub is licensed under the [MIT License ](LICENSE ).
2023-01-08 13:10:19 +01:00
2023-09-27 23:05:09 +02:00
## Supported by JetBrains
[](https://jb.gg/OpenSourceSupport)