dismap icon indicating copy to clipboard operation
dismap copied to clipboard

Binary banners seem padded with null bytes

Open p-l- opened this issue 2 years ago • 2 comments

When exporting results to JSON, the field banner.byte is often padded with null bytes, making it unreliable. This seems to happen with short (less than 256 bytes) TCP banners (when the server talks first, without needing a hello from the client).

The 256 bytes is consistent with buffer sizes often used in the code.

p-l- avatar Apr 29 '22 23:04 p-l-

There is no good way to unify bytes at the moment, so now it is used in a simple way

zhzyker avatar May 05 '22 02:05 zhzyker

I understand that, but don't you think it should be possible to only report in the JSON result the actual bytes?

For now, for example, we get

"SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u7\r\n
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

instead of

"SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u7\r\n"

And there is no simple way to tell whether the server actually sent the null bytes or not.

p-l- avatar May 05 '22 18:05 p-l-