Generalized optical theorem detection in random and complex media