World Servers
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.

[Guia] Habilitar / Deshabilitar MD5

3 participantes

Ir abajo

[Guia] Habilitar / Deshabilitar MD5 Empty [Guia] Habilitar / Deshabilitar MD5

Mensaje por LightRaven 2011-07-13, 22:37

MD5 es un tipo de encriptación de
contraseñas, es decir si un user elige como contraseña 123456789
no va a
verse así, sino algo como "d9404937ka9394d5b5l7ñ8l3n4" (Es solo una
manera de decir)


Es
basicamente usado para mas seguridad, pero personalmente molesta
bastante. Por eso aca dejo los Scripts tanto para Habilitar el MD5 como
para deshabilitarlo.


Habilitar MD5:

Ponen estos códigos en orden, es decir, primero el 1, después el 2 y así uno a uno en el analizador de consultas de SQL.

1:


USE master;
exec sp_addextendedproc 'XP_MD5_EncodeKeyVal', 'WZ_MD5_MOD.dll'

2:

use MuOnline;

3:

CREATE FUNCTION [dbo].[fn_md5] (@data VARCHAR(10), @data2 VARCHAR(10))
RETURNS BINARY(16) AS
BEGIN
DECLARE @hash BINARY(16)
EXEC master.dbo.XP_MD5_EncodeKeyVal @data, @data2, @hash OUT
RETURN @hash
END

4:

CREATE PROCEDURE Encript
@btInStr VARCHAR(10),
@
btInStrIndex VARCHAR(10)
AS
BEGIN
DECLARE @btOutVal BINARY(16)
EXEC master..XP_MD5_EncodeKeyVal @btInStr, @btInStrIndex, @btOutVal OUT
UPDATE MEMB_INFO SET memb__pwd
= @btOutVal WHERE memb___id = @btInStrIndex
END
GO

5:

CREATE PROCEDURE DencriptPW
@btInStr VARCHAR(10),
@
btInStrIndex VARCHAR(10)
AS
BEGIN
DECLARE @btOutVal BINARY(16)
EXEC master..XP_MD5_EncodeKeyVal @btInStr, @btInStrIndex, @btOutVal OUT
SELECT memb__pwd FROM MEMB_INFO WHERE memb__pwd
= @btOutVal AND memb___id = @btInStrIndex
END
GO

Y despues de eso colocan la DLL que
dejo adjunta en Binn en la carpeta de su SQL. (Normalmente es
C:\Archivo de programas\Microsoft SQL Server\MSSQL\Binn)



[Tienes que estar registrado y conectado para ver este vínculo]

---------------------------------------------------

Deshabilitar MD5

Ahora para Deshabilitar el MD5, hacemos lo siguiente.

Vamos nuevamente al analizador de consultas y esta vez ponemos:

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MANG_INFO]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MANG_INFO]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MEMB_INFO]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MEMB_INFO]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MEMB_OUT]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MEMB_OUT]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MembInfoModify]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MembInfoModify]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[VI_CURR_INFO]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[VI_CURR_INFO]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[VI_FQNW_INFO]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[VI_FQNW_INFO]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[VI_MIDS_INFO]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[VI_MIDS_INFO]
GO

