Skip to content

Commit

Permalink
Bhlast DNS Configuration implementation (#3)
Browse files Browse the repository at this point in the history
* Bhlast DNS Configuration implementation

* fix fmt
  • Loading branch information
nikola-jokic authored Jan 19, 2025
1 parent 8e0c50c commit d8654ae
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 8 deletions.
2 changes: 1 addition & 1 deletion content/1.workflows/4.scheduling.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Scheduling"
description: "How workflows are scheduled"
description: "How does BountyHub schedule your workflows"
---

## Picking the runner
Expand Down
36 changes: 29 additions & 7 deletions content/3.bhlast/1.about.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ ProjectDiscovery published an amazing tool called [interactsh](https://github.co

Since this platform is meant to eliminate as much of the boring work that you need to do in order to be successful, and to work on the stuff while you are not hacking, having this functionality is a **must**.

Therefore, I decided to learn from their implementation, and start building it. The new implementation is not feature complete. It only supports DNS and HTTP(s) protocols. This is good enough to get started, and the rest will be added as needed.

::alert{type="info"}
Thank you to ProjectDiscovery for open-sourcing this great tool! Bhlast implementation is heavily influenced by your work.
Thank you to ProjectDiscovery for open-sourcing this great tool! Bhlast implementation is heavily influenced by your work!
::

## How it works?
Expand All @@ -26,29 +28,49 @@ Each server gets random subdomain unique to your account. In order to avoid havi
Server is listening on following:

::list{type="primary"}

- HTTP (TCP port 80)
- HTTPS (TCP port 443)
- DNS (TCP and UDP port 53)
- Serve static files
- Get notified on interactions

::

## Default behavior

To track interactions per user, each user will get unique
subdomain. Everything associated with that subdomain, or
subdomain of that subdomain will be tracked for your account.

### HTTP

When you visit the [bhlast.com](https://bhlast.com), static page will be displayed. This static page is only used to point you to the documentation, and to show basic information about this server.

The `bhlast.com` supports both HTTP and HTTPS. The same
server will be used to serve custom responses (soon), and
to serve static files. As with everything, if notifications
are configured, each interaction will issue a notification.

### DNS

Each `bhlast` server gets its own subdomain. Each subdomain is unique random lowercase alphanumeric string. Every interaction with that subdomain will be recorded.
The DNS server is created not only to track DNS
interactions, but also to provide a configurable way
you can use to serve CUSTOM DNS records.

For example, let's say your ID is `ng3iqaju5npgoeuo`.

Each interaction with `ng3iqaju5npgoeuo.bhlast.com` will
be recorded. However, let's say you want to create a
DNS record that will serve address for localhost.

By default, you will also get following subdomains:
You can create a subdomain with `A` record to point to
`127.0.0.1`. Let's call that record `localhost`. Now,
when `localhost.ng3iqaju5npgoeuo.bhlast.com` is requested,
the interaction will be tracked and the `A` record will
be served, pointing to `127.0.0.1`.

- aws.\[id\].bhlast.com -> 169.254.169.254
- alibaba.\[id\].bhlast.com -> 100.100.100.200
- localhost.\[id\].bhlast.com -> 127.0.0.1
- oracle.\[id\].bhlast.com -> 127.0.0.1
Learn more about how to configure the DNS server [here](/bhlast/config#dns).

## Server registration and configuration

Expand Down
73 changes: 73 additions & 0 deletions content/3.bhlast/2.config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Configuration

Each configuration is defined using YAML. This feature is still in `alpha`, but working on improving it.

Let's discover configuration options for each server.

## DNS

Configuration portion under `dns` object is used to configure
your custom DNS server.

If empty, the default resolver will still track interactions, and
serve default responses.

You can always go back and configure it when needed.

### `dns.[subdomain]`

Under DNS, each field represents a subdomain of your own subdomain.
That means that subdomain **MUST** follow the rules for subdomain.

::alert{type="danger"}
Each domain must have up to 255 characters. FQDN adds a dot to the normal
domain we all know. That means that `bountyhub.org` becomes `bountyhub.org.`.

Your own ID takes 16 characters, add 2 dots to it (before and after) and you
can specify a subdomain up to 226 ASCII characters.
::

### `dns.[subdomain].A`

This specification is an object defining the IP address with the optional TTL
parameter. This is the record that will be served for `A` lookup whenever
`[subdomain]` is requested.

### `dns.[subdomain].A.ip`

The IPv4 address served for the subdomain lookup.

### `dns.[subdomain].A.ttl`

The TTL used for this A record. If not specified, the default TTL
will be used.

### `dns.[subdomain].AAAA`

This specification is an object defining the IP address with the optional TTL
parameter. This is the record that will be served for `AAAA` lookup whenever
`[subdomain]` is requested.

### `dns.[subdomain].AAAA.ip`

The IPv6 address served for the subdomain lookup.

If you specify an IPv4 address, it will be converted to its IPv4 equivalent.

### `dns.[subdomain].AAAA.ttl`

The TTL used for this A record. If not specified, the default TTL
will be used.

### `dns.[subdomain].TXT`

This specification provides values served when `TXT` record is looked up.

### `dns.[subdomain].TXT.values`

Values used to serve when TXT record is requested.

### `dns.[subdomain].TXT.ttl`

Optional TTL parameter served when the TXT record is requested.
If not specified, the default TTL will be used.

0 comments on commit d8654ae

Please sign in to comment.