NAHAL OZ, Israel — Benny Gantz, Israel’s former army chief, is campaigning to lead his country as the clean, moral alternative to Prime Minister Benjamin Netanyahu, who faces indictment in a corruption scandal.

But less than a month before the election, Mr. Gantz found himself fielding seamy-sounding questions late Friday about whether he had committed adultery, opened himself up to possible extortion or sandbagged his political allies to advance his own career.

The awkward news appearance here at a kibbutz near the Gaza Strip followed a report on Israeli television that Mr. Gantz’s cellphone had been hacked by Iranian intelligence after his entry into politics in December and that personal and professional information had been stolen.

Mr. Gantz retired from the military in 2015, so the issue is not whether classified information might now be in enemy hands, but that he could be vulnerable to blackmail if elected. The hack threatened to set back his bid, which polls have shown has the strongest chance of any opposition politician to depose Mr. Netanyahu. With rumors flying about what might have been harvested from Mr. Gantz’s cellphone, his party, the Blue and White, issued a statement saying the stolen data included “no security information, no embarrassing videos, and he was never a target of blackmail.”

That was not enough to put a lid on the speculation, however, and so the laconic Mr. Gantz, whose campaign strategy has entailed saying as little as possible, hastily arranged his first news conference.

His backdrop was the Gaza border, where a wave of Israeli airstrikes hit early Friday after two Hamas rockets had reached Tel Aviv for the first time since the summerlong war of 2014. That allowed Mr. Gantz, who prosecuted that war as army chief, to try to shame the Israeli press into focusing on more sober matters.

“We are here in a story of an ongoing security event,” Mr. Gantz said, glowering in front of a barbed-wire fence, to dozens of journalists who had trekked the hour from Tel Aviv or Jerusalem shortly before the start of the Sabbath. “And in the reality we are in, someone suddenly broke some political, gossipy and completely delusional story.”

Given that his party’s statement said there were no videos, he was asked, might there be embarrassing photos or correspondence? “I’m not going to stoop to that place,” he said, calling it “unethical nosiness.”

Did he ever have a relationship with a woman that could be the basis for extortion? another reporter ventured. “I’m not subject to extortion under any circumstances,” he said, again refusing to go there.

Mr. Gantz’s centrist Blue and White party is leading Mr. Netanyahu’s Likud in the polls in terms of the number of Parliament’s 120 seats it is expected to win. But the prime ministership is determined based on which leader can forge a majority governing coalition, a measure on which Mr. Gantz and his partners trail the incumbent and his right-wing allies.

On Friday, Mr. Gantz flatly accused the prime minister of being “behind the reports about the telephone.”

Mr. Gantz was informed of the hacking in early February by the Shin Bet, Israel’s domestic security service. That was before he joined forces with Yair Lapid, a former finance minister whose Yesh Atid party was trailing Mr. Gantz in the polls. Mr. Lapid agreed to let Mr. Gantz sit at the top of the ticket under an agreement that would have them swap the prime ministership midstream if they win.

But Mr. Gantz did not apprise Mr. Lapid of the Iranian hack before striking that deal. In fact, Blue and White party officials said on Friday, Mr. Lapid and the two other former army chiefs of staff running alongside Mr. Gantz, Moshe Yaalon and Gabi Ashkenazi, were not informed of the breach until shortly before Thursday’s television report.

Asked why he had not apprised his political brethren sooner, Mr. Gantz was dismissive. “Yair and the others aren’t relevant to this story,” he said.

None of his three comrades, who have routinely campaigned alongside Mr. Gantz, joined him at the late-Friday news conference — though all three publicly echoed his contention that Mr. Netanyahu, who oversees the Shin Bet, had orchestrated the leak to damage him.

Mr. Lapid said Mr. Netanyahu’s “use of sensitive security material to try to smear Benny Gantz proves he is scared of him.” And Mr. Yaalon told a TV interviewer that Mr. Netanyahu wanted to distract attention from the criminal cases in which he is accused of bribery, fraud and breach of trust.

The prime minister’s office said that the chief of the Shin Bet, who reports directly to Mr. Netanyahu, had not briefed him or his aides about the hacking. His Likud party denied any hand in the leak.

A security official involved in the matter said that Iran’s Ministry of Intelligence and Security, which has been engaged in a long-running spy-vs.-spy battle with Israel’s Mossad on multiple continents, had hacked Mr. Gantz’s phone and was behind a series of other cyber attacks against Israel.

The incident was reminiscent of one early in Mr. Netanyahu’s rise to power. In 1993, he admitted to having an extramarital affair after he said anonymous rivals had threatened to release a compromising videotape. No tape was ever produced, and Mr. Netanyahu accused an archrival of being behind the scandal.