For over eight years now, KDF troops have pitched tent in various parts of Somalia along with section of other AMISOM soldiers with an aim of defeating Al-Shabaab militants.

Do you have a lead on a newsworthy story? Share news tips with us here at Hivisasa!

Despite the slow progress, the troops have managed to liberate a few towns among them Kismayo and Mogadishu, which were previously dangerous zones.

And in the process, KDF has suffered fatalities including 2016 raid at El-Adde, which left at least 200 soldiers dead. With the troops still keen to stay in Somalia, Al-Shabaab is said still to be regrouping for future battles.

In the past weeks, they have waged a series of attacks within Mogadishu, killing scores. But the team operates under instructions from a deadly spies network called Amniyat, which gathers intelligence before making any decisions.

"The Amniyat is the veins of the organisation. It is all-powerful. If the Amniyat was destroyed, there would be no al-Shabaab," says Hussein Sheikh Ali, a former security adviser to the Somali president and director of the Hiraal Institute, a Mogadishu-based think tank, as quoted by the Nation.

The secret network, it has been established, operates in areas controlled by AMISOM and government. It's members are also well paid. They handle the health matters of fighters and finances.

"It literally controls al-Shabaab. As well as its core purpose which is intelligence gathering, it deals with sensitive areas of security. If a senior member of al-Shabaab is sick or injured, the Amniyat will deal with it. It manages finances of a secret and delicate nature, and plans the big terror attacks inside and outside the country."

Mohamed Mubarak, a researcher based in Mogadishu, estimates that the number of people in the Amniyat ranges from between 500 and 1,000.

"They are designed to live in enemy territory. They spend most of their time in government territory," he says.

According to Mr Mubarak, women play a crucial role in helping members of the Amniyat.

"Women support the Amniyat. They are part of its infrastructure. Al-Shabaab wives have to help them by providing a bed for the night, feeding them, transporting things for them and passing on messages."

The Amniyat is highly secretive. Its members hide their identities from each other. Mr Mubarak explains how Amniyat cells do not know the details of other cells. Members cover their faces when they meet amongst themselves, even within the same cell.

"Only their leaders know their faces," he says.

The network, due to the fact that it works from within areas that have been liberated, enables the militants to chose their target wisely. They also keep tracking the enemies before making decisions on Al-Shabaab's next operations.

Last week, Al-Shabaab targeted Presidential Palace in Mogadishu but the explosives only managed to hit at a number of security officers. Major General Fatuma Ali, a formidable female soldier, perished in the explosions.