jailhouse lawyer

Noun

 * 1)  A person incarcerated in a prison, jail, etc., who has acquired significant knowledge of the justice system and who is able to represent himself in some legal proceedings and to provide legal advice to other prisoners.