The $Z$-boson mass is easily fully measurable since for e.g. the processes $Z\to e^+e^-$ and $Z\to\mu^+\mu^-$ the complete four-vectors $p_\mu$ of the two final state particles can be measured very precisely, and from this one can reconstruct the $Z$ four-vector and therefore its mass: $$m_Z^2=(p_1^\mu+p_2^\mu)^2$$
For the $W$ mass it is indeed a little more tricky: as you say, the neutrino cannot be directly measured, since it does not interact with the detector and only shows up as missing transverse energy ("MET"). Since at hadron colliders, we do not know what the momentum balance in the longitudinal direction is (beam remnants disappearing along the beam line, Lorentz boost due to unequal parton momentum fractions, etc.), we can only measure missing energy in the transverse plane, therefore for the neutrino we can only measure the transverse momentum $p_T^\nu$
The canonical method to determine the $W$-mass precisely at hadron colliders is to measure the so-called transverse mass, $m_T$. The spectrum of the transverse mass has a very visible feature often called the Jacobian Peak, at the point $m_W$.
$m_T$ is defined as $$m_T = \sqrt{2p_{T}^{l}p_{T}^{\nu}(1-\cos\Delta\phi_{l\nu})},$$
where the $\Delta\phi_{l\nu}$ is the angle in the transverse plane between the lepton and the direction of the missing transverse energy.
The resulting histogram from the recorded data is fitted with a line-shape that has $m_W$ as a floating parameter.

(from https://arxiv.org/abs/1203.0275)