[Release] Admin SQL Check !

12/17/2010 22:04 Shaiya Xtreme#1
Code:
USE PS_UserData;

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO
/****** Object:  Table [dbo].[usp_AdminCheck]   Script Date: 12/17/2010 by Killsteal 22:00:00 ******/
CREATE PROCEDURE [dbo].[usp_AdminCheck]@Check int AS
DECLARE 
@UUID 	int,
@UID 	varchar(18),
@Status smallint,
@Admin smallint,
@TodayTime datetime
SET @TodayTime =  getdate()
If   (@Check = 1)
begin
print CONVERT(VARCHAR, @TodayTime, 109) + ' - START CHECK ADMIN HACKERS'


declare cur_event cursor for
SELECT     UserID
FROM         Users_Master
WHERE     (Admin > 0) AND (NOT (UserID = 'GM-NAME')) AND (NOT (UserID = 'GM-NAME')) AND (Status = 16 OR
                            Status = 32 OR
                            Status = 48 OR
                            Status = 64 OR
                            Status = 80) AND (AdminLevel = 255)
declare @i int
open cur_event
Fetch next from cur_event into @UID
set @i = 0 
while(@@fetch_status = 0  )
BEGIN
--BLOCK ADMIN HACKERS UserID
print CONVERT(VARCHAR, @TodayTime, 109) + ' BLOCK HACKER - ' + @UID
UPDATE Users_Master SET Status = 2 WHERE UserID = @UID
fetch next from cur_event into @UID
Set @i = @i + 1
END
close cur_Event
deallocate cur_Event
print CONVERT(VARCHAR, @TodayTime, 109) + ' - END CHECK ADMIN HACKERS'
end
else
begin 
print 'skip Check Admin Hackers'
End
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
:D
12/17/2010 22:18 Shaiya Xtreme#2
P.S to Check use;

exec usp_AdminCheck 1
01/07/2011 23:55 Bаne#3
# added to my list of guides
01/10/2011 01:01 shinru2004#4
what exactly does this do? lol
01/10/2011 01:03 Bаne#5
Quote:
print 'skip Check Admin Hackers'
it shows people who have hacked to become a admin.

-Bane
01/10/2011 01:09 shinru2004#6
ahh nice, sounds like fun...
01/10/2011 01:11 Bаne#7
i suppose. but it is always good to check.
05/11/2011 13:38 [GM]Recover#8
every time i use it bans all my gms accounts
05/11/2011 17:27 castor4878#9
Quote:
Originally Posted by Shaiyatoplist View Post
every time i use it bans all my gms accounts
not a surprise ... don't you read the notice / explanation ? what ?!? not a single line of explanation, can't believe it.

the script selects ID of all accounts marked as admin whose "name is not 'GM-NAME'" and (!) "name is not 'GM-NAME'".

so, since your name is likely not 'GM-NAME', your accounts are locked.

AFAI can understand that script, it checks the UserID against proc hard coded allowed values, you have to replace the 'GM-NAME' with your own GM-toon name.

or, in other words, it assumes that some hackers success to inject or alter data *but* they fail to inject a valid GM (or GS) name ...
05/13/2011 00:20 [GM]Recover#10
Quote:
Originally Posted by castor4878 View Post
not a surprise ... don't you read the notice / explanation ? what ?!? not a single line of explanation, can't believe it.

the script selects ID of all accounts marked as admin whose "name is not 'GM-NAME'" and (!) "name is not 'GM-NAME'".

so, since your name is likely not 'GM-NAME', your accounts are locked.

AFAI can understand that script, it checks the UserID against proc hard coded allowed values, you have to replace the 'GM-NAME' with your own GM-toon name.

or, in other words, it assumes that some hackers success to inject or alter data *but* they fail to inject a valid GM (or GS) name ...

oh ok then thanks very much