Any way can I elevate opening and modify C:\Windows\System32\drivers\etc\hosts file? I configure a "Set Security Permissions" policy with folder and with file but doesn´t work.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

Any way can I elevate opening and modify C:\Windows\System32\drivers\etc\hosts file? I configure a "Set Security Permissions" policy with folder and with file but doesn´t work.

L2 Linker
1 accepted solution

Accepted Solutions

L5 Sessionator

It can be done in several ways:

  • Using Set Security Permission policy to make this file editable.
  • Through regular Elevate Policy for Notepad with the host file as parameter (meaning that Notepad be elevated only when opening the host file) this option supports Audit events for every launch.

View solution in original post

9 REPLIES 9

L6 Presenter

Search for notepad application, right click and run as administrator, once opened, click on file->open and navigate to host file, modify and save. You should be good to go

L4 Transporter

Search for notepad application, right click and run as administrator, once opened, click on file->open and navigate to host file, modify and save. You should be good to go

L2 Linker

Hi Ankush,

Thanks for yor answer. Regular users do not have admin rights so runa as admin will not work and I only want to elevate for modify hosts file.

L3 Networker

I don't believe you can elevate a program only when it opens another file (as a condition). What you could do is write a script that opens the file using notepad or another program with hosts as a flag, and elevate that command/script. If you find another way though I would be curious to find out how! May be a good enhancement request! Good luck 😃

L3 Networker

Actually... there is a way to do this:

 

Within Advanced Policies:

> Actions > Create Application Policy

> Set Security Permissions

>Define needed areas

> access - set to Allow Full Control

> Objects

> Add File (specify c:\windows\system32\drivers\etc\hosts)

 

complete your policy, and give it a shot. It is not elevating the hosts file- you cant do that with a normal elevation policy since the elevation is the app being executed not what it opens, but this is a way for you to set specific users and groups to have write ability to that file- so it doesnt matter what app you use (notepad, notepad++, word.. anything should work).

 

Hope that helps!

L4 Transporter

if you want to give permission on host file, just firstly blocked the folder System32 and asked user to use run as admin to open that folder. then you will get a popup for EPM and provide elevate access through EPM console. Same thing you can do for a file also.

How we can audit Set Security Permissions, Any events were captured in Inbox if any user tried modified it. How can i verify events of Set Security Permissions policy.

L5 Sessionator

It can be done in several ways:

  • Using Set Security Permission policy to make this file editable.
  • Through regular Elevate Policy for Notepad with the host file as parameter (meaning that Notepad be elevated only when opening the host file) this option supports Audit events for every launch.

Could you elaborate on this? We are trying to give access to a few folders under system32 and the permissions are just never applied. I've tried blocking the folder, which gives me an EPM prompt that I can find in the console, but it only wants to elevate the shell32.dll process and when I set a path, it still doesn't allow me to.

  • 1 accepted solution
  • 1416 Views
  • 9 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!