Efficient extraction of resonant states in systems with defects