Rabada took five for 30 as Bangladesh were bowled out for 172, a slight improvement on their first innings of 147 in reply to South Africa`s 573 for four declared.