Kidnapping generated $25m for Islamic State last year, according to one US intelligence estimate. It's also a powerful propaganda tool. The business relies on spies, informers, kidnappers, jailers and negotiators who arrange the deals when a captive is released. Syrian journalist Omar Al-Maqdud went to meet some of those who have been involved.

Two years ago the American journalist Steven Sotloff came to visit me at my home in the US and told me he was planning a trip to Syria.

I tried to persuade him to change his mind but he wouldn't listen. Three days later, he emailed me from near Aleppo asking for help with contacts. Not long after that, he was kidnapped.

"There were three cars. I saw them from the distance - about 500m," said Yusuf Abubaker, Sotloff's fixer, who was travelling with him.

Image copyright EPA Image caption Steven Sotloff, pictured in 2010

"As soon as [the occupants] saw us they left the cars and blocked our path… I wanted to take out my weapon and aim but there were about 10 to 15 people in front of us with weapons. They were holding Kalashnikovs."

Sotloff and Abubaker were separated. "I tried to shout for him but they kept telling me to shut up," said Abubaker, who was freed after 15 days because of his links with a powerful brigade in the anti-government Free Syrian Army (FSA).

But then a year ago, in September 2014, IS released a video of Sotloff being beheaded. It followed hot on the heels of the murder of another American journalist, James Foley, in similar circumstances.

In all, 181 journalists, citizen journalists and bloggers have been killed in Syria since 2011, according to the campaign group Reporters Without Borders. At least 29, including nine foreigners, are still either missing or being held hostage by IS or other armed extremist groups.

Image copyright AP Image caption James Foley, pictured in 2011

In the Turkish border town of Antakya, I met a Syrian man, a former IS agent who asked to be called Abu Huraira. He told me he used to track down media workers covering the conflict and would help to arrange for them to be kidnapped.

He would pretend to be a Syrian refugee and get fixers to introduce him to journalists. After a few meetings he would suggest a place to film near the border. "There are kids we're going to film and I'm going to introduce you to a few people who might help you in your work," he would promise.

He used to give kidnappers details of their plans. "I would have organised everything with them. I only needed to deliver that person… someone else will take care of him and I will have nothing more to do with this. Or he might kidnap me too and then release me after a while."

At the beginning of the conflict, Abu Huraira had been a member of the FSA. He then spent some time with a local group affiliated to al-Qaeda before moving on to work for IS. He agreed to meet me only because he had decided to leave IS for good.

Image copyright Getty Images Image caption The border between Syria and Turkey, where Abu Huraira used to take journalists

The turning point came when he was asked to set up one of his friends.

"I couldn't lose my friend or face being responsible for it. I told him, 'You must leave this area, you must leave this country, because they have targeted you. They want you and there's no excuses with these people.'" I later contacted the friend in question who confirmed this was true.

Abu Huraira showed me pictures of hostages, messages, and recordings of conversations he'd had online with IS leaders in Raqqa province, illustrating how well planned kidnappings are.

He said there were plenty of people like him willing to feed information to kidnappers, for ideological reasons or for money.

I had also been to Antakya a year earlier and Abu Huraira told me he had been watching me on that visit. He almost sold me out for a couple of thousand dollars - he knew where I had been staying, who I was travelling with and details of a trip my companions and I had planned across the border. He said he had passed all this information to his IS colleagues who made plans to pick us up. Fortunately, we had cancelled the trip at the last minute.

IS has an entire department dedicated to carrying out kidnappings called the "Intelligence Apparatus", according to Abu Huraira. It targets foreign journalists the minute they set foot in cities near Syria's border. One US intelligence report estimated that in 2014, IS made $25m from ransom payments.

Sometimes though, IS kidnaps people not for money, but to punish them.

Image caption Milad Al-Shihaby now lives in Turkey

In January last year, masked men broke into the office of Syrian journalist Milad Al Shihaby in Aleppo, apparently in revenge for his reporting on IS atrocities. "They stole all the electronic equipment in the office - cameras, laptops - and they put me in a car boot and they took me to their base in the children's hospital," he told me.

He was held alone in a cell for 13 days in a former hospital in Aleppo. About 200 other Syrians were also imprisoned there.

