Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
nt0xa committed Aug 4, 2024
1 parent 0dfae07 commit 5a40f70
Show file tree
Hide file tree
Showing 18 changed files with 143 additions and 6 deletions.
Binary file added docs/docs/assets/create_payload_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/create_payload_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/dns_notification_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/dns_notification_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/example_notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/http_notification_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/http_notification_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/telegram_token_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/assets/telegram_token_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/docs/guides/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Guides",
"position": 3
}
14 changes: 14 additions & 0 deletions docs/docs/guides/notifications.md
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 5 additions & 0 deletions docs/docs/guides/payloads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 3
---

# Manage payloads
54 changes: 54 additions & 0 deletions docs/docs/guides/quick-start.md
Original file line number Diff line number Diff line change
@@ -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 <NAME>`. 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
<html><body>b991ee98230c58c0</body></html>
```
In the case of HTTP/HTTPS, this is the interaction *request* and *response*.
:::
56 changes: 55 additions & 1 deletion docs/docs/install/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

- `<DOMAIN>` — your server's domain.
- `<TOKEN>` — 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 = "<TOKEN>"
url = "https://<DOMAIN>:31337"

# You can add another server here, if you have more than one.
# [servers.myserver2]
# token = "<TOKEN2>"
# url = "https://<DOMAIN2>:31337"

[context]
# The server that is currently active.
server = "myserver1"
```
4 changes: 2 additions & 2 deletions docs/docs/install/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (`<PUBLIC_IP>`) with Docker and Docker Compose installed.
- A registered domain name (`<DOMAIN>`).
Expand All @@ -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 <DOMAIN>
<DOMAIN> name server ns.<DOMAIN>.
Expand Down
1 change: 1 addition & 0 deletions docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


2 changes: 1 addition & 1 deletion docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
9 changes: 7 additions & 2 deletions docs/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

0 comments on commit 5a40f70

Please sign in to comment.