In their new book, “Mission 27,” Mark Feinsand and Bryan Hoch take readers inside the legendary Bronx Bomber team that won the franchise’s 27th world title in 2009. But to prevail in the World Series, the Yankees had to make it through the Phillies, and, as this exclusive excerpt details, that team’s rabid fan base.

With the Fall Classic tied 1-1, the venue shifted from The Bronx to Citizens Bank Park. The Yankees opted to travel by rail.

“I remember getting off the platform and there being hundreds, maybe thousands, of Phillies fans yelling at us,” Mark Teixeira said. “Alex said it was like when Rocky went into Russia. That’s exactly what it was. Drago was like the entire Philadelphia Phillies team. Howard and Utley and Rollins and Cole Hamels and Pedro and Cliff Lee — they had some players. So we knew we had our work cut out for us playing Philly.”

The team had reported to Yankee Stadium that morning, boarding buses to Penn Station, where awed commuters halted their morning rush to gawk at Derek Jeter’s star-studded team walking the corridors in their suits and ties. With private cars and catered meals, the chartered Amtrak experience was largely enjoyable until the train squealed into Philadelphia’s 30th Street Station.

As Joe Girardi and traveling secretary Ben Tuliebitz disembarked, they were greeted by a pair of Philadelphia transit police officers.

“I’m within earshot; I can hear the conversation,” said then-assistant general manager Billy Eppler. “There’s a couple of police officers there, and they said, ‘There’s some people up there on the platform waiting for you.’ Then he goes, ‘I have a feeling it’s going to be loud up there, guys.’

“So we get on this moving escalator, and it comes up, comes up, comes up. I think as soon as the people in the terminal area of the train station saw the police officers and Benny, it just rained down. Boos rained down, and they were the loudest I had ever heard. I thought it was pretty cool, so I grabbed my BlackBerry — I was still using a BlackBerry then — and I’m hitting record. I wanted that on video.”

Each of the seven dirty words that George Carlin once identified as being unsuitable for public broadcast rained upon the traveling party, many of whom had brought their significant others along.

“When we got off that train, man, that was the worst,” CC Sabathia said. “I was not ready for that. I was half groggy because I had been sleeping, and that was unreal — those people unleashing on us. It felt like the cops were holding people back and s–t. That was an ill f–king morning. Those people were ruthless.”

“There were 10- or 11-year-old kids flipping us off,” Joba Chamberlain said.

“I’m like, ‘Shouldn’t you guys be in school?’ ”

As the World Series resumed on Halloween night, one member of the Yankees’ hierarchy was doling out more tricks than treats. In the visiting clubhouse, Brian Cashman startled players by wearing a mask from the 1996 slasher film “Scream,” which he insists disappeared into Nick Swisher’s possession.

Hours before the first pitch of Game 3, Cashman produced another fun item from his luggage — a battery-powered fart machine, which the general manager stashed in the players’ lounge. “I was keeping myself loose, more than anything else,” Cashman said. “That’s how I’m wired.

“If I have too much time on my hands, I tend to stray. I remember being in the visiting clubhouse in Philadelphia, and the dining room had some windows. I could be in another room with a remote control, so I had the fart machine underneath the table where players were sitting around. I kept hitting it, and they’re all looking around like, ‘Dude!’ They’re confused who had the problem, and I’m in the other room giggling.”

The gag device also made an appearance in Joe Girardi’s office. It was a gift from assistant general manager Jean Afterman, who said that she still keeps an extra in her desk drawer at the Stadium because Cashman wears them out so quickly.

“I would like to point out that I was the person that gave him his very first fart machine,” Afterman said. “He may have had some worthless cheap version of a burp or a fart machine, but this is what Amazon was created for. I went online and searched for the most reliable fart machine. As a matter of fact, in the first few years of the fart machine, it used to be a gift Brian would give to visiting GMs. It’s like omiyage in Japan. The fart machine was a key element in our clubhouse during the postseason in 2009. I think, because the job is so high-pressured, because he spent so many years having to deal with George [Steinbrenner], the outlet is to be a prankster. It keeps it loose around here because the job is brutal, and the hours are brutal. I think it’s refreshing when people expect one thing and get another. They ­expect somebody who’s going to be hyper-intense and they get somebody with a fart machine.”

Sabathia had been in that Philadelphia visiting clubhouse with the Milwaukee Brewers a year earlier, when he was charged with the loss in Game 2 of the National League Division Series. As he prepared for his return to the hill, Sabathia’s thoughts drifted from how to handle Chase Utley and Ryan Howard to . . . cheesesteaks.

