JEDDAH, SAUDI ARABIA, OCT. 17 -- Secretary of State George P. Shultz, after hearing an appeal for action from this strategic Persian Gulf nation, strongly hinted here today that a U.S. military response to yesterday's Iranian missile attack on a U.S.-flagged tanker could be forthcoming soon.

Following a nearly three-hour meeting with Saudi Arabia's King Fahd, Shultz told an Arab questioner at a news conference that the United States is studying the missile attack on Kuwaiti territorial waters "which also involves a U.S. vessel."

"When we have decided to take action and have taken it, you will know what it is," declared Shultz at the end of a six-hour visit to the oil-rich kingdom during a swing through the Middle East.

Shultz declined to speculate about action the United States might take or when it might come, but he condemned Iran's "unacceptable behavior" and "open hostility toward the gulf states" such as Kuwait and Saudi Arabia.

Iran has been blamed for two missile attacks, yesterday and Thursday, against ships off the Kuwaiti port of Shuaiba. The missile fired on Thursday hit a supertanker owned by a U.S. company but registered in Liberia. Yesterday's attack was on the 81,283-ton Sea Isle City, one of 11 tankers that Kuwait registered in the United States last summer in order to qualify for U.S. military protection in the volatile Persian Gulf.

Shultz reported that Kuwait will take the missile attacks to the U.N. Security Council either on its own or with other nations of the six-member Gulf Cooperation Council (GCC) or the Arab League. The United States favors a collective appeal.

The Saudi foreign minister, Prince Saud Faisal, said in an interview that his government has been in diplomatic contact with Kuwait and that "Kuwait has the full support of the GCC and the Arab League in whatever action it decides to take." Saud said the latest attacks are part of "the spiral of escalation" in the gulf that underlines the need for "dramatic action by the international community.

"The longer you wait the more chances for escalation there will be," Saud said.

At several points Saud mentioned the Security Council effort, which included a resolution passed on July 29, to enforce a cease-fire and an end to the seven-year-old war, but he did not specifically call for U.S. military action.

A U.S. official accompanying Shultz said, however, that the Saudi leadership made clear to the secretary its desire for a U.S. military response to the recent attacks. Hardly anything the United States might do would be excessive in the Saudi view, the official said.

The state-controlled news media in Kuwait were explicit today in their calls for strong U.S. military retaliation.

One Kuwaiti newspaper characterized the attack as a "direct challenge to the United States, whose naval task force has undertaken to defend freedom of navigation in the gulf."

The English-language Kuwait Times asked in an editorial, "Will the U.S. come out with a strong deterrent action, or will it just keep putting interpretations to these defiant acts to embolden the perpetrator?" The "interpretations" to which the editorial referred were statements by Reagan administration officials that the Sea Isle City was in Kuwaiti waters when the Iranian missile hit.

"Ever since the U.S. naval force started its vigil in the gulf waters, Iran has been challenging the Americans," the Kuwait Times said. "As long as the attacked ships flew other countries' flags, the U.S. had a pretext to exercise restraint in its retaliatory moves. That is not the case now."

In a similar editorial, the Arabic-language daily Al Anbaa said, "There is no way to deal with Iran except through decisive preventive deterrence," either by bombing Iranian missile sites or the bases from which Iran launches naval attacks on gulf ships, "or anything international forces think is enough to stop its stupid military madness."

Shultz, asked by a reporter if a U.S. military response to Iran might lead to a wider war, responded that the United States is not in the gulf in an aggressive posture but that "the important thing here is to have a strong deterrent capability and to show, as we already have, that there are circumstances under which we will act."

Earlier in the day, a senior aide to Shultz seemed to raise doubt about a U.S. military response by telling reporters that it is not clear that Iran "singled out" a U.S.-flagged ship to hit in the latest missile attack.

Shultz, however, gave short shrift to such a distinction. He said following the meeting with Fahd that he could not deal with "some mysterious Iranian intent" but could only infer from the facts that "Iran fired on what amounts to Kuwaiti territory and hit a ship that is an American-flagged ship."

