I studied basic knowledge about hacking with the help of others who are good at hacking. I solved provided hacking problems including web, pwnable, forensic, and cryptography. While struggling with hacking problems and trying to exploit them, I improved my knowledge about a computer system and learned the way to code safely.
These are example materials of what I practiced.
Web - PHP hacking, SQL Injection, Cross Site Scripting, Session Hijacking, etc.
Pwnable - Buffer Overflow, Return-to-libc, Use After Free, Return Oriented Programming, GOT Overwrite, Format String Bug, etc.
Cryptography - Public-key, RSA, Block Cipher (CBC Bit Flip Attack, Oracle Padding Attack), Man-in-the-middle attack, Hashing (MD5, SHA32), etc.