Alarmed by a memory of Prince Fielder gorging on sliced rib-eye, Sabathia sought out Lou Cucuzza Jr., the Yankees’ longtime visiting-clubhouse manager.

“Lou Cucuzza gets credit for this because in Philly, they had those cheesesteaks when I played in Milwaukee,” Sabathia said. “I told them, ‘Man, we had so many ­cheesesteaks before the game it f–ked us up.’ Like, Prince ate like five one day before the game. Lou was like, ‘No cheesesteaks before the game!’ during the World Series. He made it a rule so we couldn’t have it before the games — only after.”

The Phillies came out swinging after a rain delay in Game 3, scoring three second-inning runs off Andy Pettitte. The towel-waving crowd had been rowdy even before Hamels’ first pitch, and the early advantage whipped them into a frenzy, to the chagrin of the visiting executives seated behind home plate.

Afterman, Cashman, and Eppler had agreed not to wear their Yankees gear for Game 3, having been advised that it would be wiser to go incognito. If that recommendation had reached Gene Michael, the former sure-handed shortstop whose front-office acumen is credited with building the late 1990s dynasty, “Stick” disregarded it.

“We’re all in our seats, and Stick comes walking in, head-to-toe Yankee,” Afterman said. “He’s got his 1996 leather World Series jacket. He’s got a Yankee cap on. He’s wearing a World Series ring. He has that shock of white hair. As the game starts, there’s a guy in back of us who is nonstop talking the most egregious, vile s–t. I couldn’t tell when he was taking his breaths. At one point, Stick turns around and looks him straight in the eye and says, ‘You’ve got a bad mouth.’ That was good ol’ Stick. We just kind of raised our eyes and sort of murmured, ‘Great, Stick, thanks.’ We didn’t hear a word after that. That shut him up completely.”

No stranger to that brand of fan reception, Alex Rodriguez made history in the fourth inning, blasting a Hamels offering toward the right-field corner. Initially ruled a double, the umpires determined that Rodriguez’s drive had clanked off of a TV camera positioned above the 330-foot marker on the wall, making it the first instant replay call in World Series history.

“I couldn’t believe that ball went out,” Rodriguez said.

The hometown fans were not pleased.

“I remember standing out in that outfield and getting pelted with batteries and quarters,” Swisher said. “Anything people could throw at me, man, they were throwing.”

The Yankees won two and lost one in Philly. Some team employees eschewed the bus back to The Bronx, opting to gamble in Atlantic City — confident that No. 27 would be wrapped up at home.

And it was, with the Bombers winning 7-3 at Yankee Stadium. The largest Yankee was carrying the largest bottle. Jay-Z had gifted a comically oversized Magnum of his exorbitantly expensive Ace of Spades bubbly to the team, and Sabathia hoisted the 15-liter container between rooms, pouring glasses for teammates and coaches.

“That big giant bottle of champagne that only CC could carry,” first-base coach Mick Kelleher said, “he was the only one strong enough. It was so funny.”

Months later, Girardi presented the president with a pinstriped No. 27 jersey that had been autographed by the title-winning roster. The manager asked Obama to hoist the trophy for a photo opportunity. Standing a few feet away, Afterman made a quip that she would instantly regret: “Let him hold it. He may not get a chance again.”

“And you wonder why the other teams don’t root for you,” Obama replied with a smile.

“I meant to be teasing him about his references to the White Sox,” Afterman said. “And then [White Sox executive vice president] Kenny Williams, who’s a great friend of President Obama, texted me and said, ‘Look at you, talking smack with the president.’ So that was my White House experience. I’m sure any dream I had of working for Obama vanished after that.”

Nice ring to it

Can the Yankees win their 28th World Series title this year? Pitcher CC Sabathia, one of the few players still on the team 10 years later, certainly thinks so. He tells authors Mark Feinsand and Bryan Hoch in “Mission 27” that he hasn’t opened the box of his 2009 championship ring.

“I still have never tried it on,” Sabathia said. “It’s in my closet. People know you won a World Series. What the f–k do you need a ring for? For me, I feel like if you wear the ring, you’re living in the past. I don’t know, maybe when I’m done playing and I’m not trying to chase another one, maybe I’ll have a different perspective.”

This excerpt of “Mission 27: A New Boss, a New Ballpark, and One Last Ring for the Yankees’ Core Four,” by Mark Feinsand and Bryan Hoch, is presented with permission from Triumph Books. For more information or to order a copy, please visit ­triumphbooks.com/mission27.