The other problem is that even if you intend to use it safely, you have just built a massive gun which is too far away to shoot back at and which has the capability to target specific locations on this planet.
But how difficult would it be to intercept the payload safely outside the atmosphere? Seems it would be easier than intercepting an ICBM.
While it is often said that stealth is impossible in space, that tends to assume the appropriate tech has actually been manufactured rather than sitting in a lab somewhere waiting for a purchase order. Radar, even lidar, is going to have awful signal-to-noise ratios and almost all of the return signal will be stuff that bounced off the moon rather than any projectile. Even the lunar retroreflector turns 10^17 photons out into one photon back, according to Wikipedia, and that’s about as far from stealth as you can get.
Edit: I suppose one could reasonably argue that any industrialisation of Luna would, as a result of my own argument, make governments choose to put loads of effort into appropriate defence technology. On the other hand, I’m told trench warfare was more accident than deliberate planning in WW1, so perhaps governments would be as myopic as ever even with a massive space gun on the moon.
I’m more concerned that there’s nothing much you can do to redirect such an object in the few hours it takes to fall on your head. By that time it will have reached 4km/s.
As for hacking being possible, that’s just the observation that basically everything is hackable. Even things that were given as examples of clueless parents fretting over nothing when I was a teen, such as making JPEG files execute when opened, turned out possible due to exploitable bugs.
However, my main focus was supposed to be other people who are “legitimately” in space, because of the aforementioned trillion dollars, and of hacking. Because both hacking and mutiny/secession haves happened lots already, even in situations where one might expect them not to.