The hosts were reeling at 64-5 at lunch after winning the toss.
Shoaib, making his back in the Test side after the lifting of a drugs ban, removed AB de Villiers and in-form Hashim Amla.
Leg-spinner Danish Kaneria also picked up a couple and Mohammad Sami had the prized wicket of Ashwell Prince caught at slip for two.
Pakistan went into the game with three changes, recalling Shoaib, Sami and batsman Mohammad Yousuf, while South Africa were unchanged.
Batsman Herschelle Gibbs was available for the home side despite being given a two-match ban for making racist comments during the first Test. He has lodged an appeal and can continue to play until it is heard.
But it was not a happy morning for Gibbs, who fell lbw to Kaneria for two after being dropped by keeper Kamran Akmal off the previous delivery.
Pakistan also spilled a chance offered by Prince and although that did not prove costly, they also spilled Jacques Kallis, who edged between Akmal and first slip on 11 and survived to be 15 not out at lunch.
comeback man Shoaib shared the new ball in his first Test appearance for 11 months. And it only took him until his third over to make a breakthrough when de Villiers attempted to pull a ball from outside off stump and under-edged to the keeper.
Amla, who made 71 and 64 not out in the first Test, quickly followed when a gloved a catch down the leg-side.
Shoaib and new ball partner Mohammad Asif were kept to six-over spells by captain Inzamam-ul-Haq, who surprisingly turned to Kaneria as first change after only an hour of play.
Smith greeted his introduction by advancing down the pitch and hitting him powerfully back over mid-off for four, but his attempt to drive the next ball resulted in a nick which deflected off Akmal's gloves and looped into the air before being taken by Younis Khan.
Prince was next to go for two as he flashed outside off stump, having not learned the lesson from his let-off four balls earlier, and Gibbs missed an attempted sweep to give the umpire an easy decision.
South Africa: AB de Villiers, Graeme Smith (Capt), Hashim Amla, Jacques Kallis, Ashwell Prince, Herschelle Gibbs, Mark Boucher (wk), Shaun Pollock, Paul Harris, Andre Nel and Makhaya Ntini
Pakistan: Imran Farhat, Mohammad Hafeez, Mohammad Yousuf, Yasir Hameed, Younis Khan, Inzamam-ul-Haq (Capt), Kamran Akmal (wk), Mohammad Sami, Shoaib Akhtar, Danish Kaneria and Mohammad Asif
Brief ScoresSouth Africa 67 for 5 ( Graeme Smith 28, Kallis 15 n o; Shoaib Akhtar 2 for 18, Kaneria 2 for 14, Mohd Sami 1 for 15) Vs Pakistan
ThatsCricket (with inputs from agencies)