As resentment intensifies and open resistance grows to the Afghan government of Babrak Karmal and his Soviet masters, they find themselves facing a dilemma; every move they make to gain control over the country further enrages the already rebellious population.

In the view of senior diplomatic analysts and intelligence sources here, the smoldering hatred of the Soviets and the Babrak government they installed in power Dec. 27 poses a far greater threat to Moscow's aims than the sporadic, hit-and-run attacks by rebel groups.

These groups still appear to be fragmented and too poorly armed to be more than a nuisance to the Soviet forces.

According to reports reaching here, authorities are more preoccupied with a mood of protest by shopkeepers and civil servants in the Afghan capital, Kabul, that has continued since a week-long general strike ended there 10 days ago. In an indication of this official concern, threats are scattered through daily programming on Radio Afghanistan, warning merchants to open for business or face losing their shops.

These threats are not contained in the most closely monitored news bulletins, which continue to report business as usual in Kabul's bazaar, but in the regular programs.

These factors complicate international efforts to find a face-saving way for the Soviets to pull out of Afghanistan. Diplomats here and in Washington believe the Soviet invasion has become far costlier than Moscow anticipated a little more than two months ago.

Analysts here expect to see an intensification of civil disobedience, fueled by an increasing hatred of the estimated 80,000 Soviet troops trying to pacify Afghanistan.

"The problem is the more force the government uses to try and put down these uprisings, the more unpopular the Babrak government becomes," one Western diplomat here said.

The lack of support for the government is becoming increasingly clear from reports of travelers arriving here.

They say rebel groups stop traffic on key roads and look specifically for government officials and Soviet troops. The Soviets, according to reports reaching here from Kabul, dare not travel by road; they take helicopters around the country.

There are also reports here that bus traffic between Kabul and Pakistan has been stopped because of rebel ambushes.

Adding to the Soviets' problem is the continued disintegration of the Afghan Army, many of whose members have either simply deserted or have taken their weapons and joined rebel bands.

It is widely believed there that Moscow was surprised by the depth of resistance to Soviet troops and to the Babrak government, especially since Babrak had been viewed as a popular figure in Afghanistan.

Whatever popularity he had was eroded by the way he was installed by the Soviets. Among a fiercely independent people, he is seen as a Soviet stooge.

"Anyone they put in will be similarly tainted," said one diplomat here.

According to some diplomats, the big question is how badly the Soviet plan has been damaged by the popular resistance of the Afghan masses.

"I believe their game plan was to move in, stabilize the institutions such as the Army, the party and the government and then get out, maintaining Afghanistan in everything but name as a mini-Soviet republic," said one well-informed Western diplomat. "If that was their game plan they must be terribly disappointed."

The Soviets first must rebuild the Afghan Army, however, and the mass desertions may in fact help them by cleansing the force of disloyal elements.

There are signs that the Soviets are moving in vast amounts of military supplies for a spring offensive against the rebels once the snow melts in the mountains in about a month.

Analysts here differ, however, over who will have the advantage once the weather clears -- the Soviet Army or the rebel forces.

One view holds that the Soviets' vast superiority in manpower and equipment -- especially the heavy firepower of the MI24 helicopter gunships -- will then allow them to make short work of the lightly armed rebels hiding in the mountains and fighting 19th century-style battles.

The Soviet troops have shown themselves to be utterly baffled by guerrilla attacks. According to observers, they lack rudimentary training in how to react to an ambush. Instead of taking cover, they tend to gather in groups with fixed bayonets, which makes them all the more vulnerable.

However, some experts believe the past two months have given the Red Army leaders a chance to refine their tactics for dealing with guerrilla warfare. Moreover, they are gaining an opportunity to see how their modern weapons perform under battle conditions.

On the other hand, the Afghans are masters of ambushes and hit-and-run raids, tactics that drove the British from Afghanistan in the 19th century. The terrain favors the insurgents, some analyst believe, because the rebels know the mountains and valleys where Soviet tanks cannot reach them.

This school of thought sees the coming of spring as an aid to the rebels, opening their mountain hideaways.

A major question though, is how much damage the heavy firepower from the M124 helicopter gunship, being used here in combat for the first time, will inflict on the rebels. It clearly is the most powerful weapon on the Soviets' side, and one the rebels have not been able to counter.