NosTale Protocol Question

07/12/2017 19:16 Nokis97#1
I'm trying to make a clientless bot but i'm stucked with the game server connection. I've made the login packet (encrypt/decrypt/hash/version) and it works correctly, in fact the server responds with NsTeST packet.

But now? What am I supposed to do? What I understood is that the first parameter of NsTeST is the session number, required to make a login request to the game server by sending it and then send id and pw but I can't understand what's the difference between sessionEncryption and GamePacketEncryption and I dont know which one I have to use.

Can someone explain me how the connection with the game server works step by step and whats the difference between the two encryptions?

Thanks and sorry for bad english.
07/12/2017 19:17 PMasta#2
I haven't tried to do client-side login but maybe inject a packetlogger before logging in and try to login with few different parameters so you can distuingish what is what?
07/12/2017 19:17 Pumba98#3
encrypt the sessionNumber with sessionEncryption and ID and PW with GamePacketEncryption...

Edit:
Which Crypto do you use?
Use this [Only registered and activated users can see links. Click Here To Register...]
07/12/2017 19:36 Nokis97#4
Quote:
Originally Posted by Pumba98 View Post
encrypt the sessionNumber with sessionEncryption and ID and PW with GamePacketEncryption...

Edit:
Which Crypto do you use?
Use this [Only registered and activated users can see links. Click Here To Register...]
Thank you so much for the fast reply!

I've translated that entire crypto to NodeJS because I would like to make an online tool for NosTale.

Another question. I've understood that I have to send 2 packets during the login to the game server: first the session encrypted and then a second packet "ID|PW" encrypted. Am I right?
07/12/2017 20:40 DarkyZShadow#5
Quote:
Originally Posted by Nokis97 View Post
Thank you so much for the fast reply!

I've translated that entire crypto to NodeJS because I would like to make an online tool for NosTale.

Another question. I've understood that I have to send 2 packets during the login to the game server: first the session encrypted and then a second packet "ID|PW" encrypted. Am I right?
No, as I recall, 3 packets are send:
- Session
- Username
- Password

Best regards,
A random developer
07/12/2017 22:08 WalrossGreat#6
Just open packetlogger and a real game and you will know everything
07/13/2017 15:18 Nokis97#7
I did it, thanks to all

P.S: I have only a bug with the decryption of char "\n" but that's not a big problem


EDIT:
Quote:
Originally Posted by DarkyZShadow View Post
No, as I recall, 3 packets are send:
- Session
- Username
- Password

Best regards,
A random developer
For disclosure purpose that's how the game server auth works:
Only 2 packets are sent

PHP Code:
firstAuthPacket sessionEncrypt(session); //First packet is the session encrypted
sleep(1000); //You have to sleep 1 second
secondAuthPacket encryptGamePacket(user) + "|" encryptGamePacket(pass); // Send the second packet ID|PW 
07/13/2017 16:43 DarkyZShadow#8
Quote:
Originally Posted by Nokis97 View Post
I did it, thanks to all
P.S: I have only a bug with the decryption of char "\n" but that's not a big problem

EDIT:

For disclosure purpose that's how the game server auth works:
Only 2 packets are sent

PHP Code:
firstAuthPacket sessionEncrypt(session); //First packet is the session encrypted
sleep(1000); //You have to sleep 1 second
secondAuthPacket encryptGamePacket(user) + "|" encryptGamePacket(pass); // Send the second packet ID|PW 
My current C++ code (working on the official FR server) :
Code:
packet = Crypto::encryptWorldPacket(to_string(session_id), session_id, true);
::send(this->sock, packet.c_str(), packet.size(), 0);
Sleep(200);
send(user_conf.username, session_id);
send(user_conf.password, session_id);

Edit (Packet logger output) :


Best regards,
A random developer
07/13/2017 17:05 Nokis97#9
Quote:
Originally Posted by DarkyZShadow View Post
My current C++ code (working on the official FR server) :
Code:
packet = Crypto::encryptWorldPacket(to_string(session_id), session_id, true);
::send(this->sock, packet.c_str(), packet.size(), 0);
Sleep(200);
send(user_conf.username, session_id);
send(user_conf.password, session_id);

Edit (Packet logger output) :


Best regards,
A random developer
I dare say that it works in both ways.
11/03/2017 23:47 olekolekolek#10
Hi. Is this still working? I can't encrypt this session id, but much more likely that it is my fault.
So i login to this NsTeST server and get first number(for example 26053).
Now I should encrypt session id and send it but which function i should use?
I tried all of them and still can't get similiar result to that packet when i login through game client.
When I look at sent data on wireshark i can see 2 sent packets.
First one is like "9a 99 e4 xx xx xx xx xx" , generally is always similiar and looks like this, just a few changes.
second is my nickname and password, after decryption it looks like this: "1451(some random number, i believe i can just generate it and then increase by one) my_nickname1452 my_password".
But this first packet is the only that I can't decrypt. I believe it's this 26053 number but what kind of encryption i need to use to encrypt it properly? Thanks for help :p
11/04/2017 00:31 Pumba98#11
Quote:
Originally Posted by olekolekolek View Post
Hi. Is this still working? I can't encrypt this session id, but much more likely that it is my fault.
So i login to this NsTeST server and get first number(for example 26053).
Now I should encrypt session id and send it but which function i should use?
I tried all of them and still can't get similiar result to that packet when i login through game client.
When I look at sent data on wireshark i can see 2 sent packets.
First one is like "9a 99 e4 xx xx xx xx xx" , generally is always similiar and looks like this, just a few changes.
second is my nickname and password, after decryption it looks like this: "1451(some random number, i believe i can just generate it and then increase by one) my_nickname1452 my_password".
But this first packet is the only that I can't decrypt. I believe it's this 26053 number but what kind of encryption i need to use to encrypt it properly? Thanks for help :p
just use the encryptGamePacket with is_session_packet = true
11/04/2017 16:03 olekolekolek#12
Quote:
Originally Posted by Pumba98 View Post
just use the encryptGamePacket with is_session_packet = true
Thanks, i just forgot to add id packet to this packet with session id :D
12/28/2019 14:47 kurverwalter#13
Hello, would you mind sharing your NodeJS code? I have a really hard time understanding the package loggers in this forum since they are all written in c++ :(.
12/28/2019 15:23 Roxeez#14
Quote:
Originally Posted by kurverwalter View Post
Hello, would you mind sharing your NodeJS code? I have a really hard time understanding the package loggers in this forum since they are all written in c++ :(.
[Only registered and activated users can see links. Click Here To Register...]