Skip to content
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

add OSPFv2 MD5 auth hashes #3973

Open
roycewilliams opened this issue Mar 22, 2024 · 0 comments
Open

add OSPFv2 MD5 auth hashes #3973

roycewilliams opened this issue Mar 22, 2024 · 0 comments

Comments

@roycewilliams
Copy link
Member

OSPFv2 MD5 digest auth mode as specified in RFC2328, section D.4.3 (p231)

https://www.ietf.org/rfc/rfc2328.txt

Because the OSPF data itself is used in the hashing, a valid captured OSPF packet is needed.

This implementation claims support (not tested):

https://github.com/theclam/dechap

Related analysis:

https://networkingbodges.blogspot.com/2013/10/offline-attack-on-md5-keys-in-captured.html

According to that analysis, this is another way to state the algorithm:

In order to calculate the correct MD5 hash, the following method should be used:

(a) Build the OSPF packet as normal, ensuring that the key number and authentication sequence number are populated. The OSPF length field must contain the total number of bytes in the packet at this point. The checksum must be set to zero.

(b) The authentication key / password in plaintext must be adjusted to exactly 16 bytes, i.e. if the key is longer than 16 bytes then it must be truncated, shorter keys must be padded with null (0x00) bytes until 16 bytes long. The resulting 16 byte "modified authentication key" is then appended to the packet.

(c) The MD5 hash must be calculated over the entire result, i.e. the original OSPF packet plus the 16 byte modified authentication key.

(d) The resulting hash is then written over the modified authentication key in the last 16 bytes of the packet.

Thanks to @Chick3nman for the research.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant