Nigeria's Boko Haram swore allegiance recently to the Islamic State of Iraq and the Levant (ISIL) in an audio message with French and English subtitles.

What most failed to notice was a few weeks earlier an "emissary" of ISIL sent a public invitation to the emir of al-Shabab in Somalia, Abu Ubaidah, urging him to do the same.

The emissary was Hamil al-Bushra, the nom de guerre used by two media outlets that have been described by Washington Institute for Near East Policy fellow Aaron Zelin as "official semi-official accounts" from ISIL.

In the message Bushra praised the "brothers in Somalia" and encouraged them to attack "inside Kenya, Tanzania, Ethiopia". He told Abu Ubaidah all that is needed to pledge loyalty to ISIL is for the al-Shabab media wing, al-Kataib, to issue an audio message.

Abu Ubaidah already pledged loyalty to al-Qaeda, reaffirming a long-standing allegiance with that group. The public invitation from ISIL through its semi-official channels may be designed to provoke a disruption within al-Shabab at a time when it has lost territory in Somalia because of a military offensive by African Union troops.

Targeting Kenya and beyond

Meanwhile, al-Shabab is turning its attention to Kenya and other African countries in a transformation reflected in slick recruitment videos and magazines produced by al-Kataib, which play upon the marginalisation of Muslims and show details of high-profile attacks in Kenya.

Christopher Anzalone, from the Institute of Islamic Studies at McGill University, said this is evident in al-Shabab's recruitment tactics.

"If they release a video with foreign fighters in it there's a likelihood that most, if not all, will be Swahili speakers or outright identified as being from Kenya," Anzalone told Al Jazeera.

Al-Shabab works with hard-line imams and underground groups such as al-Hijra, which help with recruitment in East Africa.

The emir of al-Hijra, Sheikh Ahmad Iman Ali, for instance left Nairobi to fight in Somalia in 2009, where he was placed in charge of "Kenyan affairs" a few months after Kenyan troops began operations inside Somalia against al-Shabab.

However, al-Hijra's roots go back to the Islamic Party of Kenya in the 1990s, said Matt Bryden, chairman of Sahan Research, "when Sheikh Rogo and Sheikh Makaburi - who became the ideological leaders of al-Hijra - were themselves moving in al-Qaeda circles".

Both Rogo and Makaburi were killed in what were alleged to be extrajudicial killings by the Kenyan Anti-Terror Police Unit (APTU) that swept the coastal areas, according to an Open Society Justice Initiative report, which also accused the APTU of arbitrary detentions, torture and "disappearances".

Anzalone told Al Jazeera al-Shabab now use the deaths as a recruitment tool in their videos.

"They have recognised and taken advantage of growing discontentment about the way the Kenyan government handles terrorism or security threats," he said.

Just a taxi-ride away

Many of the recent attacks in Kenya were carried out by East African al-Shabab fighters who returned to Kenya after training in Somalia.

Now they are a fairly significant fighting force with a core of committed jihadists. Matt Bryden, Sahan Research

The high-profile attacks on the Westgate shopping mall and Mpeketoni in Kenya's northeastern Lamu County were echoed in multiple smaller but also deadly attacks in public places across Kenya.

Al-Hijra, which also has a Tanzanian wing, is believed to be behind many of these attacks and appears to have gained strength.

Anzalone's research identifies an al-Hijra poem that he said emphasised their wish to expand the war in Somalia to Kenya. It ends with the line: "Paradise is just a taxi-ride away."

Bryden estimated in terms of al-Hijra's numbers "we can fairly confidently say [they have] upwards of about 1,000 [fighters]".

"Now they are a fairly significant fighting force with a core of committed jihadists - they've grown, they've become more militarised, they've become more experienced, they represent more of a threat," said Bryden.

A report issued by the UN Monitoring Group in Somalia in 2014 said the investigators were "increasingly concerned by the foreign link to al-Hijra, in particular its foreign financiers".

In January, a new group emerged in East Africa calling itself al-Muhajiroun. With apparent links to Mombasa in Kenya and Mwanza in Tanzania - and noticeable promotion of public speeches by Ahmad Iman Ali - it is possibly an offshoot of al-Hijra.

The group announced its arrival with the publication of a magazine in Swahili and English called Amka and a pledge of loyalty to al-Shabab and al-Qaeda. Shortly after it issued a public message to Tanzania calling on the government to "protect our sheikhs".

"We've heard of them but the details are very scanty on where they were and where they are now," said Abdulhamid Sakar, executive director of the Kenya Muslim Youth Alliance.

Bryden told Al Jazeera, "At the moment this appears to be a group that is more aspirational than real, probably more Swahili than Somali oriented."

Al-Shabab's internal tensions

Meanwhile, in Somalia there are reports of tensions within al-Shabab, which has never been homogeneous, between those who want to break away from al-Qaeda and align themselves with ISIL, and those who remain loyal to its leader Ayman al-Zawahiri.

Tres Thomas, who runs the Somalia Newsroom blog, said the reason is economic. "My understanding is that it is also about deteriorating terms and conditions - pay going down for instance."

But, there are also ideological fissures. In Nairobi a firebrand imam, Sheikh Hassaan Hussein, issued a public call for loyalty to ISIL. While the Sheikh has only a small following, he is known to be close both to the al-Shabab leadership and politicians in Kenya.

Analyst Hassan Abukar told Al Jazeera he believes Hussein may be trying to influence the internal politics of al-Shabab.

"Mahad Karate, the deputy emir, favours ISIL, Hassaan perhaps wants to strengthen Karate's position," Abukar said.

None of this bodes well for East Africa, which could either see an influx of foreign fighters if ISIL gains a foothold, or increasing links to al-Qaeda in the Arabian Peninsula as Yemen becomes more unstable.

In recently published papers retrieved from Osama bin Laden's compound in Abbottabad, Pakistan, the former al-Qaeda leader commented on the al-Shabab attacks in Kampala, Uganda in 2010.

"I think the focus should have gone to preparing for a well-planned operation to assassinate Ugandan President Museveni ... If that is unachievable, then the brothers could target important military or economic targets," bin Laden wrote before being killed by US Special Forces in May 2011.

Al-Shabab is definitely proving resilient - highly capable of adapting, said Bryden.

"We've also seen from recent attacks or attempts in Ethiopia, Djibouti, here in Kenya, they still have these regional networks that are capable of staging fairly sophisticated and spectacular attacks. That threat's not going to go away any time soon."