zmap / zgrab2

Fast Go Application Scanner
Other
1.72k stars 294 forks source link

smb: allow dynamic length fields of exact length #323

Closed ghost closed 3 years ago

ghost commented 3 years ago

In order for the following line,

r = bytes.NewBuffer(meta.ParentBuf[o : o+l])

to succeed, o+l need only be <= len(meta.ParentBuf), not <.

This causes fields of exactly correct length to fail to unmarshal. This would not prevent a scan from being successful, but it would stop the targetName and negotiateFlags fields from being populated due to the early exit.