US government agencies are tracking cyber threats against nearly 20 shipping vessels around the world, according to US officials familiar with the situation.