You've probably heard of Odysseus, the King of the small island kingdom of Ithaca. He is known more often by his Roman name of Ulysses. He was the guy who came up with the idea of constructing the Trojan Horse. (And we still have that term for a piece of computer malware used to hack into your computer account!)
But before that, Odysseus did a bit of spying. He was the smartest of the Greek heroes. In my opinion, he may have been the only one of them who had a brain, actually. Odysseus had never wanted to join the expedition to Troy. He had a kingdom to run, a wife he loved and a baby son, Telemachus. But he had been part of a group agreement meant to stop the suitors of Helen of Sparta from getting into a war with each other. In fact, the agreement had been his idea.
Trying to get out of it and failing, he reluctantly went off to the Trojan War. When it had been going for ten years, Odysseus had had enough. More than enough. There was a prophecy that Troy would never fall until the Palladium, a stone sacred to the goddess Athena, was removed from its hiding place under the city. Odysseus didn't fancy another ten years or more parked outside those walls.
He disguised himself as a grubby old beggar and sneaked in. After ten years, presumably there were holes and tunnels and I bet there were lower-class Trojans and Greeks selling each other supplies. Anyway. He got in and went off to find out where the stone that could help him get home was located. While he was about it, he looked around him.
Queen Helen saw and recognised him. That was actually good news for him, because she, too, had had enough. Helen took him to where the stone was located and helped him get out of town.
The rest is mythology. Without its magical protection, Troy fell to Odysseus's next bright idea,the Trojan Horse, with some help from another Greek spy, Sinon, planted to tell the Trojans that he'd been left behind and the Horse was an offering to the gods.
Unfortunately for Odysseus, he was stuck with ten years more of travel before he finally made it home and then he disguised himself again, to make sure of his welcome. He didn't fool his old hunting dog, which recognised him through the disguise and licked his hand before finally dying... He did fool nearly everyone else.
Odysseus would have made a good professional spy, no?