You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhance documentation and configuration for subenum project
- Updated _config.yml to improve project description and added repository URL.
- Added front matter to ARCHITECTURE.md, CONTRIBUTING.md, and DEVELOPER_GUIDE.md for better Jekyll site integration.
- Revised index.md to link to Docker usage documentation correctly.
- Expanded the project structure in the Developer Guide to include new files and directories for better clarity.
Copy file name to clipboardExpand all lines: docs/ARCHITECTURE.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,8 @@
1
+
---
2
+
layout: default
3
+
title: Architecture
4
+
---
5
+
1
6
# Architecture
2
7
3
8
This document describes the architecture of the `subenum` tool, a Go-based command-line utility for subdomain enumeration.
@@ -47,14 +52,14 @@ This architecture is designed to be efficient by performing multiple DNS lookups
47
52
48
53
***Purpose**: This is the core component responsible for performing the actual DNS lookup for each constructed subdomain (e.g., `prefix.targetdomain.com`). It determines if a subdomain has a valid DNS record (typically A or CNAME, though the current implementation checks for any successful resolution).
* Function: `resolveDomainWithRetry(ctx context.Context, domain string, timeout time.Duration, dnsServer string, verbose bool, maxRetries int) bool` — wraps `resolveDomain` with configurable retry logic and exponential backoff between attempts.
52
57
*`net.Resolver{}`: A custom DNS resolver is configured.
53
58
*`PreferGo: true`: Instructs the resolver to use the pure Go DNS client.
54
59
*`Dial func(ctx context.Context, network, address string) (net.Conn, error)`: A custom dial function is provided to control the connection to the DNS server, using the user-specified `dnsServer` address.
55
60
*`net.Dialer{Timeout: timeout}`: A `Dialer` is created with the user-specified timeout.
56
61
*`d.DialContext(ctx, "udp", dnsServer)`: Establishes a UDP connection to the configured DNS server.
57
-
*`resolver.LookupHost(context.Background(), domain)`: Performs the DNS lookup for the given domain. It attempts to find A or AAAA records for the host.
62
+
*`resolver.LookupHost(timeoutCtx, domain)`: Performs the DNS lookup for the given domain. The context is derived from the caller via `context.WithTimeout(ctx, timeout)`, so both the per-query timeout and SIGINT cancellation are respected. It attempts to find A or AAAA records for the host.
58
63
* The function returns `true` if `LookupHost` returns no error (i.e., the domain resolved), and `false` otherwise.
59
64
***Interactions**: Workers call `resolveDomainWithRetry`, which delegates to `resolveDomain` with retry logic. It takes a fully qualified domain name, timeout duration, DNS server address, verbose flag, and retry count as input. It outputs a boolean indicating whether the domain resolved successfully. The result is used to decide if the domain should be printed to the console and/or written to the output file.
0 commit comments