Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install Chocolatey due to Windows Defender AMSI (Anti-Malware Scan Interfaces) blocking installation - "This script contains malicious content and has been blocked by your antivirus software" #2132

Closed
santhosh-john opened this issue Oct 15, 2020 · 22 comments

Comments

@santhosh-john
Copy link

I am using the Licenced version of McAfee AV on my licenced Windows 10 Home Edition. Not sure what is interfering with Chocolatey, but it is not letting me install even being an Administrator.

Please note: I have already followed your documents for setting the ExecutionPolicies and all okay from my end.

Also, attached the error as per the below screengrab: -

Chocolatey_AV_Issue

@vexx32
Copy link
Member

vexx32 commented Oct 15, 2020

You might want to check your AV settings and make sure they allow signed scripts, at least while you run the installation. I'm not familiar enough with McAfee itself to know exactly where that's at, though.

@santhosh-john
Copy link
Author

Okay. I will check the same. The only concern I have is after installing Chocolatey, will it do the same for every software install through its CLI. Also unsure, about being compromising with my System's Security too. So for now, will drop the plan to go ahead with Chocolatey; even though its a great package/concept/thought. Will check and explore WinGet.

@ferventcoder
Copy link
Member

I would love to know what it thinks is malicious?

@ferventcoder
Copy link
Member

@ferventcoder ferventcoder changed the title Cannot Install Chocolatey via PowerShell (as an admin) Due to Anti-virus Blocking It! Cannot Install Chocolatey Due to Windows Defender AMSI (Anti-Malware Scan Interfaces) Blocking Installation - "This script contains malicious content and has been blocked by your antivirus software" Oct 20, 2020
@ferventcoder ferventcoder changed the title Cannot Install Chocolatey Due to Windows Defender AMSI (Anti-Malware Scan Interfaces) Blocking Installation - "This script contains malicious content and has been blocked by your antivirus software" Cannot install Chocolatey due to Windows Defender AMSI (Anti-Malware Scan Interfaces) blocking installation - "This script contains malicious content and has been blocked by your antivirus software" Oct 20, 2020
@ferventcoder
Copy link
Member

https://acloud.guru/forums/python-for-beginners/discussion/-MBzMjt-giG46LHJjxwv/chocolatey%20won't%20install

@ferventcoder
Copy link
Member

@vexx32
Copy link
Member

vexx32 commented Oct 20, 2020

It's possible simple Invoke-Expression / iex usage is enough to trigger Defender at this point tbh. 🤔

@TanishqPal
Copy link

Hi! I was also facing the same problem but I was able to install chocolatey by opening McAfee app and disabling Real Time scanning and Firewall
Screenshot 2020-11-03 133849

@navaneethavarier
Copy link

@TanishqPal Thanks! I was also facing the same issue and now it is working fine!

@santhosh-john
Copy link
Author

@TanishqPal, @navaneethavarier: There is no point using Antivirus then! Though I know this works, it is not what is expected to be solution. Thanks!

@TanishqPal
Copy link

Can you please close this issue ?

@pauby
Copy link
Member

pauby commented Jan 13, 2021

@TanishqPal The issue is not yet resolved, so we should keep it open.

@Liegia
Copy link

Liegia commented Feb 14, 2021

you have to re launch the shell after disabling real-time scan and firewall for the install to work if you have McAffe

@santhosh-john
Copy link
Author

santhosh-john commented Feb 17, 2021

@Liegia: This isn't a solution! There should be a way like we usually have with other programs.

@ferventcoder: How is this an invalid issue (as per the marked label)?

@pauby
Copy link
Member

pauby commented Feb 17, 2021

@nimpossible The issue is invalid as the problem lies with McAfee and not Chocolatey.

And with all due respect, if the solution @Liegia posted works, then it is the solution.

There should be a way like we usually have with other programs.

What did you have in mind?

@pauby
Copy link
Member

pauby commented Feb 24, 2021

There has been no response to this so I'm going to go ahead and close it.

@pauby pauby closed this as completed Feb 24, 2021
@elouem7
Copy link

elouem7 commented Mar 1, 2021

you have to re launch the shell after disabling real-time scan and firewall for the install to work if you have McAffe

THANK YOU

@msharp19
Copy link

Run as admin.

@Sdrp2021
Copy link

Ty so much guys. I was enable to install chocolatey. I have McAfee and I disable Firewall + Real-Time scan and then I launch PowerShell as admin and it works! Ty ty ty

@rejithnair
Copy link

The issue is due to downloading the scripts from URL. I would suggest to download the chocolatey installation script from https://chocolatey.org/install.ps1 to a folder and edit the command

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('<full local downloaded path>/install.ps1'))

@SA-Commit
Copy link

@TanishqPal Thanks! I was also facing the same issue and now it is working fine!

Thanks a lot, it worked!

@vmj
Copy link

vmj commented Jan 1, 2022

The issue is due to downloading the scripts from URL. I would suggest to download the chocolatey installation script from https://chocolatey.org/install.ps1 to a folder and edit the command

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('<full local downloaded path>/install.ps1'))

Thanks @rejithnair! This works without tampering with security settings in McAcfee.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests