This makes me wonder, as a misanthropic European software engineer, what would be the best way to get into the weapons or (governmental) surveillance industry?
If you are applying for a junior role, I don't know much about Europe, but in India the defence and security sector often have internship programmes for university students.
Alternatively, same as all other jobs, keep your eye open and make sure your CV and cover letter is catered towards the job.
You don't need to be a misanthrope to work in defence and security. Despite the bad PR, it's comforting knowing that your work is making the world a safer place.
That 'making safer place' is 50:50 at best, every single arms/bombs/rocket/ammunition manufacturer has seen its products used for smaller or bigger genocides of civilian population across whole age spectrum, with obviously the biggest being US and Russia/CCCP.
Its supremely dumb to blame manufacturers in any way of course, they are just (pretty efficient) tools.
The same way than any other companies: they advertise the positions they are looking for.
But you will find very little misanthropy there. The salaries are not that great so most of the engineers are either genuinely interested in the complexity of what they build (aerospace and naval is often like that) or invested in the mission (serving the nation).