Gunmen in Iraq have attacked a bus carrying Shi'ite Muslim pilgrims to shrines south of Baghdad , killing three and wounding several others .