The militant group al-Shabaab took responsibility for the attacks launched on U.S. and European targets.