Day 4 Edit
When Richard Heller revealed that he went home with Mandy and Gary the week before the terrorist attacks, he explained that Mandy must have used his cell phone when he wasn't paying attention. CTU contacted cab companies and was able to track down the cab driver who drove Mandy and Gary back to The Mercerwood after leaving Richard's apartment.
Jack Bauer and a SWAT team, including Tony Almeida and Lee Castle, arrived at the complex to apprehend Mandy and Gary. Mandy realized that CTU had found them, so she killed Gary and took Tony hostage.
After Tony had been retrieved by the CTU team, Mandy cut a deal with the President clearing her of all crimes, including the attempted assassination of David Palmer several years before. She gave Habib Marwan's location up, which ultimately led to the missile being stopped before it hit Los Angeles.