Compare commits

...

5 Commits

Author SHA1 Message Date
e4ca84589b feat!: Tiny refactoring, changed plugin name (#17)
* tiny refactoring naming
2023-01-22 13:00:52 +01:00
31f5ca9cb1 Update README.md
Signed-off-by: Mario Candela <m4r10.php@gmail.com>
2023-01-08 13:10:19 +01:00
c6855e8511 Update README.md
Signed-off-by: Mario Candela <m4r10.php@gmail.com>
2022-12-21 00:12:43 +01:00
6d2500d0f5 copy the ca-certificate.crt into scratch container 2022-12-19 23:08:21 +01:00
c98b888985 Add 2222:2222 ports mapping.
Signed-off-by: Mario Candela <m4r10.php@gmail.com>
2022-12-18 18:49:13 +01:00
5 changed files with 23 additions and 18 deletions

View File

@ -29,6 +29,8 @@ RUN cp /build/main .
# Build a small image
FROM scratch
# copy the ca-certificate.crt from the builder stage
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /dist/main /
ENTRYPOINT ["/main"]

View File

@ -31,6 +31,18 @@ Unit Test:
$ go test ./...
```
## Features
- OpenAPI ChatBot GPT-3 integration
- SSH Honeypot
- HTTP Honeypot
- TCP Honeypot
- Easy to create a new strategy
- Easy to extend event tracking logic
- Strong code quality
- Docker
- RabbitMQ integration
## Example configuration service
The configurations are inside the /configurations/services directory, just add a new file for each service/port.
@ -95,7 +107,7 @@ address: ":2222"
description: "SSH interactive ChatGPT"
commands:
- regex: "^(.+)$"
plugin: "OpenAIChatGPT"
plugin: "OpenAIGPTLinuxTerminal"
serverVersion: "OpenSSH"
serverName: "ubuntu"
passwordRegex: "^(root|qwerty|Smoker666|123456|jenkins|minecraft|sinus|alex|postgres|Ly123456)$"
@ -136,18 +148,6 @@ deadlineTimeoutSeconds: 60
![alt text](https://i.postimg.cc/jdpfT0LB/Schermata-2022-06-02-alle-12-46-50.png)
## Features
- OpenAPI ChatBot GPT-3 integration
- SSH Honeypot
- HTTP Honeypot
- TCP Honeypot
- Easy to create a new strategy
- Easy to extend event tracking logic
- Strong code quality
- Docker
- RabbitMQ integration
## TODO
- telnet
@ -173,3 +173,5 @@ Happy hacking!
## License
This project is licensed under [GNU GPL 3 License](LICENSE).
[![](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/donate/?business=P75FH5LXKQTAC&no_recurring=0&currency_code=EUR)

View File

@ -4,7 +4,7 @@ address: ":2222"
description: "SSH interactive ChatGPT"
commands:
- regex: "^(.+)$"
plugin: "OpenAIChatGPT"
plugin: "OpenAIGPTLinuxTerminal"
serverVersion: "OpenSSH"
serverName: "ubuntu"
passwordRegex: "^(root|qwerty|Smoker666|123456|jenkins|minecraft|sinus|alex|postgres|Ly123456)$"

View File

@ -8,6 +8,7 @@ services:
restart: always
ports: # Remove me, if you use configuration network_mode: host
- "22:22"
- "2222:2222"
- "8080:8080"
- "80:80"
- "3306:3306"

View File

@ -8,7 +8,7 @@ import (
"strings"
)
const ChatGPTPluginName = "OpenAIChatGPT"
const ChatGPTPluginName = "OpenAIGPTLinuxTerminal"
const openAIGPTEndpoint = "https://api.openai.com/v1/completions"
type History struct {
@ -59,12 +59,12 @@ type gptRequest struct {
}
//Reference: https://www.engraved.blog/building-a-virtual-machine-inside/
const chatGPTFirstQuestion = "I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do no write explanations. Do not type commands unless I instruct you to do so.\n\nA:pwd\n\nQ:/home/user\n\n"
const promptVirtualizeLinuxTerminal = "I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do no write explanations. Do not type commands unless I instruct you to do so.\n\nA:pwd\n\nQ:/home/user\n\n"
func buildPrompt(histories []History, command string) string {
var sb strings.Builder
sb.WriteString(chatGPTFirstQuestion)
sb.WriteString(promptVirtualizeLinuxTerminal)
for _, history := range histories {
sb.WriteString(fmt.Sprintf("A:%s\n\nQ:%s\n\n", history.Input, history.Output))