From 9b2b7ad3adf23f7c30ac0039c1130ace69f1d562 Mon Sep 17 00:00:00 2001 From: Anemys <51196227+Anemys@users.noreply.github.com> Date: Sun, 7 Jan 2024 23:36:08 +0100 Subject: [PATCH] Add SourceIP in NetworkConfig (#4566) Co-authored-by: Abdelmalik KERBADOU Co-authored-by: Sandeep Singh --- lib/config.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/config.go b/lib/config.go index 07c890e1df..3f3e21ae22 100644 --- a/lib/config.go +++ b/lib/config.go @@ -227,7 +227,7 @@ type NetworkConfig struct { TrackError []string // Adds given errors to max host error watchlist DisableMaxHostErr bool // Disable max host error optimization (Hosts are not skipped even if they are not responding) Interface string // Interface to use for network scan - + SourceIP string // SourceIP sets custom source IP address for network requests } // WithNetworkConfig allows setting network config options @@ -241,6 +241,7 @@ func WithNetworkConfig(opts NetworkConfig) NucleiSDKOptions { e.opts.LeaveDefaultPorts = opts.LeaveDefaultPorts e.hostErrCache = hosterrorscache.New(opts.MaxHostError, hosterrorscache.DefaultMaxHostsCount, opts.TrackError) e.opts.Interface = opts.Interface + e.opts.SourceIP = opts.SourceIP return nil } }