An inverse scattering approach based on the contrast source inversion (CSI) algorithm is presented for the determination of the three-dimensional (3D) complex permittivity variation of arbitrarily shaped materials loaded in a rectangular waveguide. First the problem is introduced by the definition of the electric field integral equation based data and object equations, which contain the dyadic Green function of an empty rectangular waveguide. The resulting inverse scattering problem for the unknown complex permittivity of the loading is solved by the CSI technique, which is adapted by a modal expansion approach for the guiding structures. A detailed numerical implementation of the method together with some illustrative examples is given to show the effectiveness as well as the capabilities of the method.