Question How does Kaspersky evaluate shell scripts?

Please provide comments and solutions that are helpful to the author of this topic.
Kaspersky's antivirus engine can analyze scripts in various languages including PowerShell, batch, bash, python, and ruby. It uses a combination of static and dynamic analysis. It can "unpack" or read the script content for static analysis, and it also monitors the behavior of scripts when they try to run for dynamic analysis.
 
ie Powershell, batch, bash, python, maybe you could even add ruby to the list

Does it automatically "unpack" (read) the script content? Or does the script have to try to run first?
Previous trials of pre-execution detection on samples of malicious scripts ranked K as no.1 followed by ESET, and then Avast; I do not know what is the exact mechanism for detection by K, but I suppose it is a mixture of signatures, heuristics, and AMSI.
As I do not have VM, did not try to test its post-execution detection.
 
Emulation would be one of the first things if not the first thing Kaspersky or any other product will do to analyze such things
If not detected then there are multiple other layers to detect it
 
Previous trials of pre-execution detection on samples of malicious scripts ranked K as no.1 followed by ESET, and then Avast; I do not know what is the exact mechanism for detection by K, but I suppose it is a mixture of signatures, heuristics, and AMSI.
As I do not have VM, did not try to test its post-execution detection.
There is Bitdefender as well and it often detects and behaves better than Kaspersky.
 
Emulation would be one of the first things if not the first thing Kaspersky or any other product will do to analyze such things
Does emulation work with disabled hardware virtualization?
Capture.PNG
 
All antivirus software scans scripts the same ways, by executing portions of the script in a virtual, controlled environment. It is mainly heuristics (heuristics require emulation and emulation requires heuristics) that are used to detect the malicious behaviour.
Some vendors also utilise machine learning on the results obtained from the virtual environment. Examples include DeepInstinct, Trend Micro and few others.

During runtime, it is mostly the AMSI that’s feeding behavioural information to the security solutions.