If you are the victim of violence or another negative action in your dream, you may be feeling guilty about something and using your dream to punish yourself. Your dream could also be a sign that you feel vulnerable.
Is your attacker someone you know in waking life? If so, your dream may may warning you of a threat that they pose.
Weapons are often sexual symbols. What kind of weapon was used to attack you?
Has the attack left you injured? If you end up bruised and battered, your unconscious mind may be trying to kick-start you into taking action about something in your waking life. However, if you have very serious injuries, you may be suffering from deep emotional wounds.
If you dream of being in front of a firing squad, you may feel that you are being victimized in your waking life.
If you are the victim of an animal attack, pay attention to the type of animal that attacked you. It may represent an aspect of yourself that you want to control. An animal can represent your animal nature, and this dream can be a way of telling you that you are neglecting a basic instinct or urge.
Theories of evolutionary biology say that dreams about animal attacks are designed to teach us how to ward off real animal attacks in our waking lives, which humans would have had to do millions of years ago.