Sensex gains 279 points, Nifty near 24,000 amid broad-based recovery