We investigate the quantitative reconstruction of physical properties in passive imaging, where ambient wavefields are used to probe a medium. These wavefields arise from stochastic excitations, and we consider in particular helioseismology, in which observed solar oscillations are driven by turbulent convection. We model the data as a superposition of waves generated by stochastic sources, such that the expected cross-correlation is related to the deterministic Green's function. The inverse wave problem is formulated as an iterative minimization procedure, with gradients computed using the adjoint-state method. We focus on time-harmonic acoustic wave propagation and perform synthetic experiments in two and three dimensions, comparing inversions based on cross-correlation measurements with those relying on direct wavefield observations in an active-source acquisition setting.