From a63da9d0fe6ccbe3909598c2156fe2701b846d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B0=D0=BD=D1=8E=D0=BA=D0=BE=D0=B2=20=D0=9D=D0=B8?= =?UTF-8?q?=D0=BA=D0=B8=D1=82=D0=B0=20=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0?= =?UTF-8?q?=D0=BD=D0=B4=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Mon, 5 Aug 2024 10:18:12 +0300 Subject: [PATCH 1/2] Adds an option to disable system-wide proxy --- cmd/spoof-dpi/main.go | 13 +++++++++---- util/config.go | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cmd/spoof-dpi/main.go b/cmd/spoof-dpi/main.go index 57fc3b2..223bd5d 100644 --- a/cmd/spoof-dpi/main.go +++ b/cmd/spoof-dpi/main.go @@ -39,8 +39,10 @@ func main() { util.PrintColoredBanner() } - if err := util.SetOsProxy(*config.Port); err != nil { - log.Fatal(err) + if *config.SystemProxy { + if err := util.SetOsProxy(*config.Port); err != nil { + log.Fatal(err) + } } go pxy.Start() @@ -63,7 +65,10 @@ func main() { }() <-done - if err := util.UnsetOsProxy(); err != nil { - log.Fatal(err) + + if *config.SystemProxy { + if err := util.UnsetOsProxy(); err != nil { + log.Fatal(err) + } } } diff --git a/util/config.go b/util/config.go index 9962e8b..1adf5e6 100644 --- a/util/config.go +++ b/util/config.go @@ -19,6 +19,7 @@ type Config struct { EnableDoh *bool Debug *bool NoBanner *bool + SystemProxy *bool Timeout *int AllowedPattern *regexp.Regexp AllowedUrls *regexp.Regexp @@ -54,6 +55,7 @@ func ParseArgs() { config.EnableDoh = flag.Bool("enable-doh", false, "enable 'dns over https'") config.Debug = flag.Bool("debug", false, "enable debug output") config.NoBanner = flag.Bool("no-banner", false, "disable banner") + config.SystemProxy = flag.Bool("system-proxy", false, "enable system-wide proxy") config.Timeout = flag.Int("timeout", 0, "timeout in milliseconds. no timeout when not given") config.WindowSize = flag.Int("window-size", 0, `chunk size, in number of bytes, for fragmented client hello, try lower values if the default value doesn't bypass the DPI; From 467a5f32e3f0bf2d8b23cecc1eeb7c2e0bacd9c8 Mon Sep 17 00:00:00 2001 From: BuzzBuzzards <81798239+BuzzBuzzards@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:49:02 +0300 Subject: [PATCH 2/2] Changes default value for the system-wide proxy toggle to true --- util/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/config.go b/util/config.go index 1adf5e6..a860589 100644 --- a/util/config.go +++ b/util/config.go @@ -55,7 +55,7 @@ func ParseArgs() { config.EnableDoh = flag.Bool("enable-doh", false, "enable 'dns over https'") config.Debug = flag.Bool("debug", false, "enable debug output") config.NoBanner = flag.Bool("no-banner", false, "disable banner") - config.SystemProxy = flag.Bool("system-proxy", false, "enable system-wide proxy") + config.SystemProxy = flag.Bool("system-proxy", true, "enable system-wide proxy") config.Timeout = flag.Int("timeout", 0, "timeout in milliseconds. no timeout when not given") config.WindowSize = flag.Int("window-size", 0, `chunk size, in number of bytes, for fragmented client hello, try lower values if the default value doesn't bypass the DPI;