Habeas Corpus, in the Federal Court, is a petition that claims that you are being detained against your US constitutional rights. The procedure for filing a petition for a writ of habeas corpus is spelled out in the CPLR Article 70.Petition for Writ of Habeas Corpus. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment. The "Great Writ" of habeas corpus is a fundamental right in the Constitution that protects against unlawful and indefinite imprisonment. The state writ of habeas corpus is a legal mechanism that allows individuals to challenge their detention or imprisonment. Anyone can file a writ of habeas corpus including individuals with knowledge of someone being unlawfully detained. The "Great Writ" of habeas corpus is a fundamental right in the Constitution that protects against unlawful and indefinite imprisonment. The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty. The trial court sentenced Montgomery to prison for an aggregate term of 61 years to life.