Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 21:47

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Proxy Server DHKey Exchance

Discussion on Proxy Server DHKey Exchance within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2011
Posts: 98
Received Thanks: 12
Proxy Server DHKey Exchance

Hello, epvp
how are you guys???


i finally finished my proxy(not bot for now)
i maked the client merged (auth and game)
auth encryption is easy cause it doesnt need a dhkey

but my problem is in game encryption
i have lastest encryption and key
this the event or receiving game data
Code:
        public void OnSendToGame(ref byte[] data,bool toserver)
        {
            byte[] xdG = data;
                if (toserver)
                {
                    //client sending to server
                    ServerCrypt.Decrypt(xdG);
                    byte[] exdata = xdG;
                    if (Exchange && exdata.Length != 0)
                    {
                        Exchange = false;
                        File.AppendAllText(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\Packets\CS\" + "packet.txt", BitConverter.ToString(data).Replace("-", " ") + Environment.NewLine);
                        ushort position = 7;
                        uint PacketLen = BitConverter.ToUInt32(exdata, position);
                        position = (ushort)(position + 4);
                        int JunkLen = BitConverter.ToInt32(exdata, position);
                        position = (ushort)(position + 4);
                        position = (ushort)(position + ((ushort)JunkLen));
                        int Len = BitConverter.ToInt32(exdata, position);
                        position = (ushort)(position + 4);
                        byte[] pubKey = new byte[Len];
                        for (int x = 0; x < Len; x++)
                        {
                            pubKey[x] = exdata[x + position];
                        }
                        string PubKey = Encoding.UTF7.GetString(pubKey);
                        Program.MainForm.Log("ClientPublicKey:" + PubKey);
                        GameCrypt = DHKeyExchance.HandleClientKeyPacket(PubKey, GameCrypt);
                    }
                    else if(!Exchange && exdata.Length !=0)
                    {
                        ushort ID = BitConverter.ToUInt16(data, 2);
                    }
                    ServerCrypt.Encrypt(xdG);
                }
                else
                {
                    //server sending to client
                    GameCrypt.Decrypt(xdG);
                    byte[] exdata = xdG;
                    if (Exchange)
                    {
                                 File.AppendAllText(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\Packets\SC\" + "packet.txt", BitConverter.ToString(data).Replace("-", " ") + Environment.NewLine);
                               //  throw new NotImplementedException();
                    }
                    GameCrypt.Encrypt(xdG);
                }
            data = xdG;
        }
i have the DHKey Exchance for client
but i dont know how it works in server
can some one help me ??

how the server Exchange works ??
this is my problem, i already have the client exchange
tariqx111 is offline  
Old 03/07/2013, 16:43   #2
 
elite*gold: 0
Join Date: Jul 2011
Posts: 98
Received Thanks: 12
hmmmmm ?
tariqx111 is offline  
Old 03/07/2013, 21:52   #3
 
donn's Avatar
 
elite*gold: 0
Join Date: Jan 2007
Posts: 485
Received Thanks: 272
You don't even know what the code snippet you posted does.

You should look into GameCrypt.Encrypt(byte[]) and GameCrypt.Decrypt(byte[]) methods.
donn is offline  
Old 03/08/2013, 06:08   #4
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
after going throw the authentication process

server send p , g and public key to the proxy (as if it was sending it to the client)

proxy use that packet with server to auth with server and being able to encrypt/decrypt what it receive and send to the server

and in the same time proxy generates another private and public keys and send the public key , p and g to the client
once client reply to the proxy it takes the client public key and it figure out the private shared key

so basically you are man in the middle , you reply to the server and make common private shared key , and create a fake dh public key and use it with client to make another common private shared key
so now you will have 2 private shared keys , one with client and one with server
use one when receive from client to decrypt packets with the private shared key between proxy/client and edit them
then encrypt that packets by the private shared key of server/proxy and send to the server
on receiving from the server you decrypt it with the private shared key of proxy/server and so on


that's way far from the normal server-client , so leaching isn't really easy to be done unless you really know what you are doing
if you can't do it on your own then forget it cuz no proxy farmwork are up to date and it's not easy to copy from the source
but still everything is public tho
go for it is offline  
Old 03/08/2013, 08:40   #5
 
elite*gold: 0
Join Date: Jul 2011
Posts: 98
Received Thanks: 12
Quote:
Originally Posted by go for it View Post
after going throw the authentication process

server send p , g and public key to the proxy (as if it was sending it to the client)

proxy use that packet with server to auth with server and being able to encrypt/decrypt what it receive and send to the server

and in the same time proxy generates another private and public keys and send the public key , p and g to the client
once client reply to the proxy it takes the client public key and it figure out the private shared key

so basically you are man in the middle , you reply to the server and make common private shared key , and create a fake dh public key and use it with client to make another common private shared key
so now you will have 2 private shared keys , one with client and one with server
use one when receive from client to decrypt packets with the private shared key between proxy/client and edit them
then encrypt that packets by the private shared key of server/proxy and send to the server
on receiving from the server you decrypt it with the private shared key of proxy/server and so on


that's way far from the normal server-client , so leaching isn't really easy to be done unless you really know what you are doing
if you can't do it on your own then forget it cuz no proxy farmwork are up to date and it's not easy to copy from the source
but still everything is public tho
understand thank you.

Quote:
Originally Posted by go for it View Post
after going throw the authentication process

server send p , g and public key to the proxy (as if it was sending it to the client)

proxy use that packet with server to auth with server and being able to encrypt/decrypt what it receive and send to the server

and in the same time proxy generates another private and public keys and send the public key , p and g to the client
once client reply to the proxy it takes the client public key and it figure out the private shared key

so basically you are man in the middle , you reply to the server and make common private shared key , and create a fake dh public key and use it with client to make another common private shared key
so now you will have 2 private shared keys , one with client and one with server
use one when receive from client to decrypt packets with the private shared key between proxy/client and edit them
then encrypt that packets by the private shared key of server/proxy and send to the server
on receiving from the server you decrypt it with the private shared key of proxy/server and so on


that's way far from the normal server-client , so leaching isn't really easy to be done unless you really know what you are doing
if you can't do it on your own then forget it cuz no proxy farmwork are up to date and it's not easy to copy from the source
but still everything is public tho
i do as you say
this is the results:

LOG:
Code:
[AuthClient]Connected
[AuthServer]Connected
[AuthClient]Disconnected
[AuthServer]Disconnected
[GameClient]Connected
[GameServer]Connected
G: 05
P: A320A85EDD79171C341459E94807D71D39BB3B3F3B5161CA84894F3AC3FC7FEC317A2DDEC83B66D30C29261C6492643061AECFCF4A051816D7C359A6A7B7D8FB
ServerPublicKey:58F8D50519FCFA1B80C9DA608CBD776FCA2DB5A76437EF705EA8819DEC27B86CFA242A93887EEA8C3CCA997CA3510309535F2A492816ED6EF6E35840F5C4B53F
FAServerPublicKey:6113F5B0273489BFF430DFA7CA968EBCB03742084B5E14820BD6B647E4189DFBA6B49D176C056015BC49C4CA2EEF545CB4B360532A11D2FF10223E2732329E59
ClientPublicKey:4BD6FE4261E9A7E89BDCB909773000C69FC42A0F63AD684E7F0596C0E98AD2CBA3F6B272E4DB5BBCF9CE80246D4FD059362272EF35A84AC840ECBCFD0AC38B52
FAClientPublicKey:01DBADC8C1E41812240B42A18EBCBB3E80E9C775F872B58A02042B2A45472A58BFB88D7CB83F13A0F4FA08992B38FAC7924CDD36F2FB2BDAECDA02A766A54C98
[GameServer]Disconnected
Final Code :
Code:
        public void SetupCrypto()
        {
            try
            {
                BigNumber realClientPublicKey = BigNumber.FromHexString(ClientExchange.PublicKey);
                BigNumber realServerPublicKey = BigNumber.FromHexString(ServerExchange.PublicKey);
                GameCrypt.SetKey(GameCrypt.DH.ComputeKey(realClientPublicKey));
                ServerCrypt.SetKey(ServerCrypt.DH.ComputeKey(realServerPublicKey));
                GameCrypt.Blowfish.EncryptIV = this.ServerExchange.ClientIV;
                GameCrypt.Blowfish.DecryptIV = this.ServerExchange.ServerIV;
                ServerCrypt.Blowfish.EncryptIV = this.ServerExchange.ServerIV;
                ServerCrypt.Blowfish.DecryptIV = this.ServerExchange.ClientIV;
            }
            catch { }
        }
        public bool Exchange = true;
        public void OnSendToGame(ref byte[] data,bool toserver)
        {
            try
            {
                if (data.Length == 0)
                {
                    return;
                }
                byte[] Buffer = data;
                if (toserver)
                {
                    //client sending to server
                    byte[] exdata = Buffer;
                    if (Exchange && exdata.Length > 35)
                    {
                        Exchange = false;
                        ServerCrypt.Decrypt(exdata);
                        ClientExchange = new ClientExchange(exdata);
                        Program.MainForm.Log("ClientPublicKey:" + ClientExchange.PublicKey);
                        Log("FAClientPublicKey:" + GameCrypt.DH.PublicKey.ToHexString());
                        ClientExchange.Edit(exdata, GameCrypt.DH.PublicKey.ToHexString());
                        //ServerCrypt.Encrypt(exdata);
                        GameServer.Send(exdata);
                        skipPacket = true;
                        SetupCrypto();
                        return;

                    }
                    if (!Exchange && exdata.Length > 1)
                    {
                        ServerCrypt.Decrypt(Buffer);
                        ushort ID = BitConverter.ToUInt16(Buffer, 2);
                    }
                    ServerCrypt.Encrypt(Buffer);
                }
                else
                {
                    //server sending to client

                    byte[] exdata = Buffer;
                    if (Exchange)
                    {
                        GameCrypt.Decrypt(exdata);
                        ServerExchange = new ServerExchange(exdata);
                        Log("G: " + ServerExchange.G);
                        Log("P: " + ServerExchange.P);
                        this.GameCrypt.DH = new DH(BigNumber.FromHexString(this.ServerExchange.P), BigNumber.FromHexString(this.ServerExchange.G));
                        this.ServerCrypt.DH = new DH(BigNumber.FromHexString(this.ServerExchange.P), BigNumber.FromHexString(this.ServerExchange.G));
                        this.GameCrypt.DH.GenerateKeys();
                        this.ServerCrypt.DH.GenerateKeys();
                        this.ServerExchange.Edit(exdata, this.ServerCrypt.DH.PublicKey.ToHexString());
                        Program.MainForm.Log("ServerPublicKey:" + ServerExchange.PublicKey);
                        Log("FAServerPublicKey:" + ServerCrypt.DH.PublicKey.ToHexString());
                        skipPacket = true;
                        //GameCrypt.Encrypt(exdata);
                        GameClient.Send(exdata);
                        return;
                    }
                    if (!Exchange && exdata.Length > 1)
                    {
                        GameCrypt.Decrypt(Buffer);
                        ushort ID = BitConverter.ToUInt16(Buffer, 2);
                    }
                    GameCrypt.Encrypt(Buffer);
                }
                data = Buffer;
            }
            catch (Exception e)
            {
                Log("OnSendToGame:" + e + "");
                GameServer.Disconnect(false);
                GameClient.Disconnect(false);
                GameServer = null;
                GameClient = null;
                Program.MainForm.server.DoOnDisconnected(this,"[GameServer + GameClient]");
            }
        }
        ServerExchange ServerExchange;
        ClientExchange ClientExchange;
Conquer freeze in logging in game server

What is the problem ?
what i need to update ?
tariqx111 is offline  
Old 03/08/2013, 13:35   #6
 
donn's Avatar
 
elite*gold: 0
Join Date: Jan 2007
Posts: 485
Received Thanks: 272
Stop leeching ProxyParadise source code. You will never be able to update it without basic knowledges in programming, packets and encryption.

Client is freezing on login because encryption is not updated in ProxyParadise. You should do it, all the required info is released.
donn is offline  
Thanks
1 User
Old 03/08/2013, 14:30   #7
 
elite*gold: 0
Join Date: Jul 2011
Posts: 98
Received Thanks: 12
Quote:
Originally Posted by donn View Post
Stop leeching ProxyParadise source code. You will never be able to update it without basic knowledges in programming, packets and encryption.

Client is freezing on login because encryption is not updated in ProxyParadise. You should do it, all the required info is released.
stop replying if you dont want to help this encryption is not from proxyparadise and pro4never is sharing the code
i just use proxy phoneix dh key exchange
and the encryption is from arabic conquer server source(the proxy is for arabic co)
most code is by me
socket,merged client,server,packet handler........
and other things is public and if pro4never or any one other dont want i use him code
just say to me and i wont....sorry
i also tried to use this :
on english co(to know if the problem is from arabic cryptography) and i got Unable to read beyond the end of the stream.....sorry again donn

edit : some time he dont give Unable to read beyond the end of the stream. give me the information then disconnect
tariqx111 is offline  
Old 03/19/2013, 12:52   #8
 
elite*gold: 0
Join Date: Jan 2007
Posts: 118
Received Thanks: 20
All of the information were given already on this forum and if you don't know how to use or find it then you don't deserve to have your own proxy.
xmen01235 is offline  
Reply


Similar Threads Similar Threads
[HOT] Ghost 1.1 Beta.Proxy IPgrabber,Hidemyass.com HMA Proxy-Tool,Nice,Free
12/11/2013 - Coding Releases - 6 Replies
]Hab nun seit langem an meinen Ghost! Proxy-Tool weiter gefeilt, ist eig nichts besonderes draus geworden, deshalb ist es ne Beta für die eig. 1.1 :P - nun kannst du dir Freshe IP:PORT's von Hide My Ass! Free Proxy and Privacy Tools - Surf The Web Anonymously ziehen und die auch gleich verwenden, natürlich kannst du auch deinen Favoriten manuell eingeben(siehe bild) - links führen zu hidemyass.com, geoiptool.comund speedtest.net - Proxy-Liste kannst du speichern - Lock, verhindert das...
[Important]Needed Update For DHKey For ProxyParadise .
09/15/2012 - Conquer Online 2 - 11 Replies
Hello Guys, Am Here Today To Ask Any Body To Upgrade DH-Key and Add MD5 To Proxy Paradise Pro4Never's Proxy To work on The Latest Co Client That's Will Be Very Useful , I Have Tried Many Times But I Couldn't When I go For Log In It Disconnects From Game Server ... So Please Do It As My First Request Here In Forum ... I Attached The Source Code In Topic .. All Rights Go To Pro4Never I didn't Do Any Thing . Thanks For Your Time ... Samuel .
MYSRO EXCHANCE BUG !!!
01/19/2010 - SRO Private Server - 8 Replies
Guys now any pserver get full bug... i sell reverse in exchance and turk cancel trade after press approve my reverse disapear and i dont get my money ; o .... realy its very suck now...:/ i think you know what i wanna say.;) THX FOR ATTENTION :p SORRY FOR BAD ENGLISH I STILL LEARNING. @edit



All times are GMT +1. The time now is 21:47.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.