SOCKS/Tor credential randomization to force new circuits with each outbound connection.

shw_dev
shw 8 years ago
parent 604c157a7b
commit de4f6ac206

@ -5,6 +5,7 @@ import (
"net" "net"
"os" "os"
"sync" "sync"
"time"
"github.com/subgraph/go-procsnitch" "github.com/subgraph/go-procsnitch"
"strings" "strings"
@ -157,6 +158,11 @@ func (c *socksChainSession) sessionWorker() {
return 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 { switch c.req.Cmd {
case CommandTorResolve, CommandTorResolvePTR: case CommandTorResolve, CommandTorResolvePTR:
err = c.dispatchTorSOCKS() err = c.dispatchTorSOCKS()

Loading…
Cancel
Save