Afghanistan’s military launched a cross-border attack on Pakistan on Thursday night, claiming to have captured more than a dozen Pakistani army posts in the latest escalation of violence between the volatile neighbors.