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
RestrictedExecutionPolicy toBypassfor theCurrentUserScope.
powershell Set-ExecutionPolicy Bypass -Scope CurrentUser -Force
- Running the command using the
actionflag, along with theipand thehostnameto edit.
powershell -File ${file} -action ${action} -ip ${ip} -hostname ${hostname}
Here:
- file: as
setup.ps1 - action:
activatefor adding,deactivatefor deletion - IP: as the
IPaddress - Hostname: as the hostname for that particular IP