*HOT* Packet Encryption - Decrypt/ReEncrypt HowTo

08/06/2005 19:31 (GAME)Master#61
Quote:
Originally posted by Lowfyr+Jan 11 2005, 20:12--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (Lowfyr @ Jan 11 2005, 20:12)</td></tr><tr><td id='QUOTE'> all lvl2 epvp Members quitted playing Conquer Online, so we release our Packet Encryption Guide, I hope it is usefull for all AGH's out there

Urheberrechte und Copyright dieser Guide liegen bei elitepvpers.com

You will not use any information obtained from this guide for malicious purposes.
All information from this guide is for intellectual purposes only, and you are responsible for how you use it.

This guide may only be posted on the elitepvpers network, so if you see it anywhere else, please let me know about it.

Posted on: Nov 8 2004

Contact me for copy & paste permission
DO NOT PM ME, if you want to know how to make hacks with these informations


Update:

<!--QuoteBegin--Ultima

one month after the guide came out they made litle change in the firs packet you recive its now 32 bytes long not 28 like in the guide and for the key you have to start taking the keys now at the 5th position not the 4th thats all they won`t patch anything cause its most likeley to complex and they don`t even make money with conquer only with the dbs so i dont think the ll make anything
Guide zur Conqueronline packet Ver- und Entschlüsselung

Inhalt:

1. Die Schlüssel
a. Allgemein
b. Die beiden ersten Schlüssel
c. Erstellen des 3. und 4. Schlüssels

2. Entschlüsseln von Paketen
a. Die Zähler
b. Das entschlüsseln von Empfangenen Paketen
c. Das entschlüsseln von "vom Client gesendeten Paketen"

3. Das Ver- und Entschlüsseln als Server


Die Schlüssel

Allgemein

Es werden 4 Schlüssel für die Conquer Verschlüsselung benutzt. Eigentlich sind es nur zwei. Diese zwei werden jedoch, nach dem Anmelden am Login Server, durch 2, vom Server gesendete Schlüssel, Verschlüsselt und als neue Schlüssel für die ausgehenden Pakete benutzt. So entstehen 4 Schlüssel.

Die beiden ersten Schlüssel:

1. Schlüssel

Code:
9D 90 83 8A D1 8C E7 F6 25 28 EB 82 99 64 8F 2E
2D 40 D3 FA E1 BC B7 E6 B5 D8 3B F2 A9 94 5F 1E
BD F0 23 6A F1 EC 87 D6 45 88 8B 62 B9 C4 2F 0E
4D A0 73 DA 01 1C 57 C6 D5 38 DB D2 C9 F4 FF FE
DD 50 C3 4A 11 4C 27 B6 65 E8 2B 42 D9 24 CF EE
6D 00 13 BA 21 7C F7 A6 F5 98 7B B2 E9 54 9F DE
FD B0 63 2A 31 AC C7 96 85 48 CB 22 F9 84 6F CE
8D 60 B3 9A 41 DC 97 86 15 F8 1B 92 09 B4 3F BE
1D 10 03 0A 51 0C 67 76 A5 A8 6B 02 19 E4 0F AE
AD C0 53 7A 61 3C 37 66 35 58 BB 72 29 14 DF 9E
3D 70 A3 EA 71 6C 07 56 C5 08 0B E2 39 44 AF 8E
CD 20 F3 5A 81 9C D7 46 55 B8 5B 52 49 74 7F 7E
5D D0 43 CA 91 CC A7 36 E5 68 AB C2 59 A4 4F 6E
ED 80 93 3A A1 FC 77 26 75 18 FB 32 69 D4 1F 5E
7D 30 E3 AA B1 2C 47 16 05 C8 4B A2 79 04 EF 4E
0D E0 33 1A C1 5C 17 06 95 78 9B 12 89 34 BF 3E

2. Schlüssel

Code:
62 4F E8 15 DE EB 04 91 1A C7 E0 4D 16 E3 7C 49
D2 3F D8 85 4E DB F4 01 8A B7 D0 BD 86 D3 6C B9
42 2F C8 F5 BE CB E4 71 FA A7 C0 2D F6 C3 5C 29 
B2 1F B8 65 2E BB D4 E1 6A 97 B0 9D 66 B3 4C 99
22 0F A8 D5 9E AB C4 51 DA 87 A0 0D D6 A3 3C 09
92 FF 98 45 0E 9B B4 C1 4A 77 90 7D 46 93 2C 79
02 EF 88 B5 7E 8B A4 31 BA 67 80 ED B6 83 1C E9
72 DF 78 25 EE 7B 94 A1 2A 57 70 5D 26 73 0C 59
E2 CF 68 95 5E 6B 84 11 9A 47 60 CD 96 63 FC C9
52 BF 58 05 CE 5B 74 81 0A 37 50 3D 06 53 EC 39
C2 AF 48 75 3E 4B 64 F1 7A 27 40 AD 76 43 DC A9
32 9F 38 E5 AE 3B 54 61 EA 17 30 1D E6 33 CC 19
A2 8F 28 55 1E 2B 44 D1 5A 07 20 8D 56 23 BC 89
12 7F 18 C5 8E 1B 34 41 CA F7 10 FD C6 13 AC F9
82 6F 08 35 FE 0B 24 B1 3A E7 00 6D 36 03 9C 69
F2 5F F8 A5 6E FB 14 21 AA D7 F0 DD A6 F3 8C D9

