You shouldn't assume that you're outside the law just because you're in space. There is such a thing as space law, and virtually every major country in the world has signed up to it. The original signatories were the United States, the United Kingdom and Russia, back in 1967. As of right now, there are 107 sovereign states who have agreed to be bound by its rules.
Kept deliberately basic and designed to be a foundation set of rules which can be expanded upon by our space-faring descendants, it specifically bans the placing of weapons of mass destruction either in Earth orbit, on the Moon, or otherwise stationed in outer space. It also states that the Moon and other celestial bodies should only be used for peaceful purposes, and that that the testing of weapons on them is expressly prohibited. Going further, it states the intention that the exploration of space should be pursued peacefully and for the benefit of all States and all humankind - a noble sentiment if ever we heard one.