hi. can we print some fields of a packet in hex format in tshark? if we use :
the output(nbns.txt) is : 1 192.168.1.9 2 192.168.1.9 3 192.168.1.9 but i want to Write ip address in hex format(below).is it possible? 1 c0 a8 01 09 2 c0 a8 01 09 3 c0 a8 01 09 This question is marked "community wiki". asked 22 Apr '17, 05:20 ghader wikified 22 Apr '17, 10:23 |
One Answer:
This can probably be optimized, but you can pipe the
answered 22 Apr '17, 14:55 cmaynard ♦♦ edited 22 Apr '17, 15:30 |
thanks, but when i run this command in tshark it says: sed in not recognizeds as an internal or external command,operable program or batch file. we use %02x %02x %02x %02x to printf ip address in hex format and know that ip address has 4 byte,but if we dont know fields length, how we can write them in hex format?
If you're running on Windows, that answer won't work, unless you happen to have UN*X tools such as sed, xargs, and printf installed on your machine (for example, through Cygwin); you'll have to find some other program or programs to transform the output into that format - TShark has no mechanism to produce that output directly.