Tractor beams are used for offense and defense in the Star Trek universe although it is usually used simply for towing purposes.
They were most often employed to tow a disabled or vulnerable ship to
safety, or sometimes, used by an enemy ship to control the movement of
the target vessel.
(TOS: "Who Mourns for Adonais?"; TNG: "The Naked Now", "The Battle",
"The Masterpiece Society"; TNG: "Cause and Effect"; VOY: "Scorpion")
The Borg were the ones who used the tractor beams for purposes other than towing though.
The Borg favored the use of a considerably more advanced tractor beam
when engaging in combat. The Borg beam was capable of rapidly draining
a vessel's shields while holding the vessel in place, rendering it
virtually helpless against the cutting beam that it was often used in
conjunction with. Furthermore, the sheer size of the Borg cube
permitted the tractor beam to be used with considerable effectiveness
against even ships as large as the USS Enterprise-D. They also had the
ability to utilize tractor beams at warp velocities.
(TNG: "Q Who"; DS9: "Emissary"; VOY: "Scorpion")
Also according to the website it states that Worf was able to modify a tractor beam to affect ship weaponry
A carefully modulated tractor beam could be used to affect
ship-to-ship weaponry. In 2372, Lieutenant Commander Worf of the USS
Defiant suggested using such a beam against a Vor'cha-class attack
cruiser. When put into practice, his plan was successful, deflecting
some of the vessel's disruptor fire and reducing its effectiveness by
(DS9: "The Way of the Warrior")
Overall there is an abundance of evidence to show that tractor beams are used for more than just towing ships.