The groups formed a loose alliance in recent days, targeting critical infrastructure in the Middle East and the U.S.