Set an intimidating victory target of 539, the home side were wobbling on 169 for four at stumps and facing a potential record defeat against South Africa.
Usman Khawaja was on 58 and Mitchell Marsh on 15, with South Africa's unbeaten record at the ground set to be extended.
An extraordinary piece of fielding by the diminutive Temba Bavuma removed the dangerous David Warner for 35 to end an opening stand of 52.
It rattled the stumps at the non-striker's end with Warner centimetres out of his ground.
More From This Section
The dismissal set the stage for Rabada (3-49) to display his quality in the absence of champion pacemen Dale Steyn due to a shoulder injury suffered on the first day.
Four balls later fellow opener Shaun Marsh (15) was caught at second slip by Faf du Plessis off the bowling of Rabada as Australia suddenly slumped to 52-2.
A decision review saved Khawaja when it showed the ball had glanced off his pad rather than the bat.
Steven Smith and Khawaja, who was dropped on 41 when Hashim Amla could not cling on to a tough chance at first slip, set about rebuilding the Australian innings in search of a draw.
The pair settled in against the part-time bowlers, but when the ball started to reverse swing Rabada returned to the attack and ended a 92-run third-wicket stand with an impressive spell.
Smith had looked solid but drove at a ball and got an outside edge to wicketkeeper Quinton de Kock.
Rabada's next over to Voges was outstanding, with a couple of almost unplayable deliveries before he had the new batsman caught behind off a thin outside edge.
South Africa had declared their second innings on 540 for 8 after lunch when Vernon Philander was bowled by Smith for 73.
South Africa's massive total was underpinned by 141 from Duminy and 127 from Dean Elgar.
The pair put on 250 for the third wicket as part of a remarkable comeback by the tourists after their disappointing first day.