4 ms·
Reverse Engineering Cyclic Redundancy Codes
- carlmr 7y agoVery cool indeed, but I wish the blog post would go more in detail about how the program works instead of just that it exists.
- Isamu 7y agoThe CRC RevEng readme file has some interesting references cited, including "Reversing CRC – Theory and Practice" http://reveng.sourceforge.net/readme.htm http://reveng.sourceforge.net/readme.htm PDF of the paper is here: https://sar.informatik.hu-berlin.de/research/publications/SAR-PR-2006-05/SAR-PR-2006-05_.pdf https://sar.informatik.hu-berlin.de/research/publications/SA...
- Isamu 7y agoA CRC is the remainder or residue after division (by the CRC generating polynomial). So you are given a dividend (the message) and a remainder (the CRC). What is the divisor (the CRC polynomial)? From one example dividend/remainder you can come up with several possible divisors, but you have already greatly narrowed the field. With more examples you can eliminate the false positives.
- carlmr 7y agoThat's what it says in the article, I just think the interesting part is HOW the number of possibilities are narrowed down efficiently.
- deleted 7y ago[deleted]
- kop316 7y agoSo maybe someone else can help me understand, but I do not know why you would want to "spoof" CRCs. CRCs are not a cryptographic hash algorithm, and CRCS are meant to correct errors in transmission. If I were to MITM, I would simply recalculate the CRC after changing the transmission.
- Isamu 7y ago>I would simply recalculate the CRC This is how you figure out which CRC to use in order to "simply" recalculate it. Usually you are doing this because you want to interface with a closed-source device where only the messages are known, or if you want to check a closed-source device for vulnerabilities.
- kop316 7y agoI agree with you on that, however the article says "The CRC RevEng code can also manipulate a message to generate a desired CRC value." That is what I am confused on. Why would you need a desired CRC value?
- ifoundthetao 7y agoMaybe there are CRC values that signal hashes, and are used as such. So instead of looking at a message, it'll look at the CRC instead. This gives you the ability to not have to know the full message, but leverage this with part/none of it. Another reason might be for QA testing, or for fuzzing purposes. You don't always know the implementation details, but this type of control allows one to get more understanding of those details, by seeing how the software under test reacts. This stuff is not wildly uncommon in low-grade IoT devices, or high-end devices with a low level of security maturity.
- nayuki 7y agoThe article in this post talks about figuring out the parameters for an unknown CRC, based on sample data. Somewhat relatedly, I have an article talking about modifying a file to generate a particular CRC, assuming that the parameters are known. https://www.nayuki.io/page/forcing-a-files-crc-to-any-value https://www.nayuki.io/page/forcing-a-files-crc-to-any-value
- Isamu 7y agoPretty interesting! The tool they use is CRC RevEng - apparently one of the things it does it try known CRCs, and they give this unique catalog of known CRCs: http://reveng.sourceforge.net/crc-catalogue/ http://reveng.sourceforge.net/crc-catalogue/