From what I've heard in reporting, they build rockets from parts of unexploded Israeli bombs. Over the last 4 months, I have no doubt they've found a few duds and accumulated the material with which to hack these things together.
What is clear now is that the very weapons that Israeli forces have used to enforce a blockade of Gaza over the past 17 years are now being used against them. Israeli and American military explosives have enabled Hamas to shower Israel with rockets and, for the first time, penetrate Israeli towns from Gaza.
“Unexploded ordnance is a main source of explosives for Hamas,” said Michael Cardash, the former deputy head of the Israeli National Police Bomb Disposal Division and an Israeli police consultant. “They are cutting open bombs from Israel, artillery bombs from Israel, and a lot of them are being used, of course, and repurposed for their explosives and rockets.”
The Iranian narrative is that they kick-started all the missile production in Gaza and gave them the technical and knowledge base, but now the Palestinians are self-sufficient, said Fabian Hinz, an independent security analyst focusing on missiles in the Mideast.