Somalia’s al Shabaab group said on Monday its fighters had attacked a military base in the south of the country, killing 27 soldiers.