Opener Stephen Cook reached his second Test century before he was the last man out, bowled by Mitchell Starc for 104 off 240 balls.
Starc finished with four wickets for 80 and spinner Nathan Lyon captured three for 60.
Resurgent Australia are bidding to prevent the Proteas from making an unprecedented series clean sweep in Australia after heavy losses in the first two Tests in Perth and Hobart.