These two procedures (seven_ORA)for detection hidden GMs in a database and their blockings.
GM256,GM512,GM768 - These are correct GMs accounts. Can rename on the or add in inquiry still AND (NOT (Account = 'myGM'))
andCode:CREATE PROCEDURE [dbo].[SP_GMGUARD] @Check int AS If (@Check = 1) begin declare cur_event cursor for SELECT Account FROM UserInfo WHERE ([Right] > 1) AND (NOT (Account = 'GM256')) AND (NOT (Account = 'GM256')) AND (NOT (Account = 'GM512')) AND (NOT (Account = 'GM768')) declare @Account nvarchar(50) declare @i int open cur_event Fetch next from cur_event into @Account set @i = 0 while(@@fetch_status = 0 ) BEGIN -- RUN TERMINATOR PROC exec SP_GMHACKERTERMINATOR @Account --print @Account fetch next from cur_event into @Account Set @i = @i + 1 END close cur_Event deallocate cur_Event end else begin print 'skip Check GM' End GO
Command for execute : exec SP_GMGUARD 1Code:CREATE PROCEDURE [dbo].[SP_GMHACKERTERMINATOR] @Hacker nvarchar(50) AS DECLARE @TodayTime datetime --print @TodayTime update UserInfo set [Right] = '0', BlockReason='Hacker Stop!',BlockGM = 'Terminator' where Account = @Hacker print CONVERT(VARCHAR, @TodayTime, 109) + ' Account - '+@Hacker+' - BLOCKED!' GO
It is possible to use it as the task in Job tools SQL a server or any other language using timers.
Procedure - as an example. But it is possible to create other, analyzing logs on the basis of this procedure
Success.
Twilight for RZ.



![[Arcturus] - Dev Store Proc's for Admins](http://ragezone.com/hyper728.png)


