Contractors ward off attacker after his gun misfires