Iran has been emboldened since the war in the Gaza Strip began in October, using proxy forces against Israel and its allies and increasing the risk of a spiraling regional conflict. On Tuesday, Iran used its own military to attack both Pakistan and Iraq, responding to what it said were terrorist assaults inside Iran, exacerbating tensions in the region.