A booby trap was a type of device meant to kill or injure a person. It typically had some means to lure victims into it and then make it difficult to extricate themselves from it.
In 2366, a Menthar booby trap disabled the USS Enterprise-D, nearly resulting in the loss of all hands until Geordi La Forge managed to restore the systems aided by a holographic version of Leah Brahms, a designer of the Enterprise. (TNG: "Booby Trap")
During the Occupation of Bajor in 2351 Bajoran scientist Dekon Elig and his assistant Surmak Ren created the aphasia virus as a weapon against the Cardassians and set it as a booby trap on the space station Terok Nor. Miles O'Brien accidentally activated the virus while making repairs to Deep Space 9's replicators which spread via the replicators until mutating into an airborne disease causing the crew to speak incoherently until Kira Nerys kidnapped Surmak to force to create a cure in 2369. (DS9: "Babel")
In 2370, O'Brien warned Julian Bashir not to touch supplies that Bashir found on T'Lani III as they could have been booby-trapped. O'Brien had seen several soldiers killed in the same circumstances during the Cardassian War. (DS9: "Armageddon Game")
In 2371, Seska rewrote the Insurrection Alpha holoprogram and left booby-trapped subroutines, so that when someone attempted to open the holodeck doors, the power grid would explode. (VOY: "Worst Case Scenario")