jailhouse lawyer

noun
  1. : a prison inmate self-taught in the law who tries to gain release through legal maneuvers or who advises fellow inmates on their legal problems