Cops: Intruder attacks man with hammer