You send the box and liquid towards a barrier equipped with a gauge to measure force. The setup looks like:
When the box hits the barrier it stops, but the liquid inside it keeps moving. A short time later the liquid hits the side of the box and it too stops moving. So when you record the force at the barrier as a function of time you will get two peaks, first as the box hits the barrier and stops, then a short time later a second peak as the water hits the end of the box and stops.
If you integrate the force time curve you will get the impulse during the collision, and this is equal to the change of momentum. Since momentum is $mv$, and you know the velocity $v$, you can calculate the mass. The two peaks will give you the mass of the box and the mass of the liquid.
Needless to say, in real life you will get only approximate results. The peak for the box should be clear, however the viscosity of the liquid will mean there is a force exerted on the barrier while the liquid is moving and before it hits the end of the box. Also the liquid will splash, so the impulse you measure will be too high. However the method should give you an approximate result.