An invasive program was a benign or malevolent computer program not native to a target computer's environment, and forcibly maintaining itself within that target environment, with or without that system's knowledge of the program's existence.
In 2368, an invasive paradoxical puzzle program was developed by Commanders Geordi La Forge and Data as an unconventional weapon in the war against the Borg for use as an exploit of Hugh's subspace transceiver link to the Borg Collective. The program was designed as a geometric form that could not actually exist in physical space; when Hugh's prosthetic eyepiece attempted to create a three-dimensional holographic render of the shape, it would fail, and the program would be shunted into Hugh's memory banks for further analysis. When Hugh rejoined the Borg, his memory would be downloaded by the Collective, which would continue to attempt to analyze the shape. Each step taken by the Borg to understand the program would spawn a series of anomalous solutions that would interact with each other, resulting in an endless, unsolvable puzzle. Eventually, the Borg neural network would collapse under the strain of attempting to solve the paradox, resulting in a total systems failure across the entire Collective.
In 2369, an alien probe from the Gamma Quadrant transmitted the "Pup" non-biological lifeform to Deep Space 9 space station. "Pup" acted like an invasive program, and thwarted all attempts that were made to return it to the probe. (DS9: "The Forsaken")