The Open Web Application Security Project - Broken Web Application provides an excellent framework to learn about web application vulnerabilities and test penetration techniques. This can all be done within a virtual environment and is free! You can find more information and download the framework
here: