Skip to content

Instantly share code, notes, and snippets.

@khr0x40sh
Created November 19, 2019 15:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khr0x40sh/f6bc06f3a1ad5af4b7839e391a7a5db6 to your computer and use it in GitHub Desktop.
Save khr0x40sh/f6bc06f3a1ad5af4b7839e391a7a5db6 to your computer and use it in GitHub Desktop.
Takes a string and applies CHR(ascii int) & for each character in string
Param([string]$string = "C:\windows\syswow64\windowspowershell\v1.0\powershell.exe -exec Bypass -nop ping 127.0.0.1"
);
$result = ""
$strA = $string.ToCharArray()
for($i = 0; $i -lt $strA.Length; $i++)
{
$x = [byte]$strA[$i]
$result += "Chr (" + $x.ToString() + ") & "
}
$result = $result.Substring(0, $result.Length-2)
$result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment