MISURATA, Libya — When the bloody siege of this isolated city began, the rebels who rose against Col. Muammar el-Qaddafi’s conventional army had almost no firearms. Many of them relied on hands, knives and stones.

Now they roam the streets as a paramilitary force built around hastily armored trucks that have been fitted with captured machine guns set on crude turrets and mounts.

The transformation, evident in an offensive late last month that chased many of Colonel Qaddafi’s forces from Misurata’s center to its outskirts, is in part the result of a hidden side of this lopsided ground war: a clandestine network of rebel workshops, where these makeshift weapons have been designed, assembled and pushed out.

The workshops are officially a rebel secret. But for three days journalists for The New York Times were granted access to two of them, on the condition that their exact locations not be disclosed and that no photographs be taken of their entrances.