CREATE TABLE
[dbo].[MANG_INFO] (
[
mang_guid] [int] NOT NULL ,
[
mang___id] [nvarchar] (15) COLLATE Polish_CI_AS NOT NULL ,
[
mang__pwd] [nvarchar] (15) COLLATE Polish_CI_AS NOT NULL ,
[
mang_name] [nvarchar] (20) COLLATE Polish_CI_AS NOT NULL ,
[
mail_addr] [nvarchar] (50) COLLATE Polish_CI_AS NOT NULL ,
[
levl_name] [nvarchar] (30) COLLATE Polish_CI_AS NULL ,
[
part_name] [nvarchar] (30) COLLATE Polish_CI_AS NULL ,
[
auth_code] [nvarchar] (30) COLLATE Polish_CI_AS NULL ,
[
appl_days] [nvarchar] (8) COLLATE Polish_CI_AS NOT NULL ,
[
ctl1_code] [nvarchar] (1) COLLATE Polish_CI_AS NOT NULL ,
[
Group_code] [nvarchar] (2) COLLATE Polish_CI_AS NULL ,
[
dep_code] [nvarchar] (4) COLLATE Polish_CI_AS NOT NULL ,
[
perm] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE
[dbo].[MEMB_INFO] (
[
memb_guid] [int] IDENTITY (1, 1) NOT NULL ,
[
memb___id] [varchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb__pwd] [varchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb_name] [varchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
sno__numb] [char] (13) COLLATE Polish_CI_AS NOT NULL ,
[
post_code] [char] (6) COLLATE Polish_CI_AS NULL ,
[
addr_info] [varchar] (50) COLLATE Polish_CI_AS NULL ,
[
addr_deta] [varchar] (50) COLLATE Polish_CI_AS NULL ,
[
tel__numb] [varchar] (20) COLLATE Polish_CI_AS NULL ,
[
phon_numb] [varchar] (15) COLLATE Polish_CI_AS NULL ,
[
mail_addr] [varchar] (50) COLLATE Polish_CI_AS NULL ,
[
fpas_ques] [varchar] (50) COLLATE Polish_CI_AS NULL ,
[
fpas_answ] [varchar] (50) COLLATE Polish_CI_AS NULL ,
[
job__code] [char] (2) COLLATE Polish_CI_AS NULL ,
[
appl_days] [datetime] NULL ,
[
modi_days] [datetime] NULL ,
[
out__days] [datetime] NULL ,
[
true_days] [datetime] NULL ,
[
mail_chek] [char] (1) COLLATE Polish_CI_AS NULL ,
[
bloc_code] [char] (1) COLLATE Polish_CI_AS NOT NULL ,
[
ctl1_code] [char] (1) COLLATE Polish_CI_AS NOT NULL ,
[
adminaccess] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE
[dbo].[MEMB_OUT] (
[
out__guid] [int] NOT NULL ,
[
memb_guid] [int] NOT NULL ,
[
sno__numb] [nvarchar] (7) COLLATE Polish_CI_AS NULL ,
[
memb_name] [nvarchar] (15) COLLATE Polish_CI_AS NULL ,
[
appl_days] [smalldatetime] NULL ,
[
ctl1_code] [nvarchar] (1) COLLATE Polish_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE
[dbo].[MembInfoModify] (
[
Number] [int] NOT NULL ,
[
memb___id] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb__pwd] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb_name] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
sno__numb] [nvarchar] (13) COLLATE Polish_CI_AS NOT NULL ,
[
tel__numb] [nvarchar] (20) COLLATE Polish_CI_AS NULL ,
[
phon_numb] [nvarchar] (15) COLLATE Polish_CI_AS NULL ,
[
mail_addr] [nvarchar] (50) COLLATE Polish_CI_AS NULL ,
[
fpas_ques] [nvarchar] (50) COLLATE Polish_CI_AS NULL ,
[
fpas_answ] [nvarchar] (50) COLLATE Polish_CI_AS NULL ,
[
bloc_code] [nvarchar] (1) COLLATE Polish_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE
[dbo].[VI_CURR_INFO] (
[
ends_days] [nvarchar] (8) COLLATE Polish_CI_AS NULL ,
[
chek_code] [nvarchar] (1) COLLATE Polish_CI_AS NOT NULL ,
[
used_time] [int] NULL ,
[
memb___id] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb_name] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb_guid] [int] NOT NULL ,
[
sno__numb] [nvarchar] (18) COLLATE Polish_CI_AS NOT NULL ,
[
Bill_Section] [int] NULL ,
[
Bill_Value] [int] NULL ,
[
Bill_Hour] [int] NULL ,
[
Surplus_Point] [int] NULL ,
[
Surplus_Minute] [datetime] NULL ,
[
Increase_Days] [int] NULL
) ON [PRIMARY]
GO

