Jump to content

Cannot open or edit Hosts file


Go to solution Solved by Flood and Flood's wife,

Recommended Posts

Posted

I am using Kaspersky Internet Security 20.0.14.1085(I) on a Windows 7 machine. I added some entries to my Hosts file located in C:\Windows\System32\drivers\etc. After I did Kaspersky said it had detected Trojan.Win32.Host2.gen. It gave me no option to ignore that detection and kept replacing my updated version with the previous version. This happened several times. Now I cannot even open the hosts file. Everytime I try, I get a popup window saying “Access is denied”.

The hosts file is not marked read only. All the users have full permissions.

I added exclusions to Kaspersky for both the hosts file and the folder it is in but still cannot open it.

I opened a command prompt window as an administrator and ran the following commands successfully but still cannot open the hosts file:

takeown /f %windir%\system32\drivers\etc /r /d y

icacls %windir%\system32\drivers\etc /grant administrators:F /T

I also opened a command prompt window as an administrator and ran the following commands successfully but still cannot open the hosts file:

cd %windir%\system32\drivers\etc
attrib -s -h -r hosts
notepad hosts

I opened Notepad as an administrator and tried opening the hosts file but get a popup saying “You dont have permission to open this file. Contact the file owner or administrator to obtain permission.”

When I look at the properties of the file, on the security tab all users have full permissions allowed (except for special permissions).

There are other versions of the hosts file in the folder as well such as “hosts.old”. I cannot open any of those either. I cannot copy the hosts file to another folder either.

How can I get back the ability to open and edit my own hosts file without Kaspersky doing this?

 

  • Solution
Flood and Flood's wife
Posted

Hello @mailalan

Welcome!

  1. Run the system in SafeMode, make required changes, revert to normal mode. 

Thank you🙏

Flood+1🐳

Disclaimer, we have no association with Kaspersky. 

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...