Follow Us

Soluții pentru problemele tale IT

Home /Servicii baze de date/SQL Server/List wrong attempt to login sql server
Home /Servicii baze de date /List wrong attempt to login sql server

List wrong attempt to login sql server

  • Data 15/02/2023
  • Autor Bogdan Dumitru
  • Categorie Servicii baze de date, SQL Server
  • -3
  • 596
Configurare noua (How To)

Situatie

Mai jos este o procedura ce returneaza incercari gresite de introducere a parolei pentru utilizatorii sql in ultimele 24 de ore, pentru a determina posibile atacuri asupra credentialelor.

Solutie

create procedure FindPosibleBruteForcePasswordAttempt_prc

as

create table #errorLog (
LogDate datetime,
ProcessInfo varchar(250),
[Text] varchar(8000)
)

 

insert into #errorLog (LogDate, ProcessInfo, [Text])
exec sp_readerrorlog 0, 1

 

select
replace(right([Text],charindex(‘ ‘, reverse([Text]))-1), ‘]’, ”) as IP,
substring([Text], charindex(””, [Text]) + 1, charindex(‘.’, [Text]) – charindex(””, [Text]) – 2 ) as [User],
count(LogDate) as [Number of login attempts],
min(LogDate) as [StartedAt],
max(LogDate) as [EndedAt],
datediff(minute, min(LogDate), max(LogDate)) as [IntervalInMinutes],
cast(cast(count(LogDate) as decimal(18,2))/isnull(nullif(datediff(minute, min(LogDate), max(LogDate)),0),1) as decimal(18,2)) as [AttemptsPerMinute]

from #errorLog

where

ProcessInfo = ‘Logon’
and [Text] like ‘Login failed for user%’
and datediff(hour, LogDate, getdate()) <= 24

group by
[Text]

having
count(LogDate) > 3 –filter users typing their passwords incorrectly

order by
[Number of login attempts] desc,
[EndedAt] desc

drop table #errorLog

Tip solutie

Permanent
Etichetare: wrong attempt to login in sql

Voteaza

Up Down
(14 din 31 persoane apreciaza acest articol)
Share
Tweet
Share

Despre Autor

Bogdan Dumitru

Solutii Asemanatoare

  • Listare restaurari efectuate pe un server MSSQL 4
  • Listare backup-uri efectuate pe un server MSSQL 1
  • Listare date despre utilizarea bazei TempDB pe un server MSSQL -2
  • Gasire blocaje pe un server MSSQL Server 5
  • Listare joburi ce nu s-au executat cu succes pe un server MSSQL 3
  • Cele mai utilizate baze de pe un server MSSQL 6

Leave A Comment? × Cancel Reply

30789

Soluții Disponibile

0 Articole

In ultima saptamana

Cele mai recente soluții

  • Bring your Windows Desktop to life with Wallpaper Engine
    • 11
    • 10 hours ago
  • How to move Taskbar to top or side on Windows 11
    • 16
    • 17/12/2025
  • Reparare eroare:”Trust Relationship Failed” fără scoatere din domeniu și fără restart (PowerShell)
    • 10
    • 2 days ago
  • You’ve been deleting files the wrong way in Windows
    • 11
    • 2 days ago
  • Arduino Soil Moisture Sensor
    • 27
    • 15/12/2025
© Askit.ro, 2014 - 2025. All rights reserved. Done by Class IT
Share
Tweet
Share