A gunman dressed as a policeman guns down at least 18 people worshipping at a shrine in the Afghan capital on Tuesday.