Created
June 18, 2024 11:36
-
-
Save k4nfr3/b6a54bdd647273a3261c8c2bc34a9c24 to your computer and use it in GitHub Desktop.
Revisions
-
k4nfr3 created this gist
Jun 18, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ $SpoofedAst = [ScriptBlock]::Create("Write-Output 'Hello'").Ast $ExecutedAst = [ScriptBlock]::Create("Write-Output 'My Hidden Hello Hidden'").Ast $Ast = [System.Management.Automation.Language.ScriptBlockAst]::new($SpoofedAst.Extent,$null,$null,$null,$ExecutedAst.EndBlock.Copy(),$null) $Sb = $Ast.GetScriptBlock() $Sb&