Cylon computer virus
From Battlestar Wiki, the free, open content Battlestar Galactica encyclopedia and episode guide
The virus infiltration tactic was used greatly in the first Cylon War. In response, the Colonials began using simpler technologies that were impossible to reprogram or shut down. The first battlestars, to which Galactica belongs to, used computers but didn't network them or tie them to external sensors or communications, preventing a virus from entering ship's systems and minimizing damage to other systems in the event of an infection.
Comparatively primitive communications gear and other hardware throughout these ships also reduced or eliminated the ability of the Cylons to hack into or shut down a shipboard function. In the case of total power loss, the Colonials also installed sound-powered phones on the original battlestars as a last-ditch communications measure.
In the second Cylon War, the Cylons use a slightly different means of electronic infiltration, after their espionage determined that Colonial use of computer technology has become widespread once again, 40 years after the first war. However, instead of using viruses, backdoors are planted in the Command Navigation Program, the operating system used by the Colonial military, by a human-looking agent.
These exploits make it possible to remotely shut down all computers on Colonial warships and fighters, without a possibly lengthy period of time to bypass a computer's defenses.
Because Galactica continued its "no networks" historical tradition, the Cylons could not overcome the battlestar by electronic subversion, and are forced to directly attack the ship. While Galactica's last Viper Mark VII squadron (which used the CNP) is compromised and destroyed, Galactica has, by happenstance, a squadron of Viper Mark II fighters in its museum, which, as similar to or identical to the Cylon War-era Vipers, are impervious to CNP compromise. The Mark IIs give Galactica sufficient defenses until it is able to rearm itself at Ragnar Anchorage (TRS: Miniseries).
In the same relative time, the battlestar Pegasus avoids Cylon computer incursion because most of her critical computer systems were offline while being retrofitted for the CNP by Integral Systems Engineering contractors. The battlestar escapes the destruction of her dock via a blind jump. Later, Pegasus suffers some cyber-attacks after Gina Inviere alerts other Cylons of the battlestar's imminent attack on a communications array and causes system failures in several computer systems. Despite Inviere's sabotage, Pegasus survives to fight another day (TRS: "Pegasus", "Razor").
Some time later after leaving Colonial space, Galactica suffers a Cylon virus infection near the legendary planet of Kobol. The viral attack occurs after CIC is forced into doing what Commander William Adama (at the time, seriously wounded in an assassination attempt) would never normally allow: The temporary networking of several of the battlestar's computers. The temporary network is needed to greatly reduce the computation time needed to find the proper coordinates of the missing civilian Fleet, which jumped to a different set of coordinates (TRS: "Scattered").
Improvised software firewalls (software barriers that deny unauthorized intrusion) are put in place by Lieutenant Felix Gaeta in order to slow down the anticipated Cylon cracking attempts, but the protection loses its integrity at the very last moment. After the virus initially shuts down several systems (while, coincidentally, a squad of heavily-armored Cylon Centurions board Galactica), the battlestar uses software or other means to purge the virus (TRS: "Valley of Darkness").
The Logic Bomb
Initially, the crew thought it had eliminated the infection, but when, weeks later, as computer malfunctions and equipment failures begin to surface, Gaeta is ordered to run diagnostics and review the source code of programs aboard the ship. Commander Adama orders Karl Agathon to have Caprica-8 review a printout of the virus source code.
Upon reading, Valerii warns that the virus, believed removed weeks before, has returned as a "logic bomb". The virus replicated into other systems on the system, probing and learning control and weaknesses. The logic bomb sends a signal through the battlestar's communications system to alert other Cylons of the compromise, and awaited a Cylon force to activate the bomb.
Once activated, the logic bomb would take over complete control of the ship, probably venting the ship's atmosphere  to kill its crew, and then training the ship's batteries on the civilian ships to complete the Fleet's destruction.
Caprica-Valerii offers her services to eradicate the virus by connecting herself through her Cylon data port to the Colonial mainframe and communication systems through a fiber optic cable. The battlestar erases its hard drives to eradicate the logic bomb, but is left completely defenseless for a time, save Valerii's efforts.
Valerii isolates, ostensibly reprograms and transmits the virus to an oncoming Cylon fighter force, disabling it and permitting the small Viper defense to destroy the Cylon attack forces with impunity.