Two-dimensional semiconductors have recently emerged as promising materials for novel optoelectronic devices. In particular, they exhibit favorable nonlinear optical properties. Potential applications include broadband and ultrafast light sources, optical signal processing, and generation of nonclassical light states. The prototypical nonlinear process second harmonic generation (SHG) is a powerful tool to gain insight into nanoscale materials because of its dependence on crystal symmetry. Material resonances also play an important role in the nonlinear response. Notably, excitonic resonances critically determine the magnitude and spectral dependence of the nonlinear susceptibility. We perform ultrabroadband SHG spectroscopy of atomically thin semiconductors by using few-cycle femtosecond infrared laser pulses. The spectrum of the second harmonic depends on the investigated material, MoS2 or WS2, and also on the spectral and temporal shape of the fundamental laser pulses used for excitation. Here, we present a method to remove the influence of the laser by normalization with the flat SHG response of thin hexagonal boron nitride crystals. Moreover, we exploit the distinct angle dependence of the second harmonic signal to suppress two-photon photoluminescence from the semiconductor monolayers. Our experimental technique provides the calibrated frequency-dependent nonlinear susceptibility χ(2)(ω) of atomically thin materials. It allows for the identification of the prominent A and B exciton resonances, as well as excited exciton states.