Australia require a further 168 runs for victory after Ricky Ponting and Pat Cummins put the tourists in a winning position ahead of the final day of the second Test in Johannesburg.
Former captain Ponting ended the day unbeaten on 54 and Pakistan-born batsman Usman Khawaja also contributed a half-century as the Aussies closed the day on 142-3.
Debutant paceman Cummins earlier took 6-79, including the wicket of AB de Villiers for 73 as South Africa were bowled out for 339 in their second innings.
Hashim Amla, who shared a 147 run fourth wicket stand with de Villiers, reached his century for the hosts before being caught behind off Mitchell Johnson for 105.
A win for Australia would level the two match Test series at 1-1.