When a new CVE drops, there is no Metasploit module yet. There is usually a crude Python script ("Proof of Concept"). Understanding how to read, modify, and improve these scripts is a critical skill.
Pwntools
Don't write raw sockets for CTFs. Use pwntools.
It handles endianness (`p32(0xdeadbeef)`), SSH connections, and GDB debugging automatically.
It makes exploit development 10x faster.
1. Fuzzing
Before you can write an exploit, you must find the bug.
Write a Python script to send random garbage to the target application until it crashes.
Then analyze the crash dump to see if you control the Instruction Pointer (EIP).