Israel (Mossad?) can hack something in Russia, see tools and recognise those tools as top secret NSA gear. Do you wonder how they made that recognition? Were they shared with Israel so they knew, in which case the source could have been Israel being hacked, right? Or they knew because hacking the NSA is something multiple nation states have done. I'd be completely amazed if the NSA wasn't absolutely full of spies act…
One could argue that e.g. German spy tools copy the American style so that those decompiling it will think it is American. I argue that is a lot harder that it sounds. Code style is much deeper than whether or not to use braces around lone if clauses. The whole way of thinking, layout of data structures, use of getters/setters or properties, breakdown of what goes where and into which classes, breakup of large methods, etc etc etc. These signatures and many more give one a feel for the software's origin. Not proof, but a very solid foundation for suspicion.