Two serving members of the British Armed Forces, both Special Forces soldiers, have admitted attempting to sell cannabis.