PAYLOAD=`cat $f`
header=`cat a.hex`
send=$header$PAYLOAD #The actual Payload
echo -en $send | nc -p 3300 127.0.0.1 4000 &
PAYLOAD
包含一个简单的字符串
header
包含"\x00" "\x01"
...等二进制文件
echo
无法发送\x00
字符。
部分字符的发送方式为\x01 \x11 \x10...
,但不是\x00
如何echo
或read
或cat
(等)并将其提供给nc而不会丢失\x00
个字符?
答案 0 :(得分:1)
尝试
cat a.hex $f | ...
而不是说:
PAYLOAD=`cat $f`
header=`cat a.hex`
send=$header$PAYLOAD #The actual Payload
echo -en $send | ...