Mishkat al-Masabih
Al-Hasan on Samura’s authority reported the Prophet (ﷺ) as saying, “When any of you comes upon animals whose owner is among them he must ask his permission; if not he must call three times and if anyone answers him he must ask his permission; but if no one answers him he may draw some milk and drink, but not carry any away.” Abu Dawud transmitted it.
وَعَن الْحسن عَن سَمُرَة أَنَّ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ: «إِذَا أَتَى أَحَدُكُمْ عَلَى مَاشِيَةٍ فَإِنْ كَانَ فِيهَا صَاحِبُهَا فَلْيَسْتَأْذِنْهُ وَإِنْ لَمْ يَكُنْ فِيهَا فَلْيُصَوِّتْ ثَلَاثًا فَإِنْ أَجَابَهُ أَحَدٌ فَلْيَسْتَأْذِنْهُ وَإِنْ لَمْ يُجِبْهُ أَحَدٌ فَلْيَحْتَلِبْ وَلْيَشْرَبْ وَلَا يَحْمِلْ» . رَوَاهُ أَبُو دَاوُد
Reference