Erstellen des 3. und 4. Schlüssels:

Den dritten und vierten Schlüssel erhält man indem man den ersten und zweiten Schlüssel, mit dem vom Server gesendeten Schlüsseln, Verschlüsselt.
Der Schlüssel dafür ist im ersten Packet das man nach dem Senden des Login Paketes erhält. Also genau das 2. Paket überhaupt.

Das Packet mit dem Schlüssel sieht wie folgt aus:

Code:
*** RECV - size&#58; 28
1C 00 1C 04 2E A6 44 00 F4 48 5C 20 36 34 2E 31 * * . ..¦D.ôH&#092; 64.1
35 31 2E 38 31 2E 32 30 34 00 00 00 * * * * * * * * * * 51.81.204...
Key im Empfangenen packet sind das 11. + 10. + 9. + 8. byte vom start aus.
Hier also: 20 5C 48 F4

Der 2. Key sind das 7. + 6. + 5. + 4. byte im packet.
Hier also: 00 44 A6 2E

Um nun den dritten und vierten Schlüssel zu erhalten muss folgendes getan werden

1. Man addiere Key 1 und 2 205C48F4 + 0044A62E = 20A0EF22
2. XOR Ergebnis aus 1. mit 4321 XOR 20A0EF22, 4321 = 20A0AC03
3. XOR Key 1 mit Ergebnis aus 2. XOR 205C48F4, 20A0AC03 = 00FCE4F7
4. IMUL Ergebnis 3 mit Ergebnis 3 IMUL FCE4F7, FCE4F7 = F9D39310E651
(Logische Multiplikation // Ergebnis nur 4 byte lang also 9310E651)

Um nun den 3. und 4. Schlüssel richtig zu erzeugen muss noch folgendes getan werden
Immer 4 byte des 1. Schlüssels mit dem Ergebnis aus 3. per XOR erzeugen also:

Die ersten 4 byte des 1. Schlüssels (verkehrt herum Original: 9D 90 83 8A):
8A 83 90 9D

Mit dem Ergebnis aus 3.
00 FC E4 F7

Das Ergebnis
8A 7F 74 6A

Das Ergebnis muss auch Falschrum gewertet werden. Also die ersten 4 byte des Schlüssels lauten nun:

6A 74 7F 8A

Das wiederholt man bis das erste Schlüssel komplett umgewandelt ist.

Den 2. Schlüssel muss man nach dem gleichen Muster umwandeln nur mit dem Unterschied das als schlüssel nicht das Ergebnis aus 3. benutzt wird sondern das aus 4.

Die ersten 4 byte des 2. Schlüssels (verkehrt herum Original: 62 4F E8 15):
15 E8 4F 62

Mit dem Ergebnis aus 4.
93 10 E6 51

Das Ergebnis
86 F8 A9 33
Das Ergebnis muss auch Falschrum gewertet werden. Also die ersten 4 byte des Schlüssels lauten nun:

33 A9 F8 86

Nun hat man den 3. und 4. Schlüssel die für das Versenden von Paketen benötigt werden.


Entschlüsseln von Paketen:

Die Zähler

Um die Verschlüsselten Pakete zu entschlüsseln benötigt man die vier 256 byte Schlüssel die ich eben vorgestellt habe.
Um Pakete zu entschlüsseln die man vom Server zugesandt bekommt braucht man den 1. und 2. Schlüssel. Für Pakete die der Client zum Server Sendet benötigt man den 3. und 4. Schlüssel.
Es muss zwischen Login und Spiele Server unterschieden werden. Nicht aber weil die art der Entschlüsselung unterschiedlich ist sondern weil es Insgesamt 4 Zähler gibt. 2 für die Gesendeten Pakete und 2 für die Empfangenen Pakete. Diese 4 Zähler werden zu beginn alle auf 00 gesetzt. Die Pakete werden immer byte weise ver- und entschlüsselt. Nach jedem byte das ver- oder entschlüsselt wird wird der entsprechend erste Zähler um 1 erhöht. Erreicht einer der ersten beiden Zähler FF und wird um 1 erhöht so wird dieser auf 00 gesetzt und der entsprechend 2. Zähler um 1 erhöht. Hat auch dieser den Wert FF und wird erhöht so werden beide Zähler auf 00 gesetzt.
Es gibt für Login und Spiele Server jeweils 4 Zähler.

Wofür man die Zähler eigentlich braucht? Wartet es ab das folgt nun.


Das Entschlüsseln von Empfangenen Paketen

So nun zum verschlüsseln an sich. Es läuft in 4 schritten ab.

Als Beispiel nehmen wir das Login Paket das der Client an den Login Server sendet.

Unverschlüsseltes Paket:
Code:
34 00 1B 04 54 65 73 74 54 65 73 74 00 00 00 00 00 00 00 00 51 15 EE 1B 19 45 2C 6E 5C 01 5C 41 56 25 F6 D7 45 61 67 6C 65 00 00 00 00 00 00 00 00 00 00 00
Verschlüsseltes Paket:
Code:
17 84 04 65 D5 13 C4 A5 9A 59 04 E2 14 CB 75 6F 5F 89 B0 22 86 17 18 52 47 54 FC 44 D2 D4 BD 78 33 D0 D0 56 C6 55 83 26 8F 05 35 AB 16 C1 7F 6D 59 87 BA 20
1. XOR von zu verschlüsselnden byte und dem X-ten byte des schlüssels (x = 1. Zähler)

XOR 34, 9D ---> A9

2. Das Ergebnis von eben wird mit dem N-ten byte des 2. schlüssels per XOR verschlüsselt
(N = 2. Zähler)

XOR A9, 62 ---> CB


3. Das Ergebnis wird nun umgedreht.

CB wird zu BC (CB -> BC)


4. Das Ergebnis von 3. wird nun per XOR mit AB verschlüsselt und fertig.

XOR ESI, 0AB ---> 17

Dies wird nun für das gesamte Paket wiederholt. Nach jedem byte das verschlüsselt wurde wird der erste Zähler erhöht. Nach 256 byte wird der 2. Zähler um 1 erhöht. Nach 65536 byte werden beide Zähler auf Null gesetzt und der Spaß fängt von vorne an. Nach dem Anmelden Am Login Server beginnt das Zählen bei 00 sobald die Kommunikation mit dem Spiele Server beginnt.

Das Entschlüsseln von ?Vom Client Gesendeten Paketen?

Um Pakete die der Client an den Server sendet entschlüsseln zu können muss dasselbe Verfahren angewendet werden wie zum Entschlüsseln von Empfangenen Paketen nur Andersrum.

Also:

1. XOR byte Packet, AB

2. E1 umkehren

3. XOR E2, 62

4. XOR E3, 9D

(E1, E2, E3 = Ergebnis von 1., 2. und 3.)


Ver- und Entschlüsselung als Server

Wenn wir einen Server aufsetzen wollen, müssen wir dieselben Ver- und Entschlüsselungsprozeduren benutzen wie für den Client jedoch jeweils andersrum. Die Schlüssel bleiben alle gleich. Jeder Spieler erhält vom Server einen Individuellen Schlüssel mit dem der Client seine Pakete verschlüsselt ehe er sie an den Server Sendet. [/b][/quote]
could u explain this in english pls
08/06/2005 19:35 Nx²#62
ich versteh kein wort :D
08/06/2005 23:08 Ultima#63
the englisch version of this is just a few posts below this or go ---> [Only registered and activated users can see links. Click Here To Register...] <---
08/07/2005 18:46 lildevils666#64
thnx u
08/16/2005 12:39 krazynayba#65
umm, yeh sounds interesting but your all forgetting the point. What the hell is the point of making your own server?
i cant really think of one
08/16/2005 14:01 Ultima#66
Quote:
Originally posted by krazynayba@Aug 16 2005, 12:39
umm, yeh sounds interesting but your all forgetting the point. What the hell is the point of making your own server?
i cant really think of one
own server so you can play with friends at home on a lan party with lvl 120 chars in you own self made co world ;)

