If you want to challenge a federal judgment that imposed a sentence to be served in the future, you should file a motion under 28 U.S.C. § 2255 in the federal. In Massachusetts, the writs of habeas corpus may be filed in state and Massachusetts federal courts."Habeas corpus" is a writ utilized to bring a person before a court, most frequently to ensure that a person' s imprisonment or detention is not illegal. Massachusetts has a Habeas Corpus law I would like to use to try to get a trial. The law is at this hyperlink: Section 3. Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. A § 2254 petition is a motion for a writ of habeas corpus. A federal petition for habeas corpus is filed after a conviction and sentence in state court, and after appeals in state court. A petition for a writ of habeas corpus is a case filed in court, either state or federal court depending on jurisdiction. View on Westlaw or start a FREE TRIAL today, § .