The script provided in this directory, [again](https://github.com/mgeeky/Penetration-Testing-Tools/tree/master/red-teaming/Self-Signed%20Threat), uses splendid work of [Matt Graeber, @mattifestation](https://twitter.com/mattifestation), namely his [AMSITools.ps1](https://gist.github.com/mgraeber-rc/1eb42d3ec9c2f677e70bb14c3b7b5c9c) script, that pulls AMSI events from Windows' event-log.
We can pull AMSI events to review more closely what happened thanks to Matt's [AMSITools.ps1]](https://gist.github.com/mgraeber-rc/1eb42d3ec9c2f677e70bb14c3b7b5c9c).
Follow these steps:
1. Disable your Anti-Virus. In Defender, that includes turning off Real-Time Detection option.
2. Open up Powershell as Administrator and browse to this script's directory.
3. Load up `Get-AMSIScanResult.ps1` script:
```
PS D:\AMSITools> . .\Get-AMSIScanResult.ps1
```
4. And then - to inspect Office document - simply launch the following:
```
PS D:\AMSITools> Get-AMSIScanResult -Interactive
```
5. You will be prompted with following message:
```
Trigger AMSI detections now and then press any key to pull AMSI events...
```
6. Now re-enable your Anti-Virus, to make sure AMSI provider will be active and Maldoc will get remediated.
7. Open up your faulty Maldoc document to ensure AMSI triggers and event gets generated
8. After seeing AMSI error dialog, close up Office application and get back to Powershell console.
9. Now hit **Enter** in the console and review output or follow instructions.
**All credits go to [Matt](https://twitter.com/mattifestation)** - this directory contains **HIS** script _AMSITools.ps1_, mirrored for preserverance purposes.