can be a one of many things, first off i'd say eliminate the easy to fix, loose chainring bolts, pedal problems, somthin with the front derail and chain. But most likely it is either loose crank arms, or dirty/dry bottom bracket threads, it could also be a dead bottom bracket, or a loose one, but thats less likely. Anyway, hold your frame and try to wiggle your crank arms side to side, I find its easiest to hold the bike with your upper arms/torso (arm over the top tube) and put a hand on each crank arm when they are at 12 and 6 o'clock, if you get any play then you crank arms are loose and need to be tightened, even if you feel no play this could still be the problem, the crank bolts need to be tightened to 30ft/lbs assuming splined/isis/octalink/squar tapered setup, if you have an external BB you may still need to hit that 30ft/lbs, if you have only 1 bolt on the nondrive side and no pinch bolts then 30ft/lbs, if you have pinch bolts then you neede to tighten the main bolt like you would a headset, don't overtighten. So if that wasn't your problem then pull the cranks off and pull your BB, clean all the threads, grease, and reinstall torqueing to 35 ft lbs. You will prolly need to head into a shop for that unless you have a torque wrench crank puller and BB tool.
If you have a full suspension make sure all your pivots are tight, i've seen people mistake loose pivots for crank or wheel problems.
fyi BB just need to be pulled once in a while cause the threads go dry after so many miles and they start to get noisy, somtimes crank arms just need to be tightened, it just happens, bearings in BB go bad