CREATE TABLE
[dbo].[VI_FQNW_INFO] (
[
appl_code] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
ctrl_text] [nvarchar] (50) COLLATE Polish_CI_AS NULL ,
[
fpas_ques] [nvarchar] (50) COLLATE Polish_CI_AS NOT NULL ,
[
fpas_answ] [nvarchar] (50) COLLATE Polish_CI_AS NOT NULL ,
[
appl_days] [nvarchar] (8) COLLATE Polish_CI_AS NOT NULL ,
[
ctl1_code] [nvarchar] (1) COLLATE Polish_CI_AS NOT NULL ,
[
memb_name] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb_guid] [int] NOT NULL ,
[
fanw_guid] [int] NOT NULL ,
[
memb___id] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
sno__numb] [nvarchar] (18) COLLATE Polish_CI_AS NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE
[dbo].[VI_MIDS_INFO] (
[
memb___id] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
memb_name] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
sno__numb] [nvarchar] (18) COLLATE Polish_CI_AS NOT NULL ,
[
appl_days] [nvarchar] (8) COLLATE Polish_CI_AS NOT NULL ,
[
chek_code] [nvarchar] (1) COLLATE Polish_CI_AS NOT NULL ,
[
prev_info] [nvarchar] (50) COLLATE Polish_CI_AS NOT NULL ,
[
modi_info] [nvarchar] (10) COLLATE Polish_CI_AS NOT NULL ,
[
cont_text] [ntext] COLLATE Polish_CI_AS NOT NULL ,
[
mids_guid] [int] NOT NULL ,
[
admin_name] [nvarchar] (10) COLLATE Polish_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE MEMB_INFO ALTER COLUMN memb__pwd VARCHAR
(10) NOT NULL
GO


Y luego vamos a la carpeta Binn de donde se instalo el SQL y eliminamos la DLL que mencionamos antes.

Solo eso, ya tenes tu server SIN MD5.

NOTA: El paso de QUITAR MD5 debe hacerse con las DB limpias, de lo contrario pueden perder información valiosa
LightRaven
LightRaven
Level V
Level V

KaiZen Gunz Masculino World ServerS Trofeo de Plata Estrella de Oro : Nivel 12º No tienes ninguna Advertencia
Kaizen Project
Mensajes : 782
Cash Point : 23537
Prestigio : 322
Registro : 04/12/2010
Localización : A la vuelta de la esquina
Edad : 28

http://www.world-servers.org

Volver arriba Ir abajo

[Guia] Habilitar / Deshabilitar MD5 Empty Re: [Guia] Habilitar / Deshabilitar MD5

Mensaje por Sebastian 2011-07-13, 23:52

Exelente aporte.
Sebastian
Sebastian
Leyenda
Leyenda

Usuario Registrado Masculino Argentina Trofeo de Plata Corona de Plata No tienes ninguna Advertencia
~ El Macho de la caverna ~
Mensajes : 1400
Cash Point : 33192
Prestigio : 2239
Registro : 09/11/2010
Localización : Buenos Aires.
Edad : 28

Volver arriba Ir abajo

[Guia] Habilitar / Deshabilitar MD5 Empty Re: [Guia] Habilitar / Deshabilitar MD5

Mensaje por Hellscrem 2011-07-14, 00:07

Exelente light parece que estas devuelta [Tienes que estar registrado y conectado para ver esa imagen]
Hellscrem
Hellscrem
Fundador
Fundador

Administrador Masculino Argentina Trofeo de Oro Corona de Oro No tienes ninguna Advertencia
ლ(ಠ益ಠლ)
Mensajes : 2043
Cash Point : 28533
Prestigio : 1508
Registro : 08/11/2010
Localización : Buenos Aires
Edad : 32

http://www.world-servers.org

Volver arriba Ir abajo

[Guia] Habilitar / Deshabilitar MD5 Empty Re: [Guia] Habilitar / Deshabilitar MD5

Mensaje por Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Volver arriba


 
Permisos de este foro:
No puedes responder a temas en este foro.