How to escape hex values in netcat
Asked Answered
B

3

7

I want to send the following via netcat:

99||0x00

(4 ASCII characters and a zero)

How is this done? I'm using Windows XP.

Thank you.

Baptista answered 12/10, 2009 at 9:29 Comment(0)
H
13
# echo -ne "99||\x00" | nc <host> <port>
Hudak answered 22/7, 2010 at 21:24 Comment(2)
This should be the accepted answer! Helped me to answer my own question and get my software working. ThanksPhillip
OP said Windows, not *nix.Naseby
C
4

Put the bytes into a file with binary editor and pipe it to netcat. Windows shell too supports input from file redirection via

netcat (options) < (file)

Alternatively, you may be able to input it with keyboard directly via Alt-000, but I doubt it.

Chippy answered 12/10, 2009 at 10:51 Comment(0)
F
3

Depending on your Unix flavor you can try one of these

echo '99||#' | tr '#' '\000' | netcat <host> <port>

echo -e '99||\000' | netcat <host> <port>
Fag answered 5/11, 2009 at 22:3 Comment(1)
OP requested help for windows xp not Linux.Pentathlon

© 2022 - 2024 — McMap. All rights reserved.