From 6b8db926eb5746869f8ffce2ec2a373a216de956 Mon Sep 17 00:00:00 2001 From: Brian Dwyer Date: Fri, 5 Mar 2021 14:04:37 -0500 Subject: [PATCH] Swap to my forks --- go.mod | 9 +- go.sum | 24 ++-- pkg/gontlm-proxy.go | 2 +- .../go-get-proxied/LICENSE.txt | 0 .../go-get-proxied/proxy/doc.go | 2 +- .../go-get-proxied/proxy/provider.go | 0 .../go-get-proxied/proxy/provider_darwin.go | 1 + .../go-get-proxied/proxy/provider_linux.go | 0 .../go-get-proxied/proxy/provider_windows.go | 2 +- .../go-get-proxied/proxy/proxy.go | 0 .../go-get-proxied/proxy/url.go | 0 .../go-get-proxied/winhttp/winhttp.go | 0 .../proxyplease/.gitignore | 0 .../{aus => bdwyertech}/proxyplease/LICENSE | 0 .../{aus => bdwyertech}/proxyplease/README.md | 0 .../{aus => bdwyertech}/proxyplease/basic.go | 0 .../proxyplease/connect.go | 0 .../{aus => bdwyertech}/proxyplease/debug.go | 0 .../{aus => bdwyertech}/proxyplease/go.mod | 7 +- .../{aus => bdwyertech}/proxyplease/go.sum | 33 ++++- .../proxyplease/negotiate_other.go | 0 .../proxyplease/negotiate_windows.go | 0 .../proxyplease/ntlm_other.go | 0 .../proxyplease/ntlm_windows.go | 0 .../{aus => bdwyertech}/proxyplease/proxy.go | 2 +- .../{aus => bdwyertech}/proxyplease/socks.go | 0 .../golang.org/x/sys/windows/svc/security.go | 100 +++++++++++---- .../x/sys/windows/syscall_windows.go | 61 --------- .../golang.org/x/sys/windows/types_windows.go | 116 ------------------ .../x/sys/windows/zsyscall_windows.go | 73 ----------- vendor/modules.txt | 18 ++- 31 files changed, 139 insertions(+), 311 deletions(-) rename vendor/github.com/{rapid7 => bdwyertech}/go-get-proxied/LICENSE.txt (100%) rename vendor/github.com/{rapid7 => bdwyertech}/go-get-proxied/proxy/doc.go (95%) rename vendor/github.com/{rapid7 => bdwyertech}/go-get-proxied/proxy/provider.go (100%) rename vendor/github.com/{rapid7 => bdwyertech}/go-get-proxied/proxy/provider_darwin.go (99%) rename vendor/github.com/{rapid7 => bdwyertech}/go-get-proxied/proxy/provider_linux.go (100%) rename vendor/github.com/{rapid7 => bdwyertech}/go-get-proxied/proxy/provider_windows.go (99%) rename vendor/github.com/{rapid7 => bdwyertech}/go-get-proxied/proxy/proxy.go (100%) rename vendor/github.com/{rapid7 => bdwyertech}/go-get-proxied/proxy/url.go (100%) rename vendor/github.com/{rapid7 => bdwyertech}/go-get-proxied/winhttp/winhttp.go (100%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/.gitignore (100%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/LICENSE (100%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/README.md (100%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/basic.go (100%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/connect.go (100%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/debug.go (100%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/go.mod (52%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/go.sum (57%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/negotiate_other.go (100%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/negotiate_windows.go (100%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/ntlm_other.go (100%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/ntlm_windows.go (100%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/proxy.go (98%) rename vendor/github.com/{aus => bdwyertech}/proxyplease/socks.go (100%) diff --git a/go.mod b/go.mod index 02c1a95..bc225b0 100644 --- a/go.mod +++ b/go.mod @@ -4,21 +4,16 @@ go 1.16 replace github.com/elazarl/goproxy => github.com/bdwyertech/goproxy v0.0.0-20200419011457-7aaf118834c9 -replace github.com/aus/proxyplease => github.com/bdwyertech/proxyplease v0.1.1-0.20210304025852-a16bce5f30dd - -// My branch supports reading PAC from Mac SCUtil Config -replace github.com/rapid7/go-get-proxied => github.com/bdwyertech/go-get-proxied v0.0.0-20210305160813-ca7ca4cda17c - // replace github.com/aus/proxyplease => ../proxyplease // replace github.com/rapid7/go-get-proxied => ../go-get-proxied require ( - github.com/aus/proxyplease v0.0.0-00010101000000-000000000000 + github.com/bdwyertech/proxyplease v0.1.1-0.20210305210130-a100ce82b827 github.com/elazarl/goproxy v0.0.0-00010101000000-000000000000 github.com/kardianos/service v1.2.0 github.com/mattn/go-colorable v0.1.8 github.com/mattn/go-isatty v0.0.12 github.com/sirupsen/logrus v1.8.0 - golang.org/x/sys v0.0.0-20210305034016-7844c3c200c3 + golang.org/x/sys v0.0.0-20210304203840-7b4935edff86 ) diff --git a/go.sum b/go.sum index bb6c2db..f215eda 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,15 @@ +github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 h1:Kk6a4nehpJ3UuJRqlA3JxYxBZEqCeOmATOvrbT4p9RA= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4= -github.com/bdwyertech/go-get-proxied v0.0.0-20210305160813-ca7ca4cda17c h1:pgMz8KsYfNp8rCXMr6c+92CHIx5vs0DRQpMm4uUfwgQ= -github.com/bdwyertech/go-get-proxied v0.0.0-20210305160813-ca7ca4cda17c/go.mod h1:naQjqgnUovcdHd48PuNF3PFU3cwS/oaVFfvf7dIFCes= +github.com/aus/proxyplease v0.1.0/go.mod h1:hIgmILi8LhQ+6f1CZKQFCPyM4rjOyXTnQq0MSBa1UMk= +github.com/bdwyertech/go-get-proxied v0.0.0-20210305205935-912c3d1ded9e h1:y76jg9cKgIiVi2hbqulYJr39CpO99ajl4h9ede7oRnI= +github.com/bdwyertech/go-get-proxied v0.0.0-20210305205935-912c3d1ded9e/go.mod h1:gM7ddayfKDubVwLb5eu7Anq8gih5R74RR63b9hxCRA4= github.com/bdwyertech/go-scutil v0.0.0-20210305044044-814e0f3f0cd3 h1:oMOwe3KddRPeMJkr+oYXQcJua9kZbIUCq30Ze/QYGJE= github.com/bdwyertech/go-scutil v0.0.0-20210305044044-814e0f3f0cd3/go.mod h1:gV303gJocqRNJVrg/n4cB+ZwoHxKKMiAiwe+t627Kjw= github.com/bdwyertech/goproxy v0.0.0-20200419011457-7aaf118834c9 h1:Eu3d1Y6dGkfqvQ+S0v5RccH8pBZlzhOTBU+U7NQmlRs= github.com/bdwyertech/goproxy v0.0.0-20200419011457-7aaf118834c9/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= -github.com/bdwyertech/proxyplease v0.1.1-0.20210304025852-a16bce5f30dd h1:MuroEdaY4e8zt4K++2uqnl1CLkCqu/pvpV+Iq6WTkrc= -github.com/bdwyertech/proxyplease v0.1.1-0.20210304025852-a16bce5f30dd/go.mod h1:ZHaPOAtIsr8KPMDbp60vH/LCYuBkoUwDVDDzXjmOdl0= +github.com/bdwyertech/proxyplease v0.1.1-0.20210305210130-a100ce82b827 h1:10AC1o6J6f9IedR3Oq+R/nb8cAw8BGxY794j7aRIiQk= +github.com/bdwyertech/proxyplease v0.1.1-0.20210305210130-a100ce82b827/go.mod h1:7QvkgCxa9M28QJMYs0ji/c+C92p4DvEz2uPFKq+EsM0= github.com/darren/gpac v0.0.0-20201209040425-3300e0622b93 h1:H6CW26kV4Egh6/v0o7Nd33ArRtwfQ9erfrVzOCZ1O6Q= github.com/darren/gpac v0.0.0-20201209040425-3300e0622b93/go.mod h1:1Id6bMaG5dQYTt+Pk0msQw4r/+kkuzfuFwoictr5mcU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -19,6 +21,7 @@ github.com/dop251/goja v0.0.0-20200629185240-bfd59704b500 h1:QthjkRYZQj+FcH5GZXl github.com/dop251/goja v0.0.0-20200629185240-bfd59704b500/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2 h1:dWB6v3RcOy03t/bUadywsbyrQwCqZeNIEX6M1OtSZOM= github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= +github.com/git-lfs/go-ntlm v0.0.0-20190401175752-c5056e7fa066/go.mod h1:YnCP1lAyul0ITv9nT/OqXseZmGeaqvMVa2uvl8ssQvE= github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -38,18 +41,21 @@ github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoU github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rapid7/go-get-proxied v0.0.0-20181210221417-16249a544090/go.mod h1:ELOKvSUbHx1oVeecsknc02S0eEAFD+TdV3rTt3BcNzM= github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU= github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -57,12 +63,11 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210304203840-7b4935edff86 h1:TmVfeQsidiBAiZMvxnHWD63KxYBVCiFs+k/pWtzhllI= golang.org/x/sys v0.0.0-20210304203840-7b4935edff86/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305034016-7844c3c200c3 h1:RdE7htvBru4I4VZQofQjCZk5W9+aLNlSF5n0zgVwm8s= -golang.org/x/sys v0.0.0-20210305034016-7844c3c200c3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= @@ -73,5 +78,6 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +h12.io/socks v1.0.1/go.mod h1:AIhxy1jOId/XCz9BO+EIgNL2rQiPTBNnOfnVnQ+3Eck= h12.io/socks v1.0.2 h1:cZhhbV8+DE0Y1kotwhr1a3RC3kFO7AtuZ4GLr3qKSc8= h12.io/socks v1.0.2/go.mod h1:AIhxy1jOId/XCz9BO+EIgNL2rQiPTBNnOfnVnQ+3Eck= diff --git a/pkg/gontlm-proxy.go b/pkg/gontlm-proxy.go index 9e2022e..ad0eb81 100644 --- a/pkg/gontlm-proxy.go +++ b/pkg/gontlm-proxy.go @@ -12,7 +12,7 @@ import ( log "github.com/sirupsen/logrus" - "github.com/aus/proxyplease" + "github.com/bdwyertech/proxyplease" "github.com/elazarl/goproxy" // "github.com/bhendo/concord" // "github.com/bhendo/concord/handshakers" diff --git a/vendor/github.com/rapid7/go-get-proxied/LICENSE.txt b/vendor/github.com/bdwyertech/go-get-proxied/LICENSE.txt similarity index 100% rename from vendor/github.com/rapid7/go-get-proxied/LICENSE.txt rename to vendor/github.com/bdwyertech/go-get-proxied/LICENSE.txt diff --git a/vendor/github.com/rapid7/go-get-proxied/proxy/doc.go b/vendor/github.com/bdwyertech/go-get-proxied/proxy/doc.go similarity index 95% rename from vendor/github.com/rapid7/go-get-proxied/proxy/doc.go rename to vendor/github.com/bdwyertech/go-get-proxied/proxy/doc.go index 396635c..63e06d4 100644 --- a/vendor/github.com/rapid7/go-get-proxied/proxy/doc.go +++ b/vendor/github.com/bdwyertech/go-get-proxied/proxy/doc.go @@ -26,7 +26,7 @@ // package main // // import ( -// "github.com/rapid7/go-get-proxied/proxy" +// "github.com/bdwyertech/go-get-proxied/proxy" // ) // // func main() { diff --git a/vendor/github.com/rapid7/go-get-proxied/proxy/provider.go b/vendor/github.com/bdwyertech/go-get-proxied/proxy/provider.go similarity index 100% rename from vendor/github.com/rapid7/go-get-proxied/proxy/provider.go rename to vendor/github.com/bdwyertech/go-get-proxied/proxy/provider.go diff --git a/vendor/github.com/rapid7/go-get-proxied/proxy/provider_darwin.go b/vendor/github.com/bdwyertech/go-get-proxied/proxy/provider_darwin.go similarity index 99% rename from vendor/github.com/rapid7/go-get-proxied/proxy/provider_darwin.go rename to vendor/github.com/bdwyertech/go-get-proxied/proxy/provider_darwin.go index a0be558..ac2c45b 100644 --- a/vendor/github.com/rapid7/go-get-proxied/proxy/provider_darwin.go +++ b/vendor/github.com/bdwyertech/go-get-proxied/proxy/provider_darwin.go @@ -183,6 +183,7 @@ func (p *providerDarwin) scutil(protocol string, targetUrl *url.URL) (Proxy, err if scutilCfg.ProxyAutoConfigEnable == "1" && scutilCfg.ProxyAutoConfigURLString != "" { pacOnce.Do(func() { + log.Println("[proxy.Provider.scutil]: Retrieving ProxyAutoConfigURL:", scutilCfg.ProxyAutoConfigURLString) resp, err := http.Get(scutilCfg.ProxyAutoConfigURLString) if err != nil { log.Fatal(err) diff --git a/vendor/github.com/rapid7/go-get-proxied/proxy/provider_linux.go b/vendor/github.com/bdwyertech/go-get-proxied/proxy/provider_linux.go similarity index 100% rename from vendor/github.com/rapid7/go-get-proxied/proxy/provider_linux.go rename to vendor/github.com/bdwyertech/go-get-proxied/proxy/provider_linux.go diff --git a/vendor/github.com/rapid7/go-get-proxied/proxy/provider_windows.go b/vendor/github.com/bdwyertech/go-get-proxied/proxy/provider_windows.go similarity index 99% rename from vendor/github.com/rapid7/go-get-proxied/proxy/provider_windows.go rename to vendor/github.com/bdwyertech/go-get-proxied/proxy/provider_windows.go index cb99e96..120af77 100644 --- a/vendor/github.com/rapid7/go-get-proxied/proxy/provider_windows.go +++ b/vendor/github.com/bdwyertech/go-get-proxied/proxy/provider_windows.go @@ -13,7 +13,7 @@ package proxy import ( - "github.com/rapid7/go-get-proxied/winhttp" + "github.com/bdwyertech/go-get-proxied/winhttp" "log" "net/url" "reflect" diff --git a/vendor/github.com/rapid7/go-get-proxied/proxy/proxy.go b/vendor/github.com/bdwyertech/go-get-proxied/proxy/proxy.go similarity index 100% rename from vendor/github.com/rapid7/go-get-proxied/proxy/proxy.go rename to vendor/github.com/bdwyertech/go-get-proxied/proxy/proxy.go diff --git a/vendor/github.com/rapid7/go-get-proxied/proxy/url.go b/vendor/github.com/bdwyertech/go-get-proxied/proxy/url.go similarity index 100% rename from vendor/github.com/rapid7/go-get-proxied/proxy/url.go rename to vendor/github.com/bdwyertech/go-get-proxied/proxy/url.go diff --git a/vendor/github.com/rapid7/go-get-proxied/winhttp/winhttp.go b/vendor/github.com/bdwyertech/go-get-proxied/winhttp/winhttp.go similarity index 100% rename from vendor/github.com/rapid7/go-get-proxied/winhttp/winhttp.go rename to vendor/github.com/bdwyertech/go-get-proxied/winhttp/winhttp.go diff --git a/vendor/github.com/aus/proxyplease/.gitignore b/vendor/github.com/bdwyertech/proxyplease/.gitignore similarity index 100% rename from vendor/github.com/aus/proxyplease/.gitignore rename to vendor/github.com/bdwyertech/proxyplease/.gitignore diff --git a/vendor/github.com/aus/proxyplease/LICENSE b/vendor/github.com/bdwyertech/proxyplease/LICENSE similarity index 100% rename from vendor/github.com/aus/proxyplease/LICENSE rename to vendor/github.com/bdwyertech/proxyplease/LICENSE diff --git a/vendor/github.com/aus/proxyplease/README.md b/vendor/github.com/bdwyertech/proxyplease/README.md similarity index 100% rename from vendor/github.com/aus/proxyplease/README.md rename to vendor/github.com/bdwyertech/proxyplease/README.md diff --git a/vendor/github.com/aus/proxyplease/basic.go b/vendor/github.com/bdwyertech/proxyplease/basic.go similarity index 100% rename from vendor/github.com/aus/proxyplease/basic.go rename to vendor/github.com/bdwyertech/proxyplease/basic.go diff --git a/vendor/github.com/aus/proxyplease/connect.go b/vendor/github.com/bdwyertech/proxyplease/connect.go similarity index 100% rename from vendor/github.com/aus/proxyplease/connect.go rename to vendor/github.com/bdwyertech/proxyplease/connect.go diff --git a/vendor/github.com/aus/proxyplease/debug.go b/vendor/github.com/bdwyertech/proxyplease/debug.go similarity index 100% rename from vendor/github.com/aus/proxyplease/debug.go rename to vendor/github.com/bdwyertech/proxyplease/debug.go diff --git a/vendor/github.com/aus/proxyplease/go.mod b/vendor/github.com/bdwyertech/proxyplease/go.mod similarity index 52% rename from vendor/github.com/aus/proxyplease/go.mod rename to vendor/github.com/bdwyertech/proxyplease/go.mod index 6c98d8b..faf2bce 100644 --- a/vendor/github.com/aus/proxyplease/go.mod +++ b/vendor/github.com/bdwyertech/proxyplease/go.mod @@ -1,14 +1,13 @@ -module github.com/aus/proxyplease +module github.com/bdwyertech/proxyplease go 1.12 require ( github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 + github.com/aus/proxyplease v0.1.0 + github.com/bdwyertech/go-get-proxied v0.0.0-20210305205935-912c3d1ded9e github.com/gorilla/websocket v1.4.2 github.com/launchdarkly/go-ntlmssp v1.0.1 - github.com/rapid7/go-get-proxied v0.0.0-20181210221417-16249a544090 - github.com/stretchr/testify v1.7.0 // indirect - golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 // indirect golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h12.io/socks v1.0.2 ) diff --git a/vendor/github.com/aus/proxyplease/go.sum b/vendor/github.com/bdwyertech/proxyplease/go.sum similarity index 57% rename from vendor/github.com/aus/proxyplease/go.sum rename to vendor/github.com/bdwyertech/proxyplease/go.sum index 8ab8485..43ebef6 100644 --- a/vendor/github.com/aus/proxyplease/go.sum +++ b/vendor/github.com/bdwyertech/proxyplease/go.sum @@ -1,7 +1,24 @@ +github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 h1:Kk6a4nehpJ3UuJRqlA3JxYxBZEqCeOmATOvrbT4p9RA= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4= +github.com/aus/proxyplease v0.1.0 h1:oANCVDoihKw0FlKCMrVv0ensolBFWamlPbUrRgGbwpY= +github.com/aus/proxyplease v0.1.0/go.mod h1:hIgmILi8LhQ+6f1CZKQFCPyM4rjOyXTnQq0MSBa1UMk= +github.com/bdwyertech/go-get-proxied v0.0.0-20210305205935-912c3d1ded9e h1:y76jg9cKgIiVi2hbqulYJr39CpO99ajl4h9ede7oRnI= +github.com/bdwyertech/go-get-proxied v0.0.0-20210305205935-912c3d1ded9e/go.mod h1:gM7ddayfKDubVwLb5eu7Anq8gih5R74RR63b9hxCRA4= +github.com/bdwyertech/go-scutil v0.0.0-20210305044044-814e0f3f0cd3 h1:oMOwe3KddRPeMJkr+oYXQcJua9kZbIUCq30Ze/QYGJE= +github.com/bdwyertech/go-scutil v0.0.0-20210305044044-814e0f3f0cd3/go.mod h1:gV303gJocqRNJVrg/n4cB+ZwoHxKKMiAiwe+t627Kjw= +github.com/darren/gpac v0.0.0-20201209040425-3300e0622b93 h1:H6CW26kV4Egh6/v0o7Nd33ArRtwfQ9erfrVzOCZ1O6Q= +github.com/darren/gpac v0.0.0-20201209040425-3300e0622b93/go.mod h1:1Id6bMaG5dQYTt+Pk0msQw4r/+kkuzfuFwoictr5mcU= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dlclark/regexp2 v1.2.0 h1:8sAhBGEM0dRWogWqWyQeIJnxjWO6oIjl8FKqREDsGfk= +github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/dop251/goja v0.0.0-20200629185240-bfd59704b500 h1:QthjkRYZQj+FcH5GZXltnlBiyW19WLb+l7R0TrZChNw= +github.com/dop251/goja v0.0.0-20200629185240-bfd59704b500/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= +github.com/git-lfs/go-ntlm v0.0.0-20190401175752-c5056e7fa066 h1:f5UyyCnv3o2EHy+zsqOyYa8jB5bZR/N9ZEideqeDYag= +github.com/git-lfs/go-ntlm v0.0.0-20190401175752-c5056e7fa066/go.mod h1:YnCP1lAyul0ITv9nT/OqXseZmGeaqvMVa2uvl8ssQvE= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/h12w/go-socks5 v0.0.0-20200522160539-76189e178364 h1:5XxdakFhqd9dnXoAZy1Mb2R/DZ6D1e+0bGC/JhucGYI= @@ -15,28 +32,34 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/rapid7/go-get-proxied v0.0.0-20181210221417-16249a544090 h1:UKK+YjZ1XXs+fhehWgVtTIqr3rdSkOR+3JEtGj05Q4c= github.com/rapid7/go-get-proxied v0.0.0-20181210221417-16249a544090/go.mod h1:ELOKvSUbHx1oVeecsknc02S0eEAFD+TdV3rTt3BcNzM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.0.0-20210304203840-7b4935edff86 h1:TmVfeQsidiBAiZMvxnHWD63KxYBVCiFs+k/pWtzhllI= +golang.org/x/sys v0.0.0-20210304203840-7b4935edff86/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +h12.io/socks v1.0.1/go.mod h1:AIhxy1jOId/XCz9BO+EIgNL2rQiPTBNnOfnVnQ+3Eck= h12.io/socks v1.0.2 h1:cZhhbV8+DE0Y1kotwhr1a3RC3kFO7AtuZ4GLr3qKSc8= h12.io/socks v1.0.2/go.mod h1:AIhxy1jOId/XCz9BO+EIgNL2rQiPTBNnOfnVnQ+3Eck= diff --git a/vendor/github.com/aus/proxyplease/negotiate_other.go b/vendor/github.com/bdwyertech/proxyplease/negotiate_other.go similarity index 100% rename from vendor/github.com/aus/proxyplease/negotiate_other.go rename to vendor/github.com/bdwyertech/proxyplease/negotiate_other.go diff --git a/vendor/github.com/aus/proxyplease/negotiate_windows.go b/vendor/github.com/bdwyertech/proxyplease/negotiate_windows.go similarity index 100% rename from vendor/github.com/aus/proxyplease/negotiate_windows.go rename to vendor/github.com/bdwyertech/proxyplease/negotiate_windows.go diff --git a/vendor/github.com/aus/proxyplease/ntlm_other.go b/vendor/github.com/bdwyertech/proxyplease/ntlm_other.go similarity index 100% rename from vendor/github.com/aus/proxyplease/ntlm_other.go rename to vendor/github.com/bdwyertech/proxyplease/ntlm_other.go diff --git a/vendor/github.com/aus/proxyplease/ntlm_windows.go b/vendor/github.com/bdwyertech/proxyplease/ntlm_windows.go similarity index 100% rename from vendor/github.com/aus/proxyplease/ntlm_windows.go rename to vendor/github.com/bdwyertech/proxyplease/ntlm_windows.go diff --git a/vendor/github.com/aus/proxyplease/proxy.go b/vendor/github.com/bdwyertech/proxyplease/proxy.go similarity index 98% rename from vendor/github.com/aus/proxyplease/proxy.go rename to vendor/github.com/bdwyertech/proxyplease/proxy.go index b97a4bd..98ae6fa 100644 --- a/vendor/github.com/aus/proxyplease/proxy.go +++ b/vendor/github.com/bdwyertech/proxyplease/proxy.go @@ -8,7 +8,7 @@ import ( "net/http" "net/url" - ggp "github.com/rapid7/go-get-proxied/proxy" + ggp "github.com/bdwyertech/go-get-proxied/proxy" ) // Proxy is a struct that can be passed to NewDialContext. All variables are optional. If a value is nil, diff --git a/vendor/github.com/aus/proxyplease/socks.go b/vendor/github.com/bdwyertech/proxyplease/socks.go similarity index 100% rename from vendor/github.com/aus/proxyplease/socks.go rename to vendor/github.com/bdwyertech/proxyplease/socks.go diff --git a/vendor/golang.org/x/sys/windows/svc/security.go b/vendor/golang.org/x/sys/windows/svc/security.go index ef719c1..8cc6778 100644 --- a/vendor/golang.org/x/sys/windows/svc/security.go +++ b/vendor/golang.org/x/sys/windows/svc/security.go @@ -7,8 +7,8 @@ package svc import ( - "path/filepath" - "strings" + "errors" + "syscall" "unsafe" "golang.org/x/sys/windows" @@ -64,45 +64,101 @@ func IsAnInteractiveSession() (bool, error) { return false, nil } +var ( + ntdll = windows.NewLazySystemDLL("ntdll.dll") + _NtQueryInformationProcess = ntdll.NewProc("NtQueryInformationProcess") + + kernel32 = windows.NewLazySystemDLL("kernel32.dll") + _QueryFullProcessImageNameA = kernel32.NewProc("QueryFullProcessImageNameA") +) + // IsWindowsService reports whether the process is currently executing // as a Windows service. func IsWindowsService() (bool, error) { + // This code was copied from runtime.isWindowsService function. + // The below technique looks a bit hairy, but it's actually // exactly what the .NET framework does for the similarly named function: // https://github.com/dotnet/extensions/blob/f4066026ca06984b07e90e61a6390ac38152ba93/src/Hosting/WindowsServices/src/WindowsServiceHelpers.cs#L26-L31 // Specifically, it looks up whether the parent process has session ID zero // and is called "services". - - var pbi windows.PROCESS_BASIC_INFORMATION - pbiLen := uint32(unsafe.Sizeof(pbi)) - err := windows.NtQueryInformationProcess(windows.CurrentProcess(), windows.ProcessBasicInformation, unsafe.Pointer(&pbi), pbiLen, &pbiLen) + const _CURRENT_PROCESS = ^uintptr(0) + // pbi is a PROCESS_BASIC_INFORMATION struct, where we just care about + // the 6th pointer inside of it, which contains the pid of the process + // parent: + // https://github.com/wine-mirror/wine/blob/42cb7d2ad1caba08de235e6319b9967296b5d554/include/winternl.h#L1294 + var pbi [6]uintptr + var pbiLen uint32 + r0, _, _ := syscall.Syscall6(_NtQueryInformationProcess.Addr(), 5, _CURRENT_PROCESS, 0, uintptr(unsafe.Pointer(&pbi[0])), uintptr(unsafe.Sizeof(pbi)), uintptr(unsafe.Pointer(&pbiLen)), 0) + if r0 != 0 { + return false, errors.New("NtQueryInformationProcess failed: error=" + itoa(int(r0))) + } + var psid uint32 + err := windows.ProcessIdToSessionId(uint32(pbi[5]), &psid) if err != nil { + if err == windows.ERROR_INVALID_PARAMETER { + // This error happens when Windows cannot find process parent. + // Perhaps process parent exited. + // Assume we are not running in a service, because service + // parent process (services.exe) cannot exit. + return false, nil + } return false, err } - var psid uint32 - err = windows.ProcessIdToSessionId(uint32(pbi.InheritedFromUniqueProcessId), &psid) - if err != nil || psid != 0 { + if psid != 0 { + // parent session id should be 0 for service process return false, nil } - pproc, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pbi.InheritedFromUniqueProcessId)) + + pproc, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pbi[5])) if err != nil { return false, err } defer windows.CloseHandle(pproc) - var exeNameBuf [261]uint16 - exeNameLen := uint32(len(exeNameBuf) - 1) - err = windows.QueryFullProcessImageName(pproc, 0, &exeNameBuf[0], &exeNameLen) - if err != nil { - return false, err + + // exeName gets the path to the executable image of the parent process + var exeName [261]byte + exeNameLen := uint32(len(exeName) - 1) + r0, _, e0 := syscall.Syscall6(_QueryFullProcessImageNameA.Addr(), 4, uintptr(pproc), 0, uintptr(unsafe.Pointer(&exeName[0])), uintptr(unsafe.Pointer(&exeNameLen)), 0, 0) + if r0 == 0 { + if e0 != 0 { + return false, e0 + } else { + return false, syscall.EINVAL + } } - exeName := windows.UTF16ToString(exeNameBuf[:exeNameLen]) - if !strings.EqualFold(filepath.Base(exeName), "services.exe") { + const ( + servicesLower = "services.exe" + servicesUpper = "SERVICES.EXE" + ) + i := int(exeNameLen) - 1 + j := len(servicesLower) - 1 + if i < j { return false, nil } - system32, err := windows.GetSystemDirectory() - if err != nil { - return false, err + for { + if j == -1 { + return i == -1 || exeName[i] == '\\', nil + } + if exeName[i] != servicesLower[j] && exeName[i] != servicesUpper[j] { + return false, nil + } + i-- + j-- + } +} + +func itoa(val int) string { // do it here rather than with fmt to avoid dependency + if val < 0 { + return "-" + itoa(-val) + } + var buf [32]byte // big enough for int64 + i := len(buf) - 1 + for val >= 10 { + buf[i] = byte(val%10 + '0') + i-- + val /= 10 } - targetExeName := filepath.Join(system32, "services.exe") - return strings.EqualFold(exeName, targetExeName), nil + buf[i] = byte(val + '0') + return string(buf[i:]) } diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 968f211..a9225a1 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -9,7 +9,6 @@ package windows import ( errorspkg "errors" "fmt" - "runtime" "sync" "syscall" "time" @@ -346,7 +345,6 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error) //sys GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) //sys GetProcessId(process Handle) (id uint32, err error) -//sys QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size *uint32) (err error) = kernel32.QueryFullProcessImageNameW //sys OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (handle Handle, err error) //sys SetProcessPriorityBoost(process Handle, disable bool) (err error) = kernel32.SetProcessPriorityBoost //sys GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintptr, lpMaximumWorkingSetSize *uintptr, flags *uint32) @@ -382,17 +380,10 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) = ole32.StringFromGUID2 //sys coCreateGuid(pguid *GUID) (ret error) = ole32.CoCreateGuid //sys CoTaskMemFree(address unsafe.Pointer) = ole32.CoTaskMemFree -//sys CoInitializeEx(reserved uintptr, coInit uint32) (ret error) = ole32.CoInitializeEx -//sys CoUninitialize() = ole32.CoUninitialize -//sys CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable **uintptr) (ret error) = ole32.CoGetObject //sys getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetProcessPreferredUILanguages //sys getThreadPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetThreadPreferredUILanguages //sys getUserPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetUserPreferredUILanguages //sys getSystemPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetSystemPreferredUILanguages -//sys findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, err error) = kernel32.FindResourceW -//sys SizeofResource(module Handle, resInfo Handle) (size uint32, err error) = kernel32.SizeofResource -//sys LoadResource(module Handle, resInfo Handle) (resData Handle, err error) = kernel32.LoadResource -//sys LockResource(resData Handle) (addr uintptr, err error) = kernel32.LockResource // Process Status API (PSAPI) //sys EnumProcesses(processIds []uint32, bytesReturned *uint32) (err error) = psapi.EnumProcesses @@ -1587,55 +1578,3 @@ func (s *UNICODE_STRING) Slice() []uint16 { func (s *UNICODE_STRING) String() string { return UTF16ToString(s.Slice()) } - -// FindResource resolves a resource of the given name and resource type. -func FindResource(module Handle, name, resType ResourceIDOrString) (Handle, error) { - var namePtr, resTypePtr uintptr - var name16, resType16 *uint16 - var err error - resolvePtr := func(i interface{}, keep **uint16) (uintptr, error) { - switch v := i.(type) { - case string: - *keep, err = UTF16PtrFromString(v) - if err != nil { - return 0, err - } - return uintptr(unsafe.Pointer(*keep)), nil - case ResourceID: - return uintptr(v), nil - } - return 0, errorspkg.New("parameter must be a ResourceID or a string") - } - namePtr, err = resolvePtr(name, &name16) - if err != nil { - return 0, err - } - resTypePtr, err = resolvePtr(resType, &resType16) - if err != nil { - return 0, err - } - resInfo, err := findResource(module, namePtr, resTypePtr) - runtime.KeepAlive(name16) - runtime.KeepAlive(resType16) - return resInfo, err -} - -func LoadResourceData(module, resInfo Handle) (data []byte, err error) { - size, err := SizeofResource(module, resInfo) - if err != nil { - return - } - resData, err := LoadResource(module, resInfo) - if err != nil { - return - } - ptr, err := LockResource(resData) - if err != nil { - return - } - h := (*unsafeheader.Slice)(unsafe.Pointer(&data)) - h.Data = unsafe.Pointer(ptr) - h.Len = int(size) - h.Cap = int(size) - return -} diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index dfd8116..50e70ec 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -2600,119 +2600,3 @@ const ( SECURITY_SQOS_PRESENT = 0x100000 SECURITY_VALID_SQOS_FLAGS = 0x1f0000 ) - -// ResourceID represents a 16-bit resource identifier, traditionally created with the MAKEINTRESOURCE macro. -type ResourceID uint16 - -// ResourceIDOrString must be either a ResourceID, to specify a resource or resource type by ID, -// or a string, to specify a resource or resource type by name. -type ResourceIDOrString interface{} - -// Predefined resource names and types. -var ( - // Predefined names. - CREATEPROCESS_MANIFEST_RESOURCE_ID ResourceID = 1 - ISOLATIONAWARE_MANIFEST_RESOURCE_ID ResourceID = 2 - ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID ResourceID = 3 - ISOLATIONPOLICY_MANIFEST_RESOURCE_ID ResourceID = 4 - ISOLATIONPOLICY_BROWSER_MANIFEST_RESOURCE_ID ResourceID = 5 - MINIMUM_RESERVED_MANIFEST_RESOURCE_ID ResourceID = 1 // inclusive - MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID ResourceID = 16 // inclusive - - // Predefined types. - RT_CURSOR ResourceID = 1 - RT_BITMAP ResourceID = 2 - RT_ICON ResourceID = 3 - RT_MENU ResourceID = 4 - RT_DIALOG ResourceID = 5 - RT_STRING ResourceID = 6 - RT_FONTDIR ResourceID = 7 - RT_FONT ResourceID = 8 - RT_ACCELERATOR ResourceID = 9 - RT_RCDATA ResourceID = 10 - RT_MESSAGETABLE ResourceID = 11 - RT_GROUP_CURSOR ResourceID = 12 - RT_GROUP_ICON ResourceID = 14 - RT_VERSION ResourceID = 16 - RT_DLGINCLUDE ResourceID = 17 - RT_PLUGPLAY ResourceID = 19 - RT_VXD ResourceID = 20 - RT_ANICURSOR ResourceID = 21 - RT_ANIICON ResourceID = 22 - RT_HTML ResourceID = 23 - RT_MANIFEST ResourceID = 24 -) - -type COAUTHIDENTITY struct { - User *uint16 - UserLength uint32 - Domain *uint16 - DomainLength uint32 - Password *uint16 - PasswordLength uint32 - Flags uint32 -} - -type COAUTHINFO struct { - AuthnSvc uint32 - AuthzSvc uint32 - ServerPrincName *uint16 - AuthnLevel uint32 - ImpersonationLevel uint32 - AuthIdentityData *COAUTHIDENTITY - Capabilities uint32 -} - -type COSERVERINFO struct { - Reserved1 uint32 - Aame *uint16 - AuthInfo *COAUTHINFO - Reserved2 uint32 -} - -type BIND_OPTS3 struct { - CbStruct uint32 - Flags uint32 - Mode uint32 - TickCountDeadline uint32 - TrackFlags uint32 - ClassContext uint32 - Locale uint32 - ServerInfo *COSERVERINFO - Hwnd HWND -} - -const ( - CLSCTX_INPROC_SERVER = 0x1 - CLSCTX_INPROC_HANDLER = 0x2 - CLSCTX_LOCAL_SERVER = 0x4 - CLSCTX_INPROC_SERVER16 = 0x8 - CLSCTX_REMOTE_SERVER = 0x10 - CLSCTX_INPROC_HANDLER16 = 0x20 - CLSCTX_RESERVED1 = 0x40 - CLSCTX_RESERVED2 = 0x80 - CLSCTX_RESERVED3 = 0x100 - CLSCTX_RESERVED4 = 0x200 - CLSCTX_NO_CODE_DOWNLOAD = 0x400 - CLSCTX_RESERVED5 = 0x800 - CLSCTX_NO_CUSTOM_MARSHAL = 0x1000 - CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000 - CLSCTX_NO_FAILURE_LOG = 0x4000 - CLSCTX_DISABLE_AAA = 0x8000 - CLSCTX_ENABLE_AAA = 0x10000 - CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000 - CLSCTX_ACTIVATE_32_BIT_SERVER = 0x40000 - CLSCTX_ACTIVATE_64_BIT_SERVER = 0x80000 - CLSCTX_ENABLE_CLOAKING = 0x100000 - CLSCTX_APPCONTAINER = 0x400000 - CLSCTX_ACTIVATE_AAA_AS_IU = 0x800000 - CLSCTX_PS_DLL = 0x80000000 - - COINIT_MULTITHREADED = 0x0 - COINIT_APARTMENTTHREADED = 0x2 - COINIT_DISABLE_OLE1DDE = 0x4 - COINIT_SPEED_OVER_MEMORY = 0x8 -) - -// Flag for QueryFullProcessImageName. -const PROCESS_NAME_NATIVE = 1 diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 6a8143a..d41985d 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -205,7 +205,6 @@ var ( procFindNextFileW = modkernel32.NewProc("FindNextFileW") procFindNextVolumeMountPointW = modkernel32.NewProc("FindNextVolumeMountPointW") procFindNextVolumeW = modkernel32.NewProc("FindNextVolumeW") - procFindResourceW = modkernel32.NewProc("FindResourceW") procFindVolumeClose = modkernel32.NewProc("FindVolumeClose") procFindVolumeMountPointClose = modkernel32.NewProc("FindVolumeMountPointClose") procFlushFileBuffers = modkernel32.NewProc("FlushFileBuffers") @@ -278,11 +277,9 @@ var ( procIsWow64Process2 = modkernel32.NewProc("IsWow64Process2") procLoadLibraryExW = modkernel32.NewProc("LoadLibraryExW") procLoadLibraryW = modkernel32.NewProc("LoadLibraryW") - procLoadResource = modkernel32.NewProc("LoadResource") procLocalAlloc = modkernel32.NewProc("LocalAlloc") procLocalFree = modkernel32.NewProc("LocalFree") procLockFileEx = modkernel32.NewProc("LockFileEx") - procLockResource = modkernel32.NewProc("LockResource") procMapViewOfFile = modkernel32.NewProc("MapViewOfFile") procMoveFileExW = modkernel32.NewProc("MoveFileExW") procMoveFileW = modkernel32.NewProc("MoveFileW") @@ -297,7 +294,6 @@ var ( procProcessIdToSessionId = modkernel32.NewProc("ProcessIdToSessionId") procPulseEvent = modkernel32.NewProc("PulseEvent") procQueryDosDeviceW = modkernel32.NewProc("QueryDosDeviceW") - procQueryFullProcessImageNameW = modkernel32.NewProc("QueryFullProcessImageNameW") procQueryInformationJobObject = modkernel32.NewProc("QueryInformationJobObject") procReadConsoleW = modkernel32.NewProc("ReadConsoleW") procReadDirectoryChangesW = modkernel32.NewProc("ReadDirectoryChangesW") @@ -330,7 +326,6 @@ var ( procSetStdHandle = modkernel32.NewProc("SetStdHandle") procSetVolumeLabelW = modkernel32.NewProc("SetVolumeLabelW") procSetVolumeMountPointW = modkernel32.NewProc("SetVolumeMountPointW") - procSizeofResource = modkernel32.NewProc("SizeofResource") procSleepEx = modkernel32.NewProc("SleepEx") procTerminateJobObject = modkernel32.NewProc("TerminateJobObject") procTerminateProcess = modkernel32.NewProc("TerminateProcess") @@ -368,10 +363,7 @@ var ( procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb") procCLSIDFromString = modole32.NewProc("CLSIDFromString") procCoCreateGuid = modole32.NewProc("CoCreateGuid") - procCoGetObject = modole32.NewProc("CoGetObject") - procCoInitializeEx = modole32.NewProc("CoInitializeEx") procCoTaskMemFree = modole32.NewProc("CoTaskMemFree") - procCoUninitialize = modole32.NewProc("CoUninitialize") procStringFromGUID2 = modole32.NewProc("StringFromGUID2") procEnumProcesses = modpsapi.NewProc("EnumProcesses") procSubscribeServiceChangeNotifications = modsechost.NewProc("SubscribeServiceChangeNotifications") @@ -1755,15 +1747,6 @@ func FindNextVolume(findVolume Handle, volumeName *uint16, bufferLength uint32) return } -func findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, err error) { - r0, _, e1 := syscall.Syscall(procFindResourceW.Addr(), 3, uintptr(module), uintptr(name), uintptr(resType)) - resInfo = Handle(r0) - if resInfo == 0 { - err = errnoErr(e1) - } - return -} - func FindVolumeClose(findVolume Handle) (err error) { r1, _, e1 := syscall.Syscall(procFindVolumeClose.Addr(), 1, uintptr(findVolume), 0, 0) if r1 == 0 { @@ -2388,15 +2371,6 @@ func _LoadLibrary(libname *uint16) (handle Handle, err error) { return } -func LoadResource(module Handle, resInfo Handle) (resData Handle, err error) { - r0, _, e1 := syscall.Syscall(procLoadResource.Addr(), 2, uintptr(module), uintptr(resInfo), 0) - resData = Handle(r0) - if resData == 0 { - err = errnoErr(e1) - } - return -} - func LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error) { r0, _, e1 := syscall.Syscall(procLocalAlloc.Addr(), 2, uintptr(flags), uintptr(length), 0) ptr = uintptr(r0) @@ -2423,15 +2397,6 @@ func LockFileEx(file Handle, flags uint32, reserved uint32, bytesLow uint32, byt return } -func LockResource(resData Handle) (addr uintptr, err error) { - r0, _, e1 := syscall.Syscall(procLockResource.Addr(), 1, uintptr(resData), 0, 0) - addr = uintptr(r0) - if addr == 0 { - err = errnoErr(e1) - } - return -} - func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) { r0, _, e1 := syscall.Syscall6(procMapViewOfFile.Addr(), 5, uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length), 0) addr = uintptr(r0) @@ -2567,14 +2532,6 @@ func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint3 return } -func QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryFullProcessImageNameW.Addr(), 4, uintptr(proc), uintptr(flags), uintptr(unsafe.Pointer(exeName)), uintptr(unsafe.Pointer(size)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobObjectInformation uintptr, JobObjectInformationLength uint32, retlen *uint32) (err error) { r1, _, e1 := syscall.Syscall6(procQueryInformationJobObject.Addr(), 5, uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), uintptr(unsafe.Pointer(retlen)), 0) if r1 == 0 { @@ -2853,15 +2810,6 @@ func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err erro return } -func SizeofResource(module Handle, resInfo Handle) (size uint32, err error) { - r0, _, e1 := syscall.Syscall(procSizeofResource.Addr(), 2, uintptr(module), uintptr(resInfo), 0) - size = uint32(r0) - if size == 0 { - err = errnoErr(e1) - } - return -} - func SleepEx(milliseconds uint32, alertable bool) (ret uint32) { var _p0 uint32 if alertable { @@ -3158,32 +3106,11 @@ func coCreateGuid(pguid *GUID) (ret error) { return } -func CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable **uintptr) (ret error) { - r0, _, _ := syscall.Syscall6(procCoGetObject.Addr(), 4, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bindOpts)), uintptr(unsafe.Pointer(guid)), uintptr(unsafe.Pointer(functionTable)), 0, 0) - if r0 != 0 { - ret = syscall.Errno(r0) - } - return -} - -func CoInitializeEx(reserved uintptr, coInit uint32) (ret error) { - r0, _, _ := syscall.Syscall(procCoInitializeEx.Addr(), 2, uintptr(reserved), uintptr(coInit), 0) - if r0 != 0 { - ret = syscall.Errno(r0) - } - return -} - func CoTaskMemFree(address unsafe.Pointer) { syscall.Syscall(procCoTaskMemFree.Addr(), 1, uintptr(address), 0, 0) return } -func CoUninitialize() { - syscall.Syscall(procCoUninitialize.Addr(), 0, 0, 0, 0) - return -} - func stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) { r0, _, _ := syscall.Syscall(procStringFromGUID2.Addr(), 3, uintptr(unsafe.Pointer(rguid)), uintptr(unsafe.Pointer(lpsz)), uintptr(cchMax)) chars = int32(r0) diff --git a/vendor/modules.txt b/vendor/modules.txt index 89d4321..65775c1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -3,11 +3,14 @@ github.com/alexbrainman/sspi github.com/alexbrainman/sspi/internal/common github.com/alexbrainman/sspi/negotiate github.com/alexbrainman/sspi/ntlm -# github.com/aus/proxyplease v0.0.0-00010101000000-000000000000 => github.com/bdwyertech/proxyplease v0.1.1-0.20210304025852-a16bce5f30dd -## explicit -github.com/aus/proxyplease +# github.com/bdwyertech/go-get-proxied v0.0.0-20210305205935-912c3d1ded9e +github.com/bdwyertech/go-get-proxied/proxy +github.com/bdwyertech/go-get-proxied/winhttp # github.com/bdwyertech/go-scutil v0.0.0-20210305044044-814e0f3f0cd3 github.com/bdwyertech/go-scutil/proxy +# github.com/bdwyertech/proxyplease v0.1.1-0.20210305210130-a100ce82b827 +## explicit +github.com/bdwyertech/proxyplease # github.com/darren/gpac v0.0.0-20201209040425-3300e0622b93 github.com/darren/gpac # github.com/dlclark/regexp2 v1.2.0 @@ -39,18 +42,15 @@ github.com/mattn/go-colorable # github.com/mattn/go-isatty v0.0.12 ## explicit github.com/mattn/go-isatty -# github.com/rapid7/go-get-proxied v0.0.0-20181210221417-16249a544090 => github.com/bdwyertech/go-get-proxied v0.0.0-20210305160813-ca7ca4cda17c -github.com/rapid7/go-get-proxied/proxy -github.com/rapid7/go-get-proxied/winhttp # github.com/sirupsen/logrus v1.8.0 ## explicit github.com/sirupsen/logrus -# golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 +# golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 golang.org/x/crypto/md4 # golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 golang.org/x/net/internal/socks golang.org/x/net/proxy -# golang.org/x/sys v0.0.0-20210305034016-7844c3c200c3 +# golang.org/x/sys v0.0.0-20210304203840-7b4935edff86 ## explicit golang.org/x/sys/internal/unsafeheader golang.org/x/sys/unix @@ -73,5 +73,3 @@ golang.org/x/text/unicode/norm # h12.io/socks v1.0.2 h12.io/socks # github.com/elazarl/goproxy => github.com/bdwyertech/goproxy v0.0.0-20200419011457-7aaf118834c9 -# github.com/aus/proxyplease => github.com/bdwyertech/proxyplease v0.1.1-0.20210304025852-a16bce5f30dd -# github.com/rapid7/go-get-proxied => github.com/bdwyertech/go-get-proxied v0.0.0-20210305160813-ca7ca4cda17c