Johor customs foiled an attempt to smuggle contraband worth almost half a million ringgit through a foreign-registered ship.