What you want to do is go through every post and if there are images in the content that come from /wp-includes/upload/ then wrap each img tag with an anchor tag (<a><img/></a>
) that links to the full size image file.
I don’t know of any plugins to do this. It is feasible to do this by script, but you must account for all conditions that could cause errors, like external images, images already with anchor tags, images where there is no larger size, etc. You also need a reliable routine to determine the full size file name from whatever happens to be used in the image tag.
Test the script carefully and thoroughly on a limited number of posts before turning it loose on the whole DB. You will likely need to extend the execution time for PHP or treat limited blocks of posts at a time once you’re ready to do the entire DB due to how long this is likely to take.