A "pump and dump" scheme can be considered a form of online securities fraud
The US Securities Exchange Commission (SEC) recommends several ways for the public to steer clear of pump and dump schemes.
They recommend considering the advertisement source. In other words, if the investment firm advertises online, there is a more of a chance that it is a scam. However, there are some legitimate companies that do advertise online, so it's important to conduct extensive research before making an investment. When researching, it is also important to verify that their claims are accurate.
It is also important to see where the companies trade their stocks. If they trade with a larger stock exchange (i.e. NASDAQ, the New York Stock Exchange, etc.), it is more likely that their company is legitimate versus a smaller company who trades within the OTC market. The SEC also recommends being wary of "high-pressure" sales pitches. These usually come in the form of advertisements claiming to have a "once in a lifetime" chance or other outrageous claims.