A booby trap was a type of device meant to kill or injure a person. They usually had some means to lure victims into them and then make it difficult to extricate themselves from it.
In 2366, a Menthar disabled the USS Enterprise-D nearly resulting in the loss of all hands until Geordi La Forge managed to repair 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 airborne disease causing the crew to speak incoherently until Kira Nerys kidnapped Surmak to force to create a cure in 2369. (DS9: "Babel")