Configuring Windows Defender Exclusions for Kali Linux on WSL

Kali Linux has been released for Windows 10 and works very well. Assuming Windows Defender or any other Anti-Virus protection doesn’t go crazy when you try to install any programs that they see as malware (Metasploit for example).

The Kali Linux team has a very nice video on how to do this on Vimeo – [Kali Linux Video Instructions](https://vimeo.com/258892544).

I just like having this in text format with screenshots as its easier to do searchs for.

Run the command *sudo apt-get install webshells*

Kali Linux will try to download the webshells package and then Windows Defender will stop the install. The output from the apt-get install will be something like

**After this operation, 67.6 kB of additional disk space will be used.
(Reading database … 17354 files and directories currently installed.)
Preparing to unpack …/webshells_1.1-0kali0_all.deb …
Unpacking webshells (1.1-0kali0) over (1.1-0kali0) …
dpkg: error processing archive /var/cache/apt/archives/webshells_1.1-0kali0_all.deb (–unpack):
unable to install new version of ‘/usr/share/webshells/asp/cmdasp.asp’: Invalid argument
dpkg: error while cleaning up:
unable to remove newly-extracted version of ‘/usr/share/webshells/php/php-backdoor.php’: Invalid argument
dpkg: error while cleaning up:
unable to remove newly-extracted version of ‘/usr/share/webshells/asp/cmdasp.asp’: Invalid argument
Errors were encountered while processing:
/var/cache/apt/archives/webshells_1.1-0kali0_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)**

To remedy the situation, open Windows Defender Security Center, in the logs for today, it will list something like **Backdoor:VBS/Ace.C** . Click on details button and you will see something similiar to this:

**containerfile: C:\Users\Simon\AppData\Local\Packages\KaliLinux.54290C8133FEE_ey8k8hqnwqnmg\LocalState\rootfs\usr\share\webshells\asp\cmdasp.asp.dpkg-new**

Cope the the c:\users\ information and then go back to the Windows Defender Security Center. Click Allow on each of the items that were picked up by Windows Defender.

Then go the **Virus and Threat Protection** option in the left side menu, then scroll down to **Virus & Threat Protection Settings** and click on the **Manage Setting**s link.

Scroll down to **Exclusions** and click on **Add or remove exclusions**

Click on the **+ Add an Exclusion** and select folder.

Paste the C:\users information into the Folder section and click on Select Folder.

Under Exclusions, it should now list the folder which you pasted in.

Close Kali if you have it open and then re-open and run the *sudo apt-get install webshells* command and it will now install without a problem.