The Linux Programming Interface
http://it-ebooks.info/book/2014/free pdf there. 1400 pages
Seriously, one of the most important things is to know the fucking operating system in and out. You can read all the metasploit guides and social engineering tricks you want, but you're going to be extremely fucking limited if you don't know the OS.