-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial submission of CoAP-related code to the Nmap project. #369
Conversation
It's been a while, wondering if there's anything that's needed from me that would help move this along? |
Conflicts: nmap-service-probes nselib/unittest.lua
Fixed the assert failures against the list of test IPs. Additional issues remain which should probably be addressed for wider compatibility, the most common being |
…omething near the 16-bit max.
Does this script really work on port 5684 (coaps)? I would think it doesn't since Nmap doesn't support DTLS currently. This is the last bit of info I need before I commit. |
No, it won't support it as-is. I tried to put things in place so that if DTLS support gets added it would start working. Port numbers and such. Feel free to remove if that's jumping the gun. |
Merged in 0790885 |
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
unittest
library's own unit tests. I have also included a new test methodunittest.identical
which 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
build()
orparse()
functions. Points of complexity that could certainly use review are:COAP.header.options.build()
COAP.header.options.delta_length.build()
COAP.header.options.delta_length.parse()
COAP.payload.application_link_format.parse()
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.