Hypodermic needles, cattle prods and a gun containing blanks were used for at least six months this year by law enforcement officers in the Birmingham, Ala., suburb of Bessemer to intimidate black prisoners into confessing to crimes or informing on others.

The public safety commissioner and three vice squad officers in Bessemer, a largely black, blue-collar suburb, and a state liquor control agent were indicted yesterday by a federal grand jury for conspiring to violate the civil rights of six prisoners. All of the men indicted are white.

Named in the seven-count indictment were Commissioner Max Williams, 40, vice squad officers Douglas F. Acker, 39; Thomas Lamar Cruce, 41, and Stephen D. Crump, 32, and Alabama Alcohol Beverage Control agent Robert E. Bassett, 52.

Sources familiar with the case said that the vice squad officers were part of a group that worked directly for Williams and did not report to the Bessemer police chief.

The source added that Williams is the same police commissioner who was injured in 1977 when a bomb that was mailed to his office exploded, killing a police lieutenant and causing Williams to lose a hand and one of his eyes. A former police officer was charged with the crime but later acquitted.

Several of the prisoners have already filed civil suits against the city of Bessemer, asking for $250,000 each in damages.

Attorney Harry Lyon, who is representing the prisoners in the civil suit, said that they had been picked up on "petty" crimes ranging from writing a bad check to "stealing a $5 lamp from an abandoned house."

The indictment charges that Williams witnessed assaults and abuses on one occasion and did not intervene. The incidents occurred between Jan. 16 and June 3 of this year, the indictment said.

The prods were allegedly purchased in the 1960s for possible use in civil rights disturbances, and Lyon said he believes they may have been in use since that time. Williams later ordered that the prods be destroyed.

The three vice squad officers are charged with using the electric prods to induce confessions from the prisoners.

The indictment also charged that Cruce injected a syringe into one prisoner, while Bassett displayed a syringe purporting to contain heroin to intimidate another prisoner.

In addition, the indictment charged that Acker aimed a gun at one prisoner and fired a blank cartridge as he told the prisoner he would claim that he was shot while trying to escape.