Skip to content

Commit

Permalink
fix: -gencert refuses to work when emp3r0r.json not found
Browse files Browse the repository at this point in the history
  • Loading branch information
jm33-m0 committed Jan 24, 2024
1 parent 3f9bd4d commit f100936
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions core/cmd/cc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,6 @@ func main() {
relayed_port := flag.Int("relayed_port", 0, "Relayed port, use with -connect_relay")
flag.Parse()

// read config file
err = readJSONConfig(*config)
if err != nil {
cc.CliFatalError("Failed to read config from '%s': %v", *config, err)
}

// set up magic string
init_magic_str()

// generate C2 TLS cert for given host names
if *names != "" {
hosts := strings.Fields(*names)
Expand All @@ -91,6 +82,15 @@ func main() {
os.Exit(0)
}

// read config file
err = readJSONConfig(*config)
if err != nil {
cc.CliFatalError("Failed to read config from '%s': %v", *config, err)
}

// set up magic string
init_magic_str()

// abort if CC is already running
if cc.IsCCRunning() {
cc.CliFatalError("CC is already running")
Expand Down

0 comments on commit f100936

Please sign in to comment.