but the main purpose for the packet decryption is to be able to send your own packets without the need for the original co client like the new bjx bot ;)
09/12/2005 06:22 nightmarepaladin#67
yea, can you tell me what is
XOR and that imul thing? I am noob in game hacking, but i am willing ot learn.
11/16/2005 17:21 Ultima#68
Quote:
Originally posted by nightmarepaladin@Sep 12 2005, 05:22
yea, can you tell me what is
XOR and that imul thing? I am noob in game hacking, but i am willing ot learn.
XOR = Exclusiv OR

Code:
Table&#58;
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0
imul = multiplication with sign
(so it means out normal mathematical multiplication rules are applyed)

1*1=1
1*(-1)=-1
-1*1=-1
-1*(-1)=1

if its not with sign
(the normal multiplication rules are not applyed)

-1*1=1 instead of -1*1=-1

i posted a asm reference my post is in german but if i remember correct the guide is in english


[Only registered and activated users can see links. Click Here To Register...]
01/14/2006 19:11 Lurker3#69
2 quick questions:

1) Does this still work with 2.0 (the same keys/methods, etc)

[Edit]
New info:
First Login packet (Client->Server) decrypted so guess it still works...
...now to generate the "Server->Client" key and add a proxy to the new CryptoLib class :)
[/Edit]

