Skip to content
UnderDunn Courses

Programming Foundations

Module 48 lessons · 3 labsAbout 10 hoursLab included

Vulnerabilities live in programs. If we want to understand why a program crashes, accepts something it should reject, or wanders into memory it does not own, we need to read the instructions it was built from.

You do not need to become a professional software developer before doing vulnerability research. You do need enough programming fluency to follow a value through a small program, predict which path it will take, change one piece, and explain the result. That is what this module is for.

We will begin with Python because it lets us concentrate on program behavior without introducing a compiler and manual memory management at the same time. Then we will move to C, where the relationship between source code, compiled instructions, and memory becomes much more visible. C is less forgiving. This is inconvenient when writing software and extremely educational when researching it.

  1. What Is a Program? — Source code, instructions, input, output, state, and what it means to run code.
  2. Python Scripts and Values — Your first scripts, variables, basic types, and terminal arguments.
  3. Decisions and Repetition — Conditions, comparisons, loops, and tracing the path a program takes.
  4. Functions, Errors, and Files — Breaking work into functions, interpreting failures, and reading data from disk.
  5. Python Behavior Lab — Investigate a script whose behavior changes with its input.
  1. C Programs and Compilation — Build a small native program and connect source code to the resulting executable.
  2. Types, Functions, and Control Flow in C — Revisit familiar programming ideas under C’s stricter rules.
  3. Arrays, Strings, Pointers, and Memory — Build the mental model needed for later debugging and exploitation.
  4. C Memory Lab — Predict and observe how a small program lays out and changes data.
  1. Reading Unfamiliar Code — Turn source code into a map of inputs, decisions, state changes, and outputs.
  2. Code Investigation Lab — Apply the complete process to an unfamiliar but bounded program.

The numbering contains eight lessons and three labs. Labs are listed in the order you will encounter them because saving every exercise for the end would be a fine way to forget the first half before using it.

Everything runs inside the Linux course VM. We will use:

  • the terminal and filesystem commands from Linux Foundations;
  • a plain text editor;
  • Python 3;
  • GCC, the GNU C compiler;
  • ordinary command-line inspection tools;
  • small course programs that are safe to change and break.

Setup instructions appear when each tool is first needed. Do not install a random collection of development tools in advance. More software is not the same thing as more understanding.

Keep a directory for your programming exercises and a separate research notebook. Before running an example, write down what you expect it to do. Afterward, record what actually happened and explain any difference.

That prediction step may feel slow. It is also the beginning of debugging and vulnerability research. Running a program repeatedly without a question is not investigation; it is just making the computer warm.

Start with What Is a Program?