NSA director: Surveillance programs disrupted dozens of attacks