"I was blindfolded for 10 days. I would pray blindfolded, I would eat blindfolded. After those 10 days, for three days I was blindfolded and handcuffed. Even while I was praying, I was handcuffed."

He was then moved to a larger room with other prisoners, where his blindfold and handcuffs were removed. Some of his jailers had Iraqi accents, he said, and he could hear them torturing other captives.

"They would hang [a man] from his hands and let his legs hang down, and he would be hanging for two to three hours… sometimes they would have so many prisoners that they wouldn't have enough rope so they would hang them using the handcuffs."

Image caption Milad Al-Shihaby with the hooks where prisoners were hung

Image caption The prison where Mila Al-Shihaby was held

Al Shihaby said some of his cellmates were executed because they didn't convert to Islam.

But when FSA fighters overcame IS positions around the detention centre, the militants fled. Al Shihaby and the other prisoners escaped. He had been held captive for 16 days.

Forty-eight hours after he took me back to the deserted prison, we heard that IS had returned to the area.

Al Shihaby is not the only person to get away - some foreign journalists have also been released.

In June 2013, French journalists Edouard Elias and Didier Francois were kidnapped from a car in Syria. Their driver would only speak to me anonymously, using the name Al'aa.

"There was a moment when our eyes met," he told me in January last year, describing the kidnapping. "The way he [Francois] looked at me had a very strong impact on me. I'm still affected by it to this day, as if his eyes were saying: 'Are you just going to leave us?'"

Al'aa said the kidnappers told him to "drive off and don't look back". He sought help from the FSA but the man who dealt with him was suspicious. "I said to him, 'If I was working with them, I wouldn't have come directly to you… do something before we lose more time.' They put me in a prison cell."

The French journalists were released after 10 months.

I later heard that Al'aa was driving Japanese journalists when they were kidnapped in two separate incidents. When I tried to contact Al'aa again to ask him what had happened, his phone was no longer in service. He seems to have disappeared.

Austin Tice

Image copyright AFP

The first registered kidnappings of foreign journalists in Syria happened in 2012. One of them involved Austin Tice from Texas, who was abducted near the Syrian capital, Damascus, in August 2012, a few days after his 31st birthday.

According to a website set up by his family, "Five weeks later, a 43-second video emerged unlike any other to emerge from a hostage case in Syria. It showed Austin being held by a group of unidentified armed men. No message accompanied the video, only the title, 'Austin Tice is Alive'. "

It's not known where he is and no group has taken responsibility for his disappearance.

So why are some hostages released? France said no ransom was paid for Elias and Francois but there are cases where payments have been made.

In my search for the middlemen who carry out negotiations, I was told about a businessman who split his time between Paris and Istanbul, where he owns a bakery.

When I finally met him, it turned out to be someone I had known from the start of the revolution, Moutez Shaklab.

He said he had acted as a go-between for kidnappers and victims' families, using a network of contacts across Syria to track people down.

"You call the kidnappers, you ask them if they have this person. They say, 'Yes.'

"You ask them for proof, they say, 'What proof do you want?' I'm told to ask, for example, 'What's the name of his deceased older brother? And the date and location of his death?' So we asked the question, and received the answers, which confirms that the guy is alive."

Shaklab said he helped negotiate the release of Belgian writer Pierre Piccinin da Prata and Italian journalist Domenico Quirico.

Image caption Moutez Shaklab

"Their families' representative paid $4m which I witnessed," he said. The money was loaded into a van and taken to a building where the kidnappers counted it and packed it into suitcases.

In this case the abductors were former FSA rebels who have since joined Islamist factions. But Shaklab's two attempts to negotiate with IS were less successful.

While he was searching for one kidnap victim he met a Saudi member of IS. The encounter lasted about 30 minutes. The man was aggressive and threatening, accusing Shaklab of being a blasphemer. The level of hostility shocked Shaklab and he left, scared.

In cases like this, IS kidnaps people not for money, but for propaganda, to demonstrate its power.

And what shocked me most, was not just the videos of journalists being murdered, but how ordinary Syrians have been corrupted and sucked into this shady world - how friends have been turned into spies.

Omar Al-Maqdud's TV documentary The Islamic State Kidnap Machine was made for BBC Arabic.

Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.