Basic Command
The basic of Command Prompt and PowerShell
Last updated
The basic of Command Prompt and PowerShell
Last updated
This note was created when I was not very familiar with the Windows environment. I didn't know how to restart the machine from the command line, copy files, or import PowerShell scripts, etc.
Enter powershell with Execution Policy Bypass
Or, if you already inside powershell session, you can set Execution Policy with this command:
Load powershell script function into memory with dot sourcing:
Import module to powershell:
How to copy file:
How to copy directory:
Explanation:
/E
β Copies all subdirectories, including empty ones.
/I
β If the destination does not exist and copying more than one file, this option assumes that the destination must be a directory.
/Y
β Suppresses prompting to confirm you want to overwrite an existing destination file.
How to Move File or Directory
Sometimes, after found service run as SYSTEM user and writable by low user, you can drop payload to the directory and rename the payload to match the service name.
certutil.exe
powershell.exe: Invoke-WebRequest
powershell.exe: Invoke-Expression
Or, from cmd.exe to powershell.exe
Or, use start /B to run the command in background.
Shutdown now:
Restart now:
User stuff:
Check Local Group using Command Prompt:
Check group member