Guerrillas launched a rocket attack on two of South Africa's sophisticated oil-from-coal refineries early today, amid signs that the black underground is trying to step up its war against the white-minority government.

According to a police statement, the rockets fired against the Sasol 2 and 3 refineries, south of Johannesburg, missed their target. Three of the alleged attackers were later killed in a shoot-out with security forces.

In two other incidents today, police clashed with a group of suspected insurgents in western Transvaal Province, killing four of them, and a series of land-mine explosions near the Zimbabwean border claimed their first victim when a black tractor driver was killed.

South Africa has said the mines were laid by African National Congress guerrillas who crossed the border from Zimbabwe, and it has formally warned Prime Minister Robert Mugabe's government not to allow attacks to be launched from its territory.

The ANC in a statement today denied any of its guerrillas had entered South Africa from Zimbabwe.

Western observers in Pretoria believe the increased insurgent activity, which began with the first land-mine attacks Tuesday, is evidence of an attempt by the underground ANC to step up its low-intensity guerrilla war in line with a decision made at a congress of exiled members held in Kabwe, Zambia, in June.

Apart from a few isolated bombings in the port city of Durban in September, there has been little evidence of this intensification since the congress.

Before last June, ANC guerrillas attacked military and other government targets. They also have used car bombs since 1983, killing 19 persons and wounding more than 200. One car bomb blew up on a crowded Pretoria street.

During the past few weeks, security sources have reported a sharp increase in guerrilla infiltrations into South Africa.

South Africa may now face the additional strain of having to cope with an escalation of the guerrilla war while racial unrest continues unabated in most parts of the country.

Police reported clashes in 17 black townships last night and today, and two more deaths brought the official casualty toll to nearly 900 in 16 months of continuous violence.

According to an account of the attack on the $2.1 billion Sasol 2 and 3 refineries given by the commissioner of police, General Johan Coetzee, three black insurgents fired between four and six 122-mm rockets at the installations at 1 a.m. Coetzee said there was no damage.

A security policeman later noticed a pickup truck with three black occupants in the town of Piet Retief, about 125 miles from Secunda, where the Sasol plants are located.

Coetzee said the men in the truck opened fire as the policeman forced the truck off the road. He called for help from a nearby Army unit, which followed the three men to near the Swaziland border and killed them in a shoot-out.

The gun battle occurred near the main road to Bophuthatswana's Sun City golf and gambling resort, about a mile from the white mining town of Rustenburg.

This was the third guerrilla attack on the vital Sasol plants, which supply about 42 percent of South Africa's annual consumption of 120 million barrels of oil.

South Africa has vast coal reserves but no oil and cannot buy oil on the open market because oil-producing nations refuse to deal with the white-minority government.

The first refinery attack was in June 1980, when limpet mines caused damage estimated at $6 million at Sasol 1, at Sasolburg about 100 miles south of Johannesburg.

Two weeks later, the bigger Sasol 2 and 3 plants at Secunda were attacked. Official statements at the time said damage was minimal, but later it was estimated at more than $1.5 million. Another attack on the Secunda complex was attempted in 1983.

Some observers expressed skepticism about the official claims that no damage had been caused today.

They noted that the adjoining plants consist of a mass of tanks and exposed pipes, which would be vulnerable to damage from six 122-mm rockets, even if these were poorly aimed.

Today's was the fifth land-mine explosion near the Zimbabwean border since Tuesday. One person has been killed and seven injured, including four soldiers. Four undetonated mines have been defused.

South Africa claims to have found tracks showing that the insurgents who planted the heavy Czechoslovak-made mines crossed the border from Zimbabwe and returned there.

A spokesman for the African National Congress in Lusaka, Zambia, was reported here as refusing to confirm or deny that the ANC was responsible for the spate of land-mine explosions. The official statement issued in Zambia denied that any of its guerrillas had entered South Africa from Zimbabwe.

The spokesman was reported as saying that the congress was honoring an assurance given to the Zimbabwean government that it would not operate from its territory.

The land-mine explosions have all occurred within a six-mile radius on military land along the south bank of the Limpopo River, which forms the border with Zimbabwe. The border with Botswana is 10 miles to the west.

South African Foreign Minister Roelof F. (Pik) Botha has warned Mugabe that if he does not act immediately to prevent further land-mine explosions, South Africa will send troops across the border to seek out the insurgents.

Zimbabwe has not yet responded to the warning. Reports from Harare today said the government there was investigating the South African claims.

The shoot-out today in which four suspected insurgents were killed occurred in Tlhabane, in the nominally independent tribal homeland of Bophuthatswana, which adjoins Botswana. South Africa has frequently accused Botswana of allowing guerrillas to transit its territory.

Earlier this year South African commandos launched an attack on what they claimed were guerrilla-occupied houses in Botswana's capital of Gaborone.

Col. David George, liaison officer for the Bophuthatswana police, said a quantity of arms were found after the gun battle.

According to witnesses, the battle lasted nearly two hours. They said the police surrounded a house occupied by a group of young armed blacks. After a long exchange of fire there was an explosion and the house was demolished, the witnesses said.