Stanley Jobson (Hugh Jackman) is a cyber-hacker who became notorious for infecting the FBI's Carnivore program with a computer virus. Stanley's parole forbids him from accessing the internet and computers while his ex-wife Melissa, an alcoholic and part-time porn star, has issued a restraining order against him. This also prevents him from seeing his only daughter Holly.
Ginger Knowles (Halle Berry) persuades Stanley to work for Gabriel Shear (John Travolta), who threatens him into cracking a secure Defense Department server. After the hack, Gabriel offers Stanley $10 million to program a multi-headed worm, a "hydra", to siphon $9.5 billion from government slush funds. Stanley begins work on the worm, learning that Gabriel leads Black Cell, a secret organization created by J. Edgar Hoover to launch retaliatory attacks against terrorists that threaten the United States. He also privately discovers Ginger is a DEA agent working undercover and is further surprised to discover a corpse that resembles Gabriel.
After he goes to see Holly home from school, Stanley discovers that he is being followed by FBI agent J.T. Roberts (Don Cheadle), who had previously arrested him. Roberts, though monitoring Stanley closely, is more interested in Gabriel as he does not appear on any government database, and after learning that another hacker, Axl Torvalds (Rudolf Martin), had been killed by Gabriel's men, warns Stanley to be cautious. Stanley opts to secretly code a backdoor in his hydra that reverses the money transfer after a short period. Meanwhile, U.S. Senator Jim Reisman (Sam Shepard), who oversees Black Cell, learns the FBI has started tracking Gabriel and orders him to stand down. Gabriel refuses and narrowly defeats a hit team dispatched against him by Reisman. In retaliation, Gabriel personally kills Reisman in revenge and continues his plan.
Stanley delivers the hydra to Gabriel and leaves to see Holly, only to find that Gabriel has kidnapped her and framed him for Melissa's murder alongside her husband and porn producer. Stanley has no choice but to participate in a bank heist to get Holly back. At the site of the heist, Gabriel and his men storm a branch and secure its employees and customers as hostages, fitting each of them with ball-bearing-based explosives similar to Claymore mines. When police and FBI surround the branch, Gabriel takes Stanley to a nearby coffee shop across the street to meet with Roberts, but Gabriel spends the time discussing the film Dog Day Afternoon and the nature of misdirection. Once back in the bank, Gabriel has one of his men escort a hostage to demonstrate the situation where a sharpshooter kills the man. As other agents pull the hostage away from the bank, the bomb detonates and devastates much of the street, a scene shown in medias res.
Gabriel instructs Stanley to launch the hydra and turns Holly over to him once completed. However, the back door triggers before they can leave the bank, leading to Stanley being recaptured while Holly is rescued. Gabriel threatens to kill Ginger, who he knows is a DEA agent, unless Stanley re-siphons the money back to a Monte Carlo bank. Although Stanley complies, Gabriel shoots Ginger. Gabriel and his men load the hostages onto a bus and demand a plane wait for them at the local airport, but while en route, the bus is lifted off by a S-64 Aircrane and deposited on the roof of a local skyscraper. Gabriel deactivates the bombs and departs with his surviving men on a waiting helicopter, which Stanley shoots down using a rocket-propelled grenade from the bus.
Roberts takes Stanley to verify a corpse they found, believing Gabriel was a Mossad agent. There is no record of a DEA agent named Ginger Knowles, and her body hasn't been found. Stanley recognizes the corpse as the one he discovered earlier and personally realizes that the whole scenario was a deception; Ginger was wearing a bulletproof vest and was working with Gabriel all along, who escaped via a different route. Despite Stanley not telling the police that Gabriel and Ginger are still alive, Roberts arranges for Stanley to have full custody of Holly, where they depart to places elsewhere. In Monte Carlo, Gabriel and Ginger withdraw the stolen money and later watch as a yacht at sea explodes. Over the film's credits, a news report reveals the destruction of the yacht, carrying a known terrorist, as the third such incident in as many weeks.
Hugh Jackman as Stanley Jobson
John Travolta as Gabriel Shear
Halle Berry as Ginger Knowles
Don Cheadle as Agent J.T. Roberts
Sam Shepard as Senator James Reisman
Vinnie Jones as Marco
Drea de Matteo as Melissa
Rudolf Martin as Axl Torvalds
Zach Grenier as Assistant Director Bill Joy
Camryn Grimes as Holly Jobson
Angelo Pagan as Torres
Kirk B. R. Woller as Axl's Lawyer
Carmen Argenziano as Agent
Tim DeKay as Agent
Laura Lane as Helga