Three makeshift “crack pipe” vending machines have cropped up in Long Island on Monday, and authorities are investigating to find out how they got there.

The machines, which are selling crack pipes for $2 in quarters, have been discovered in the towns of Coram and Medford near shopping centers and apartment complexes, News 12 Long Island reported.

Residents discovered one of the vending machines cemented in front of an apartment complex in Medford on Monday, but authorities removed the machine.

A second machine with the label “SPENS” had been cemented into a grassy area in front of a Home Depot store in Coram and appeared to be working as of Monday.

Another resident discovered a third machine with the label “Sketch Pens” on August 31 in front of the Coram Commons shopping center and posted a picture of it on Facebook. Town officials removed the machine on Sunday after receiving complaints from neighbors.

Brookhaven Town Councilman Michael Loguercio Jr. called the dispensers “illegal” because they lack proper permits, and are actively looking into who could be behind the mysterious contraptions.

“The dispenser alone is illegal. Like any other structure, if someone were to construct anything on the right of way they’d have to get permits, they’d have to get a site plan. So that in itself is illegal, then obviously what it’s selling is not anything that I want in this community whatsoever,” Loguercio Jr. said.

Suffolk County Police, however, told NBC New York that the act of selling the items might not be a crime. The “crack pipes” sold through the machine are actually real pens that can be used to write, even if the tubes of the pen could be used as crack pipes, police said.

Officials say they are looking for the person responsible for installing the machines.