© 2022 Elsevier B.V.Detection of jamming attacks is an important tool to improve the resource efficiency of jammer resilient communication networks. Detecting reactive jammers is especially difficult since the attacker is cognitive and focuses only on the used channels. Orthogonal frequency division multiplexing with index modulation (OFDM-IM) consists of active and passive subcarriers. Only active subcarriers carry modulated signals while passive subcarriers are left unused. In OFDM-IM systems, information bits are also dynamically embedded in the indices of these active subcarriers. As a result, remaining passive subcarriers cause instantaneously changing and unused holes in the spectrum that a reactive jammer cannot escape from attacking. In this paper, we propose an OFDM-IM-based detection scheme to improve the detection performance against reactive jammers. The proposed method exploits the dynamically changing empty OFDM-IM subcarriers to improve detection performance. A detection mechanism that is based on the variance of received signals is considered to identify the jammed subcarriers reliably and with low complexity. We assumed a destructive and elusive reactive jammer model that applies a zero-mean Gaussian jamming signal to the occupied channels. The performance of the variance detector is investigated analytically for OFDM-IM and OFDM-based systems under the given jammer model. The results showed that passive subcarriers of OFDM-IM inherently provide a better detection performance compared to the classical OFDM. Lastly, the analytical results are verified via simulations against both full-band and partial-band reactive jammers. Also, the effect of noise and the jamming power on the detection performance is investigated via extensive simulations.