We provide an optimization approach to reverse stress testing, i.e., choosing the most likely scenarios among scenarios that cause a systemic risk measure exceeding a given threshold. In particular, we use the Eisenberg-Noe clearing framework to quantify the effect of contagion of a shock in interbank networks. It is well known that a clearing payment vector of a regular financial system is given by a unique solution of a fixed point problem. Utilizing this, we show that reverse stress testing can be formulated as a mixed integer programming. Our model can be applied to an extension of the Eisenberg-Noe framework, which reflects bankruptcy costs that occur when a bank defaults. Numerical results are presented based on the actual European Banking Authority data.