MB3 127b: Hitting Animals on Shabbos (316:7-8)

Hitting an animal to prevent it from hurting someone (non-fatal) or to keep it away. Capturing one of the 8 שרצים listed in the Torah are subject to the prohibition against trapping. A mouse trap on Shabbos. Causing a wound is under the melacha of killing.