An attack was a hostile and forceful physical assault on another individual or group with the intent to injure or kill. This individual or group was known as the attacker.
Due to the misunderstanding of a transmission from Captain Mitchell, a wrong story was told among the Novans for three generations. In this story, Humans attacked the Terra Nova colony and poisoned and gutted the adults. (ENT: "Terra Nova")
In June of 2151, the Andorian Imperial Guard Commander Thy'lek Shran expressed his concerns regarding a possible attack on his ship by Enterprise NX-01 when it leaves orbit of the planet with the Vulcan monastery at P'Jem. Sub-commander T'Pol instructed Enterprise to let his ship pass. (ENT: "The Andorian Incident")
Earth Cargo Service freighters were known to be attacked by Nausicaan pirates in a particular sector. In August of 2151, the ECS Fortunate was attacked by Nausicaan ships but the first officer Matthew Ryan was up for revenge and attacked the Nausicaans and their cargo base. (ENT: "Fortunate Son")
In 2266, Commander Spock and Lieutenant Stiles agreed that the USS Enterprise should attack a Romulan Bird-of-Prey which was on the Earth side of the Romulan Neutral Zone. Doctor Leonard McCoy was dismissive of attacking them based on the memories of a war over a century before, and on theories about people they had never met face-to-face. (TOS: "Balance of Terror")
In 2267, Earth probe Nomad attacked the Enterprise, which caused the deflector shields to absorb energy equivalent to ninety of the ship's photon torpedoes. The energy used for the shields to repulse the attack reduced shielding power twenty percent. According to Spock, they could resist three more such attacks, while a fourth would shatter their shields completely. Spock believed that Nomad broke off its attack because it thought Captain James T. Kirk was actually its creator Jackson Roykirk. Kirk later assured Nomad that Spock touching it to perform a Vulcan mind probe was not an attack, but a form of communication. (TOS: "The Changeling")
After a nanite infestation of the USS Enterprise-D's computer core in 2366, Commander William T. Riker asked why nanites would attack them. Later, Doctor Paul Stubbs was attacked by nanites, and Captain Jean-Luc Picard could not believe it was an arbitrary attack, as Stubbs had previously sterilized a computer core processor which killed nanites in the upper core. (TNG: "Evolution")