You just got your computer, you're setting it up and figure that it's time to install the programs that you need. However, within a weeks of using the computer, the inevitable starts. The weird pop-ups, the slow load times, the blue screens. You eventually get around to installing an anti-virus and things get better. But, wouldn't it be nice to understand the virus on your computer?
First, let me say that I'm not responsible for what you do with this information. This blog post will give you an idea on how this specific malware/virus works, and its up to you to use that information in a responsible and safe way. Seriously, don't have your lawyers send me letters saying that I had information that you misused and got yourself into trouble with. Also, I'm not a complete expert in this field, so I'm still learning about how all of this works and what it all means, so I'm not 100% sure that everything will be accurate. Also, this can be a bit hard to follow, so if you don't understand something I did, let me know.
That being said, lets get into things.
So recently, in class, we've been using Python to do some basic programming. As you've seen, it's a little bit different from plain English, but it's not too bad once you get a hang of it. This is the python code for a piece of malware that I found online. Before you go any further, I would advise that you DO NOT compile this and DO NOT WRITE IT. It's a virus, and its going to damage your system if you're not careful. If you are going to play with it in anyway, do it on a computer that you no longer need or in a virtual machine.
So maybe something like this finds its way into your email and you download the attachments
And of course, you run the things that were sent. Without even realizing it, you just installed a keylogger into your computer, which will record the keystrokes and mouse movements of the infected computer, which will, in effect, hand over your passwords to hackers. How does it do this? Let's take a look.
The code above does two things. First, it harvests your system info. The other, more malicious thing it does, is establish a server for the rest of the malware to be downloaded from.
From that server, another two pieces of malware are installed. The first is WINRM.EXE. This will harvest your files, such as documents, spreadsheets, point points, pdfs, etc. The other one is SPPSVC.EXE. You thought the last one was bad? SPPSVC is just plain intrusive.
SPPSVC acts as a keylogger and sends it back to the server that was established before. It will keep track of any usernames or passwords that you enter, which is going to give hackers access to any accounts that you log into, be it your email or bank account.

What this code above will do is constantly run a "user input" program. Everything you type is going to be sent back to someone else, who is going to be able to use that to get unauthorized access. Not pictured is the code that creates a "registry key". A "registry key" is something on you computer that has extra access as opposed to regular files, which have to ask for explicit access before getting true control. The registry key is called REG.EXE, and will start whenever you boot up your computer, so just as you start your computer, you're also starting the keylogger. I didn't include a picture because its written in C++, which is a language that I don't understand, so I don't want spread misinformation. From here, the code pretty much loops, waiting for you to start typing so it can begin to harvest that data and use it on your various logins.
In conclusion, this is one of the thousands of pieces of malware out there. Usually, keeping your computer up to date and using an anti-virus is enough to prevent them. What makes a skill like reverse engineering useful is that you will be able to understand how they work, and as a result, know how to prevent them.
A major source was this blog: https://www.bluecoat.com/security-blog/2014-06-10/snake-grass-python-based-malware-used-targeted-attacks
If you're interested in computer security, I highly recommend reading it, as they have a lot of good posts about the topic and they're usually pretty well written. Once you understand some basic terminology, it will become really, really interesting.