Years ago a mysterious hacking group "The Shadow Brokers" leaked secret data hacked from the US intelligence agency NSA, then everyone began looking for the tools that were hacked by NSA.
According to a research NSA's specialized team known as Territorial Dispute developed some codes and tools which helped the intelligence agency to detect hackers from other nation or cities who targeted those machines which were infected.