South Africa beat defending champions Australia by eight wickets to advance to the final where they will face either the West Indies or New Zealand.