EXGEN: Cross-platform, Automated Exploit Generation for Smart Contract Vulnerabilities

—Smart contracts, just like other computer programs, are prone to a variety of vulnerabilities, which lead to severe consequences including massive token and coin losses. Prior works have explored automated exploit generation for vulnerable Ethereum contracts. However, the scopes of prior works are limited in both vulnerability types and contract platforms. In this paper, we propose a cross-platform framework, called E X G EN , to generate multiple transactions as exploits to given vulnerable smart contracts. E X G EN ﬁrst translates either Ethereum or EOS contracts to an intermediate representation (IR). Then, E X G EN generates symbolic attack contracts with transactions in a partial order and then symbolically executes the attack contracts together with the target to ﬁnd and solve all the constraints. Lastly, E X G EN concretizes all the symbols, generates attack contracts with multiple transactions, and veriﬁes the generated contracts’ exploitability on a private chain with values crawled from the public chain. We implemented a prototype of E X G EN and evaluated it on Ethereum and EOS benchmarks. E X G EN successfully exploits 1,258/1,399 (89.9%) Ethereum and 126/130 (96.9%) EOS vulnerabilities. E X G EN is also able to exploit zero-day vulnerabilities on EOS. symbolic values by extracting and solving constraints. Our evaluation shows that E X G EN successfully outperforms state-of-the-art tool, namely teEther, in generating exploits for vulnerable Ethereum (Solidity) contracts. The evaluation also shows that E X G EN is able to ﬁnd 50 zero-day vulnerabilities of 24 EOS smart contracts.