Alex pulled his shirt up over his face, revealing 20 long pink scars that stretched along his torso. "It felt like I was having a warm bath in my own blood. But I couldn’t stop shivering because of the shock," explained Alex.

While incarcerated, Alex was jumped by three prisoners wielding makeshift shivs, with razor blades melted onto the ends. "One of the blokes snapped his blade in me, so the others said, 'Oi slice him. Cut him open. Don't stick it in!'"

Alex was attacked in Port Phillip Prison because he didn’t play by the rules. He “lobbed in a packet,” meaning he smuggled in methamphetamines, but refused to “kick-up” a share to the guys in charge. Those in charge of the prison yard weren’t the prison officers, but a select few hardened inmates who had achieved dominance through calculated violence and political prowess.

So Alex was meted out prison justice and he refused to report the perpetrators to the authorities, even when he was in a hospital bed fighting for his life. As he explained, “That is the code mate. I don’t know where it comes from but we grow up that way. We have our own rules and you don’t talk to cops because they fuck kids.”

Although the attacks like the one on Alex aren’t reported, they’re not usual. They’re cogs of a much larger rule-of-law within Australian jails. It’s an underground justice system that operates within the larger, more official one. And in some places, like the infamous Scarborough South division of Port Phillip Prison, this unofficial court system is coalescing into something more organised.

Last month, detectives at Port Phillip were called to investigate a series of violent assaults on younger prisoners after notes were left outside the cells of inmates, in the manner of a summons, requiring them to attend “kangaroo court” proceedings.

According to the Herald Sun, several inmates were severely assaulted, and a 25-year-old prisoner was rushed to hospital after receiving two stab wounds. There were also allegations that some of the prisoners who were summoned to the jail-yard proceeding had been sexually assaulted.

The “Kangaroo courts” in prison are a formal example of what has been the active protocol of prisoners since the inception of convict culture. Prisoners have always been policing themselves in an attempt to maintain a disfigured sense of order while upholding tribal values like honour and quasi-religious notions of right and wrong. The only difference is that now, they are adopting the formal procedures of the public.

“It goes as far as some prisoners even being nicknamed the General or the Governor of the jail. The screws [prison officers] turn a blind eye because it’s easier to have a deal with the guys running the unit. Otherwise everyone will just turn on each other,” explained Alex. “So they choose who to back, but it’s not like they’re backing them, they just choose to turn a blind eye for certain people and those guys end up running the joint.”

Prison breeds a culture that totally resents official authority, so this veiled agreement is necessary for both parties to negotiate an overarching sense of order. Although they would never bow before anyone with a badge, the paradox is that inmates choose to fall in line with their own elected leaders—“heavies”—who become crowned kings of the yard through violent dominance, street stature, and extensive rap sheets. What gives their reign longevity is a juggling act of prison politics, maniacal violence, and fairness—although fairness is ambiguously defined within the context of a criminal code that shifts in accordance with the gossip of the prison population.

But sometimes the vault of the prison yard is seduced by politics of the outside world.

In Sydney’s Goulburn SuperMax prison, the majority of prisoners are of Middle Eastern background and are often fundamentalist Muslims, largely due to the fact that all convicted terrorists are housed in the same unit. In the Muslim yard, a group of self-described religious leaders, called the Shura or council, enforce the Sharia laws on the prisoners.

Ahmed Elomar, the brother of high ranking ISIS fighter Mohamed Elomar, was allegedly a member of the Shura throughout his stint in Goulburn. The group were responsible for enforcing the law of the sharia across the largely Muslim-populated yard, disciplining inmates with beatings for missing prayers, stealing, gossiping and, worst of all, indulging in sexual acts.

Karim*, a 26-year-old prisoner, detailed a different experience in Victoria’s maximum security Barwon prison. “A few of the [Muslims] caught on that I was getting on the Bupe (Buprenorphine)," he explained. "My parents put me in rehab. The prison put me in rehab. Nothing worked ay.

“One day, I got called into a cell and there was about seven blokes in there. They had the bloke I was getting the strips off in the cell. Bloodied all over and that. They told me what I was doing was haram. And jumped on me. And I love them for it."

Karim has since been released and works as a mechanic in Altona. He told me: “I got off the drugs. I fixed my life. I work now. But it’s not for everyone. It just worked for me. My parents tried everything. My mum would cry to me everyday begging me to stop puffing. But I didn’t get the picture. I was a fuck-up and needed a shock to my system.”

I asked him about what happens to Muslim inmates who are involved in prison sex. “It’s very rare, although I seen it happen at a minimum joint just before I got out. We don’t accept these things. We have our own morals and way of thinking. If you want to eat with us, it’s simple, you don’t do that shit.”

Sources, off the record, told VICE that violent bashing and stabbings were inflicted on Muslim inmates suspected of being involved in prison sex. Most were forced to move into protection units as a form of exile from the prison community.

But the rules of the prison yard are not always as ideologically grounded as they are in Goulburn, and in some jails the “Kangaroo court” system has nothing to do with a disfigured sense of justice or order at all. Instead the power dynamic is exploited and abused for nefarious activities.

Rob was a high-ranking prisoner in a rural Victorian prison who thrived off power and manipulated it to fit his agenda. I met Rob in Doveton to discuss his ideas about life in the “boob (booby trap).” He said: “Our boys had an agreement with the screws, we’ll make sure everything’s in order and they’ll turn away from certain things. It’s like the jungle in there, you have to be able to stand over to survive. You have to earn your extra-curricular activities.”

After pressing him on what exactly he meant by “extra-curricular activities,” Rob explained: “Sometimes we will stand over blokes for their shit. Sometimes we will put them on a payment-plan. Get their folks to put money into an account, once a month. Get their girlfriends to lob in steroids. They get looked after and the boys make a little earn.”

I told him it sounded as though he was essentially picking victims he knew he could bully. “Mate, get real. If you can be bent over, as easy as that, you deserve to be fucked. Pure and simple. You’re talking about jail, not a playground. You want to be a crim, well then be prepared for the shit that comes with it. Or stand up for yourself and get your head kicked in like a man...and you’ll likely be left alone”

In Discipline and Punish, Michel Foucault argues that if we study the procedures of punishment, it might illustrate a more accurate depiction of how societies govern themselves. Foucault traces the shift from public, physical punishments of the body, to a private, invisible discipline of the soul. In prison culture, the opposite has happened. When prisoners are left to their own devices, they have unwound the criteria of punishment. The primary concern is order and the reason is effectiveness, not morality.

I asked Ahmed about his problem with authority and he said: “We don’t want to be told how to act by these cunts. That’s the difference. They don’t know where we come from... so why are they telling us who we should become?”