Created
November 7, 2021 20:06
-
-
Save ProIntegritate/7b6c7b4fb9a869cbe85c608fb4a6c598 to your computer and use it in GitHub Desktop.
CleanCommand
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
Public Function CleanCommand(ByVal sString As String) As String | |
' Cleans up commandline params that try to break up strings to bypass detection with ASCII > 127 and Nop characters like "^" | |
Dim sByteArray() As Byte = System.Text.Encoding.Default.GetBytes(sString) | |
Dim sResult As String = "" | |
For n = 0 To UBound(sByteArray) | |
If sByteArray(n) <= 127 And sByteArray(n) > 0 Then | |
sResult = sResult & Chr(sByteArray(n)) | |
End If | |
Next | |
sByteArray = Nothing | |
Return sResult.Replace("^", "") | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment