We demonstrate that electrically pumped random laser resonators, operating at terahertz (THz) frequencies, and comprising a quantum cascade laser heterostructure, can operate as sensitive photodetectors through the self-mixing effect. We devise two-dimensional cavities exploiting a disordered arrangement of surface holes that simultaneously provide optical feedback and allow light out-coupling. By reflecting the emitted light back onto the surface with random holes pattern, and by varying the external cavity length, we capture the temporal dependence of the laser voltage, collecting a rich sequence of interference fringes that follow the bias-dependent spectral emission of the laser structure. This provides a visible signature of the random laser sensitivity to the self-mixing effect, under different feedback regimes. The latter effect is then exploited, in the near-field, to demonstrate detectorless scattering near-field optical microscopy with nanoscale (120 nm) spatial resolution. The achieved results open up possibilities of detectorless speckle-free nano-imaging and quantum sensing applications across the far-infrared.