LOS ANGELES — Sandra Bullock and Ellen DeGeneres have spent the last two years in a behind-the-scenes battle with obscure internet companies that peddle beauty products with fabricated endorsements. As soon as one site is taken down, another pops up in its place.

Tired of playing Whac-a-Mole, the stars went public with their fight on Wednesday, filing a lawsuit in Los Angeles Superior Court. They are suing over false advertising and the unauthorized use of their names and likenesses to endorse products — a “right of publicity” claim. Because Ms. DeGeneres and Ms. Bullock do not know for sure who is behind the fraud, the defendants are identified as John Does Nos. 1 through 100.

“These companies change names frequently, merge in and out of entities formed in states that allow for secrecy, operate websites that pop up and disappear overnight, and generally do everything possible to ‘stay one step ahead of the sheriff,’” the complaint said. Michael J. Kump, who is Ms. Bullock’s lawyer, and Michael E. Weinsten, who is representing Ms. DeGeneres, can now issue subpoenas to uncover the players.

The lawsuit shines a light on so-called celebrity endorsement theft, which has become a problem for Hollywood in the digital age. It relies on exploiting loopholes in a fast-growing area of advertising known as affiliate marketing.