Books

Hacking
Jon Erickson
technicalsecurity
Erickson's book is unusual for teaching the underlying computer science rather than a list of tools — C, assembly, how the stack is laid out, and then why a buffer overflow works at all.
It ships with a bootable environment so the exercises run against a fixed target. Dated in its specifics now, and still one of the clearest explanations of why memory safety is a security property.