Baseball officials uncovered the scheme as Cabrera prepared his case to challenge the test. Cabrera's grievance then was dropped, and Major League Baseball announced a 50-game suspension Wednesday.
The New York Daily News first reported on the scheme Sunday.
A team of six-to-seven investigators from MLB spent several weeks working to uncover the plan, a baseball official familiar with the probe told The Associated Press. The person spoke on condition of anonymity because MLB didn't authorize anyone to discuss the matter publicly.
It's the first such case MLB has had and officials hope that uncovering the scheme will discourage similar attempts.
The person said baseball had referred the case to federal investigators.
A second baseball official, also speaking on condition of anonymity, said additional discipline against Cabrera was unlikely.
Cabrera, MVP of the All-Star game last month, tested positive for testosterone, MLB said.
The person said Juan Nunez, who works with Cabrera's agents, purchased an existing website and attempted to alter it in a manner that would allow Cabrera to claim the positive test was caused by a substance obtained through the website. The News reported Nunez paid $10,000 for the website.
"If you create a new website, you would know when the website was created," the baseball official said. "At least they were smart enough to buy an existing website."
The baseball official said MLB investigators were able to use their forensic resources to trace the website back to Nunez.
Cabrera is represented by brothers Sam and Seth Levinson of ACES, a sports management company based in Brooklyn. The Levinsons, who did not respond to messages Sunday, told the Daily News that Nunez was a "paid consultant" of their agency.
"The MLBPA has clearly stated that ACES has no connection to the website or this matter and, as reported, Juan Nunez has taken full responsibility for his acts," Seth Levinson told The Associated Press. "There is nothing more we can add and we will allow our reputation in the industry for 27 years to speak for itself."
The second baseball official said MLB intends to ask the Major League Baseball Players Association, which regulates agents, to follow up on the situation at ACES.
Cabrera was enjoying the best season of his big league career, helping the Giants contend for a postseason berth. He was hitting .346 with 11 homers and 60 RBIs, but will miss the rest of the regular season and the start of the playoffs, if the Giants advance that far.
A former member of the New York Yankees, Atlanta Braves and Kansas City Royals, Cabrera is eligible for free agency after the World Series.
San Francisco manager Bruce Bochy declined to discuss the allegations against Cabrera before the Giants played the Padres in San Diego. He didn't defend his player's actions, either.
"You can be world-class parents and your kids can go south or have some issues. We can't follow guys 24/7, and it comes down to choices. (Cabrera) is a grown man, he's a veteran," Bochy said. "These are unfortunate things and we'll continue to work at cleaning out baseball."