C++ projects: a tool, an integrity monitor and a network service
You take three realistic C++ projects from design to delivery and combine modern C++, testing, concurrency and secure coding at production quality.
Level 501 · 16 lessons · 15 practice labs
Lessons
Project 1: a command-line tool
- Tool design: options, exit codes and error messages
- Using an argument-parsing library
- JSON configuration: nlohmann/json
- Tests, version numbers and packaging
- Short task: make your tool usable by someone else
Project 2: a file integrity monitor
- Integrity monitor design: baseline and comparison
- File hashes: SHA-256 with OpenSSL EVP
- Parallel scanning and progress reporting
- Change reports and alert format
- Short task: catch tampered files
Project 3: a network service
- Designing and documenting a protocol
- An asynchronous server and connection limits
- Persistence: safe writes to disk and recovery
- Logs, metrics and a health endpoint
- Short task: test under load and malformed input
Capstone
- Capstone: harden, document and present one of your projects
Practice labs
- Adding help text and exit codes to a tool: Add help and version options to a command-line tool and give separate exit codes for usage errors, input errors and success.
- Merging JSON settings with options: Merge a settings file read with nlohmann/json with command-line options in precedence order and report unknown keys.
- Making the tool usable by someone else: Add an install target, version info, end-to-end tests and clear error messages to the tool and show it installs and runs in a clean container.
- Computing a file's SHA-256 hash: Compute a file's hash by reading it in chunks with the OpenSSL EVP interface and release the context object with RAII.
- Comparing against a baseline to find changes: Build a hash baseline of a directory and on a later scan report added, deleted and changed files in separate lists.
- Parallelising the scan with progress: Distribute hashing over a worker pool, report progress without races and show the output is byte-identical to the single-threaded version.
- Writing a change alert as JSON: Produce a valid JSON alert record with path, old and new hash and time for a changed file, escaping special-character paths correctly.
- Applying ignore rules: Exclude log and temporary files from monitoring with patterns and table-test paths the rules do and do not cover.
- Noticing a tampered baseline: Sign the baseline file with an HMAC and show with tests that a change to a monitored file and a change to the baseline are each caught.
- Parsing a documented command line: Write the function that parses the command format in the protocol document and returns the documented error code for unknown commands and missing arguments.
- Putting a connection limit on the server: Add total and per-client connection limits to the async server, refuse new connections gracefully past the limit and show the counters do not leak.
- Testing resilience under load and malformed input: Write a test tool that sends concurrent load and malformed messages to your own service, fix the crash and memory growth it finds and show a clean run under sanitizers.
- Adding a health command: Add a health command to the service that returns uptime, connection count and time of the last error.
- Writing state to disk without half-writes: Write the state file to a temporary file, sync it and rename, and show the old file stays intact after the process is killed mid-write.
- Recovering from a write-ahead log after a crash: Append changes to a checksummed write-ahead log and prove by test that a service killed at a random point returns to a consistent state on restart.
About this course
You take three realistic C++ projects from design to delivery and combine modern C++, testing, concurrency and secure coding at production quality.
What you will learn
- Project 1: a command-line tool
- Project 2: a file integrity monitor
- Project 3: a network service
- Capstone
Prerequisites
You should be experienced in the topics of the same path up to level 401.
Lab environment
Lessons run in your own Kali Linux terminal that opens in the browser. Nothing to install; the lab starts clean in every lesson.
Frequently asked questions
- Is this course right for my level?
- The course is at level 501; it assumes you know the topics of the lower-level courses.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.