From f7bf368df61b11c9b007ee138d4bff54ca04ef9a Mon Sep 17 00:00:00 2001 From: onSec-fr <59887731+onSec-fr@users.noreply.github.com> Date: Tue, 7 Oct 2025 10:50:28 +0200 Subject: [PATCH 1/2] Add custom user agent option Allow specifying a custom user agent via the global flag --user-agent (-U). If no value is provided, the application falls back to the default user agent. --- client/rest/http.go | 9 +++++++-- config/config.go | 9 +++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/client/rest/http.go b/client/rest/http.go index cc729fe7..52e8aba9 100644 --- a/client/rest/http.go +++ b/client/rest/http.go @@ -128,8 +128,13 @@ func NewRequest( req.Header.Set("Accept", "application/json") } - // set azurehound as user-agent - req.Header.Set("User-Agent", constants.UserAgent()) + // set azurehound as user-agent, use custom if set in config + ua := config.UserAgent.Value() + if s, ok := ua.(string); ok && s != "" { + req.Header.Set("User-Agent", s) + } else { + req.Header.Set("User-Agent", constants.UserAgent()) + } return req, nil } } diff --git a/config/config.go b/config/config.go index dae48594..1ef1efd1 100644 --- a/config/config.go +++ b/config/config.go @@ -355,6 +355,14 @@ var ( Default: "", } + UserAgent = Config{ + Name: "user-agent", + Shorthand: "U", + Usage: "Custom User-Agent header", + Persistent: true, + Default: "", + } + GlobalConfig = []Config{ ConfigFile, VerbosityLevel, @@ -364,6 +372,7 @@ var ( Proxy, RefreshToken, Pprof, + UserAgent, } AzureConfig = []Config{ From bda7547cce9135dd7782a8ca2e42fc2efd9baf88 Mon Sep 17 00:00:00 2001 From: onSec-fr <59887731+onSec-fr@users.noreply.github.com> Date: Tue, 7 Oct 2025 11:05:24 +0200 Subject: [PATCH 2/2] retrigger checks