I have got myself a bug that I just can't figure out how to get rid of. My OS is windows 98 SE.

Yes this is a form of a RAT but is to be used with the permision of my friend for penitration testing. However the atachement itself is NOT a RAT , only the frame work. Therefore I dont premote ilegal activities by ataching my code.


I am creating a server and a client, (useing winsock for windows). The server is suposed to execute dos commands sent by the client, curently though the server is not complete and is only suposed to display whatever string the client sends. The client is suposed to open a small dos window and wait for input from the user, then send the string entered to the server, where it gets displayed.

Currently the remote address and port number to conect to are hard coded as localhost 21, therefor the client only conects to your own computer on port 21 (ftp port). Where the server is listening for conections.

I have tested it, and have confirmed that yes indeed all the setting up of sockets, creating sockets, listening, binding all works. The problem is as folows:

when you start the server, second.cpp a dos window opens and starts to listen to port 21,

when you start the client, try.cpp, it will make a conection with the server on port 21, the server will continualy display in the dos window whatever string was in the memory location where the buf character array is, this is because I have not initialized buf yet

All is well so far, but the client dows not open a dos window and does not ask for input.

Since the sockets are working the problem area of the code is the last part:

try.cpp, client:

int done = 0;
char buf[256];

while (done != 1){

second.cpp, server:

int done = 0;
char buf[256];
int ert;

while (done != 1){

I am woundering if anyone can tell me why the server opens a dos window and the client doesnt.

If you decide to comple you must link in the wsock32.lib file in your compiler options.

Atached is my code, (note that you will have errors trying to compile it in linux, it is not linux compliant.