A witness says a senior commander of the Somali insurgent group al-Shabab has been assassinated in an area tightly controlled by the militants.