Where did Gaddafi get his advanced surface-to-air missiles?

They're Russian-made SA-24s Grinch missiles. Very portable, used for knocking out aircraft. Aviation Week first noticed them in recent footage of Libyan government army operations. And they're nasty.

The SA-24 is more accurate, longer-flying, and more lethal than than earlier models of surface-to-air missiles. It also has a dual-band infrared seeker and is more difficult to jam than older systems.

The missiles “reportedly have counter-countermeasures that may be difficult for planes with just flares to counter,” Matthew Schroeder, director of the Federation of American Scientists’ Arms Sales Monitoring Project, tells Danger Room. ”Overall it’s just a much more capable system.”

So where did they come from? No one (outside the regime) is sure, but

Russia has sold Venezuela a shoulder-fired version of the SA-24, which is a bit different from the truck-mounted model found by Aviation Week. In classified cables released by WikiLeaks, American diplomats expressed alarm at Russia’s deal with Venezuela, writing that the missile, “considered one of the most lethal portable air defense systems ever made,” was at risk of falling into other hands.

Faced with evidence that Russia’s sales of ammunition to Venezuela had ended up in the hands of Colombian terrorists, Russian diplomats tried to reassure their American counterparts that they had their arms sales under control.

I don't find reassurances from a KGB police government, about Hugo Chavez, particularly reassuring. Venezuela reportedly bought 1,800 SA-24s from Russia in 2009. At $60k to $80K a pop, Gaddafi can afford to buy an awful lot of them.