RMEILAN, Syria — After boiling crude oil from the ground near here all day in a metal tank to refine it into diesel, Ali Mohammed braved the fumes to bang the tank’s drain open with a shovel. He stepped back as the dregs oozed into the dirt and burst into flames.

As a column of putrid smoke rose into the sky, he pulled a cigarette from his oil-soaked shirt and explained how the Syrian civil war had turned him into a diesel bootlegger.

He had once worn clean scrubs as a nurse in a state-run hospital, but was fired after rebels took over his village, making all residents suspect, he said. Later, stretched by the war, the government had left the area, leaving its oil up for grabs.

“Before, we saw the wells but we never saw the oil,” Mr. Mohammed said. Now, although its fumes made them sick, the oil helped hundreds of families like his scrape by.