Momena Shoma faced a maximum sentence of life in prison (Representational)

A Bangladeshi student who enrolled in an Australian university with the aim of killing someone in the name of ISIS was jailed for 42 years Wednesday for stabbing her local host as he slept.

Momena Shoma, 26, admitted to engaging in a terrorist act when she stabbed Roger Singaravelu in the neck with a kitchen knife just eight days after arriving in Australia.

Shoma, who wore a black niqab showing only her eyes at the sentencing hearing in Victoria state's supreme court, shouted "Allahu akbar" as she attacked Singaravelu, who survived and was also present at the hearing, the court heard.

"Your deeds and words, and the intentions accompanying them, are chilling," said judge Lesley Taylor in handing down the sentence of 42 years, with a non-parole period of 31 years and six months. She faced a maximum sentence of life in prison.

Taylor said her actions "sent ripples of horror throughout the Australian community".

"But they do not make you a martyr. They do not make you a beacon of Islam... They make you an undistinguished criminal," she said.

Prosecutors said Shoma became radicalised in 2013 while living in Dhaka and became enamoured of the ISIS and its calls for Muslims to engage in violent jihad against non-Muslims.

After failed attempts to study in Turkey -- with the aim of crossing into ISIS-controlled parts of Syria -- prosecutors said Shoma received a scholarship to study at La Trobe University in Melbourne, and arrived in the city on February 1, 2018.

She moved in with an Australian family under a homestay program for foreign students and immediately began planning an attack on them, the court heard.

She purchased night vision goggles on February 3 and on February 6 rehearsed an attack by repeatedly stabbing the mattress of her host couple when they were not home.

The family discovered the damage and immediately asked the homestay organisers to remove her from the home.

Shoma was then placed with Singaravelu's family and stabbed him three days later after watching videos about the ISIS online, the court heard.

Outside court Singaravelu, an immigrant from Malaysia, said he was amazed to have survived the attack, and questioned how Shoma could have obtained a visa to travel to Australia.

"We came from Malaysia, from a Muslim country. We came to Australia for a better life. And most importantly, the security of this country," he told reporters.

"She was red flagged in other countries; how she was allowed here?" he asked.