The word is possibly derived from the 1670s underworld cant word for "knife," chive. ... The derived verb, shiv means "to stab someone", a shivver being an archaic/mostly unused term for a criminal who attacks victims with a knife. A knife improvised in prison is also often called a shank.
Where did the phrase shank come from?
Old English sceanca "leg, shank, shinbone," specifically, the part of the leg from the knee to the ankle, from Proto-Germanic *skunkia- (source also of Middle Low German schenke, German schenkel "shank, leg"), perhaps literally "that which bends," from PIE root *skeng- "crooked" (source also of Old Norse skakkr "wry, ...
Why is a shank called a shank?
Shanks did indeed mean legs - Edward Longshanks was called that for a reason: he was tall and had long legs. It was also used for the narrowest part of a golf club. In 1816, it was used to mean to send off without ceremony. Perhaps the prison meaning of getting shanked derives from this unceremonious sending off.