Skip to content

Commit

Permalink
updated to not raise errors unnecessarily for c2 status updates
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Nov 27, 2024
1 parent 96b05c9 commit 16b6d33
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mythic-docker/src/rabbitmq/recv_mythic_rpc_c2_update_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
databaseStructs "github.com/its-a-feature/Mythic/database/structs"
"github.com/its-a-feature/Mythic/logging"
amqp "github.com/rabbitmq/amqp091-go"
"strings"
)

type MythicRPCC2UpdateStatusMessage struct {
Expand Down Expand Up @@ -41,8 +42,13 @@ func MythicRPCC2UpdateStatus(input MythicRPCC2UpdateStatusMessage) MythicRPCC2Up
response.Success = true
}
if input.Error != "" {
go SendAllOperationsMessage(fmt.Sprintf("Error from C2 Profile %s:%s\n", input.C2Profile, input.Error),
0, fmt.Sprintf("%s_error", input.C2Profile), database.MESSAGE_LEVEL_WARNING)
if strings.HasPrefix(input.Error, "Server already") {
go SendAllOperationsMessage(fmt.Sprintf("Update from C2 Profile %s:\n%s\n", input.C2Profile, input.Error),
0, fmt.Sprintf("%s_error", input.C2Profile), database.MESSAGE_LEVEL_DEBUG)
} else {
go SendAllOperationsMessage(fmt.Sprintf("Error from C2 Profile %s:\n%s\n", input.C2Profile, input.Error),
0, fmt.Sprintf("%s_error", input.C2Profile), database.MESSAGE_LEVEL_WARNING)
}
}
return response
}
Expand Down

0 comments on commit 16b6d33

Please sign in to comment.