Suspicious_PowerShell_WebDownload_1
Description
Detects suspicious PowerShell code that downloads from web sites
Query · yara
strings:
$s1 = "System.Net.WebClient).DownloadString(\"http" ascii nocase
$s2 = "System.Net.WebClient).DownloadString('http" ascii nocase
$s3 = "system.net.webclient).downloadfile('http" ascii nocase
$s4 = "system.net.webclient).downloadfile(\"http" ascii nocase
$s5 = "GetString([Convert]::FromBase64String(" ascii nocase
$fp1 = "NuGet.exe" ascii fullword
$fp2 = "chocolatey.org" ascii
$fp3 = " GET /"
$fp4 = " POST /"
$fp5 = ".DownloadFile('https://aka.ms/installazurecliwindows', 'AzureCLI.msi')" ascii
$fp6 = " 404 " /* in web server logs */
$fp7 = "# RemoteSSHConfigurationScript" ascii /* \.vscode\extensions\ms-vscode-remote.remote-ssh */
$fp8 = "<helpItems" ascii fullword
$fp9 = "DownloadFile(\"https://codecov.io/bash" ascii
$fp10 = "DownloadFile('https://get.golang.org/installer.exe" ascii
$fpg1 = "All Rights"
$fpg2 = "<html"
$fpg3 = "<HTML"
$fpg4 = "Copyright"
$fpg5 = "License"
$fpg6 = "<?xml"
$fpg7 = "Help" fullword
$fpg8 = "COPYRIGHT" fullword
condition:
1 of ($s*) and not 1 of ($fp*)