An episode from Season 1 of Farscape (10103).
Moya went behind a cloud of what appeared to be asteroid debris to hide from Crais. Only, of course, it wasn't debris but a swarm of alien lifeforms, some of which get on board.
These lifeforms create physically identical replicants of Crichton, D'Argo, Aeryn, and Zhaan who quickly began to take over Moya, particularly adjusting Moya's environmental controls so that the temperature rose to a level adequate for their breeding, but dangerous to Aeryn.
Just as the crew works out a peace with the creatures Peacekeeper Commandos slip on board and begin killing every replicant they find. Rygel manages to keep the breeding queen from over reacting while Crichton deals with the Commandos.
Writer: Ro Hume
Director: Brian Henson
Information culled from my memory of the episodes and support by www.farscape.com, and www.scifi.com/farscape.