/ nmap Public
Initial submission of CoAP-related code to the Nmap project. #369
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge.
I am submitting a new port definition, service probe, discovery script, and protocol library for CoAP, an Internet of Things HTML-like protocol. CoAP is standardized and has many implementations and public test servers. Along with MQTT, it appears to be one of the most popular protocols in its domain.
I corrected what appeared to be an error in the
unittestlibrary's own unit tests. I have also included a new test method
unittest.identicalwhich is useful for performing deep comparisons of arbitrary Lua objects. This method tests the existence, type, length, and value of all objects recursively. Its existence allows the unit testing of the packet building and parsing features, many of which return nested tables.
Since this protocol has many features which I found difficult to get just right, the library is very hierarchical, structured as sort of a tree where the leaves are usually
parse()functions. Points of complexity that could certainly use review are:
The following command lines can be used to test multiple public test servers:
nmap -p U:5683 -sU --script coap-resources coap.me
nmap -p U:5683 -sU --script coap-resources californium.eclipse.org
The script output is a bit strange, having blank lines everywhere. I have not been able to correct this, and have also failed to get the example code in
stdnse.format_output()working as documented. Unsure if this is my failure or the library's, but assuming it's my fault for now.
If you have any questions or guidance, I will do my best to respond promptly.