Say I have client X passing Y message to Z winsock server.
I am trying to make a RAT for educational purposes, and the client must be able to send messages to server.exe to say open a random messagebox or start keylogging, etc.
How do you guys think I should parse messages?
Heres what Im thinking about doing:
The server listens and accepts, then recvs a message from the client. The client sends some message that is easy to distinguish like OPEN_MSGBOX or uses integer numbers to signify what the server must do.
After that im gonna use a switch statement to see which server.exe function the message matches it to, and then begin a new thread for that particular action.
My question is, what would be a good way to handle a char string with a switch statement? Recv only lets you recieve char[]s, so would i do something like:
if recv_server_reply_string == "OPEN_MSGBOX{
start_my_MSGBOX thread
}
or this:
switch(recv_server_reply_string){
case "OPEN_MSGBOX:{ start_my_msgbox thread}
break;