The 21-year-old Farhat was unbeaten on 73 and captain Inzamam-ul-Haq was on 12 as the hosts, replying to India's 287, went to lunch on 145 for two on Tuesday.
Pakistan, hoping to level the three-match series after losing the first Test by an innings last week, trail India by 142 runs with eight wickets in hand.
Resuming at 6 for one, Farhat and Yasir Hameed showed no signs of discomfort and took the score to 95 before seamer Ajit Agarkar struck in his first over of the day.
Hameed played a rash shot outside the off stump and was smartly snapped up at first slip by Rahul Dravid after making 19.
Farhat was lucky to reach his third half-century when he hooked Irfan Pathan's bouncer in the air and Agarkar dived valiantly only to see the ball drop short and cross the boundary.
Farhat's innings has been laced with 10 boundaries.
Inzamam, who made 77 and 0 in the first Test, hit two scorching fours off Agarkar and helped Farhat add 50 runs for the unbroken third wicket.
Left hander Yuvraj Singh saved India's blushes on day one with a fighting 112 after lanky Pakistan seamer Umer Gul wrecked the top order with career best figures of 5-31.