Forums
New posts
Search forums
News
Security News
Technology News
Giveaways
Giveaways, Promotions and Contests
Discounts & Deals
Reviews
Users Reviews
Video Reviews
Support
Windows Malware Removal Help & Support
Inactive Support Threads
Mac Malware Removal Help & Support
Mobile Malware Removal Help & Support
Blog
Log in
Register
What's new
Search
Search titles only
By:
Search titles only
By:
Reply to thread
Menu
Install the app
Install
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Software
Security Apps
Microsoft Defender
How to prevent efficiently Defender from considering a given VBS script as containing a threat
Message
<blockquote data-quote="Andy Ful" data-source="post: 935562" data-attributes="member: 32260"><p>I made some tests and found some bugs in the way how Defender manages threats via Security Center. Some scripts are blocked by AMSI-based models without any alert, even from the scripting engine.</p><p>Now I use a simple test-script:</p><p>[CODE]urlsource = "https://sample-videos.com/img/Sample-jpg-image-100kb.jpg"</p><p>Set WshShell = WScript.CreateObject("WScript.Shell")</p><p>targetfolder = WshShell.ExpandEnvironmentStrings("%userprofile%\\Downloads\\2021\\")</p><p>downloadpath = targetfolder & "temp.jpg"</p><p></p><p>Set fso = WScript.CreateObject("Scripting.FileSystemObject")</p><p>If not fso.FolderExists(targetfolder) Then</p><p> fso.CreateFolder(targetfolder)</p><p>End If</p><p></p><p>Set XHR = CreateObject("Msxml2.ServerXMLHTTP")</p><p>On Error Resume Next</p><p>With XHR</p><p>' .setTimeouts 15000, 15000, 15000, 15000</p><p> .Open "GET", urlsource, False</p><p> .Send</p><p>End With</p><p></p><p>Set Stream = CreateObject("ADODB.Stream")</p><p>With Stream</p><p> .Type = 1</p><p> .Open</p><p> .Write XHR.ResponseBody</p><p> .SaveToFile downloadpath, 2</p><p> .Close</p><p>End With</p><p>Set Stream = Nothing</p><p>Set XHR = Nothing</p><p>Set fso = Nothing</p><p></p><p>WshShell.run """C:\Windows\notepad.exe"""</p><p>Set WshShell = Nothing[/CODE]</p><p></p><p>It simply downloads the JPG from URL (different from yours) to the folder %userprofile%\Downloads\2021\, and runs Notepad. If the JPG is downloaded but Notepad is not executed then it is the sign of AMSI-based post-execution detection.</p><p></p><p>After some tests, I can say that I do not like the way how Defender manages these detections. They were introduced in the year 2020 and will require many improvements.<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite111" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" /></p><p>Anyway, I did not see that Avast would use post-execution AMSI-based detections. If I correctly remember it only uses AMSI for pre-execution behavior detections. Defender script detection without AMSI-based post-execution detections is similar to Avast and can be stronger after enabling Defender ASR rules.</p></blockquote><p></p>
[QUOTE="Andy Ful, post: 935562, member: 32260"] I made some tests and found some bugs in the way how Defender manages threats via Security Center. Some scripts are blocked by AMSI-based models without any alert, even from the scripting engine. Now I use a simple test-script: [CODE]urlsource = "https://sample-videos.com/img/Sample-jpg-image-100kb.jpg" Set WshShell = WScript.CreateObject("WScript.Shell") targetfolder = WshShell.ExpandEnvironmentStrings("%userprofile%\\Downloads\\2021\\") downloadpath = targetfolder & "temp.jpg" Set fso = WScript.CreateObject("Scripting.FileSystemObject") If not fso.FolderExists(targetfolder) Then fso.CreateFolder(targetfolder) End If Set XHR = CreateObject("Msxml2.ServerXMLHTTP") On Error Resume Next With XHR ' .setTimeouts 15000, 15000, 15000, 15000 .Open "GET", urlsource, False .Send End With Set Stream = CreateObject("ADODB.Stream") With Stream .Type = 1 .Open .Write XHR.ResponseBody .SaveToFile downloadpath, 2 .Close End With Set Stream = Nothing Set XHR = Nothing Set fso = Nothing WshShell.run """C:\Windows\notepad.exe""" Set WshShell = Nothing[/CODE] It simply downloads the JPG from URL (different from yours) to the folder %userprofile%\Downloads\2021\, and runs Notepad. If the JPG is downloaded but Notepad is not executed then it is the sign of AMSI-based post-execution detection. After some tests, I can say that I do not like the way how Defender manages these detections. They were introduced in the year 2020 and will require many improvements.:( Anyway, I did not see that Avast would use post-execution AMSI-based detections. If I correctly remember it only uses AMSI for pre-execution behavior detections. Defender script detection without AMSI-based post-execution detections is similar to Avast and can be stronger after enabling Defender ASR rules. [/QUOTE]
Insert quotes…
Verification
Post reply
Top