Register for your free account! | Forgot your password?
Rust Cheats

You last visited: Today at 12:44

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

Advertisement



[SRC]Salt-System

Discussion on [SRC]Salt-System within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2009
Posts: 1,422
Received Thanks: 1,368
[SRC]Salt-System

Da ein kleiner Hobbit meint er könnte mich ärgern werde ich ihn eines besseren belehren...

Was ist ein Saltsystem? Diese Frage ist leicht beantwortet.



Man hat einmal das Passwort und einen einmaligen String aus Zahlen und Buchstaben. Damit ist sichergestellt das der Hash des Passwortes immer unterschiedlich ist auch wenn das eigentliche Passwort das selbe ist.

Nutzt man diese Methode, so sind Hashdatenbanken nutzlos und man erzielt da keinen Fund des original Passworts.

Denkt vorher an ein Backup!

input_auth.cpp

suchen nach:
Code:
DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, dwKey, p, 
	"SELECT PASSWORD('%s'),password,securitycode,social_id,id,status,availDt - NOW() > 0,"
	"UNIX_TIMESTAMP(silver_expire),"
	"UNIX_TIMESTAMP(gold_expire),"
	"UNIX_TIMESTAMP(safebox_expire),"
	"UNIX_TIMESTAMP(autoloot_expire),"
	"UNIX_TIMESTAMP(fish_mind_expire),"
	"UNIX_TIMESTAMP(marriage_fast_expire),"
	"UNIX_TIMESTAMP(money_drop_rate_expire),"
	"UNIX_TIMESTAMP(create_time)"
	" FROM account WHERE login='%s'",
	szPasswd, szLogin);
und ersetzen durch:
Code:
DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, dwKey, p, 
	"SELECT password,salt,securitycode,social_id,id,status,availDt - NOW() > 0,"
	"UNIX_TIMESTAMP(silver_expire),"
	"UNIX_TIMESTAMP(gold_expire),"
	"UNIX_TIMESTAMP(safebox_expire),"
	"UNIX_TIMESTAMP(autoloot_expire),"
	"UNIX_TIMESTAMP(fish_mind_expire),"
	"UNIX_TIMESTAMP(marriage_fast_expire),"
	"UNIX_TIMESTAMP(money_drop_rate_expire),"
	"UNIX_TIMESTAMP(create_time)"
	" FROM account WHERE login='%s'",
	szLogin);
db.cpp

suchen nach:
Code:
#include <sstream>
darunter einfügen:
Code:
#include "sha1.h"// new hash
#include "md5.h"// new hash
dann hiernach suchen:
Code:
	char szEncrytPassword[45 + 1];
	char szPassword[45 + 1];
	char szMatrixCode[MATRIX_CODE_MAX_LEN + 1];
	char szSocialID[SOCIAL_ID_MAX_LEN + 1];
	char szStatus[ACCOUNT_STATUS_MAX_LEN + 1];
	DWORD dwID = 0;;
und hiermit ersetzen:
Code:
	// new hash
	std::string szEncrytPassword;// new hash
	char szPassword[45 + 1];
	char szSalt[45 + 1];
	char szMatrixCode[MATRIX_CODE_MAX_LEN + 1];
	char szSocialID[SOCIAL_ID_MAX_LEN + 1];
	char szStatus[ACCOUNT_STATUS_MAX_LEN + 1];
	DWORD dwID = 0;
suchen:
Code:
	strlcpy(szEncrytPassword, row[col++], sizeof(szEncrytPassword));

	if (!row[col]) 
	{
	   	sys_err("error column %d", col);
		M2_DELETE(pinfo);
	   	break;
	}
				
	strlcpy(szPassword, row[col++], sizeof(szPassword));
und ersetzen mit dem hier:
Code:
	strlcpy(szPassword, row[col++], sizeof(szPassword));

	strlcpy(szSalt, row[col++], sizeof(szSalt));

	if (!row[col]) 
	{
	   	sys_err("error column %d Salt", col);
		M2_DELETE(pinfo);
	   	break;
	}
suchen nach:
Code:
	nPasswordDiff = strcmp(szEncrytPassword, szPassword);
und ersetzen durch:
Code:
	// new hash
	szEncrytPassword.append(sha1(szSalt));
	szEncrytPassword.append(md5(pinfo->passwd));

	int nPasswordDiff = strcmp(md5(szEncrytPassword).c_str(), szPassword);
ladet die 4 Daten aus dem Anhang game_src.rar in den game src:
Quote:
sha1.h
sha1.cpp
md5.h
md5.cpp
öffnet die Makefile und fügt "sha1.cpp md5.cpp" dem CPPFILE define hinzu.

