diff --git a/docs/docs/assets/clear_all_telegram_dark.png b/docs/docs/assets/clear_all_telegram_dark.png new file mode 100644 index 0000000..0ea889b Binary files /dev/null and b/docs/docs/assets/clear_all_telegram_dark.png differ diff --git a/docs/docs/assets/clear_all_telegram_light.png b/docs/docs/assets/clear_all_telegram_light.png new file mode 100644 index 0000000..9f2387e Binary files /dev/null and b/docs/docs/assets/clear_all_telegram_light.png differ diff --git a/docs/docs/assets/clear_telegram_dark.png b/docs/docs/assets/clear_telegram_dark.png new file mode 100644 index 0000000..36fccdb Binary files /dev/null and b/docs/docs/assets/clear_telegram_dark.png differ diff --git a/docs/docs/assets/clear_telegram_light.png b/docs/docs/assets/clear_telegram_light.png new file mode 100644 index 0000000..11ef271 Binary files /dev/null and b/docs/docs/assets/clear_telegram_light.png differ diff --git a/docs/docs/assets/create_payload_events_telegram_dark.png b/docs/docs/assets/create_payload_events_telegram_dark.png new file mode 100644 index 0000000..2de2a5e Binary files /dev/null and b/docs/docs/assets/create_payload_events_telegram_dark.png differ diff --git a/docs/docs/assets/create_payload_events_telegram_light.png b/docs/docs/assets/create_payload_events_telegram_light.png new file mode 100644 index 0000000..fe2293f Binary files /dev/null and b/docs/docs/assets/create_payload_events_telegram_light.png differ diff --git a/docs/docs/assets/create_payload_protocols_telegram_dark.png b/docs/docs/assets/create_payload_protocols_telegram_dark.png new file mode 100644 index 0000000..de00f0c Binary files /dev/null and b/docs/docs/assets/create_payload_protocols_telegram_dark.png differ diff --git a/docs/docs/assets/create_payload_protocols_telegram_light.png b/docs/docs/assets/create_payload_protocols_telegram_light.png new file mode 100644 index 0000000..7bc0a01 Binary files /dev/null and b/docs/docs/assets/create_payload_protocols_telegram_light.png differ diff --git a/docs/docs/assets/create_payload_dark.png b/docs/docs/assets/create_payload_telegram_dark.png similarity index 100% rename from docs/docs/assets/create_payload_dark.png rename to docs/docs/assets/create_payload_telegram_dark.png diff --git a/docs/docs/assets/create_payload_light.png b/docs/docs/assets/create_payload_telegram_light.png similarity index 100% rename from docs/docs/assets/create_payload_light.png rename to docs/docs/assets/create_payload_telegram_light.png diff --git a/docs/docs/assets/dns_clear_telegram_dark.png b/docs/docs/assets/dns_clear_telegram_dark.png new file mode 100644 index 0000000..ed704da Binary files /dev/null and b/docs/docs/assets/dns_clear_telegram_dark.png differ diff --git a/docs/docs/assets/dns_clear_telegram_light.png b/docs/docs/assets/dns_clear_telegram_light.png new file mode 100644 index 0000000..be5dccc Binary files /dev/null and b/docs/docs/assets/dns_clear_telegram_light.png differ diff --git a/docs/docs/assets/dns_del_telegram_dark.png b/docs/docs/assets/dns_del_telegram_dark.png new file mode 100644 index 0000000..fd61bf3 Binary files /dev/null and b/docs/docs/assets/dns_del_telegram_dark.png differ diff --git a/docs/docs/assets/dns_del_telegram_light.png b/docs/docs/assets/dns_del_telegram_light.png new file mode 100644 index 0000000..fd53277 Binary files /dev/null and b/docs/docs/assets/dns_del_telegram_light.png differ diff --git a/docs/docs/assets/dns_list_telegram_dark.png b/docs/docs/assets/dns_list_telegram_dark.png new file mode 100644 index 0000000..8d2c4d0 Binary files /dev/null and b/docs/docs/assets/dns_list_telegram_dark.png differ diff --git a/docs/docs/assets/dns_list_telegram_light.png b/docs/docs/assets/dns_list_telegram_light.png new file mode 100644 index 0000000..300820f Binary files /dev/null and b/docs/docs/assets/dns_list_telegram_light.png differ diff --git a/docs/docs/assets/dns_new_multiple_telegram_dark.png b/docs/docs/assets/dns_new_multiple_telegram_dark.png new file mode 100644 index 0000000..7aead4a Binary files /dev/null and b/docs/docs/assets/dns_new_multiple_telegram_dark.png differ diff --git a/docs/docs/assets/dns_new_multiple_telegram_light.png b/docs/docs/assets/dns_new_multiple_telegram_light.png new file mode 100644 index 0000000..81d85fd Binary files /dev/null and b/docs/docs/assets/dns_new_multiple_telegram_light.png differ diff --git a/docs/docs/assets/dns_new_rebind_telegram_dark.png b/docs/docs/assets/dns_new_rebind_telegram_dark.png new file mode 100644 index 0000000..1d3bdc2 Binary files /dev/null and b/docs/docs/assets/dns_new_rebind_telegram_dark.png differ diff --git a/docs/docs/assets/dns_new_rebind_telegram_light.png b/docs/docs/assets/dns_new_rebind_telegram_light.png new file mode 100644 index 0000000..2ea283f Binary files /dev/null and b/docs/docs/assets/dns_new_rebind_telegram_light.png differ diff --git a/docs/docs/assets/dns_new_telegram_dark.png b/docs/docs/assets/dns_new_telegram_dark.png new file mode 100644 index 0000000..7f3e66d Binary files /dev/null and b/docs/docs/assets/dns_new_telegram_dark.png differ diff --git a/docs/docs/assets/dns_new_telegram_light.png b/docs/docs/assets/dns_new_telegram_light.png new file mode 100644 index 0000000..2330ab5 Binary files /dev/null and b/docs/docs/assets/dns_new_telegram_light.png differ diff --git a/docs/docs/assets/dns_new_wildcard_telegram_dark.png b/docs/docs/assets/dns_new_wildcard_telegram_dark.png new file mode 100644 index 0000000..e06e68b Binary files /dev/null and b/docs/docs/assets/dns_new_wildcard_telegram_dark.png differ diff --git a/docs/docs/assets/dns_new_wildcard_telegram_light.png b/docs/docs/assets/dns_new_wildcard_telegram_light.png new file mode 100644 index 0000000..e5ded04 Binary files /dev/null and b/docs/docs/assets/dns_new_wildcard_telegram_light.png differ diff --git a/docs/docs/assets/dns_test_alert_multiple_telegram_dark.png b/docs/docs/assets/dns_test_alert_multiple_telegram_dark.png new file mode 100644 index 0000000..8be9a18 Binary files /dev/null and b/docs/docs/assets/dns_test_alert_multiple_telegram_dark.png differ diff --git a/docs/docs/assets/dns_test_alert_multiple_telegram_light.png b/docs/docs/assets/dns_test_alert_multiple_telegram_light.png new file mode 100644 index 0000000..6cc7b65 Binary files /dev/null and b/docs/docs/assets/dns_test_alert_multiple_telegram_light.png differ diff --git a/docs/docs/assets/dns_test_alert_rebind_telegram_dark.png b/docs/docs/assets/dns_test_alert_rebind_telegram_dark.png new file mode 100644 index 0000000..0c84b47 Binary files /dev/null and b/docs/docs/assets/dns_test_alert_rebind_telegram_dark.png differ diff --git a/docs/docs/assets/dns_test_alert_rebind_telegram_light.png b/docs/docs/assets/dns_test_alert_rebind_telegram_light.png new file mode 100644 index 0000000..46cd4c3 Binary files /dev/null and b/docs/docs/assets/dns_test_alert_rebind_telegram_light.png differ diff --git a/docs/docs/assets/dns_test_alert_telegram_dark.png b/docs/docs/assets/dns_test_alert_telegram_dark.png new file mode 100644 index 0000000..46072c3 Binary files /dev/null and b/docs/docs/assets/dns_test_alert_telegram_dark.png differ diff --git a/docs/docs/assets/dns_test_alert_telegram_light.png b/docs/docs/assets/dns_test_alert_telegram_light.png new file mode 100644 index 0000000..2dd7000 Binary files /dev/null and b/docs/docs/assets/dns_test_alert_telegram_light.png differ diff --git a/docs/docs/assets/dns_test_alert_wildcard_telegram_dark.png b/docs/docs/assets/dns_test_alert_wildcard_telegram_dark.png new file mode 100644 index 0000000..4db1d6c Binary files /dev/null and b/docs/docs/assets/dns_test_alert_wildcard_telegram_dark.png differ diff --git a/docs/docs/assets/dns_test_alert_wildcard_telegram_light.png b/docs/docs/assets/dns_test_alert_wildcard_telegram_light.png new file mode 100644 index 0000000..02b3dad Binary files /dev/null and b/docs/docs/assets/dns_test_alert_wildcard_telegram_light.png differ diff --git a/docs/docs/assets/dns_test_dark.png b/docs/docs/assets/dns_test_dark.png new file mode 100644 index 0000000..22c4e69 Binary files /dev/null and b/docs/docs/assets/dns_test_dark.png differ diff --git a/docs/docs/assets/dns_test_light.png b/docs/docs/assets/dns_test_light.png new file mode 100644 index 0000000..26716bd Binary files /dev/null and b/docs/docs/assets/dns_test_light.png differ diff --git a/docs/docs/assets/dns_test_multiple_dark.png b/docs/docs/assets/dns_test_multiple_dark.png new file mode 100644 index 0000000..3229205 Binary files /dev/null and b/docs/docs/assets/dns_test_multiple_dark.png differ diff --git a/docs/docs/assets/dns_test_multiple_light.png b/docs/docs/assets/dns_test_multiple_light.png new file mode 100644 index 0000000..c2382ca Binary files /dev/null and b/docs/docs/assets/dns_test_multiple_light.png differ diff --git a/docs/docs/assets/dns_test_rebind_1_dark.png b/docs/docs/assets/dns_test_rebind_1_dark.png new file mode 100644 index 0000000..6d3c9c3 Binary files /dev/null and b/docs/docs/assets/dns_test_rebind_1_dark.png differ diff --git a/docs/docs/assets/dns_test_rebind_1_light.png b/docs/docs/assets/dns_test_rebind_1_light.png new file mode 100644 index 0000000..c937a81 Binary files /dev/null and b/docs/docs/assets/dns_test_rebind_1_light.png differ diff --git a/docs/docs/assets/dns_test_wildcard_dark.png b/docs/docs/assets/dns_test_wildcard_dark.png new file mode 100644 index 0000000..fb68b41 Binary files /dev/null and b/docs/docs/assets/dns_test_wildcard_dark.png differ diff --git a/docs/docs/assets/dns_test_wildcard_light.png b/docs/docs/assets/dns_test_wildcard_light.png new file mode 100644 index 0000000..9320d9a Binary files /dev/null and b/docs/docs/assets/dns_test_wildcard_light.png differ diff --git a/docs/docs/assets/events_get_telegram_dark.png b/docs/docs/assets/events_get_telegram_dark.png new file mode 100644 index 0000000..b88d1a4 Binary files /dev/null and b/docs/docs/assets/events_get_telegram_dark.png differ diff --git a/docs/docs/assets/events_get_telegram_light.png b/docs/docs/assets/events_get_telegram_light.png new file mode 100644 index 0000000..29aa6d0 Binary files /dev/null and b/docs/docs/assets/events_get_telegram_light.png differ diff --git a/docs/docs/assets/events_list_first_telegram_dark.png b/docs/docs/assets/events_list_first_telegram_dark.png new file mode 100644 index 0000000..b5f099e Binary files /dev/null and b/docs/docs/assets/events_list_first_telegram_dark.png differ diff --git a/docs/docs/assets/events_list_first_telegram_light.png b/docs/docs/assets/events_list_first_telegram_light.png new file mode 100644 index 0000000..f30699a Binary files /dev/null and b/docs/docs/assets/events_list_first_telegram_light.png differ diff --git a/docs/docs/assets/events_list_mn2_telegram_dark.png b/docs/docs/assets/events_list_mn2_telegram_dark.png new file mode 100644 index 0000000..fbf0861 Binary files /dev/null and b/docs/docs/assets/events_list_mn2_telegram_dark.png differ diff --git a/docs/docs/assets/events_list_mn2_telegram_light.png b/docs/docs/assets/events_list_mn2_telegram_light.png new file mode 100644 index 0000000..35bc577 Binary files /dev/null and b/docs/docs/assets/events_list_mn2_telegram_light.png differ diff --git a/docs/docs/assets/events_list_mn_telegram_dark.png b/docs/docs/assets/events_list_mn_telegram_dark.png new file mode 100644 index 0000000..ecff909 Binary files /dev/null and b/docs/docs/assets/events_list_mn_telegram_dark.png differ diff --git a/docs/docs/assets/events_list_mn_telegram_light.png b/docs/docs/assets/events_list_mn_telegram_light.png new file mode 100644 index 0000000..fe4f9c6 Binary files /dev/null and b/docs/docs/assets/events_list_mn_telegram_light.png differ diff --git a/docs/docs/assets/events_list_n_telegram_dark.png b/docs/docs/assets/events_list_n_telegram_dark.png new file mode 100644 index 0000000..e5a7e33 Binary files /dev/null and b/docs/docs/assets/events_list_n_telegram_dark.png differ diff --git a/docs/docs/assets/events_list_n_telegram_light.png b/docs/docs/assets/events_list_n_telegram_light.png new file mode 100644 index 0000000..02fe0e2 Binary files /dev/null and b/docs/docs/assets/events_list_n_telegram_light.png differ diff --git a/docs/docs/assets/events_list_telegram_dark.png b/docs/docs/assets/events_list_telegram_dark.png new file mode 100644 index 0000000..4b86756 Binary files /dev/null and b/docs/docs/assets/events_list_telegram_dark.png differ diff --git a/docs/docs/assets/events_list_telegram_light.png b/docs/docs/assets/events_list_telegram_light.png new file mode 100644 index 0000000..aaa3ced Binary files /dev/null and b/docs/docs/assets/events_list_telegram_light.png differ diff --git a/docs/docs/assets/http_clear_telegram_dark.png b/docs/docs/assets/http_clear_telegram_dark.png new file mode 100644 index 0000000..eb1aab8 Binary files /dev/null and b/docs/docs/assets/http_clear_telegram_dark.png differ diff --git a/docs/docs/assets/http_clear_telegram_light.png b/docs/docs/assets/http_clear_telegram_light.png new file mode 100644 index 0000000..b7838fa Binary files /dev/null and b/docs/docs/assets/http_clear_telegram_light.png differ diff --git a/docs/docs/assets/http_del_telegram_dark.png b/docs/docs/assets/http_del_telegram_dark.png new file mode 100644 index 0000000..3b7b0ea Binary files /dev/null and b/docs/docs/assets/http_del_telegram_dark.png differ diff --git a/docs/docs/assets/http_del_telegram_light.png b/docs/docs/assets/http_del_telegram_light.png new file mode 100644 index 0000000..cc08f15 Binary files /dev/null and b/docs/docs/assets/http_del_telegram_light.png differ diff --git a/docs/docs/assets/http_list_telegram_dark.png b/docs/docs/assets/http_list_telegram_dark.png new file mode 100644 index 0000000..09ab1d0 Binary files /dev/null and b/docs/docs/assets/http_list_telegram_dark.png differ diff --git a/docs/docs/assets/http_list_telegram_light.png b/docs/docs/assets/http_list_telegram_light.png new file mode 100644 index 0000000..c1c5924 Binary files /dev/null and b/docs/docs/assets/http_list_telegram_light.png differ diff --git a/docs/docs/assets/http_new_dynamic_all_telegram_dark.png b/docs/docs/assets/http_new_dynamic_all_telegram_dark.png new file mode 100644 index 0000000..6e578f3 Binary files /dev/null and b/docs/docs/assets/http_new_dynamic_all_telegram_dark.png differ diff --git a/docs/docs/assets/http_new_dynamic_all_telegram_light.png b/docs/docs/assets/http_new_dynamic_all_telegram_light.png new file mode 100644 index 0000000..a3c9b80 Binary files /dev/null and b/docs/docs/assets/http_new_dynamic_all_telegram_light.png differ diff --git a/docs/docs/assets/http_new_dynamic_telegram_dark.png b/docs/docs/assets/http_new_dynamic_telegram_dark.png new file mode 100644 index 0000000..882b4b5 Binary files /dev/null and b/docs/docs/assets/http_new_dynamic_telegram_dark.png differ diff --git a/docs/docs/assets/http_new_dynamic_telegram_light.png b/docs/docs/assets/http_new_dynamic_telegram_light.png new file mode 100644 index 0000000..97ad396 Binary files /dev/null and b/docs/docs/assets/http_new_dynamic_telegram_light.png differ diff --git a/docs/docs/assets/http_new_redirect_telegram_dark.png b/docs/docs/assets/http_new_redirect_telegram_dark.png new file mode 100644 index 0000000..f3e0b37 Binary files /dev/null and b/docs/docs/assets/http_new_redirect_telegram_dark.png differ diff --git a/docs/docs/assets/http_new_redirect_telegram_light.png b/docs/docs/assets/http_new_redirect_telegram_light.png new file mode 100644 index 0000000..972189e Binary files /dev/null and b/docs/docs/assets/http_new_redirect_telegram_light.png differ diff --git a/docs/docs/assets/http_test_alert_dynamic_all_telegram_dark.png b/docs/docs/assets/http_test_alert_dynamic_all_telegram_dark.png new file mode 100644 index 0000000..cdf9eee Binary files /dev/null and b/docs/docs/assets/http_test_alert_dynamic_all_telegram_dark.png differ diff --git a/docs/docs/assets/http_test_alert_dynamic_all_telegram_light.png b/docs/docs/assets/http_test_alert_dynamic_all_telegram_light.png new file mode 100644 index 0000000..9c94e86 Binary files /dev/null and b/docs/docs/assets/http_test_alert_dynamic_all_telegram_light.png differ diff --git a/docs/docs/assets/http_test_alert_dynamic_telegram_dark.png b/docs/docs/assets/http_test_alert_dynamic_telegram_dark.png new file mode 100644 index 0000000..e6357d7 Binary files /dev/null and b/docs/docs/assets/http_test_alert_dynamic_telegram_dark.png differ diff --git a/docs/docs/assets/http_test_alert_dynamic_telegram_light.png b/docs/docs/assets/http_test_alert_dynamic_telegram_light.png new file mode 100644 index 0000000..73d784b Binary files /dev/null and b/docs/docs/assets/http_test_alert_dynamic_telegram_light.png differ diff --git a/docs/docs/assets/http_test_alert_redirect_telegram_dark.png b/docs/docs/assets/http_test_alert_redirect_telegram_dark.png new file mode 100644 index 0000000..59a9f66 Binary files /dev/null and b/docs/docs/assets/http_test_alert_redirect_telegram_dark.png differ diff --git a/docs/docs/assets/http_test_alert_redirect_telegram_light.png b/docs/docs/assets/http_test_alert_redirect_telegram_light.png new file mode 100644 index 0000000..5f15b1d Binary files /dev/null and b/docs/docs/assets/http_test_alert_redirect_telegram_light.png differ diff --git a/docs/docs/assets/http_test_dynamic_all_dark.png b/docs/docs/assets/http_test_dynamic_all_dark.png new file mode 100644 index 0000000..0988858 Binary files /dev/null and b/docs/docs/assets/http_test_dynamic_all_dark.png differ diff --git a/docs/docs/assets/http_test_dynamic_all_light.png b/docs/docs/assets/http_test_dynamic_all_light.png new file mode 100644 index 0000000..924cd6b Binary files /dev/null and b/docs/docs/assets/http_test_dynamic_all_light.png differ diff --git a/docs/docs/assets/http_test_dynamic_dark.png b/docs/docs/assets/http_test_dynamic_dark.png new file mode 100644 index 0000000..edf3dea Binary files /dev/null and b/docs/docs/assets/http_test_dynamic_dark.png differ diff --git a/docs/docs/assets/http_test_dynamic_light.png b/docs/docs/assets/http_test_dynamic_light.png new file mode 100644 index 0000000..0ba3dff Binary files /dev/null and b/docs/docs/assets/http_test_dynamic_light.png differ diff --git a/docs/docs/assets/http_test_redirect_dark.png b/docs/docs/assets/http_test_redirect_dark.png new file mode 100644 index 0000000..097f79c Binary files /dev/null and b/docs/docs/assets/http_test_redirect_dark.png differ diff --git a/docs/docs/assets/http_test_redirect_light.png b/docs/docs/assets/http_test_redirect_light.png new file mode 100644 index 0000000..7079553 Binary files /dev/null and b/docs/docs/assets/http_test_redirect_light.png differ diff --git a/docs/docs/assets/list_payloads_filter_telegram_dark.png b/docs/docs/assets/list_payloads_filter_telegram_dark.png new file mode 100644 index 0000000..a20a093 Binary files /dev/null and b/docs/docs/assets/list_payloads_filter_telegram_dark.png differ diff --git a/docs/docs/assets/list_payloads_filter_telegram_light.png b/docs/docs/assets/list_payloads_filter_telegram_light.png new file mode 100644 index 0000000..cef75c8 Binary files /dev/null and b/docs/docs/assets/list_payloads_filter_telegram_light.png differ diff --git a/docs/docs/assets/list_payloads_telegram_dark.png b/docs/docs/assets/list_payloads_telegram_dark.png new file mode 100644 index 0000000..f7e6540 Binary files /dev/null and b/docs/docs/assets/list_payloads_telegram_dark.png differ diff --git a/docs/docs/assets/list_payloads_telegram_light.png b/docs/docs/assets/list_payloads_telegram_light.png new file mode 100644 index 0000000..69eb9db Binary files /dev/null and b/docs/docs/assets/list_payloads_telegram_light.png differ diff --git a/docs/docs/assets/modify_payload_events_telegram_dark.png b/docs/docs/assets/modify_payload_events_telegram_dark.png new file mode 100644 index 0000000..ada651a Binary files /dev/null and b/docs/docs/assets/modify_payload_events_telegram_dark.png differ diff --git a/docs/docs/assets/modify_payload_events_telegram_light.png b/docs/docs/assets/modify_payload_events_telegram_light.png new file mode 100644 index 0000000..10a2403 Binary files /dev/null and b/docs/docs/assets/modify_payload_events_telegram_light.png differ diff --git a/docs/docs/assets/modify_payload_telegram_dark.png b/docs/docs/assets/modify_payload_telegram_dark.png new file mode 100644 index 0000000..7a72f07 Binary files /dev/null and b/docs/docs/assets/modify_payload_telegram_dark.png differ diff --git a/docs/docs/assets/modify_payload_telegram_light.png b/docs/docs/assets/modify_payload_telegram_light.png new file mode 100644 index 0000000..d254b89 Binary files /dev/null and b/docs/docs/assets/modify_payload_telegram_light.png differ diff --git a/docs/docs/guides/dns.md b/docs/docs/guides/dns.md new file mode 100644 index 0000000..643bbb9 --- /dev/null +++ b/docs/docs/guides/dns.md @@ -0,0 +1,174 @@ +--- +sidebar_position: 4 +--- + +# DNS records + +``` +Manage DNS records + +Usage: + /dns [command] + +Available Commands: + /new Create new DNS records + /del Delete DNS record + /list List DNS records + /clr Delete multiple DNS records + +Flags: + -h, --help help for dns + +Use "/dns [command] --help" for more information about a command. +``` + +- You can manage DNS records for subdomains of your payload domains. +- There are several record types supported: "A", "АААА", "МХ", "ТХТ", "CNAME", "NS", "CAA". +- You can set TTL for records. +- Wildcard records are supported. +- Multiple records are supported with different strategies: + - `all` — All values for the record are returned at once. + - `round-robin` - Values for the record are rotated (first returned, then second, then +third, etc.) + - `rebind` - Value for the record depends on time between requests. If time > 3s, the first +value is returned, otherwise the second value. + +## Create new DNS record + +``` +Create new DNS records + +Usage: + /dns new VALUES... [flags] + +Flags: + -h, --help help for new + -n, --name string Subdomain + -p, --payload string Payload name + -s, --strategy string Strategy for multiple records (one of "all", "round-robin", "rebind") (default "all") + -l, --ttl int Record TTL (in seconds) (default 60) + -t, --type string Record type (one of "A", "AAAA", "MX", "TXT", "CNAME", "NS", "CAA") (default "A") +``` + +### Create A-record with IP 127.0.0.1 for payload + +``` +/dns new --payload --name --type A 127.0.0.1 +``` + +![Create new DNS record](../assets/dns_new_telegram_dark.png#gh-dark-mode-only)![Create new DNS record](../assets/dns_new_telegram_light.png#gh-light-mode-only) + +Now `abc.d14a68e4.sonar.test` will respond with IP-address `127.0.0.1` for A-query: + +![Test DNS](../assets/dns_test_dark.png#gh-dark-mode-only)![Test DNS](../assets/dns_test_light.png#gh-light-mode-only) + +And you will also receive an alert: + +![DNS test alert](../assets/dns_test_alert_telegram_dark.png#gh-dark-mode-only)![DNS test alert](../assets/dns_test_alert_telegram_light.png#gh-light-mode-only) + +### Create multiple A-records for payload + +``` +/dns new -p -n -t A 1.1.1.1 2.2.2.2 3.3.3.3 +``` + +![Create new DNS record with multiple IPs](../assets/dns_new_multiple_telegram_dark.png#gh-dark-mode-only)![Create new DNS record with multiple IPs](../assets/dns_new_multiple_telegram_light.png#gh-light-mode-only) + +Now `multiple.d14a68e4.sonar.test` will return all 3 IPs for A record: + +![Test DNS multiple records](../assets/dns_test_multiple_dark.png#gh-dark-mode-only)![Test DNS multiple records](../assets/dns_test_multiple_light.png#gh-light-mode-only) + +And you will also receive an alert: + +![DNS test alert multiple](../assets/dns_test_alert_multiple_telegram_dark.png#gh-dark-mode-only)![DNS test alert multiple](../assets/dns_test_alert_multiple_telegram_light.png#gh-light-mode-only) + +### Create wildcard AAAA-record for payload + +``` +/dns new -p -n "*" -t AAAA 2606:2800:220:1:248:1893:25c8:1946 +``` + +![Create new DNS wildcard record](../assets/dns_new_wildcard_telegram_dark.png#gh-dark-mode-only)![Create new DNS wildcard record](../assets/dns_new_wildcard_telegram_light.png#gh-light-mode-only) + +Now any query for AAAA record on `*.d14a68e4.sonar.test` will return an IP `2606:2800:220:1:248:1893:25c8:1946`: + +![Test DNS wildcard records](../assets/dns_test_wildcard_dark.png#gh-dark-mode-only)![Test DNS wildcard records](../assets/dns_test_wildcard_light.png#gh-light-mode-only) + +And you will also receive an alert: + +![DNS test alert wildcard](../assets/dns_test_alert_wildcard_telegram_dark.png#gh-dark-mode-only)![DNS test alert wildcard](../assets/dns_test_alert_wildcard_telegram_light.png#gh-light-mode-only) + +### Create rebinding record for payload + +``` +/dns new -p -n -l 0 -t A -s rebind 1.1.1.1 127.0.0.1 +``` + +- ⚠️ In this case you must set TTL to 0 (`-l 0` or `--ttl 0`) otherwise it won't work. +- `-s` is shorthand for `--strategy`, the default value is `all`, which means "return all +values for this query at once". In this case we use `rebind`, which means "return the first +value (1.1.1.1) if the record hasn't been requested in the last 3 seconds, otherwise return the +next value (127.0.0.1)". +- This can be used to bypass SSRF checks using TOCTOU issues. + +![Create new DNS rebind record](../assets/dns_new_rebind_telegram_dark.png#gh-dark-mode-only)![Create new DNS rebind record](../assets/dns_new_rebind_telegram_light.png#gh-light-mode-only) + +Here is the result of requesting `rebind.d14a68e4.sonar.test` with delay < 3 seconds between requests: + +![Test DNS rebind records](../assets/dns_test_rebind_1_dark.png#gh-dark-mode-only)![Test DNS rebind records](../assets/dns_test_rebind_1_light.png#gh-light-mode-only) + +And you will also receive an alert: + +![DNS test alert rebind](../assets/dns_test_alert_rebind_telegram_dark.png#gh-dark-mode-only)![DNS test alert rebind](../assets/dns_test_alert_rebind_telegram_light.png#gh-light-mode-only) + +## List records + +``` +List DNS records + +Usage: + /dns list [flags] + +Flags: + -h, --help help for list + -p, --payload string Payload name +``` + +### List DNS records for payload + +``` +/dns list -p +``` + +- Every DNS record has an index, which can be used in `/del` command to remove the record. + +![List DNS records for payload](../assets/dns_list_telegram_dark.png#gh-dark-mode-only)![List DNS records for payload](../assets/dns_list_telegram_light.png#gh-light-mode-only) + +## Delete + +``` +Delete DNS record identified by INDEX + +Usage: + /dns del INDEX [flags] + +Flags: + -h, --help help for del + -p, --payload string Payload name +``` + +### Delete DNS record for payload by index + +``` +/del -p +``` + +![Delete DNS record for payload by index](../assets/dns_del_telegram_dark.png#gh-dark-mode-only)![Delete DNS record for payload by index](../assets/dns_del_telegram_light.png#gh-light-mode-only) + +## Clear DNS records for payload + +``` +/dns clr -p +``` + +![Delete all DNS records for payload](../assets/dns_clear_telegram_dark.png#gh-dark-mode-only)![Delete all DNS records for payload](../assets/dns_clear_telegram_light.png#gh-light-mode-only) diff --git a/docs/docs/guides/events.md b/docs/docs/guides/events.md new file mode 100644 index 0000000..3e1580b --- /dev/null +++ b/docs/docs/guides/events.md @@ -0,0 +1,105 @@ +--- +sidebar_position: 6 +--- + +# Events + +:::warning + +You can only view events for payloads with events logging enabled, see: [Enable events](/sonar/guides/payloads#create-payload-and-enable-event-logging) + +::: + +``` +View events + +Usage: + /events [command] + +Available Commands: + /list List payload events + /get Get payload event by INDEX + +Flags: + -h, --help help for events + +Use "/events [command] --help" for more information about a command. +``` + +## List events for payload + +``` +List payload events + +Usage: + /events list [flags] + +Flags: + -a, --after int After ID + -b, --before int Before ID + -c, --count uint Count of events (default 10) + -h, --help help for list + -p, --payload string Payload name + -r, --reverse List events in reversed order +``` + +### Get last 10 events for payload + +``` +/events list -p +``` + +![List events for payload](../assets/events_list_telegram_dark.png#gh-dark-mode-only)![List events for payload](../assets/events_list_telegram_light.png#gh-light-mode-only) + +### Get last N events for payload + +``` +/events list -p -c +``` + +![List last N events for payload](../assets/events_list_n_telegram_dark.png#gh-dark-mode-only)![List last N events for payload](../assets/events_list_n_telegram_light.png#gh-light-mode-only) + +### Get first N events for payload + +``` +/events list -p -c -r +``` + +![List first N events for payload](../assets/events_list_first_telegram_dark.png#gh-dark-mode-only)![List first N events for payload](../assets/events_list_first_telegram_light.png#gh-light-mode-only) + +### Get N events after Mth event + +``` +/events list -p -c -a +``` + +![List N events after Mth event for payload](../assets/events_list_mn_telegram_dark.png#gh-dark-mode-only)![List N events after Mth event for payload](../assets/events_list_mn_telegram_light.png#gh-light-mode-only) + +### Get N events before Mth event + +``` +/events list -p -c -b +``` + +![List N events before Mth event for payload](../assets/events_list_mn2_telegram_dark.png#gh-dark-mode-only)![List N events before Mth event for payload](../assets/events_list_mn2_telegram_light.png#gh-light-mode-only) + +## Get event + +``` +Get payload event by INDEX + +Usage: + /events get INDEX [flags] + +Flags: + -h, --help help for get + -p, --payload string Payload name +``` + +### Get event for payload by index + +``` +/events get -p +``` + +![Get event for payload by index](../assets/events_get_telegram_dark.png#gh-dark-mode-only)![Get event for payload by index](../assets/events_get_telegram_light.png#gh-light-mode-only) diff --git a/docs/docs/guides/http.md b/docs/docs/guides/http.md new file mode 100644 index 0000000..b0e96ea --- /dev/null +++ b/docs/docs/guides/http.md @@ -0,0 +1,175 @@ +--- +sidebar_position: 5 +--- + +# HTTP routes + +``` +Manage HTTP routes + +Usage: + /http [command] + +Available Commands: + /new Create new HTTP route + /del Delete HTTP route + /list List HTTP routes + /clr Delete multiple HTTP routes + +Flags: + -h, --help help for http + +Use "/http [command] --help" for more information about a command. +``` + +- You can create HTTP routes on your payloads, which will respond with any content you want. +- It is possible to set response status code, headers and body. +- It is possible to create dynamic response based on request headers, query parameters, path +parameters, etc. using Golang template language. +- Data available to use in templates. Example HTTP request for reference: + + ```http + POST /test/PATH?param=QUERY HTTP/1.1 + Host: d14a68e4.sonar.test + User-Agent: curl/7.86.0 + Accept: */* + Param: HEADER + Cookie: param=COOKIE; + Content-Length: 10 + Content-Type: application/x-www-form-urlencoded + Connection: close + + param=FORM + ``` + + - `{{ .Host }}` - HTTP `Host` header: `d14a68e4.sonar.test` + + - `{{ .Method }}` - HTTP method: `POST` + + - `{{ .Path }}` - HTTP path: `/test/PATH` + - `{{ .RawQuery }}` - query part after `?`: `param=QUERY` + - `{{ .RequestURI }}` - fullURI (path + query): `/test/PATH?param=QUERY` + - `{{ .Header "Param" }}` - value of `Param` header: `HEADER` + - `{{ .URLParam "param" }}` - path parameter defined during route creation like + this `/test/{param}`: `PATH` + - `{{ .Query "param" }}` - value of query paramter with name `param`: `QUERY` + - `{{ .Form "param" }}` - value of body parameter with name `param`: `FORM` + - `{{ .Cookie "param" }}` — value of cookie with name `param`: `COOKIE` + +## Create new HTTP route + +``` +Create new HTTP route + +Usage: + /http new BODY [flags] + +Flags: + -c, --code int Response status code (default 200) + -d, --dynamic Interpret body and headers as templates + -H, --header stringArray Response header + -h, --help help for new + -m, --method string Request method (one of "ANY", "CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "TRACE") (default "GET") + -P, --path string Request path (default "/") + -p, --payload string Payload name +``` + +### Create HTTP GET route with 302 redirect to https://example.com on path "/redirect" + +``` +/http new --payload --path /redirect --code 302 --header 'Location: https://example.com' "Redirecting..." +``` + +![Create new HTTP route with redirect](../assets/http_new_redirect_telegram_dark.png#gh-dark-mode-only)![Create new HTTP route with redirect](../assets/http_new_redirect_telegram_light.png#gh-light-mode-only) + +Now `/redirect` on the payload will return code 302, header `Location: https://example.com` and body `Redirecting...`: + +![Test HTTP redirect route](../assets/http_test_redirect_dark.png#gh-dark-mode-only)![Test HTTP redirect route](../assets/http_test_redirect_light.png#gh-light-mode-only) + +And you will also receive an alert: + +![Test HTTP redirect alert](../assets/http_test_alert_redirect_telegram_dark.png#gh-dark-mode-only)![Test HTTP redirect alert](../assets/http_test_alert_redirect_telegram_light.png#gh-light-mode-only) + +### Create HTTP POST route which uses request form parameter in response + +``` +/http new -p -m POST -P /hello -c 200 -d 'Hello {{ .Query "name" }}!' +``` + +![Create new HTTP dynamic POST](../assets/http_new_dynamic_telegram_dark.png#gh-dark-mode-only)![Create new HTTP dynamic POST](../assets/http_new_dynamic_telegram_light.png#gh-light-mode-only) + +Now you can test it by seding `POST` request with form data `name=peter` to `d14a68e4.sonar.test/hello`: + +![Test dynamic HTTP POST route](../assets/http_test_dynamic_dark.png#gh-dark-mode-only)![Test dynamic HTTP POST route](../assets/http_test_dynamic_light.png#gh-light-mode-only) + +And you will also receive an alert: + +![Test HTTP dynamic route alert](../assets/http_test_alert_dynamic_telegram_dark.png#gh-dark-mode-only)![Test HTTP dynamic route alert](../assets/http_test_alert_dynamic_telegram_light.png#gh-light-mode-only) + +### Create HTTP route for any method with all possible dynamic variables in response + +``` +/http new -p test -m ANY -P "/test/{param}" -d '.Host => {{ .Host }}, .Method => {{ .Method }}, .Path => {{ .Path }}, .RawQuery => {{ .RawQuery }}, .RequestURI => {{ .RequestURI }}, .Header "param" => {{ .Header "param" }}, .URLParam "param" => {{ .URLParam "param" }}, .Query "param" => {{ .Query "param" }}, .Form "param" => {{ .Form "param" }}' +``` + +![Create new HTTP dynamic route with all parameters](../assets/http_new_dynamic_all_telegram_dark.png#gh-dark-mode-only)![Create new HTTP dynamic route with all parameters](../assets/http_new_dynamic_all_telegram_light.png#gh-light-mode-only) + +Now you can test it by seding request with `curl`: + +![Test dynamic HTTP route with all parameters](../assets/http_test_dynamic_all_dark.png#gh-dark-mode-only)![Test dynamic HTTP route with all parameters](../assets/http_test_dynamic_all_light.png#gh-light-mode-only) + +And you will also receive an alert: + +![Test HTTP dynamic route alert](../assets/http_test_alert_dynamic_all_telegram_dark.png#gh-dark-mode-only)![Test HTTP dynamic route alert](../assets/http_test_alert_dynamic_all_telegram_light.png#gh-light-mode-only) + +## List HTTP routes + +``` +List HTTP routes + +Usage: + /http list [flags] + +Flags: + -h, --help help for list + -p, --payload string Payload name +``` + +### List HTTP routes for payload + +``` +/http list -p +``` + +- Every HTTP route has an index, which can be used in `/del` command to remove the record. + +![List HTTP routes for payload](../assets/http_list_telegram_dark.png#gh-dark-mode-only)![List HTTP routes for payload](../assets/http_list_telegram_light.png#gh-light-mode-only) + +## Delete HTTP route + +``` +Delete HTTP route identified by INDEX + +Usage: + /http del INDEX [flags] + +Flags: + -h, --help help for del + -p, --payload string Payload name +``` + +### Delete HTTP route for payload by index + +``` +/http del -p +``` + +![Delete HTTP route for payload by index](../assets/http_del_telegram_dark.png#gh-dark-mode-only)![Delete HTTP route for payload by index](../assets/http_del_telegram_light.png#gh-light-mode-only) + +### Clear HTTP routes for payload + +``` +/http clr -p +``` + +![Delete all HTTP routes for payload](../assets/http_clear_telegram_dark.png#gh-dark-mode-only)![Delete all HTTP routes for payload](../assets/http_clear_telegram_light.png#gh-light-mode-only) diff --git a/docs/docs/guides/payloads.md b/docs/docs/guides/payloads.md index f695fba..5d3dd4e 100644 --- a/docs/docs/guides/payloads.md +++ b/docs/docs/guides/payloads.md @@ -2,4 +2,175 @@ sidebar_position: 3 --- -# Manage payloads +# Payloads + +``` +Main commands + /new Create a new payload + /list List payloads + /mod Modify existing payload + /del Delete payload + /clr Delete multiple payloads +``` + +- Payloads are just unique domains with associated names. +enable/disable some protocols for payload, add DNS records, etc.) and to distinguish alerts. +- Payload name (``) is used to identify the payload in commands (when you enable/disable some protocols for the payload, +add DNS records, etc.) and to distinguish alerts. +- You can enable/disable alerts for specific protocols for the payload. +information about all alerts for the payload using CLI tool or API. +- You can enable event logging for the payload. In this case all events will be stored in the Sonar server database and you will be able +to get full information about all alerts for the payload using the CLI tool or API. + +## Create payload + +``` +Create a new payload identified by NAME + +Usage: + /new NAME [flags] + +Flags: + -e, --events Store events in database + -h, --help help for new + -p, --protocols strings Protocols to notify (default [dns,http,smtp,ftp]) +``` + +### Create new payload + +``` +/new +``` + +- `` — could be any string (use quotes if you want to have spaces in name). It is used to +identify your payload in notifications and other commands. + +![Payload creation](../assets/create_payload_telegram_dark.png#gh-dark-mode-only)![Payload creation](../assets/create_payload_telegram_light.png#gh-light-mode-only) + +- You will receive notifications about all DNS, HTTP(s), SMTP, FTP interactions containing your +unique subdomain (`d14a68e4` in example). + +### Create payload and enable alerts only for selected protocols + +``` +/new -p http,dns +``` + +![Payload creation with protocols](../assets/create_payload_protocols_telegram_dark.png#gh-dark-mode-only)![Payload creation with protocols](../assets/create_payload_protocols_telegram_light.png#gh-light-mode-only) + +### Create payload and enable event logging + +``` +/new -e +``` + +- By default events are not stored in the database. Event storage is usetul it you want to +automate something and retrieve all events for your subdomain using API or CLI tool. + +![Payload creation with events logging](../assets/create_payload_events_telegram_dark.png#gh-dark-mode-only)![Payload creation with events logging](../assets/create_payload_events_telegram_light.png#gh-light-mode-only) + + +## List payloads + +``` +List payloads whose NAME contain SUBSTR + +Usage: + /list [SUBSTR] [flags] + +Flags: + -h, --help help for list +``` + +### List all payloads + +``` +/list +``` + +![List payloads](../assets/list_payloads_telegram_dark.png#gh-dark-mode-only)![List payloads](../assets/list_payloads_telegram_light.png#gh-light-mode-only) + +### List payloads containing "SUBSTR" in name + +``` +/list +``` + +![List payloads](../assets/list_payloads_filter_telegram_dark.png#gh-dark-mode-only)![List payloads](../assets/list_payloads_filter_telegram_light.png#gh-light-mode-only) + +## Modify payload + +``` +Modify existing payload identified by NAME + +Usage: + /mod NAME [flags] + +Flags: + -e, --events Store events in database + -h, --help help for mod + -n, --name string Payload name + -p, --protocols strings Protocols to notify +``` + +### Change the protocols for the payload for which you want to be alerted + +``` +/mod -p smtp +``` + +![Modify payload's protocols](../assets/modify_payload_telegram_dark.png#gh-dark-mode-only)![Modify payload's protocols](../assets/modify_payload_telegram_light.png#gh-light-mode-only) + +### Enable events logging for the payload + +``` +/mod -e +``` + +![Enable events logging for payload](../assets/modify_payload_events_telegram_dark.png#gh-dark-mode-only)![Enable events logging for payload](../assets/modify_payload_events_telegram_light.png#gh-light-mode-only) + +## Delete payload + +``` +Delete payload identified by NAME + +Usage: + /del NAME [flags] + +Flags: + -h, --help help for del +``` + +### Delete single payload by name + +``` +/del +``` + +## Clear payloads + +``` +Delete payloads that have a SUBSTR in their NAME + +Usage: + /clr [SUBSTR] [flags] + +Flags: + -h, --help help for clr +``` + +### Delete all payloads + +``` +/clr +``` + +![Delete all payloads](../assets/clear_all_telegram_dark.png#gh-dark-mode-only)![Delete all payloads](../assets/clear_all_telegram_light.png#gh-light-mode-only) + +### Delete payloads containing "SUBSTR" in name + +``` +/clr +``` + +![Delete payloads containing "SUBSTR"](../assets/clear_telegram_dark.png#gh-dark-mode-only)![Delete payloads containing "SUBSTR"](../assets/clear_telegram_light.png#gh-light-mode-only) diff --git a/docs/docs/guides/profile.md b/docs/docs/guides/profile.md new file mode 100644 index 0000000..356e8d2 --- /dev/null +++ b/docs/docs/guides/profile.md @@ -0,0 +1,24 @@ +--- +sidebar_position: 7 +--- + +# Profile + +``` +Get current user info + +Usage: + /profile [flags] + +Flags: + -h, --help help for profile +``` + +## Get current user info + +``` +/profile +``` + +![Get current user info](../assets/telegram_token_dark.png#gh-dark-mode-only)![Get current user info](../assets/telegram_token_light.png#gh-light-mode-only) + diff --git a/docs/docs/guides/quick-start.md b/docs/docs/guides/quick-start.md index d22da64..1e0f75d 100644 --- a/docs/docs/guides/quick-start.md +++ b/docs/docs/guides/quick-start.md @@ -16,7 +16,7 @@ Sonar can be managed either by sending messages to the chat with the bot in Mess 2. Create a new payload with the command `/new `. Select 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) + ![Payload creation in Telegram](../assets/create_payload_telegram_dark.png#gh-dark-mode-only)![Payload creation in Telegram](../assets/create_payload_telegram_light.png#gh-light-mode-only) 1. Install and configure CLI as described [here](/sonar/install/client). diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index 0b8fc24..ec0dc69 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", "bash", "shell-session"], + additionalLanguages: ["yaml", "toml", "bash", "shell-session", "http"], }, } satisfies Preset.ThemeConfig, }; diff --git a/internal/cmd/messengers.go b/internal/cmd/messengers.go index ef6856d..724b064 100644 --- a/internal/cmd/messengers.go +++ b/internal/cmd/messengers.go @@ -25,10 +25,16 @@ Aliases: {{.NameAndAliases}}{{end}}{{if .HasExample}} Examples: -{{.Example}}{{end}}{{if .HasAvailableSubCommands}} +{{.Example}}{{end}}{{if .HasAvailableSubCommands}}{{$cmds := .Commands}}{{if eq (len .Groups) 0}} -Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}} - /{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} +Available Commands:{{range $cmds}}{{if (or .IsAvailableCommand (eq .Name "help"))}} + /{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{else}}{{range $group := .Groups}} + +{{.Title}}{{range $cmds}}{{if (and (eq .GroupID $group.ID) (or .IsAvailableCommand (eq .Name "help")))}} + /{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if not .AllChildCommandsHaveGroup}} + +Additional Commands:{{range $cmds}}{{if (and (eq .GroupID "") (or .IsAvailableCommand (eq .Name "help")))}} + /{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} Flags: {{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}} @@ -40,3 +46,5 @@ Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}} {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}} Use "{{if .HasParent}}{{.CommandPath | replace "sonar " "/"}} {{else}}/{{end}}[command] --help" for more information about a command.{{end}}` + +