diff --git a/docs/docs/assets/create_payload_dark.png b/docs/docs/assets/create_payload_dark.png new file mode 100644 index 0000000..cc9a19d Binary files /dev/null and b/docs/docs/assets/create_payload_dark.png differ diff --git a/docs/docs/assets/create_payload_light.png b/docs/docs/assets/create_payload_light.png new file mode 100644 index 0000000..b7d686f Binary files /dev/null and b/docs/docs/assets/create_payload_light.png differ diff --git a/docs/docs/assets/dns_notification_dark.png b/docs/docs/assets/dns_notification_dark.png new file mode 100644 index 0000000..1aa7b54 Binary files /dev/null and b/docs/docs/assets/dns_notification_dark.png differ diff --git a/docs/docs/assets/dns_notification_light.png b/docs/docs/assets/dns_notification_light.png new file mode 100644 index 0000000..39df32b Binary files /dev/null and b/docs/docs/assets/dns_notification_light.png differ diff --git a/docs/docs/assets/example_notification.png b/docs/docs/assets/example_notification.png new file mode 100644 index 0000000..f9ddd7c Binary files /dev/null and b/docs/docs/assets/example_notification.png differ diff --git a/docs/docs/assets/http_notification_dark.png b/docs/docs/assets/http_notification_dark.png new file mode 100644 index 0000000..1dc4587 Binary files /dev/null and b/docs/docs/assets/http_notification_dark.png differ diff --git a/docs/docs/assets/http_notification_light.png b/docs/docs/assets/http_notification_light.png new file mode 100644 index 0000000..2550832 Binary files /dev/null and b/docs/docs/assets/http_notification_light.png differ diff --git a/docs/docs/assets/telegram_token_dark.png b/docs/docs/assets/telegram_token_dark.png new file mode 100644 index 0000000..fd62914 Binary files /dev/null and b/docs/docs/assets/telegram_token_dark.png differ diff --git a/docs/docs/assets/telegram_token_light.png b/docs/docs/assets/telegram_token_light.png new file mode 100644 index 0000000..ff48be2 Binary files /dev/null and b/docs/docs/assets/telegram_token_light.png differ diff --git a/docs/docs/guides/_category_.json b/docs/docs/guides/_category_.json new file mode 100644 index 0000000..c59a630 --- /dev/null +++ b/docs/docs/guides/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Guides", + "position": 3 +} diff --git a/docs/docs/guides/notifications.md b/docs/docs/guides/notifications.md new file mode 100644 index 0000000..1341cb9 --- /dev/null +++ b/docs/docs/guides/notifications.md @@ -0,0 +1,14 @@ +--- +sidebar_position: 2 +--- + +# Notifications + +## DNS + +- DNS listener runs on port 53. +- You will receive notifications for any DNS queries of your payload's domain (e.g. `d14a68e4.sonar.test`) + and for any queries of its subdomains (e.g. `test.d14a68e4.sonar.test`). +- DNS interaction notification is a dig-like representation of the question and answer. + + ![DNS notification example](../assets/dns_notification_dark.png#gh-dark-mode-only)![DNS notification example](../assets/dns_notification_light.png#gh-light-mode-only) diff --git a/docs/docs/guides/payloads.md b/docs/docs/guides/payloads.md new file mode 100644 index 0000000..f695fba --- /dev/null +++ b/docs/docs/guides/payloads.md @@ -0,0 +1,5 @@ +--- +sidebar_position: 3 +--- + +# Manage payloads diff --git a/docs/docs/guides/quick-start.md b/docs/docs/guides/quick-start.md new file mode 100644 index 0000000..80b8019 --- /dev/null +++ b/docs/docs/guides/quick-start.md @@ -0,0 +1,54 @@ +--- +sidebar_position: 1 +--- + +# Quick start + +1. Open a chat with the Sonar bot in the configured messenger. +2. Create a new payload with the command `/new `. Use a meaningful name as it will be used in + in interaction notifications. You will receive your unique domain name in the response. + + ![Payload creation in Telegram](../assets/create_payload_dark.png#gh-dark-mode-only)![Payload creation in Telegram](../assets/create_payload_light.png#gh-light-mode-only) + + + :::tip + + - `project_test` — payload's name + - `d14a68e4.sonar.test` — payload's unique subdomain + - `dns, ftp, http, smtp` — protocols for which notifications are enabled (by default all protocols are enabled) + - `false` — shows if all interaction events are stored in database (disabled by default) + + ::: + +3. You can now use your unique domain `d14a68e4.sonar.test` in any DNS/HTTP/SMTP/FTP interactions and + you will receive notifications to the chat with the Sonar bot for all the interactions. + Here is an example HTTP interaction notifications after execution of of the command `curl d14a68e4.sonar.test`: + + ![Example HTTP notification](../assets/http_notification_dark.png#gh-dark-mode-only)![Example HTTP notification](../assets/http_notification_light.png#gh-light-mode-only) + + + :::tip + + - `project_test` — payload's name (the same as was used in the `/new' command when the payload was created) + - `HTTP` — protocol of the iteraction + - `100.100.100.100:12345` — IP address and port from which the interaction occurred + - `04 Aug 2024 at 19:58:50 BST` — date and time of the interaction + - The interaction details: + + ``` + GET / HTTP/1.1 + Host: d14a68e4.sonar.test + User-Agent: curl/8.6.0 + Accept: */* + + HTTP/1.1 200 OK + Content-Type: text/html; charset=utf-8 + Date: Sun, 04 Aug 2024 18:58:50 GMT + Content-Length: 42 + Connection: close + + b991ee98230c58c0 + ``` + In the case of HTTP/HTTPS, this is the interaction *request* and *response*. + + ::: diff --git a/docs/docs/install/client.md b/docs/docs/install/client.md index 1f0367a..de7f3d5 100644 --- a/docs/docs/install/client.md +++ b/docs/docs/install/client.md @@ -2,5 +2,59 @@ sidebar_position: 2 --- -# Client +# CLI +:::warning + +The CLI client uses the REST API, so in order to be able to use it, make sure that the "api" module +is enabled in your Sonar server's `config.toml` file. + +See [Server: Configuration file](/sonar/install/server#configuration-file) + +::: + +## Installation + +### macOS + +```shell-session +$ brew install nt0xa/sonar/sonar +``` + +### Linux and Windows + +Download binaries for the latest release from [Github](https://github.com/nt0xa/sonar/releases). + +## API token + + +## Configration file + +To start using the CLI, you must first create the configuration file at `~/.config/sonar/config.toml`. +To configure sever you only need two values: + +- `` — your server's domain. +- `` — your user's token. If you are the one who deployed the server, you can use + the token from the [Server: Configuration file](/sonar/install/server#configuration-file). Otherwise, + you can go to the configured messenger and use the `/profile` command to get your token. + + ![Getting token in Telegram](../assets/telegram_token_dark.png#gh-dark-mode-only)![Getting token in Telegram](../assets/telegram_token_light.png#gh-light-mode-only) + + +Here is an example configuration: + +```toml title="~/.config/sonar/config.toml" +[servers] +[servers.myserver1] +token = "" +url = "https://:31337" + +# You can add another server here, if you have more than one. +# [servers.myserver2] +# token = "" +# url = "https://:31337" + +[context] +# The server that is currently active. +server = "myserver1" +``` diff --git a/docs/docs/install/server.md b/docs/docs/install/server.md index 03e3f7d..b7ea9cc 100644 --- a/docs/docs/install/server.md +++ b/docs/docs/install/server.md @@ -8,7 +8,7 @@ Sonar is **self-hosted only**, so to get started you must install it to your own ## Prerequisites -To install the Sonar Server, you must have: +To install the Sonar server, you must have: - A Linux server with a public IP address (``) with Docker and Docker Compose installed. - A registered domain name (``). @@ -35,7 +35,7 @@ Then, you need to add an `NS` record for `example.com`: To ensure that everything is configured correctly, you can use the following commands: -``` +```shell-session $ host -t ns name server ns.. diff --git a/docs/docs/intro.md b/docs/docs/intro.md index a1ab8da..cff31c0 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -15,6 +15,7 @@ It is similar to [Burp Collaborator](https://portswigger.net/burp/documentation/ - Configurable DNS responses with the ability to return multiple records for a name or set up DNS rebinding. - Configurable HTTP responses: static or dynamic using Go template language. - Automatic TLS certificates with Let's Encrypt. +- Support for multiple users. Currently there are only two roles: admin and regular user. - REST API. diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index 9ad737a..0b8fc24 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -89,7 +89,7 @@ const config: Config = { prism: { theme: prismThemes.github, darkTheme: prismThemes.vsDark, - additionalLanguages: ["yaml", "toml"], + additionalLanguages: ["yaml", "toml", "bash", "shell-session"], }, } satisfies Preset.ThemeConfig, }; diff --git a/docs/src/css/custom.css b/docs/src/css/custom.css index ec7d7cd..0f00c43 100644 --- a/docs/src/css/custom.css +++ b/docs/src/css/custom.css @@ -18,8 +18,8 @@ } /* For readability concerns, you should choose a lighter palette in dark mode. */ -[data-theme='dark'] { - --ifm-color-primary: #54768a; +[data-theme="dark"] { + --ifm-color-primary: #a3b7c3; --ifm-color-primary-dark: #21af90; --ifm-color-primary-darker: #1fa588; --ifm-color-primary-darkest: #1a8870; @@ -28,3 +28,8 @@ --ifm-color-primary-lightest: #4fddbf; --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); } + +[data-theme='light'] img[src$='#gh-dark-mode-only'], +[data-theme='dark'] img[src$='#gh-light-mode-only'] { + display: none; +}