nun muss der Datenbank account.account noch das Feld salt hinzugefügt werden:
Quote:
salt varchar(45) NOT NULL DEFAULT ''
und dann könnt ihr Kompilieren.

Für eure Webseite müsst ihr je einen Salt pro Account erzugen zb so (und in der account.account->salt speichern):
PHP Code:
function get_salt() 
{
    
$characters '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    
$characters_length strlen($characters) - 1;
    
$rand '';
    
    for (
$i 0$i 45$i++)
    {
        
$rand .= $characters[mt_rand(0$characters_length)];
    }
    
    return 
md5($rand);

das Passwort hasht ihr in diesem Fall so:
PHP Code:
$pw md5(sha1($salt).md5($pw)) 
Oben im Code ist nur ein Beispiel, es geht natürlich nach Lust und Laune.

Hier einmal ein übertriebenes Beispiel:

Code:
	szEncrytPassword.append(sha1(szSalt));
	szEncrytPassword.append(sha1(szSalt));
	szEncrytPassword.append(sha1(szSalt));
	szEncrytPassword.append(sha1(szSalt));
	szEncrytPassword.append(sha1(szSalt));
	szEncrytPassword.append(md5(pinfo->passwd));
oder auch:

Code:
	szEncrytPassword.append(sha1(szSalt));
	szEncrytPassword.append(md5(pinfo->passwd));
	szEncrytPassword.append(sha1("PwGehtSoNurAufMeinemServer"));
viel Spaß damit

für die im Code beschriebene Variante habe ich euch noch ein PWGen beigelegt damit ihr es direkt testen könnt.

lg black
Attached Files
File Type: rar game_src.rar (7.3 KB, 60 views)
File Type: rar PWGen.rar (10.1 KB, 60 views)
blackout85 is offline  
Thanks
21 Users
Old 02/09/2016, 14:12   #2
 
BizepsSupportAccount's Avatar
 
elite*gold: 0
Join Date: Dec 2014
Posts: 1,018
Received Thanks: 499
was istn das fürn system?..

€dit: hat sich geklärt habs beim überflogen nicht gesehen.

nice danke!
BizepsSupportAccount is offline  
Old 02/09/2016, 15:22   #3
 
elite*gold: 0
Join Date: Jan 2011
Posts: 54
Received Thanks: 2
Nice one. Thx
worldend is offline  
Old 02/09/2016, 15:22   #4
 
.Various's Avatar
 
elite*gold: 35
Join Date: Aug 2014
Posts: 336
Received Thanks: 267
Stellt sich nur die Frage, was hat das Ganze mit Salz zutun?

Spaß beiseite, schönes Release, danke. Werden wir ja wie schon gesagt benutzen!
.Various is offline  
Old 02/09/2016, 15:35   #5
 
elite*gold: 35
Join Date: Apr 2011
Posts: 1,018
Received Thanks: 1,984
Sehr cool
DeadBreakZz is offline  
Old 02/09/2016, 16:24   #6
 
elite*gold: 0
Join Date: Sep 2010
Posts: 73
Received Thanks: 31
Danke für der guide

Aber ich benutze ein methode mit cryptopp

Thanks for the tutorial, However I'm using a method with cryptopp, but your method is still really usefull because you're using salt + md5 in addition of sha1

Carry on men !
galetlefrancais is offline  
Old 02/11/2016, 12:17   #7
 
elite*gold: 0
Join Date: Apr 2015
Posts: 428
Received Thanks: 361
Quote:
Originally Posted by galetlefrancais View Post
Danke für der guide

Aber ich benutze ein methode mit cryptopp

Thanks for the tutorial, However I'm using a method with cryptopp, but your method is still really usefull because you're using salt + md5 in addition of sha1

Carry on men !
Wo sollte den der Unterschied zu Crypto++ sein?^^

Gutes Release, ich hoffe der Ein oder Andere lernt was draus.
#Metho is offline  
Reply


Similar Threads Similar Threads
MD5 Salt
02/28/2011 - EO PServer Hosting - 2 Replies
So while Im trying to find this in the account server, has anyone already done this, and found the salt value used in md5 password creation?
SALT
08/21/2010 - Movies & Series - 6 Replies
http://cinestar.de/ccds_cache/img/8e/8eb4423663a8e 1d4aeb17d4d8970bbe8.180x360x0.jpg Salt Filmstart am: 19.08.2010



All times are GMT +1. The time now is 12:45.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.