When 2011 began, Osama bin Laden was still alive, U.S. troops were still fighting in Iraq, and Iran could only dream about capturing our most advanced spy drone. By the end of the year -- everything had flipped upside-down. America's shadow wars grew, as its conventional conflicts shrank. Secret tech was suddenly not so secret any more. Dictators in place for decades suddenly found themselves out of jobs, thanks in no small part to Facebook. Even the ordinarily sacrosanct Pentagon budget was suddenly under fire. It was, in retrospect, a decidedly crazy, thoroughly exhausting, and utterly exhilarating year. It's hard to imagine what more could be in store for 2012.

No wonder al-Qaida didn't come close to bombing the U.S. at home, unlike its efforts in 2009 and 2010. Instead, it lost two of its most important figures; a treasure trove of its data; and suffered the kind of setbacks that have Washington talking about capital-V Victory.

The Arab World Routes Around Its Dictators

When activists began to threaten Egyptian dictator Hosni Mubarak's 30-year rule, he cut off Egypt's internet, thinking he could sever the ties that bound the protest movement together. It didn’t work. The Tahrir Square network did what strong networks always do: it routed around the obstruction. In the process, it showed the world the new boundaries of dissent, and how social media pushes them outward -- but doesn't drive them.

For the sophisticated version of what social media did and didn't in the protests of 2011, check out our colleague Bill Wasik's WIRED magazine cover story. The short version is that Facebook, Twitter, and Blackberry Messenger groups were excellent tools for organizing surreptitiously before the protests really became a phenomenon; afterward, it became the chief medium for communicating granular, protests-eye viewpoints to the outside world -- and even remixing those messages. Tahrir Square became a DIY tech hub. But Mubarak found that trolling the square's de facto Facebook page couldn't stop the movement. That's where his traditional, low tech solutions -- arrests, even camel-borne cavalry assaults -- came in. But they weren't enough either.

Even after regime change in Libya, Tunisia, and Egypt, the Arab Spring doesn't look so promising now that Syrian dictator Bashar Assad is murdering his citizens. And the Obama team still overhypes social media's role in the uprisings: one of its most direct acts against Assad is to flame him on Facebook. But the Arab Spring demonstrated both the potential and the limitations for new media's role in social change, and that's why its revolutionaries are exporting those lessons to Occupy Wall Street.

Photo: Flickr/Monasosh

America's Advanced Warplanes Catch a Cold

The Air Force has bet big on its expanding fleet of robot planes and manned stealth jets. And not without reason: they maximize what’s arguably the U.S.' biggest wartime advantage: its ability to snoop and strike from the sky. But 2011 was the year the flaws in one of America's major strategic assets began to show.

In September, Air Force technicians discovered a computer virus in the drones' remote cockpits at Creech Air Force Base in Nevada. It wasn't supposed to happen: the cockpits aren't connected to the public internet, and the removable drives that allow malware to jump from network to network have been banned for years. Worse, the virus resisted the base's efforts to scrub the malware out of the drone cockpits. Even worse than that, officers at Creech waited a whole two weeks before telling anyone off-base -- leaving the digital hygiene specialists at the 24th Air Force to learn about the malware from, um, Danger Room. The Air Force claimed that none of this was a big deal; the malware was a common piece of code – like the kind that steals the credentials of folks playing Mafia Wars. Feel better?

Mexico's Cartels Attack Bloggers, IRL

Mexico's murderous drug cartels have never taken too kindly to outsiders exposing their excesses. In 2011, though, the drug lords took things to grisly new heights. Hanging from a pedestrian overpass near the Texas border in September were the bodies of "snitches." "This will happen to all the internet snitches," a note accompanying the corpses read.

Bloggers weren’t the only targets. By the end of the year, two-thirds of Mexico was considered unsafe. And while the cartels stockpiled and U.S. guns, America sent in the drones to help hunt the drug gangs. One U.S. presidential candidate even floated the idea of invading Mexico. It's hard to imagine that things with get any safer South of the Border in 2012. Especially not when bloggers calling the cartels on their excesses are being silenced.

