BEIRUT — After weeks of setbacks, militants from the Islamic State group launched swift counteroffensives Thursday on predominantly Kurdish areas of northern Syria, killing and wounding dozens and setting off car bombs, activists and officials said. The spokesman, Abu Muhammad al-Adnani, had urged militants to strike back at their foes during the Muslim holy month of Ramadan and “shake the ground beneath them.” The early morning assault by Islamic State captured part of Hassakeh, which has long been divided between Syrian Kurds and the military forces of President Bashar Assad. The Kurdish forces, backed by a campaign of U.S.-led air strikes, drove the militants from Kobani and surrounding villages in January. The Islamic State militants, wearing Syrian rebel uniforms and carrying flags of the mainstream Free Syrian Army to deceive the Kurdish defenders, launched their attack from areas to the south and west of Kobani, said Redur Khalil, a spokesman for the Kurdish People’s Protection Units, or YPG.