As Internet middleboxes become increasingly prevalent, their influence on traffic streams presents significant challenges and opportunities for network management. Among these devices, transparent middleboxes are particularly difficult to detect, as they can modify traffic patterns without altering content, thereby preserving the appearance of normal routing. This paper addresses the challenge of detecting such transparent middleboxes by proposing a generalized detection framework capable of identifying a broad range of middlebox behaviors, including those that operate transparently. In contrast to existing ad hoc approaches that target specific middlebox types, our framework is novel in its ability to detect a wide variety of middleboxes instead. We validate the effectiveness of our approach through a combination of analytical methods, network simulations, and live Internet experiments. Our results demonstrate the framework's capability to accurately detect widely employed middlebox behaviors, such as network compression, traffic prioritization, and traffic shaping.