Nearly 20 commercial ships, mostly tankers, have come under attack over the past month while sailing through Hormuz, the Persian Gulf or off the coast of Oman.