Shultz confirmed that the United States has exchanged written messages with Iran on the two nations' respective purposes in the gulf, but he denied a report that the U.S. messages spelled out in detail the Iranian actions that would lead to American retaliation. "We're not going to tell them our game plan," he said.

The basic message to Iran in the diplomatic communications, according to Shultz, was that "we're there {in the gulf} to protect our interest and those of our friends and allies. We're not there in an aggressive posture. We're no threat to them in any way. But we will defend our interests, and we're prepared to act in support of them."

According to Shultz, Saudi Arabia is "as outraged as we are" by this week's missile attacks against ships calling at Kuwait's oil port. The Saudis "feel they worked very hard to reason with Iran" but that after the violent demonstrations by Iranian pilgrims at Mecca on July 30 and various Iranian attacks in the gulf, the Saudis question "whether Iran can be reasoned with."

The Saudis have been instrumental in arranging for an Arab League summit meeting, the first Arab League summit since 1982, which is scheduled to meet in Amman, Jordan, Nov. 8 and concentrate on seeking a unified Arab position on the gulf war. A senior State Department official accompanying Shultz said the level of Saudi anxiety about the war in the gulf has diminished as the Saudis have gained greater confidence in U.S. intentions in the area.

The official also said the Saudi Air Force has recently gone on full alert.

Shultz said that in his meeting with Fahd, he had assured the Saudi monarch "of the steadfastness of purpose of the United States and its readiness to help Saudi Arabia cope with the dangers posed" in the current situation.

Kuwait's rulers, meanwhile, marshaled a full diplomatic push in the Arab world and United Nations to win condemnation of Iran's missile attacks.

Kuwait's official press today also carried front-page photographs of wounded crewmen of the Sea Isle City recovering in their hospital beds. The photos showed burned and swollen faces and large bandages over the eyes of crew members, whose faces were sprayed with glass and the searing heat of the fireball that roared through the ship when the missile warhead exploded.

A physician attending to the injured crew at Kuwait's Addan Hospital confirmed today that the ship's captain, John Hunt, and a Filipino crewman, Victorio Joesra, will lose their eyesight. Ten other injured crewmen were reported in stable condition, and seven have been released after treatment for minor injuries.

{In Washington, a senior White House official said ordnance experts on the scene had reported back to Washington that the missile had been positively identified as a Silkworm fired by Iran, Washington Post staff writer David Hoffman reported.

{This identification was important because officials had said a final decision on the U.S. response would not be made until proof was obtained that the missile was fired by Iran. President Reagan had no meetings on the situation yesterday, the official said.}

Yesterday, Kuwait's Foreign Ministry undersecretary, Suleiman Majid Shaheen, called in the ambassadors from the five nations that are permanent members of the U.N. Security Council and told them that Kuwaiti defense forces on Fialaka Island, northeast of Kuwait City, spotted the Silkworm moments after it was fired.

They placed the missile's launch point east of the Shatt al Arab waterway on Iranian territory. Other officials in the region and in Washington have said the Silkworm was fired from the Faw Peninsula -- between the Shatt al Arab and the Kuwaiti border -- which Iranian forces have occupied since capturing it in a February 1986 offensive.

Iran has neither confirmed nor denied its forces fired the missile.

In Tehran today, the official Islamic Republic News Agency said that crowds chanting, "Down with the U.S.!" gathered in the streets to greet four wounded Iranian sailors who were captured by the U.S. forces during a clash in the gulf on Oct. 8 between U.S. helicopter gunships and Iranian gunboats, The Associated Press reported.

The sailors were repatriated, along with the bodies of two Iranians killed in the clash, after the United States handed them over to Oman, which maintains friendly relations with Iran. It was the second such repatriation of Iranian sailors captured in confrontations with U.S. forces in the gulf.

Iraq said today its warplanes attacked a "large naval target," or ship, off the Iranian gulf coast, Reuter reported. Both Iraq and Iran reported Iraqi air raids on three villages along the northern war front. Baghdad said the raids were against Iranian troop concentrations in the area, while Tehran said the attacks killed or wounded several civilians in the villages.

Patrick E. Tyler of the Washington Post Foreign Service contributed from Kuwait to this report.