README 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. "badpacket" is a tool intended to test that a nameserver can cope with
  2. incorrectly-formatted DNS messages.
  3. This particular incarnation of the tool allows various fields in the DNS
  4. message to be set to any value (including to values that invalidate the query).
  5. As well as setting individual values, it is possible to specify ranges; when
  6. this is done, the tool will send a set of packets so that each combination
  7. of values is checked.
  8. To illustrate this, consider the following command:
  9. badpacket --address 192.0.2.21 --port 5301 --aa 0-1 --cd 1
  10. --rc 0-2 ftp.example.com
  11. (The command has been split across two lines for clarity.)
  12. The address and port flags are self-evident. The other flags specify
  13. settings for the AA bit (0 and 1), CD bit (always 1) and the RCODE field
  14. (0, 1, 2). (The remaining fields in the flags word are not specified, so
  15. will always be zero.) There are six combinations of these values, so six
  16. packets will sent to the remote server with the following settings:
  17. AA RCODE CD Rest
  18. 0 0 1 0
  19. 0 1 1 0
  20. 0 2 1 0
  21. 1 0 1 0
  22. 1 1 1 0
  23. 1 2 1 0
  24. Each packet will cause a line to be output to stdout, which will have the
  25. following form:
  26. SUCCESS: (QR:0 OP:0 AA:0 TC:0 RD:0 RA:0 ...
  27. (qr:1 op:0 aa:0 tc:0 rd:0 ra:1 ...
  28. (Again the text has been split across two lines for clarity. Also, the full
  29. list of fields has been truncated.)
  30. Each lines contains a status (SUCCESS indicates that a response was received,
  31. regardless of the contents of the response), the state of the fields in the
  32. flags word of the packet sent (in upper-case letters) and the state of the
  33. fields in the flags word of the response (in lower-case letters).
  34. TODO: At the moment the tool is limited to:
  35. * Setting values in the flags field.
  36. * Setting section counts to arbitrary values.
  37. * Extending or truncating the DNS message size.
  38. Additional options needed are:
  39. * Add data to sections that should be empty.
  40. * Deliberately mangle the names placed in the message sections (e.g. by altering
  41. the label count fields).