Notes
A collection of notes I have taken throughout my journey
Windows Scripting Host
Windows scripting host is a built-in Windows administration tool that runs batch files to automate and manage tasks within the operating system.
- If the VBS files are blacklisted, then we can rename the file to .txt file and run it using wscript as follows,
PowerShell
Execution Policy
PowerShell's execution policy is a security option to protect the system from running malicious scripts. By default, Microsoft disables executing PowerShell scripts .ps1 for security purposes. The PowerShell execution policy is set to Restricted, which means it permits individual commands but not run any scripts.
You can determine the current PowerShell setting of your Windows:
To change:
Bypass Execution Policy
Microsoft provides ways to disable this restriction. One of these ways is by giving an argument option to the PowerShell command to change it to your desired setting. For example, we can change it to bypass policy which means nothing is blocked or restricted. This is useful since that lets us run our own PowerShell scripts.
In order to make sure our PowerShell file gets executed, we need to provide the bypass option in the arguments as follows,
Powercat
Netcat: The powershell version.
- Set up a web server to serve the powercat.ps1 that will be downloaded and executed on the target machine.
- Change the directory to powercat and start listening on a port of your choice. In our case, we will be using port 8080.
- Set up a listener on any port using nc to receive the connection back from the victim. We are using port 1337.
- Now, from the victim machine, we download the payload and execute it using PowerShell payload.
Download
HTA
An HTML Application (HTA) is a Microsoft Windows program that combines HTML, Dynamic HTML, and scripting languages supported by Internet Explorer, such as VBScript or JScript, to create a desktop application-like interface
cURL
cURL is a command-line tool and library for transferring data using various network protocols