Sayyidina Samurah ibn Jundub (RA) reported that the Prophet (SAW) said, ‘If you come to a herd of animals and their owner is present then seek his permission. If he gives permission then milk (the animal) and drink it. But, if there is no one then call out three times and when someone answers, seek his permission. If no one answers you then milk the animal and drink but do not carry any milk away.” [Abu Dawud 2619]
--------------------------------------------------------------------------------