Client/Server Message Passing modules with proxying capabilities
$500-1000 USD
Closed
Posted almost 13 years ago
$500-1000 USD
Paid on delivery
Create two C/C++ programs that communicate over TCP. The first program should act as a client and support connect-back SOCKS to the server. The second program must be able to accept the SOCKS connection and forward specific traffic through it.
## Deliverables
**Requirements for first C/C++ program:**
A program that accepts and sends messages to another program
C1. Must connect over TCP to a pre-specified server/port.
C2. Must Handle Encryption and Authentication.
C3. Must be able to pass messages to the server in a structured format.
C3.1 Message must contain:
C3.1.2 Message ID (or type).
C3.1.3 Message Contents.
C4. Must be able to read messages from the server.
C5. Must handle an arbitrary message length.
C6. Must be able to spawn a connect-back SOCKS5 proxy once a special message is received.
C6.1 The message will contain IP address and port to connect to.
** **
**Requirements for second C/C++ program:**
P1. Must listen on a pre-specified IP address and TCP port
P2. Must Handle Encryption and Authentication
P3. Must be able to pass messages to the client in an identical way described in C3
P4. Must be able to read messages from the client
P5. Must handle an arbitrary message length
P6. Must be able to accept SOCKS5 connections and allow (with the use of a different function) connections through it.
**Design Considerations:**
The first C/C++ program must contain at least these two functions:
PrepareMessage( ... );
Can be called multiple times with different Message ID/types thus preparing a bigger "MIXED_TYPE" message containing all messages, therefore reducing the amount of datagrams send. It can return a pointer to a structure containing the message and all necessary information for transmitting.
SendMessage( ... );
Send the actual message to the server.
ReadMessage( ... );
Read the server's reply. Can return NULL to notify that the message was send successfully and that no reply is expected, return -1 if an error occurred or return a pointer to a structure containing the message. The structure can be somewhat similar to:
struct message {
TYPE msg_type;
void * message;
}
Where msg_type identifies the type of the message and void * message is the actual message or message pointer.
**Message contents can be:**
integer, a single or multiple (up to 3) strings or buffer.
**Message Types:**
NUMBER, DBGMESSAGE, MESSAGE, SOCKS for now. But make sure the program is structured in such a way allowing us to include more message types containing the above message contents.
The second C/C++ program must contain at least these functions:
PrepareMessage( ... );
SendMessage( ... );
ReadMessage( ... );
Which are similar to the first program.
If a SOCKS type message is send then the program should allow sending and receiving data using a client as a proxy (note that there can be many clients). Those functions could be:
SocksSend(int client_id, socket s, char * data);
SocksRecv(int client_id, socket s);
Both programs should work in a similar way and contain similar functions. Both must communicate flawlessly.