mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-12-06 04:14:15 +00:00
With the target gate on, only the tool URL was checked and the proxy in the tool's proxy field was dialled without a check, so an approved target could be fetched through any host and port. Read the proxy as a target, as a proxy named on a Bash command line is: the call waits for its approval, the request records the proxy without credentials, and the proxy is dialled through the pinned dialer. The recording and global proxies, required mode and the gate-off paths are unchanged.
21 lines
681 B
Go
21 lines
681 B
Go
package server
|
|
|
|
import "testing"
|
|
|
|
// The gate reads a tool proxy without its credentials, with the port a socks5
|
|
// proxy without one is dialled on.
|
|
func TestGateProxyURL(t *testing.T) {
|
|
for in, want := range map[string]string{
|
|
"http://user:pw@10.0.0.5:8080": "http://10.0.0.5:8080",
|
|
"socks5://user:pw@10.0.0.5": "socks5://10.0.0.5:1080",
|
|
"socks5h://[::1]": "socks5h://[::1]:1080",
|
|
"socks5://10.0.0.5:9050": "socks5://10.0.0.5:9050",
|
|
"https://proxy.example": "https://proxy.example",
|
|
"http://": "",
|
|
} {
|
|
if got := gateProxyURL(in); got != want {
|
|
t.Fatalf("gateProxyURL(%q) = %q, want %q", in, got, want)
|
|
}
|
|
}
|
|
}
|