‘Thinking like a terrorist’ led professor to disrupt possible ISIS attack