Jump to content

[REZOLVAT] parole criptate


equin0x
 Share

Recommended Posts

salutare

am luat un panel de pe net (al lui Daniel) si l-am facut compatibil cu burned in mare parte, dar ma tot chinui sa ma loghez pe panel si nu merge, am auzit ca ar fi de la faptul ca gm-ul cripteaza parolele iar panel-ul nu le decripteaza.. help please

Link to comment
Share on other sites

  • Administrator

Din cate vad eu, parolele pe care le 'dehashureaza' panel-ul sunt 'hashurate' in Whrilpool, nu in MD5 cum este pe burned.

 

Descarca plugin-ul Whrilpool de aici: Click

Dupa ce l-ai descarcat, il bagi in 'my folder -> plugins'.

Dupa ce ai facut asta, adaugi in server.cfg -> plugins -> whirlpool

 

Dupa, in gamemode declari native-ul pentru Whirlpool undeva la inceputul gamemode-ului:

native WP_Hash(buffer[], len, const str[]);

Pentru inceput, du-te la Dialogul:

case DIALOG_LOGIN2:

Si acolo o sa ai:

case DIALOG_LOGIN2: {
	if(!response) return Kick(playerid);
	if(strlen(inputtext)) {
		new tmppass[64];
		mysql_real_escape_string(inputtext, tmppass);
		OnPlayerLogin(playerid,MD5_Hash(tmppass));
	}

Si inlocui codu de acolo cu:

case DIALOG_LOGIN2: {
	if(!response) return Kick(playerid);
	if(strlen(inputtext)) {
		new tmppass[64];
		WP_Hash(tmppass, sizeof tmppass, inputtext); 
		OnPlayerLogin(playerid, tmppass);
	}

Dupa ce ai facut asta, trecem mai departe la dialog-ul:

case DIALOG_LOGIN3: {
	if(!response) return Kick(playerid);
	if(strlen(inputtext)) {
		new tmppass[64];
		mysql_real_escape_string(inputtext, tmppass);
		OnPlayerLogin(playerid,MD5_Hash(tmppass));
	}

Unde procedam la fel ca la primul dialog:

case DIALOG_LOGIN3: {
	if(!response) return Kick(playerid);
	if(strlen(inputtext)) {
		new tmppass[64];
		WP_Hash(tmppass, sizeof tmppass, inputtext); 
		OnPlayerLogin(playerid, tmppass);
	}

Si la ultimul dialog:

case DIALOG_LOGIN1: {
	if(strlen(inputtext) >= 6 && strlen(inputtext) <= 30) {
		new tmppass[64];
		mysql_real_escape_string(inputtext, tmppass);
		OnPlayerRegister(playerid,MD5_Hash(tmppass));
	}	

Facem la fel ca la celelalte:

case DIALOG_LOGIN1: {
	if(strlen(inputtext) >= 6 && strlen(inputtext) <= 30) {
		new tmppass[64];
		WP_Hash(tmppass, sizeof tmppass, inputtext); 
		OnPlayerLogin(playerid, tmppass);
	}	

La dialogul asta la fel:

case DIALOG_NEWPASS: {
	if(!response) return 1;
	if(strcmp(MD5_Hash(inputtext), PlayerInfo[playerid][pKey])) {
		SCM(playerid, COLOR_WARNING, "Parola invalida!");
		return 1;
	}
	ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "Change password","Scrie mai jos noua parola pe care vrei s-o ai.","Ok","Close");
}	

Il modifici in:

case DIALOG_NEWPASS: {
	if(!response) return 1;
	new tmppass[64];
	WP_Hash(tmppass, sizeof tmppass, inputtext); 
	if(strcmp(MD5_Hash(tmppass), PlayerInfo[playerid][pKey])) {
		SCM(playerid, COLOR_WARNING, "Parola invalida!");
		return 1;
	}
	ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "Change password","Scrie mai jos noua parola pe care vrei s-o ai.","Ok","Close");
}	

si la asta la fel, din:

case DIALOG_NEWPASS1: {
	if(!response) return 1;
	new length = strlen(inputtext);
	if(length == 0 || length > 15) return ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "Change password","Scrie mai jos noua parola pe care vrei s-o ai.","Ok","Close");
	if(strlen(inputtext) > 1 && strlen(inputtext) < 16) {
		new emailtext[64];
		mysql_real_escape_string(inputtext, emailtext);
		format(PlayerInfo[playerid][pKey], 50, MD5_Hash(emailtext));
		new str1[512];
		format(str1,512,"UPDATE users SET `password`='%s' WHERE `ID`='%d'",PlayerInfo[playerid][pKey],PlayerInfo[playerid][pSQLID]);
		mysql_query(SQL,str1);
		format(string, sizeof(string), "Noua ta parola este %s.", inputtext);
		ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "New password", string, "Ok", "");
		format(string, sizeof(string), "Ti-ai schimbat parola!");
		SendClientMessage(playerid, COLOR_YELLOW,string);
	}
	else ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "Schimba parola:","Scrie parola pe care  vrei s-o ai.","Ok","Iesi");
}

in:

case DIALOG_NEWPASS1: {
	if(!response) return 1;
	new length = strlen(inputtext);
	if(length == 0 || length > 15) return ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "Change password","Scrie mai jos noua parola pe care vrei s-o ai.","Ok","Close");
	if(strlen(inputtext) > 1 && strlen(inputtext) < 16) {
		new tmppass[64];
		mysql_real_escape_string(inputtext, tmppass);
		WP_Hash(tmppass, sizeof tmppass, inputtext); 
		format(PlayerInfo[playerid][pKey], 50, tmppass);
		new str1[512];
		format(str1,512,"UPDATE users SET `password`='%s' WHERE `ID`='%d'",PlayerInfo[playerid][pKey],PlayerInfo[playerid][pSQLID]);
		mysql_query(SQL,str1);
		format(string, sizeof(string), "Noua ta parola este %s.", inputtext);
		ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "New password", string, "Ok", "");
		format(string, sizeof(string), "Ti-ai schimbat parola!");
		SendClientMessage(playerid, COLOR_YELLOW,string);
	}
	else ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "Schimba parola:","Scrie parola pe care  vrei s-o ai.","Ok","Iesi");
}

Si cam atat, sistemu de securitate ramane pe MD5 deoarece este mai ok, sper ca ai inteles.

Link to comment
Share on other sites

Gata, era modificata. Acum am o problema si mai mare :(

Cand intru pe server, indiferent ca ma loghez pe contul meu sau incerc sa ma inregistrez, zice ca parola e gresita... in server log zice ca s-au incarcat toate cum trebuie, baza e conectata.. nu stiu ce are

Edited by equin0x
Link to comment
Share on other sites

Verifica length-ul campului 'password' in baza de date sa fie de cel putin 128 . Daca tot nu functioneaza, lasa reply aici.

#define noob_level[MAX_PLAYERS];

function IHaveTheNoob(playerid){
	new randomlevelnoob = 0 + random(2);
	noob_level[playerid] = randomlevelnoob;
	switch(noob_level[playerid]){
		case 0: SendClientMessage(playerid, -1, "You f**king noob men, this is Babur's opinion");
		case 1: SendClientMessage(playerid, -1, "Brother, you are noob, nothing has changed");
		default: SendClientMessage(playerid, -1, "HA HA HA, YOU NOOB IN PAWN! HA HA HA!");
	}	
	Kick(playerid);
	return 1;
}
OnPlayerConnect return IHaveTheNoob(playerid);

 

cooltext370126435149439.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...