Skip to content
Open
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
36 changes: 21 additions & 15 deletions Payload_Type/apollo/apollo/mythic/browser_scripts/download.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
function(task, responses){

// Handle error status
if(task.status.includes("error")){
const combined = responses.reduce( (prev, cur) => {
const combined = responses.reduce((prev, cur) => {
return prev + cur;
}, "");
return {'plaintext': combined};
}

if(responses.length > 0){
try{
const task_data = JSON.parse(responses[0]);
return { "media": [{
"filename": `${task.display_params}`,
"agent_file_id": task_data["file_id"],
}]};
}catch(error){
const combined = responses.reduce( (prev, cur) => {
return prev + cur;
}, "");
return {'plaintext': combined};
// The response is just the UUID string, not JSON
const uuid = responses[0].trim();

// Basic UUID validation (optional)
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;

if(uuidRegex.test(uuid)){
// Use the UUID directly as the agent_file_id
return {
"media": [{
"filename": task.display_params || "file",
"agent_file_id": uuid
}]
};
} else {
// If it's not a valid UUID, just display what we got
return {'plaintext': responses[0]};
}
} else {
return {"plaintext": "No response yet..."}
return {"plaintext": "No response yet..."};
}

}
424 changes: 412 additions & 12 deletions documentation-payload/apollo/commands/assembly_inject.md

Large diffs are not rendered by default.

Loading