2) Does anyone have a working program to display decrypted info?

Im considering adding a module to the vb.net BotResourcePackage for packet decryption/encryption (proxy).

[Edit]
Following section removed, please ignore:
Im on my way out atm but will do some testing later with Ethereal... if anyone knows for sure about the 2 above questions then please lemme know & it might save me a little work :)
[/Edit]
07/20/2006 19:46 jackyyll#70
Can anyone maybe explain how to find the two fixed keys? I want to try applying this to another game.
08/02/2006 15:31 HFMuRdOc#71
Quote:
Originally posted by Ultima@Nov 16 2005, 18:21
XOR = Exclusiv OR

Code:
Table&#58;
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0
This part i understood from wikipedia, what i don't get is how to apply it in hex. are we supposed to pass the hex numbers to binary and then aply xor and hex the result?
08/02/2006 15:36 tester#72
Quote:
Originally posted by HFMuRdOc+Aug 2 2006, 15:31--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (HFMuRdOc @ Aug 2 2006, 15:31)</td></tr><tr><td id='QUOTE'> <!--QuoteBegin--Ultima@Nov 16 2005, 18:21
XOR = Exclusiv OR

Code:
Table&#58;
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0
This part i understood from wikipedia, what i don't get is how to apply it in hex. are we supposed to pass the hex numbers to binary and then aply xor and hex the result? [/b][/quote]
You can xor the bytes it will do all the work for you so tmpByte(0) XOr tmpByte(1) will work, None of the programming languages I have used have ever had a Type for HEX as its just a numeric anyway. Convert you Hex to Int or byte and perform the xor on that
08/02/2006 15:49 HFMuRdOc#73
Quote:
Originally posted by tester+Aug 2 2006, 15:36--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (tester @ Aug 2 2006, 15:36)</td></tr><tr><td id='QUOTE'>
Quote:
Originally posted by -HFMuRdOc@Aug 2 2006, 15:31
<!--QuoteBegin--Ultima
Quote:
@Nov 16 2005, 18:21
XOR = Exclusiv OR

Code:
Table&#58;
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0

This part i understood from wikipedia, what i don't get is how to apply it in hex. are we supposed to pass the hex numbers to binary and then aply xor and hex the result?
You can xor the bytes it will do all the work for you so tmpByte(0) XOr tmpByte(1) will work, None of the programming languages I have used have ever had a Type for HEX as its just a numeric anyway. Convert you Hex to Int or byte and perform the xor on that [/b][/quote]
oh, so u'r actually applying xor using a programming language. i thought u we're doing it manually. Okay, i guess now i can make the keys. Another thing I dont get: this tut explains how to encrypt received packets. aren't they supposed to be encrypted already? :s

"- To decrypt the packets wich you get from the server you need the 1st and the 2nd key."

ok, got everything from here xept this:

"step 4

finally you have to encrypt (XOR) the result from step 3 with AB.

XOR ESI, 0AB ---> 17"

but the result from step 3 is BC not ESI :|
08/02/2006 16:33 tester#74
they are encrypted already, you could write a proxy that simple relayed the packets from the client - > server and vice versa. The reason for doing all this is so you can intercept the packet modify it and relay it.

You just XOR the result by 171 or AB

so as an example:

myBtye=myBtye XOR Key1(Counter1)
myBtye=myByte XOR Key2(Counter2)
myBtye=ReverseString(ConvertToHex(myByte))
myBtye=myBtye XOR 171
08/02/2006 19:32 HFMuRdOc#75
so... to decrypt packet:

D3 33 EF AD FB E3 7D 21 7A FB E8 05 A6 EF F4 C9 3F F3 E0 6D FE 77 2C 71 1A 8B 58 D5

i'd have to do:

Code:
11010011 -> D3
10101011 -> AB
= 01111000 -> 78

78 -> 87

10000111 -> 87
01100010 -> 62
= 11100101 -> E5

11100101 -> E5
10011101 -> 9D
= 01111000 -> 78



00110011 -> 33
10101011 -> AB
= 10011000 -> 98

98 -> 89

10001001 -> 89
01100010 -> 62
= 11101011 -> EB

11101011 -> EB
10010000 -> 90
= 01111011 -> 7B
and so forth with the following bytes of keys and code?