A former NASA engineer made an explosive glitter bomb meant to ward off parcel thieves after a parcel was stolen from his porch earlier this year.

Mark Rober, who worked for NASA’s Jet Propulsion Laboratory for nine years, said in a Monday YouTube video that he spent six months building a “glitter-bomb revenge package” after someone stole a parcel from his porch in May.

The police at the time told him there wasn’t much they could do about it, he said.

Here’s how the high-tech prank works

The glitter bomb is hidden inside the packaging of an Apple HomePod speaker, which is wrapped in clear cellophane and left on a person’s porch.

But instead of the speaker, the box contains four concealed smartphones that record the would-be thief from every angle through hidden windows cut into the box.

(Mark Rober/YouTube)

The package also has a built-in GPS locator and accelerometer, which prompt the phones to start recording if the box is moved.

As a tribute to Kevin McCallister, the Home Alone prankster played by Macaulay Culkin, Rober put postage stickers on the package that were addressed to Harry and Marv, the movie’s slapstick crooks.

As the thief opens the package, wires are tripped that cause the motor inside to start spinning, covering those nearby in glitter.

(Mark Rober/YouTube)

To add insult to injury, the 38-year-old also added a “fart spray” dispenser to the prank.

When the box is opened, a canister sprays the foul-smelling synthetic “fart spray” out the top of the box. In the video, Rober says: “No joke you can clear a room with one spray of this.”

Rober said in his video: “If anyone was going to make a revenge package and overengineer the crap out of it, it was going to be me.”

“The moral of the story is just don’t take other people’s stuff,” he said.