This script is adapted to perform a privilege escalation and a custom edition of the local DNS hosts
file on Windows machines, located in the C:\Windows\system32\drivers\etc\
directory.
- Changing the default's
Restricted
ExecutionPolicy toBypass
for theCurrentUser
Scope.
powershell Set-ExecutionPolicy Bypass -Scope CurrentUser -Force
- Running the command using the
action
flag, along with theip
and thehostname
to edit.
powershell -File ${file} -action ${action} -ip ${ip} -hostname ${hostname}
Here:
- file: as
setup.ps1
- action:
activate
for adding,deactivate
for deletion - IP: as the
IP
address - Hostname: as the hostname for that particular IP