24:29
لَّيْسَ عَلَيْكُمْ جُنَاحٌ أَن تَدْخُلُوا۟ بُيُوتًا غَيْرَ مَسْكُونَةٍ فِيهَا مَتَـٰعٌ لَّكُمْ ۚ وَٱللَّهُ يَعْلَمُ مَا تُبْدُونَ وَمَا تَكْتُمُونَ
laysa ʿalaykum junāḥun an tadkhulū buyūtan ghayra maskūnatin fīhā matāʿun lakum wal-lahu yaʿlamu mā tub'dūna wamā taktumūna
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 sin on you that you enter (without taking permission) houses uninhabited (i.e. not possessed by anybody), (when) you have any interest in them. And Allâh has knowledge of what you reveal and what you conceal.