The long-term answer is infiltrating and wrecking these organizations from within. The CIA people were quite good at that sort of thing at one time. But even then there weren't any spooks to speak of in the Middle East who could blend in with the crowd. The lack of spooks who look and speak Arabic/Farsi, etc., is a liability that will take years to overcome so it's going to be a while before we can get inside Al Qaeda & Co.
The short-term strategy, if you can call it "short", is to keep pushing on the dominoes until all the terrorist-sponsoring governments fall. From there on, it's a spooks/special ops show.
That is much more difficult with these groups than with other enemies unfortunately. But, fortunately, we have a President who will not stop in his efforts to destroy these enemies.