diff --git a/sgfw/socks_server_chain.go b/sgfw/socks_server_chain.go index 4528aea..4c613a4 100644 --- a/sgfw/socks_server_chain.go +++ b/sgfw/socks_server_chain.go @@ -5,6 +5,7 @@ import ( "net" "os" "sync" + "time" "github.com/subgraph/go-procsnitch" "strings" @@ -157,6 +158,11 @@ func (c *socksChainSession) sessionWorker() { return } + // Randomize username and password to force a new TOR circuit with each connection + rndbytes := []byte("sgfw" + strconv.Itoa(int(time.Now().UnixNano()) ^ os.Getpid())) + c.req.Auth.Uname = rndbytes + c.req.Auth.Passwd = rndbytes + switch c.req.Cmd { case CommandTorResolve, CommandTorResolvePTR: err = c.dispatchTorSOCKS()