Forms Find a national federal court form that can be used in all federal courts. If you want to challenge your immigration detention, you may use the form Petition for a Writ of Habeas Corpus under 28 U.S.C. § 2241 (For Immigration Matters).It provides an expeditious remedy for correcting erroneous sentences without resort to habeas corpus. Federal prisoners may file two different kinds of motions for post-conviction relief: "Section 2255 motions" and "Section 2241 habeas corpus petitions." File Your Motion While in Custody. Before you can file a motion under §2255, you must be in custody under federal law. Under the saving clause of Section. Section 2255 provides the general mechanism for collateral review of the legality of a federal prisoner's conviction or sentence. See 28 U.S.C. 2255(a). (a) Form of Motion and Supporting Papers for Motion and Opposition Statement. 1.