The attacks were carried out by the paramilitary Revolutionary Guard, according to Iranian media, which reported that the force seized two of the ships.