Trespassers will be prosecuted.
Sometimes, they’ll get shot !!
Although the above statement is not very likely to happen to you, Urban exploration, is almost always clandestine and made without the authorization of the rightful owners.
As expected then, it is generally prohibited by some decrees, by-laws, or certain municipal regulations, depending on where you do your deed.