I subscribe to a newsletter called Debt-Free living (formerly known as Cheapskate Monthly). One of the items that is well known by the readers is a product called SOILOVE. You can find it at the 99 cent store, it's in a 16 oz. green bottle. Works great! I'm not had it not work on anything I've tried. It works well on colored items as well.
As some of the others suggested....HYDROGEN PEROXIDE works great on getting out stains too. We've used it for years on our carpets (check for colorfastness on dark colors first) for years....whether it was a juice stain, or dirt from a shoe, or our geriatric dogs pee.....the HP eats up proteins and sanitizes as well, and does not leave a residue like most 'detergent' type rug cleaners do. So if you have animals especially, or have a liquid spill, pour a huge mound of salt on it first and let it soak up, then vacuum. Then POUR the hydrogen peroxide into the area and let it get down into the padding to eat away any liquid. HP dissipates because of it's base...so it's not like you are leaving anything behind.
Anyway, putting either product - SOILOVE or HYDROGEN PEROXIDE - in a spray bottle and spraying the socks...should turn out well.