Short summary of my journey learning C#

Last Updated on January 17, 2026 by aghanim

This post is a bit different from the other posts I’ve posted. I was bored one friday evening and thought about just writing my journey learning a programming language. I’ve always wanted to learn to program. Not just putting some code together, and call it a day. But being able to create tools or applications that can either solve some problems I have, or creating applications or websites that I’ve wanted to create, as well as writing clean and code that followed best practise.

I’ve been familier with different languages before such as C#, C, Python, Java. And even though I could read and kind of understand how the code works, and even modify some parts of the code, I was not able to write code on my own. It felt frustating being held back by that limitation. So I decided it’s time to learn it, and not just learn it, but master it. I set aside all my other personal projects and plans for certification and focused entirely on learning to program. Just to clearify, I’m in no way a master programmer, probably not even a good one either (not yet at least), but that is my goal for the next couple of years at least.

At work as a red team operator we develop our own C2 framework (You can see my collegues talk on Disobey it here (5) [D25] Adventures in developing a C2 framework – Martin Herrmann – YouTube), which is written entirely in C# (and some C), which made it natural for me to be drawn to that language. The people on my team are also experts in the language, and have written and still writing techniques and tools that are considered world class. And being able to ask questions and spar with someone much better than me has also helped me tremendously.

I was told that to write good and clean code, you need to think like a developer. Not just going on maldev academy (or any other source) and just learn the code there, but instead take a developer course that takes you through the entire language. Things like object-oriented principles, memory management, design patterns, code documentation, and most importantly debugging techniques. Debugging is in my opinion where you learn the most.

Where did I start

So the first thing I did was just finding a C# course that I enrolled in, particarly Tim Corey’s C# masterclass. The goal is to get familiar with the language, and any beginner course really do the trick. I did not feel entirely confident after finishing the course, and spent alot of time doubting myself. One friend I used to work with mentioned that to learn programming, you need to program on your own. (Seems obvious, right?) But at that time I fell into something called tutorial hell, where I was just following along tutorials. It’s like learning how to drive by watching YouTube videos. Does not work, you need to get your hards dirty.

So I stopped watching tutorials entirely and only relied on help when I was stuck on a particular program. I started to develop different applications, such as making my own website where I could play retro games, or creating my own tv remote that I used to control my TV. The projects did not matter, what mattered was writing code.

6 month later…

After about 6 month I felt a switch go off, where I started to actually understand why code was written the way they were. I was able to understand how to tackle problems. It probably seems obvious to seasoned programmers, but being able to to know HOW to tackle a problem is really eye opener.

Even though at that time I was still very far away from calling myself a programmer, I started to feel like it was doable as opposed to before where it felt more like a distant goal. But with dedicated work ethic, patience and ALOT of help from others, I was finally feeling closer to the goal.

Developing at work

As I mentioned earlier, we spend a lot of time coding at work. Making sure our C2-framework is stable, adding new features, fixing bugs etc. I was tasked with creating a new covert communication channels using Microsoft Graph API’s. Specifally using OneDrive files to send and receive traffic between the agent and the server. This by no means a new techinque, and there are multiple public repo’s that does exactly that.

Our C2 framework is very large, and I mean more than 300 000 lines of code large. There are alot of moving parts, and to add a new feature requires me to understand how some of the code base works. (Understanding everything will take me too long). Luckely the hardest work was already done. The abstract class for communicating over files already existed, and I “only” had to inherit from that class. The hard part was making sure that the API calls where correct, how to handle received and sent data, how to handle exceptions, and of cource, how to make all that work with our existing code.

The first thing I did, which at that time did not seem obvious, was actually understanding how the Graph API actually worked in depth. Writing code for something you don’t quite understand will never work. The first thing I did was create a proof of concept where I mapped out all the API calls that I was going to use, before implemeting them in our C2 framework.

The whole project with the communication channel took me about 2 month (give our take a couple of weeks). Seeing it work in action and actually useable, felt really great. Over the course of 6 month I continued to develop different communications channels either using documented API, but also undocumented API’s for more stealth and OPSEC.

Some last words

Even though I’m still I’m far away from mastering C# to it’s full extent, having started this journey makes the goal seem achiveable. I think to become a really good developer, you will have to spend a considerable amount of time doing exactly that, developing. Instead of using open-source tools in a CTF, for example, try to develop your own tools, look at other well written projects and understand them, or try to modify existing tools.

The goal is to keep learning every day, even if it’s just a little bit.