We study the imaging of a penetrable scatterer, aka target, in a waveguide with randomly perturbed boundary. The target is located between a partially coherent source which transmits the wave, and a detector which measures the spatially integrated energy flux of the wave. The imaging is impeded by random boundary scattering effects that accumulate as the wave propagates. We consider a very large distance (range) between the target and the detector, where that cumulative scattering is so strong that it distributes the energy evenly among the components (modes) of the wave. Conventional imaging is impossible in this equipartition regime. Nevertheless, we show that the target can be located with a ghost imaging modality. This forms an image using the cross-correlation of the measured energy flux, integrated over the aperture of the detector, with the time and space resolved energy flux in a reference waveguide, at the search range. We consider two reference waveguides: The waveguide with unperturbed boundary, in which we can calculate the energy flux, and the actual random waveguide, before the presence of the target, in which the energy flux should be measured. We analyze the ghost imaging modality from first principles and show that it can be efficient in a random waveguide geometry in which there is both strong modal dispersion and mode coupling induced by scattering, provided that the standard ghost imaging function is modified and integrated over a suitable time offset window in order to compensate for dispersion and diffusion. The analysis quantifies the resolution of the image in terms of the source and detector aperture, the range offset between the source and the target, and the duration of the measurements.