Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 18:36

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

Advertisement



Change in obtaining token protocol.

Discussion on Change in obtaining token protocol. within the Nostale forum part of the MMORPGs category.

Reply
 
Old 02/10/2021, 11:40   #16
 
ZaKuHD's Avatar
 
elite*gold: 0
Join Date: Mar 2015
Posts: 12
Received Thanks: 7
Quote:
Originally Posted by Apourtartt View Post
Oh sorry, did not noticed that the user agent value was changing ! mb
Same about the guid, I thought it had to be registered because of my first assumption.

Well, so here we go, I reversed it I found it out :
get platformGameUserId, sha1 it, store it
get installationid (also known as gfuid), sha256 it and store it
get chromeversion (the "C2.1.22.784"), sha1 it and store it
get the encryption key (currently : "edd76c5219499d00da2c5a9e2b703c03d5aaf67d1f16c7ecd 3165869921148f7", will maybe change, or maybe it's generated, will take a look later)

then mix it all up together :
pre_code = encryptionKey + chromeversion + install + platform
pre_code = sha256(pre_code)
code = 2 first character of platformGameUserId not crypted + 8 first character from pre_code

here you go

if you want a poc :

btw razzort, you're receiving "not allowed to create code" because the request has a lifetime
You are almost right but not quite, with Xeno's help I've reverse-engineered the entire function and the first thing to point out is that it does not use the chrome version but in fact the gameforge client version - you can extract it from the exe. The second thing is that the string which you called the encryption key is actually a hash of a portion of the gameforge client certificate which is embedded in the exe. You can obtain it by using Xeno's (but you need to extract it by hand since the tool doesn't have an extract function yet). After you got the certificate you need to decrypt it using this password:
Then you take the first certificate from the exported p12 (there are 2 of them but only the first is used here) save it to the file and set the line endings to "LF" (it's important). This file is your "hashCertificate" used to generate the account hash. The third thing is that the algorithm in some cases actually swaps the sha1 for sha256 and vice versa. That depends on the first number from the installation id.

To generate the hash itself you need to do this:
Code:
const firstNumber = getFirstNumberFromString(installationID);

if (firstNumber == undefined || firstNumber % 2 === 0) {
	return (
		accountID.substr(0, 2) +
		getStringFromLeft(
			sha256(
				sha256(hashCertificate) +
					sha1(getCharFromType(CharType.RETURN_C) + clientVersion.version) +
					sha256(installationID) +
					sha1(accountID)
			),
			8
		)
	);
} else {
	return (
		accountID.substr(0, 2) +
		getStringFromRight(
			sha256(
				sha1(hashCertificate) +
					sha256(getCharFromType(CharType.RETURN_C) + clientVersion.version) +
					sha1(installationID) +
					sha256(accountID)
			),
			8
		)
	);
}
Where getCharFromType simply returns "C" on production. This will generate you a correct hash but... that's not all. The endpoint that generates codes is also protected and requires tricking gameforge into thinking that you have the launcher open, otherwise it won't work. We can do that fairly simple, just send a POST request to with this body:
Code:
{
	client_installation_id: installationId,
	client_locale: "usa_eng",
	client_session_id: random_uuid(),
	client_version_info: {
		branch: clientVersion.branch,
		commit_id: clientVersion.commitId,
		version: clientVersion.version,
	},
	id: 1,
	localtime: Date.now().toFormat("yyyy-MM-dd'T'HH:mm:ssZZZ"),
	start_count: 1,
	start_time: 7000,
	type: "start_time",
}
You can notice here that the client_version_info object has things like branch and commitId. You can easily extract them from the gfclient.exe itself.
Note that unlocking the endpoint only works for the same IP address as the request origin so both event and code request need to be sent from the same host.
ZaKuHD is offline  
Thanks
7 Users
Old 02/10/2021, 11:44   #17

 
imXeno's Avatar
 
elite*gold: 40
Join Date: Jan 2016
Posts: 13
Received Thanks: 54
It is also worth noting that requires client SSL authentication with the mentioned gameforge client certificate. Otherwise you'll get ERR_BAD_SSL_CLIENT_AUTH_CERT in response.
imXeno is offline  
Thanks
5 Users
Old 02/12/2021, 23:43   #18
 
elite*gold: 0
Join Date: Oct 2018
Posts: 257
Received Thanks: 207
Nearly finished :
I guess the readme will be enough

Thing missing is the use of the p12 file when sending the events2 request

+ Walross updated this :
Apourtartt is offline  
Thanks
1 User
Old 02/16/2021, 16:27   #19
 
ZaKuHD's Avatar
 
elite*gold: 0
Join Date: Mar 2015
Posts: 12
Received Thanks: 7
Quote:
Originally Posted by Apourtartt View Post
Nearly finished :
I guess the readme will be enough

Thing missing is the use of the p12 file when sending the events2 request

+ Walross updated this :
I've recently open-sourced two of my tools regarding GF's login, one for and one for .

It's worth noting that in my login tool you need to provide the certificate and password yourself because from a legal perspective it is a bad idea to store it in a public repository.
ZaKuHD is offline  
Old 02/24/2021, 20:45   #20
 
elite*gold: 0
Join Date: Oct 2018
Posts: 257
Received Thanks: 207
Walross updated his NosTale-Auth repo and seems working :
Apourtartt is offline  
Old 02/26/2021, 21:15   #21
 
ZaKuHD's Avatar
 
elite*gold: 0
Join Date: Mar 2015
Posts: 12
Received Thanks: 7
Quote:
Originally Posted by Apourtartt View Post
Walross updated his NosTale-Auth repo and seems working :
His code is full of hardcoded values, that will stop working the second a new update comes in. On the other hand tools that I've provided allow for almost undisturbed use, given that the certificate didn't changed.
ZaKuHD is offline  
Old 04/15/2022, 13:36   #22
 
elite*gold: 0
Join Date: Oct 2021
Posts: 33
Received Thanks: 1
@ Certificate expired :v
bledior is offline  
Reply


Similar Threads Similar Threads
Token and Protocol Finder
01/14/2009 - Lin2 Exploits, Hacks, Bots, Tools & Macros - 34 Replies
Hi all!! Cause so many ppl want to know how to find out the token of L2 here is a very nice tool: The Token Finder!!! :D How to use - step by step: 1st: UnRAR the Archive. (best would be: /system) 2nd: -If u use C1, C2, C3 u should run EngEXT_ME.exe (with the Chronicle-thing im not sure - try to use both) Then press "Search" (if there is an error engine.dll not found] copy the EngExt_ME.exe into the /system) -If u use C4 run EngExt_FE.exe . Klick "Open" . Then open the...
Engine.dll from wrath - getting the right token and server protocol - IMPOSSIBLE!
10/24/2007 - Lineage 2 - 1 Replies
Hello, Getting the token and protocol server from the engine.dll, that I was trying to do... nothing, it seems to be impossible.:mad: I've found all kind of advices,tutorials, guides... NOTHING.:eek: If some one could find out the token and protocol version please share it with me, PM or Smth. So.. need a coder.. pls help. :D Thanks.
What protocol version for L2pvpx and Token? plz
06/08/2006 - Lineage 2 - 0 Replies
What protocol version for L2pvpx and Token? plz thx to alltext2schild.php?smilienummer=1&text=Woow xD' border='0' alt='Woow xD' />
as knowing the protocol and token of a server
04/03/2006 - Lineage 2 - 1 Replies
as knowing the protocol and token of a private server . here is provado the walker in it carries to an extreme and ok works.. but as knowing protocol, token and port of other server. thanks and sorry for my english
Mobl2 C4 Need Token/protocol
04/02/2006 - Lineage 2 - 1 Replies
Hi! i need a token and protocol to Mobl2 c4 (www.mob-games.com). Thank u for the help!!



All times are GMT +1. The time now is 18:36.


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.