[Tutorial] Disable the account lock | DooMV3 & Untouched I:SS

Results 1 to 10 of 10
  1. #1
    Professional RageZone XxFuR4xX is offline
    MemberRank
    Jun 2013 Join Date
    ENG / FRLocation
    253Posts

    cool [Tutorial] Disable the account lock | DooMV3 & Untouched I:SS

    Hello ! RageZone !

    I'll show you how to remove the blocking of your account on the source as DooMv3 & ISS Untouched

    Open RSUpdate.sln:

    And Go Updater.cpp:
    Code:
    case CLoginHelper::ANS_SecurityLock:
          {
            loginErrMsg_ = "Your account is locked";
            MessageBox(NULL, "Account was locked due to suspicious activity.\n\nPlease check your email for instructions on how to unlock it or you can reset password, that will also unlock your account.", "Login", MB_OK | MB_ICONEXCLAMATION);
            break;
          }

    Replace for:
    Code:
    /*case CLoginHelper::ANS_SecurityLock:
          {
            loginErrMsg_ = "Your account is locked";
            MessageBox(NULL, "Account was locked due to suspicious activity.\n\nPlease check your email for instructions on how to unlock it or you can reset password, that will also unlock your account.", "Login", MB_OK | MB_ICONEXCLAMATION);
            break;
          } */
    Go WOLoginHelper.cpp:
    Search:
    Code:
    else if(AccountStatus == 102)
            loginAnswerCode = ANS_SecurityLock;
    Replace for:
    Code:
    /*else if(AccountStatus == 102)
            loginAnswerCode = ANS_SecurityLock;*/
    And Search:
    Code:
    ANS_SecurityLock,
    Replace for:
    Code:
    //ANS_SecurityLock,
    And Rebuil Release ! (Do not forget to change the update of your launcher before Rebuild)
    --------------------------------------------------------------------------------------------------------------------------------------

    Go Database:
    Go in WZ_ACCOUNT_SecurityCheckForLock in function !

    Replace all code for:
    Code:
    ALTER PROCEDURE [dbo].[WZ_ACCOUNT_SecurityCheckForLock]    @in_CustomerID int,
        @in_IP varchar(100),
        @in_Country varchar(50),
        @Out_NeedLock int out
    AS
    BEGIN
        SET NOCOUNT ON;
    
    
        -- this procedure is local to SQL
        -- select 0 as ResultCode
    
    
        -- account is fine by default
        set @Out_NeedLock = 0
        
        -- get last login info
        declare @lastloginIP varchar(32)
        declare @lastloginCountry varchar(32) = ''
        select @lastloginIP=lastloginIP, @lastloginCountry=lastloginCountry from Accounts where CustomerID=@in_CustomerID
    
    
        -- decouple IPs
        declare @ip1 varchar(32)    -- last login ip 'X.y.z.w'
        declare @ip2 varchar(32)    -- last login ip 'x.Y.z.w'
        declare @ip3 varchar(32)    -- last login ip 'x.y.Z.w'
        declare @ip4 varchar(32)    -- last login ip 'x.y.z.W'
        declare @ip5 varchar(32)    -- same for @in_IP
        declare @ip6 varchar(32)
        declare @ip7 varchar(32)
        declare @ip8 varchar(32)
        declare @n1 int
        declare @n2 int
        declare @n3 int
    
    
        set @n1  = charindex('.', @lastloginIP)
        set @ip1 = substring @lastloginIP, 1, @n1 - 1)
        set @n2  = charindex('.', @lastloginIP, @n1 + 1)
        set @ip2 = substring @lastloginIP, @n1 + 1, @n2 - 1 - @n1)
        set @n3  = charindex('.', @lastloginIP, @n2 + 1)
        set @ip3 = substring @lastloginIP, @n2 + 1, @n3 - 1 - @n2)
        set @ip4 = substring @lastloginIP, @n3 + 1, 999)
    
    
        set @n1  = charindex('.', @in_IP)
        set @ip5 = substring(@in_IP, 1, @n1 - 1)
        set @n2  = charindex('.', @in_IP, @n1 + 1)
        set @ip6 = substring(@in_IP, @n1 + 1, @n2 - 1 - @n1)
        set @n3  = charindex('.', @in_IP, @n2 + 1)
        set @ip7 = substring(@in_IP, @n2 + 1, @n3 - 1 - @n2)
        set @ip8 = substring(@in_IP, @n3 + 1, 999)
    
    
        declare @Network varchar(32) = @ip5 + '.' + @ip6
    
    
        -- do not lock if we have that IP whitelisted
        if exists (select CustomerID from AccountIpWhitelist where CustomerID=@in_CustomerID and IP @Network) begin
            return
        end
        
        -- lock if country changed
        if @lastloginCountry <> '' and @in_Country <> '' and @lastloginCountry <> @in_Country)
        begin
            set @Out_NeedLock = 1
            exec WZ_ACCOUNT_SecurityLock @in_CustomerID, @in_IP, @in_Country
            return
        end
        
        -- lock if first 2 octets is changed
        if(@ip1 <> @ip5 or @ip2 <> @ip6) 
        begin
            -- special case - we ignore first login attempt if password was reset and add that network to whitelist
            if @lastloginIP = '0.0.0.0')
            begin
                insert into AccountIpWhitelist values (@in_CustomerID, GETDATE(), @Network, @in_Country)
                return
            end
    
    
            -- ip changed, block
            set @Out_NeedLock = 0
            exec WZ_ACCOUNT_SecurityLock @in_CustomerID, @in_IP, @in_Country
            return
        end
        
        -- for first time logins - if there was no whitelist entries - add current IP there
        declare @NumEntries int = 0
        select @NumEntries=COUNT(*) from AccountIpWhitelist where CustomerID=@in_CustomerID
        if(@NumEntries = 0) begin
            insert into AccountIpWhitelist values (@in_CustomerID, GETDATE(), @Network, @in_Country)
        end
    
    
        return
    END
    And delete:
    WZ_ACCOUNT_SecurityLock And WZ_ACCOUNT_SecurityUnlock function !

    Credit: Me !
    And Save all your changes


    The tutorial is finished! You know how to remove the account lock!



  2. #2
    Apprentice mrlonely090 is offline
    MemberRank
    Oct 2013 Join Date
    15Posts

    Re: [Tutorial] Disable the account lock | DooMV3 & Untouched I:SS

    i will try this thanks a lot !!!

  3. #3
    Proficient Member erik1223 is offline
    MemberRank
    Oct 2014 Join Date
    GermanyLocation
    150Posts

    Re: [Tutorial] Disable the account lock | DooMV3 & Untouched I:SS

    why ppl need to remove the unlock ? this is security for fakemails , isnt it ?

  4. #4
    Apprentice mrlonely090 is offline
    MemberRank
    Oct 2013 Join Date
    15Posts

    Re: [Tutorial] Disable the account lock | DooMV3 & Untouched I:SS

    i try this WZ_ACCOUNT_SecurityCheckForLock in function !

    ALTER PROCEDURE [dbo].[WZ_ACCOUNT_SecurityCheckForLock] @in_CustomerID int,
    @in_IP varchar(100),
    @in_Country varchar(50),
    @Out_NeedLock int out
    AS
    BEGIN
    SET NOCOUNT ON;




    -- this procedure is local to SQL
    -- select 0 as ResultCode




    -- account is fine by default
    set @Out_NeedLock = 0

    -- get last login info
    declare @lastloginCountry varchar(32) = ''
    select @lastloginCountry=lastloginCountry from Accounts where CustomerID=@in_CustomerID




    -- decouple IPs
    declare @ip1 varchar(32) -- last login ip 'X.y.z.w'
    declare @ip2 varchar(32) -- last login ip 'x.Y.z.w'
    declare @ip3 varchar(32) -- last login ip 'x.y.Z.w'
    declare @ip4 varchar(32) -- last login ip 'x.y.z.W'
    declare @ip5 varchar(32) -- same for @in_IP
    declare @ip6 varchar(32)
    declare @ip7 varchar(32)
    declare @ip8 varchar(32)
    declare @n1 int
    declare @n2 int
    declare @n3 int





    set @n1 = charindex('.', @in_IP)
    set @ip5 = substring(@in_IP, 1, @n1 - 1)
    set @n2 = charindex('.', @in_IP, @n1 + 1)
    set @ip6 = substring(@in_IP, @n1 + 1, @n2 - 1 - @n1)
    set @n3 = charindex('.', @in_IP, @n2 + 1)
    set @ip7 = substring(@in_IP, @n2 + 1, @n3 - 1 - @n2)
    set @ip8 = substring(@in_IP, @n3 + 1, 999)




    declare @Network varchar(32) = @ip5 + '.' + @ip6




    -- do not lock if we have that IP whitelisted
    if exists (select CustomerID from AccountIpWhitelist where CustomerID=@in_CustomerID ) begin
    return
    end

    -- lock if country changed
    if (@lastloginCountry <> '' and @in_Country <> '' and @lastloginCountry <> @in_Country)
    begin
    set @Out_NeedLock = 1
    exec WZ_ACCOUNT_SecurityLock @in_CustomerID, @in_IP, @in_Country
    return
    end

    -- lock if first 2 octets is changed
    if(@ip1 <> @ip5 or @ip2 <> @ip6)
    begin
    -- special case - we ignore first login attempt if password was reset and add that network to whitelist
    begin
    insert into AccountIpWhitelist values (@in_CustomerID, GETDATE(), @Network, @in_Country)
    return
    end




    -- ip changed, block
    set @Out_NeedLock = 0
    exec WZ_ACCOUNT_SecurityLock @in_CustomerID, @in_IP, @in_Country
    return
    end

    -- for first time logins - if there was no whitelist entries - add current IP there
    declare @NumEntries int = 0
    select @NumEntries=COUNT(*) from AccountIpWhitelist where CustomerID=@in_CustomerID
    if(@NumEntries = 0) begin
    insert into AccountIpWhitelist values (@in_CustomerID, GETDATE(), @Network, @in_Country)
    end




    return
    END

    withou error save function what do i right ?

  5. #5
    Professional RageZone XxFuR4xX is offline
    MemberRank
    Jun 2013 Join Date
    ENG / FRLocation
    253Posts

    Re: [Tutorial] Disable the account lock | DooMV3 &amp; Untouched I:SS

    Search:
    Code:
    -- ip changed, block
    Bellow:
    Code:
    set @Out_NeedLock = 1
    Set:
    Code:
    set @Out_NeedLock = 0
    - - - Updated - - -

    Quote Originally Posted by erik1223 View Post
    why ppl need to remove the unlock ? this is security for fakemails , isnt it ?
    Followed the tutorial, that his works best!

  6. #6
    Apprentice Vici0 is offline
    MemberRank
    Aug 2016 Join Date
    BRAHUELocation
    12Posts

    Re: [Tutorial] Disable the account lock | DooMV3 &amp; Untouched I:SS

    This works in Untouched Source V3?
    I can not change the WZ_ACCOUNT_SecurityCheckForLock

  7. #7
    Enthusiast QcBlastar is offline
    MemberRank
    Apr 2013 Join Date
    discord : #7279Location
    40Posts

    Re: [Tutorial] Disable the account lock | DooMV3 &amp; Untouched I:SS

    Quote Originally Posted by XxFuR4xX View Post
    Search:
    Code:
    -- ip changed, block
    Bellow:
    Code:
    set @Out_NeedLock = 1
    Set:
    Code:
    set @Out_NeedLock = 0
    - - - Updated - - -


    Followed the tutorial, that his works best!
    Work it :)

  8. #8
    Member iononline is offline
    MemberRank
    Apr 2012 Join Date
    HeavenLocation
    93Posts

    Re: [Tutorial] Disable the account lock | DooMV3 & Untouched I:SS

    try
    Code:
    USE [Warz]
    GO
    
    /****** Object:  StoredProcedure [dbo].[WZ_ACCOUNT_SecurityCheckForLock]    Script Date: 12/08/2016 09:14:31 ******/
    IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WZ_ACCOUNT_SecurityCheckForLock]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[WZ_ACCOUNT_SecurityCheckForLock]
    GO
    
    USE [Warz]
    GO
    
    /****** Object:  StoredProcedure [dbo].[WZ_ACCOUNT_SecurityCheckForLock]    Script Date: 12/08/2016 09:14:31 ******/
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    -- =============================================
    -- Author:		<Author,,Name>
    -- Create date: <Create Date,,>
    -- Description:	<Description,,>
    -- =============================================
    CREATE PROCEDURE [dbo].[WZ_ACCOUNT_SecurityCheckForLock]
    @in_CustomerID int,
    @in_IP varchar(100),
    @in_Country varchar(50),
      @Out_NeedLock int out
    AS
    BEGIN
    
    SET NOCOUNT ON;
    
    -- this procedure is local to SQL
    -- select 0 as ResultCode
    
    -- account is fine by default
    set  @Out_NeedLock = 0
    
    -- get last login info
    declare  @lastloginCountry varchar(32) = ''
    select  @lastloginCountry=lastloginCountry from Accounts where CustomerID=@in_CustomerID
    
    -- decouple IPs
    declare @ip1 varchar(32) -- last login ip 'X.y.z.w'
    declare @ip2 varchar(32) -- last login ip 'x.Y.z.w'
    declare @ip3 varchar(32) -- last login ip 'x.y.Z.w'
    declare @ip4 varchar(32) -- last login ip 'x.y.z.W'
    declare @ip5 varchar(32) -- same for @in_IP
    declare @ip6 varchar(32)
    declare @ip7 varchar(32)
    declare @ip8 varchar(32)
    declare @n1 int
    declare @n2 int
    declare @n3 int
    
    set @n1 = charindex('.', @in_IP)
    set @ip5 = substring(@in_IP, 1, @n1 - 1)
    set @n2 = charindex('.', @in_IP, @n1 + 1)
    set @ip6 = substring(@in_IP, @n1 + 1, @n2 - 1 - @n1)
    set @n3 = charindex('.', @in_IP, @n2 + 1)
    set @ip7 = substring(@in_IP, @n2 + 1, @n3 - 1 - @n2)
    set @ip8 = substring(@in_IP, @n3 + 1, 999)
    
    declare  @Network varchar(32) = @ip5 + '.' + @ip6
    
    -- do not lock if we have that IP whitelisted
    if exists (select CustomerID from AccountIpWhitelist where CustomerID=@in_CustomerID ) begin
    return
    end
    
    -- lock if country changed
    if   @lastloginCountry <> '' and @in_Country <> '' and  @lastloginCountry <> @in_Country)
    begin
    set  @Out_NeedLock = 1
    exec WZ_ACCOUNT_SecurityLock @in_CustomerID, @in_IP, @in_Country
    return
    end
    
    -- lock if first 2 octets is changed
    if(@ip1 <> @ip5 or @ip2 <> @ip6) 
    begin
    -- special case - we ignore first login attempt if password was reset and add that network to whitelist
    begin
    insert into AccountIpWhitelist values (@in_CustomerID, GETDATE(),  @Network, @in_Country)
    return
    end
    
    -- ip changed, block
    set  @Out_NeedLock = 0
    exec WZ_ACCOUNT_SecurityLock @in_CustomerID, @in_IP, @in_Country
    return
    end
    
    -- for first time logins - if there was no whitelist entries - add current IP there
    declare @NumEntries int = 0
    select @NumEntries=COUNT(*) from AccountIpWhitelist where CustomerID=@in_CustomerID
    if(@NumEntries = 0) begin
    insert into AccountIpWhitelist values (@in_CustomerID, GETDATE(),  @Network, @in_Country)
    end
    
    return
    END
    
    GO
    Code:
    USE
    Warz
    GO
    UPDATE [Warz].[dbo].[Accounts]
       SET [AccountStatus] = 100
     
    GO
    USE
    Warz
    GO
    UPDATE [Warz].[dbo].[UsersData]
       SET [AccountStatus] = 100
    GO
    Last edited by iononline; 08-12-16 at 03:32 AM.

  9. #9
    Member adem346634 is offline
    MemberRank
    May 2016 Join Date
    Ankara, TurkeyLocation
    59Posts

    Re: [Tutorial] Disable the account lock | DooMV3 & Untouched I:SS

    Thanks man <3

  10. #10
    Professional RageZone XxFuR4xX is offline
    MemberRank
    Jun 2013 Join Date
    ENG / FRLocation
    253Posts

    Re: [Tutorial] Disable the account lock | DooMV3 & Untouched I:SS

    Quote Originally Posted by adem346634 View Post
    Thanks man <3
    No worries my friend, if I can help you I do it!



Advertisement