Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ne0nd0g committed Sep 24, 2020
2 parents a7cc289 + 803c986 commit 8a21cee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
7 changes: 7 additions & 0 deletions docs/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 0.9.1 - 2020-09-23

### Fixed

- Modules were not sending the first value from the modules commands section
- [Pull 97](https://github.com/Ne0nd0g/merlin/pull/97) - Incorrectly validated the module and agent platforms when the agent was set to "all"

## 0.9.0 - 2020-09-13

### Added
Expand Down
1 change: 1 addition & 0 deletions pkg/api/agents/agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func CD(agentID uuid.UUID, Args []string) messages.UserMessage {
// CMD is used to send a command to the agent to run a command or execute a program
// Args[0] = "cmd"
// Args[1:] = program and arguments to be executed on the host OS of the running agent
// Used with `cmd` and `shell` commands as well as through "standard" modules
func CMD(agentID uuid.UUID, Args []string) messages.UserMessage {
if len(Args) > 0 {
job, err := agents.AddJob(agentID, "cmd", Args[1:])
Expand Down
10 changes: 6 additions & 4 deletions pkg/api/modules/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func RunModule(module modules.Module) []messages.UserMessage {
}
for id := range agents.Agents {
// Make sure OS platform match
if strings.EqualFold(agents.Agents[id].Platform, module.Platform) {
if !strings.EqualFold(agents.Agents[id].Platform, module.Platform) {
m := fmt.Sprintf("Module platform %s does not match agent %s platform %s. Skipping job...",
module.Platform, id, agents.Agents[id].Platform)
um := messages.UserMessage{
Expand All @@ -82,7 +82,8 @@ func RunModule(module modules.Module) []messages.UserMessage {
}
switch strings.ToLower(module.Type) {
case "standard":
returnMessages = append(returnMessages, agentAPI.CMD(id, r))
// Standard modules use the `cmd` message type that must be in position 0
returnMessages = append(returnMessages, agentAPI.CMD(id, append([]string{"cmd"}, r...)))
case "extended":
// Was using Method: r[0]
job, err := agents.AddJob(id, r[0], r[1:])
Expand All @@ -98,11 +99,12 @@ func RunModule(module modules.Module) []messages.UserMessage {
}
}
return returnMessages
// Single Agent
}
// Single Agent
switch strings.ToLower(module.Type) {
case "standard":
returnMessages = append(returnMessages, agentAPI.CMD(module.Agent, r))
// Standard modules use the `cmd` message type that must be in position 0
returnMessages = append(returnMessages, agentAPI.CMD(module.Agent, append([]string{"cmd"}, r...)))
case "extended":
job, err := agents.AddJob(module.Agent, r[0], r[1:])
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/merlin.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package merlin

// Version is a constant variable containing the version number for the Merlin package
const Version = "0.9.0-beta"
const Version = "0.9.1-beta"

// Build is the unique number based off the git commit in which it is compiled against
var Build = "nonRelease"

0 comments on commit 8a21cee

Please sign in to comment.