-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create schtask.py #54
Conversation
Add the schtask module that can be used to impersonate loggedon users and run commands on their behalf. Signed-off-by: Defte <aurelien.chalot@protonmail.com>
In accordance with Defte, I've updated the code to manage the codec. |
Please also add this to the |
This looks good, seems to do something similar to ATExec. Some opsec considerations, there is a hardcoded date in the XML used to build the scheduled task 2015-07-15T20:35:13.2757294 we can use a function to generate to get the latest date and build the xml file something like
Lastly, i have not fully went through the module to see how your doing it, but we can also swap out the principal id from LocalSystem to "TrustedInstaller" . you also need to change the sid to "S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464". Just another option for more privileges. This is shown in my xml example |
Yeah we could replace the date! However I'm not sure it is necessarry to replace the TrustedInstaller |
Add @Shad0wC0ntr0ller snippet to remove hardcoded date. Signed-off-by: Defte <aurelien.chalot@protonmail.com>
I have added the code to remove the hardcoded date. :) |
Rename the module to prevent confusion. Signed-off-by: Defte <aurelien.chalot@protonmail.com>
I think this can merged into
This module basically is |
Modify the variable name to schtask_as Change the description Signed-off-by: Defte <aurelien.chalot@protonmail.com>
Yeah we thought of doing that but it implies adding another argument and refactor a few things. We thought it'd be easier to add a module on its own |
Fix typo Signed-off-by: Defte <aurelien.chalot@protonmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest looks good to me! Also tested and is working on my side
- Sed "g/atexec/schtask_as/s" - Better error output (unknown username, task has not run) - Added the output.decode("cp437") for french caracters Signed-off-by: Defte <aurelien.chalot@protonmail.com>
… session, stop printing empty output messages.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I have never been able to obtain the "User doesn't exist on the domain" but the PR seems good to me! |
Add the schtask module that can be used to impersonate loggedon users and run commands on their behalf.
To run a whoami as the WHITEFLAG\Administrateur:
This can be used to run remote commands as well: