Automatic Protocol Format Reverse Engineering through Context-Aware Monitored Execution.

Zhiqiang Lin, Xuxian Jiang, Dongyan Xu, Xiangyu Zhang

2008 · 198 citations · 23 references

Concepts

TL;DR

Protocol reverse engineering is traditionally manual, time‑consuming, and error‑prone, and existing automated approaches either lack semantic insight or only expose flat protocol structures. This work introduces AutoFormat, a system designed to accurately extract protocol fields and uncover their hierarchical message structures. AutoFormat infers format by monitoring execution contexts of each message byte, annotating offsets, clustering these contexts, and has been evaluated on over 30 messages from seven protocols, including HTTP, SIP, DHCP, RIP, OSPF, CIFS/SMB, and a malware protocol. AutoFormat achieves a 93.4 % field‑matching accuracy against Wireshark and successfully reveals sequential, parallel, and hierarchical relations among protocol fields. The research was supported by NSF grants CNS‑0716376 and CNS‑0716444 and conducted while the first author visited George Mason University in Summer 2007.

Abstract

Protocol reverse engineering has often been a manual process that is considered time-consuming, tedious and error-prone. To address this limitation, a number of solutions have recently been proposed to allow for automatic protocol reverse engineering. Unfortunately, they are either limited in extracting protocol fields due to lack of program semantics in network traces or primitive in only revealing the flat structure of protocol format. In this paper, we present a system called AutoFormat that aims at not only extracting protocol fields with high accuracy, but also revealing the inherently “non-flat”, hierarchical structures of protocol messages. AutoFormat is based on the key insight that different protocol fields in the same message are typically handled in different execution contexts (e.g., the runtime call stack). As such, by monitoring the program execution, we can collect the execution context information for every message byte (annotated with its offset in the entire message) and cluster them to derive the protocol format. We have evaluated our system with more than 30 protocol messages from seven protocols, including two text-based protocols (HTTP and SIP), three binary-based protocols (DHCP, RIP, and OSPF), one hybrid protocol (CIFS/SMB), as well as one unknown protocol used by a real-world malware. Our results show that AutoFormat can not only identify individual message fields automatically and with high accuracy (an average 93.4% match ratio compared with Wireshark), but also unveil the structure of the protocol format by revealing possible relations (e.g., sequential, parallel, and hierarchical) among the message fields. ∗Part of this research has been supported by the National Science Foundation under grants CNS-0716376 and CNS-0716444. The bulk of this work was performed when the first author was visiting George Mason University in Summer 2007.

References

23