Splunk Search

failed logins locking accounts.

atomlinson81
New Member

a bit of background info - we use sophos av software, and all machines use a local account on the sophos management server to download updates from the central repository. we must have some client devices out there with an incorrect password as we are seeing this account being locked out on a very intermittent basis - sometimes it can be weeks/months inbetween account lockouts, but i've just had two in as many days. we've got the server auditing logins and i've got an instance of splunk indexing the event log from this server. the security policy on the server is set to lock out the account after five incorrect logins. is it possible for me to use splunk to quickly identify the offending device(s)? and if so, please could someone help me build out the query to do this? thanks.

Tags (2)
0 Karma

atomlinson81
New Member

thanks for the replies. below is a sample error from the log. using the search strings you kindly provided details everything as user=null. is it possible to have splunk return entries based upon 'account for which logon failed' so that it returns the machines that are failing to login? this should then allow me to identify the wonky machines. i've tried adjusting the search terms but it doesn't appear to like spaces, even if i enclose items within either '' or "". thanks, andy.

20111107091459.000000
Category=12544
CategoryString=Logon
ComputerName=server.domain.org
EventCode=4625
EventIdentifier=4625
EventType=5
Logfile=Security
RecordNumber=106973290
SourceName=Microsoft-Windows-Security-Auditing
TimeGenerated=20111107091459.415352-000
TimeWritten=20111107091459.415352-000
Type=Audit Failure
User=NULL
wmi_type=WinEventLog:Security
Message=An account failed to log on.

Subject:
Security ID: S-1-0-0
Account Name: -
Account Domain: -
Logon ID: 0x0

Logon Type: 3

Account For Which Logon Failed:
Security ID: S-1-0-0
Account Name: update.account
Account Domain: update.hostname
Failure Information:
Failure Reason: Unknown user name or bad password.
Status: 0xc000006d
Sub Status: 0xc0000064

Process Information:
Caller Process ID: 0x0
Caller Process Name: -

Network Information:
Workstation Name: update.hostname
Source Network Address: ip.address
Source Port: port
Detailed Authentication Information:
Logon Process: NtLmSsp
Authentication Package: NTLM
Transited Services: -
Package Name (NTLM only): -
Key Length: 0

This event is generated when a logon request fails. It is generated on the computer where access was attempted.

The Subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.

The Logon Type field indicates the kind of logon that was requested. The most common types are 2 (interactive) and 3 (network).

The Process Information fields indicate which account and process on the system requested the logon.

The Network Information fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.

The authentication information fields provide detailed information about this specific logon request.
- Transited services indicate which intermediate services have participated in this logon request.
- Package name indicates which sub-protocol was used among the NTLM protocols.
- Key length indicates the length of the generated session key. This will be 0 if no session key was requested.

0 Karma

tgow
Splunk Employee
Splunk Employee

I have seen the following info from many different devices. You can really narrow this down if you have the exact field that EventCode that you need. Here is an example search that we use:

fail* password | stats count by User_Name | where count > 5

Make sure you change the timepicker to whatever time range that you want.

0 Karma

tgow
Splunk Employee
Splunk Employee

Thanks for posting the sample log. That makes it easier. Here is a shot at the search:

sourcetype="*WinEventLog:Security" Message="An account failed to log on*" | stats count by Account_Name | where count > 5 | table Account_Name, ComputerName, Workstation_Name

You can put any of the fields listed on the left-hand side of the search in your table.

0 Karma

Simeon
Splunk Employee
Splunk Employee

You probably want to find all the failed logins and chart them over time, by user. So something like this:

source=security_log_file failed login | timechart count by user

You will need to make sure you are extracting the user name per failed event.

0 Karma
Get Updates on the Splunk Community!

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...