Skip to content
Access control Write-up Advanced

Amsi Bypass New Way 2023

The blog describes a technique to bypass AMSI by patching the AmsiOpenSession function in amsi.dll, changing a conditional jump instruction so that the error branch is never taken. This allows an attacker to run malicious PowerShell commands, such as Mimikatz, without being flagged by AMSI.

Surya Dev Singh Follow

Published on infosecwriteups.com

Hello friend !! This is SURYA DEV SINGH, back here again with a new blog, In this blog, we will be discussing a new technique and a flaw found in asmi.dll , which leads to the bypass of the antimalware scan interface which we can abuse to run Mimikatz in a real red team operation on fully patched windows. but before…

Surya Dev Singh, on infosecwriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the AMSI implementation in amsi.dll uses a conditional jump that can be patched in memory to skip the error branch, allowing the session to open even when it should fail.

Impact

An attacker with administrative rights could bypass AMSI and execute malicious tools like Mimikatz without detection, though the bypass may stop working over time and antivirus heuristics can still flag the activity if the PowerShell session is not terminated immediately.

What the attacker needed

Administrator privileges; download and run amsibypass.exe; target PowerShell session PID

How it was found

  1. Download the amsibypass.exe tool from the provided GitHub project.
  2. Open PowerShell with admin privileges and disable execution policy.
  3. Run amsibypass.exe targeting the PowerShell session's PID.
  4. Confirm AMSI is patched, then run malicious commands like Invoke-Mimikatz.
  5. Add an exit command at the end to avoid detection by heuristic scans.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

AMSI is a Windows feature that scans scripts and commands for malicious content before they run. The blog shows how to modify a file called amsi.dll so that a check always passes, letting dangerous tools like Mimikatz run without being detected. This requires administrator rights and a tool that patches the file in memory.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Surya Dev Singh

View all

4 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.