How? God knows. I keep my browser, Windows and AVG up to date, daily if required. I think I might have had a Flash browser plugin that was out of date for a while, and I had a pop up to update it. I think the pop up might have been false. That's all I can think of.
A regime of Spybot, AVG, Malwarebytes cleaned the system. Along with some hard-core ComboFix to fix a stubborn root nightmare that I won't go into here.