لَّيْسَ عَلَيْكُمْ جُنَاحٌ أَن تَدْخُلُوا۟ بُيُوتًا غَيْرَ مَسْكُونَةٍ فِيهَا مَتَـٰعٌ لَّكُمْ ۚ وَٱللَّهُ يَعْلَمُ مَا تُبْدُونَ وَمَا تَكْتُمُونَ
Laisa 'alaikum junaahun ann tadkhuloo buyootan ghaira maskoonatin feeha mataa'ul lakum; wallaahu ya'lamu maa tubdoona wa maa taktumoon
You will not be blamed for entering houses where no one lives, and which could provide you with some useful service. God knows everything you do openly and everything you conceal.
There is no blame on you for entering uninhabited houses in which there is some benefit for you. And God knows what you disclose and what you conceal.