The UK's Government Communications Headquarters (GCHQ) spy agency has apparently scanning entire countries for server weaknesses that allow it to exploit vulnerable ports.
The British are using a tool called Hacienda, which is Spanish for estate. According to the German newspaper Heise, in 2009 GCHQ made port scans a 'standard tool' to be applied against entire nations. So far 27 countries are listed as targets of the Hacienda.
The portscan provides information on user endpoints and scan for potential vulnerabilities. Targeted services include SSH, HTTP and FTP, among others.
GCHQ said that its work was all-legal and it was all for Queen and country anyway.
The Snowden documents indicated a relationship between the British and US spooks where the UK was providing services to the US which might not be legal across the pond.