Independent counsel Lawrence E. Walsh is being attacked in opposite directions by the Iran-Contra defendants, with one claiming he improperly ignored congressional testimony and the other three saying he illegally used it.

Attorneys representing former national security adviser John M. Poindexter, Lt. Col. Oliver L. North and arms dealer Albert Hakim moved Thursday to dismiss the indictment against them, claiming Walsh illegally relied on testimony the three gave last year to the Iran-Contra congressional committees after being granted limited immunity. Because of the immunity grants, Walsh was required to collect all of his evidence independently.North, Poindexter and Hakim claim that, given the publicity surrounding the hearings, Walsh's case was inevitably tainted by exposure to their immunized regardless of efforts to insulate investigators and grand jurors from that evidence.

But lawyers for retired Air Force Maj. Gen. Richard V. Secord, the fourth defendant, claim that Walsh unfairly ignored the congressional testimony of North and Poindexter. They say that testimony would have led the grand jury to decline to name their client in the indictment.

Secord, who brokered the arms sales with Hakim, was the lead witness at last year's hearings of the House and Senate Iran-Contra committees and testified without immunity.

All four defendants are accused of conspiring to divert profits illegally from the U.S.-Iran arms sales to the Nicaraguan rebels.

The so-called "use immunity" grants conferred by Congress on North, Poindexter and Hakim prohibit Walsh from using evidence obtained directly or indirectly from their congressional testimony.