Completed

SOCKS5 User Authentication and IP Bind problem!

This project was successfully completed by vfeBrian for $30 USD in a day.

Get free quotes for a project like this
Employer working
Completed by:
Skills Required
Project Budget
$30 USD
Completed In
1 day
Total Bids
3
Project Description

My project working (without user authentication and with lan default ip)

[url removed, login to view] bind problem. i've several ip addresses. All of the incoming connections was bind to default ip. how can do bind any ip without default ip?
[url removed, login to view] i have used SOCKS_AUTH project confused.

any body help me? thanks
here is part of my code.

NetworkStream socksClientStream = [url removed, login to view]();
/*
* supported methods part
*/
byte[] authFields = new byte[2];
[url removed, login to view](authFields, 0, 2);
// read n supported methods
byte[] methods = new byte[authFields[1]];
[url removed, login to view](methods, 0, [url removed, login to view]);
/*
* method selection part
*/
byte[] selectedAuthMethod = { SOCKS_VERSION, SOCKS_NOAUTH };
[url removed, login to view](selectedAuthMethod, 0, 2);

// return version and auth method "no auth"

byte[] requestFields = new byte[4];
[url removed, login to view](requestFields, 0, 4);

// adresstypes ipv4 and hostname are supported
string connection_target = "";
int target_port;
if (requestFields[3] == SOCKS_IPV4ADDR )
{
//ip4v adress is requested
byte[] target_data = new byte[4];
[url removed, login to view](target_data, 0, 4);
IPAddress ip = new IPAddress(target_data);
connection_target = [url removed, login to view]();
}
else if (requestFields[3] == SOCKS_DNSNAME )
{

byte[] domainname_length = new byte[1];

[url removed, login to view](domainname_length, 0, 1);
byte[] target_data = new byte[domainname_length[0]];

[url removed, login to view](target_data, 0, domainname_length[0]);

connection_target = [url removed, login to view](target_data);
}
else
{
//unsupported addresstype

}

//if requested address is supported
if (connection_target != "")
{

/*
* server client connection part
*/


//doc: byteorder
byte[] bintargetport = new byte[2];
[url removed, login to view](bintargetport, 0, 2);
byte[] tmp_byteorder = new byte[2];
tmp_byteorder[0] = bintargetport[1];
tmp_byteorder[1] = bintargetport[0];
target_port = (int)[url removed, login to view](tmp_byteorder, 0);

serverClient = new TcpClient(connection_target, target_port);


/* **
* reply part
*/

if ([url removed, login to view])
{
// reply successful audience
byte[] reply = new byte[10];
//version
reply[0] = SOCKS_VERSION ;
// replycode
reply[1] = SOCKS_REPLYSUCCESS ;
//reserved and 0
reply[2] = 0;
// addresstype
reply[3] = 1;
string ip = [url removed, login to view]().Split(':')[0];
IPAddress ipaddr = [url removed, login to view](ip);
reply[4] = [url removed, login to view]()[0];
reply[5] = [url removed, login to view]()[1];
reply[6] = [url removed, login to view]()[2];
reply[7] = [url removed, login to view]()[3];
int port = [url removed, login to view]([url removed, login to view]().Split(':')[1]);

reply[8] = [url removed, login to view]((UInt16)port)[0];
reply[9] = [url removed, login to view]((UInt16)port)[1];
[url removed, login to view](reply, 0, 10);

/*
* tcp redirection
*/


NetworkStream serverClientStream = [url removed, login to view]();

bool ioError = false;


while ([url removed, login to view] && [url removed, login to view] && !ioError )
{
..
}

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online