Anxiety attacks can occur with many anxiety disorders, such as specific phobia, social phobia (social anxiety disorder), panic disorder, PTSD (post traumatic stress disorder), and OCD (obsessive compulsive disorder). Anxiety attacks and panic attacks are similar, but have one important difference: anxiety attacks are triggered, while panic attacks have a random onset and come out of the blue.
So anxiety attacks are triggered, and are part of the underlying anxiety disorder. So the medications used to treat the anxiety attack depends on the anxiety disorder you have. If you have specific phobia, then no medications are helpful to treat the anxiety attacks when you are exposed to your feared object or situation. If you have social anxiety disorder, panic disorder, OCD, or PTSD, then the medication used to treat the anxiety attacks caused by these anxiety disorders are SSRIs (selective serotonin reuptake inhibitors) and SNRIs (serotonin norepinephrine reuptake inhibitors). Benzodiazepines have a limited role in anxiety attacks, given their addictive potential and other side effects. If a benzodiazepine has to be used, then it should be used sparingly and only on a short-term basis, until other treatments can help to reduce the anxiety attacks.