Bump-fire stocks remain legal, but it is getting increasingly harder to find one to buy. Scores of online retailers have sold out of the devices, which enable a semiautomatic weapon to mimic the functionality of a machine gun.

Police found at least a dozen rifles equipped with bump-fire stocks in the hotel room from which a gunman killed 58 people in Las Vegas on Sunday night. In the wake of the shooting, Senator Dianne Feinstein of California introduced a bill that would ban the devices.

Bump-fire stocks are typically widely available for purchase on the Internet. WalMart and Cabela’s, two of the nation’s largest gun sellers, appear to have halted online sales of the devices early Wednesday. For retailers that have continued to sell them, business is booming. The webpages of several online retailers state that the devices are sold out.

“Due to extreme high demands, we are currently out of stock. Please check back with us shortly,” reads a notice on the website of Slide Fire Solutions, the manufacturer of a popular bump-fire device.

It is common for gun sales to surge after mass shootings — especially when there is a threat of new gun regulations. After a gunman massacred 20 schoolchildren and six adults at an elementary school in Newtown, Connecticut, in December 2012, lawmakers began an unsuccessful push to pass a national ban on assault weapons. The following week, the Federal Bureau of Investigation processed nearly 1,000,000 gun background checks — a proxy for firearms sales — more than in any seven-day period on record.