当我使用带有键的sqlmap--hex
转储表条目时,我正确地获得了密码哈希字节,但 powershell 将这些字节表示为字符串。所有不可打印的字符都被转义,我将这些字节作为\\?e1\n\\?dc9I\\?baY\\?ab\\?beV\\?e0W\\?f2\x0f\\?88>
. 如何取消转义此字符串以从中获取原始字节?
问问题
746 次
1 回答
0
从字符串到字节将取决于它是否是每个字节的字符串,如果是这样,试试这个:
# simulated output as a byte per string
$str = [string[]][char[]][byte[]](0xE1,0x0A,0xDC,0x39,0x49,0xBA,0x59,0xAB,0xBE,0x56,0xE0,0x57,0xF2,0x0F,0x88,0x3E)
# convert to bytes
$str | Foreach {[byte][char]$_}
如果是单个字符串,试试这个:
# simulated output as a single string containing all the bytes
$ofs=''
$str = [string][char[]][byte[]](0xE1,0x0A,0xDC,0x39,0x49,0xBA,0x59,0xAB,0xBE,0x56,0xE0,0x57,0xF2,0x0F,0x88,0x3E)
# convert to bytes
$str.ToCharArray() | % {[byte]$_}
于 2015-07-11T18:15:04.137 回答