Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions implants/imix/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ print(sys.shell(input_params["cmd"])["stdout"])
.to_string(),
parameters: HashMap::from([("cmd".to_string(), "echo hello_from_stdout".to_string())]),
file_names: Vec::new(),
quest_name: "test_quest".to_string(),
};

let runtime = tokio::runtime::Builder::new_multi_thread()
Expand Down Expand Up @@ -134,6 +135,7 @@ aoeu
.to_string(),
parameters: HashMap::new(),
file_names: Vec::new(),
quest_name: "test_quest".to_string(),
};

let runtime: tokio::runtime::Runtime = tokio::runtime::Builder::new_multi_thread()
Expand Down
1 change: 1 addition & 0 deletions implants/imix/src/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ mod tests {
eldritch: "print('okay')".to_string(),
parameters: HashMap::from([("iter".to_string(), "3".to_string())]),
file_names: Vec::new(),
quest_name: "test_quest".to_string(),
}];
start_new_tasks(new_tasks, &mut all_exec_futures, debug_start_time).await?;
assert_eq!(all_exec_futures.len(), 1);
Expand Down
2 changes: 2 additions & 0 deletions implants/lib/c2/src/c2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ pub struct Task {
>,
#[prost(string, repeated, tag = "4")]
pub file_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "5")]
pub quest_name: ::prost::alloc::string::String,
}
/// TaskError provides information when task execution fails.
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down
1 change: 1 addition & 0 deletions tavern/internal/c2/api_claim_tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ func (srv *Server) ClaimTasks(ctx context.Context, req *c2pb.ClaimTasksRequest)
Eldritch: claimedTome.Eldritch,
Parameters: params,
FileNames: claimedFileNames,
QuestName: claimedQuest.Name,
})
}

Expand Down
1 change: 1 addition & 0 deletions tavern/internal/c2/c2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ message Task {
string eldritch = 2;
map<string, string> parameters = 3;
repeated string file_names = 4;
string quest_name = 5;
}

// TaskError provides information when task execution fails.
Expand Down
126 changes: 68 additions & 58 deletions tavern/internal/c2/c2pb/c2.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions tavern/internal/c2/c2test/ent.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ func ConvertTaskToC2PB(t *testing.T, ctx context.Context, task *ent.Task) *c2pb.
Eldritch,
Parameters: params,
FileNames: fileNames,
QuestName: task.
QueryQuest().
OnlyX(ctx).
Name,
}
}

Expand Down