But a combination of loose lips, technical glitches, and a network of amateur sleuths pushed each of these supposedly clandestine projects from the black world to the white. All of which made 2011 the year that secrets died.

The Pentagon and its pals tried to lock things down -- with decoy documents and software to spot malcontents. But not all those plans panned out. When the security firm HBGary tried to hatch a plot to kneecap WikiLeaks and its supporters, those supporters hacked HBGary - and published thousands and thousands of private documents the company that it was keeping to themselves. Score another round for the secret-spillers.

Photo: Reuters

The Shadow Wars Grow

This is what President Obama means when he says the "tide of war is receding." U.S. troop numbers are coming down in Afghanistan and they've zeroed out in Iraq. But all around the globe, America is escalating its Shadow Wars -- undeclared conflicts against al-Qaida, waged by spies, special operations forces and their robotic pals.

The Pentagon's Mad Scientists Go to War

We're used to the mad scientists at the Darpa preparing for the wars of 2030. But in 2011, the agency's top priorities focused on the wars of... 2011. "There is a time and a place for daydreaming. But it is not at Darpa," agency director Regina Dugan said. For an agency that spent millions of dollars on shape-shifting robots and mind-controlled limbs, that was something of a revolutionary statement.

One of Darpa's most important projects is one of its most secret. Known as Nexus 7, it seeks the hidden metrics of the Afghanistan war's progress. Like for instance: the price of fruit in Jalalabad, which stabilizes when violence is predictably high or low. That's arguably an intelligence program, though, which is decidedly not what Darpa is chartered to do. But agency director Regina Dugan pushed Nexus 7 as a way for Darpa to help the Afghanistan war -- even if many serving in Afghanistan ridicule the idea that they can learn anything new from the cost of a banana.

Nexus 7 grew out of Darpa's current obsession with crowdsourcing. And that obsession showed no signs of letting up in 2011. The agency turned to us great unwashed to come up with new spy drone designs. Dugan even showed off Darpa's crowdsourced armored car to President Obama.

Meanwhile, Darpa is looking to appeal to a very different crowd: the hackers who have traditionally shied away from government work. The agency introduced a crash program to approve cash for computer security research in a week. Dugan waxed poetic in a "cyber colloquium" meant to appeal to the hacker-minded. Darpa is getting more than a half-billion dollars to fight what many believe to be the Pentagon's most pressing security issue of today: its porous network defenses; somebody with clue out to get that cash.

It remains to be seen when Darpa's efforts will bear, er, fruit. But Dugan's ended the days of her researchers focusing solely on the long-term. Still, there's at least one moment from 2011 Dugan wants to leave in the past: she's owed money by one of Darpa's contractors -- which just so happens to be her family company.

Photo: U.S. Air Force

FBI Trainers Compare Islam to the Death Star

Last year, anti-Islam zealots protested in Lower Manhattan against the "Ground Zero Mosque," warning that Muslims were trying to conquer America. Not many actual counterterrorism scholars took them seriously; those who did warned they would harm counterterrorism. Problem was: they had a foothold into the FBI, the Justice Department and the military.

It wasn't just the two of them, nor was the problem limited to the FBI. Gawthrop lectured before military intelligence audiences and taught veterans at an online college. Similar messages turned up at the U.S. Army's brain trust at Fort Leavenworth and in a U.S. Attorney's office in Pennsylvania.

Image: Slide from a presentation by Justice Department intelligence analyst John Marsh

The Military Freaks Out Over Budget Cuts

Officers don't rise high in the military by losing their cool. But it turns out there's an easy way to make a four-star flip his lid: just tell him that his budget is getting cut. "We won’t be able to meet the global force management plan," warned the Navy chief, Adm. Jonathan Greenert. The second in command of the Air Force worries that the military can't afford its new plan for joint aerial-naval war. And all these nightmares come true if the U.S. military... goes back to its 2007 budget.

All that seems like gasoline near a fire that most Americans think is extinguished. And if that isn't enough, Iran has agents in Iraq who'd love to introduce flame to fuel -- and get Iraqis outraged over U.S. hired guns all over again.