[SHEHZADE//ABDULLAH ANSARI]
Red Team Consultant @ Google | MS in Cybersecurity @ NYU
● Notice //GitHub (@shehzade) is temporarily suspended pending an automated false-positive review. All tools are hosted on this Code Mirror and available on request (contact); GitHub links will return once reinstated.
PUBLIC MIRRORGo v1.0
Multi-protocol network egress assessment and DLP verification framework featuring automated L4 sweeps, corporate proxy traversal, and covert protocol smuggling across 20+ channels.
$
git clone https://shehzade.io/repos/contraband.git
Copy
Source ZIP (1.93 MB)
39 lines · 1.0 KB
| 1 | //go:build windows |
| 2 | |
| 3 | package proxy |
| 4 | |
| 5 | import ( |
| 6 | "golang.org/x/sys/windows/registry" |
| 7 | ) |
| 8 | |
| 9 | // WindowsProxyConfig holds Windows-specific proxy settings. |
| 10 | type WindowsProxyConfig struct { |
| 11 | AutoDetect bool |
| 12 | AutoConfigURL string |
| 13 | Proxy string |
| 14 | ProxyBypass string |
| 15 | } |
| 16 | |
| 17 | // GetWindowsProxyConfig retrieves Windows proxy configuration from HKCU Internet Settings registry. |
| 18 | func GetWindowsProxyConfig() (*WindowsProxyConfig, error) { |
| 19 | k, err := registry.OpenKey(registry.CURRENT_USER, `Software\Microsoft\Windows\CurrentVersion\Internet Settings`, registry.QUERY_VALUE) |
| 20 | if err != nil { |
| 21 | return nil, err |
| 22 | } |
| 23 | defer k.Close() |
| 24 | |
| 25 | cfg := &WindowsProxyConfig{} |
| 26 | if enable, _, err := k.GetIntegerValue("ProxyEnable"); err == nil && enable == 1 { |
| 27 | if server, _, err := k.GetStringValue("ProxyServer"); err == nil { |
| 28 | cfg.Proxy = server |
| 29 | } |
| 30 | if bypass, _, err := k.GetStringValue("ProxyOverride"); err == nil { |
| 31 | cfg.ProxyBypass = bypass |
| 32 | } |
| 33 | } |
| 34 | if autoConfig, _, err := k.GetStringValue("AutoConfigURL"); err == nil { |
| 35 | cfg.AutoConfigURL = autoConfig |
| 36 | } |
| 37 | |
| 38 | return cfg, nil |
| 39 | } |