Detection: Potential password in username

Description

The following analytic identifies instances where users may have mistakenly entered their passwords in the username field during authentication attempts. It detects this by analyzing failed authentication events with usernames longer than 7 characters and high Shannon entropy, followed by a successful authentication from the same source to the same destination. This activity is significant as it can indicate potential security risks, such as password exposure. If confirmed malicious, attackers could exploit this to gain unauthorized access, leading to potential data breaches or further compromise of the system.

 1
 2| tstats `security_content_summariesonly` earliest(_time) AS starttime latest(_time) AS endtime latest(sourcetype) AS sourcetype values(Authentication.src) AS src values(Authentication.dest) AS dest count FROM datamodel=Authentication WHERE nodename=Authentication.Failed_Authentication BY "Authentication.user" 
 3| `drop_dm_object_name(Authentication)` 
 4| lookup ut_shannon_lookup word AS user 
 5| where ut_shannon>3 AND len(user)>=8 AND mvcount(src) == 1 
 6| sort count, - ut_shannon 
 7| eval incorrect_cred=user 
 8| eval endtime=endtime+1000 
 9| map maxsearches=70 search="
10| tstats `security_content_summariesonly` earliest(_time) AS starttime latest(_time) AS endtime latest(sourcetype) AS sourcetype values(Authentication.src) AS src values(Authentication.dest) AS dest count FROM datamodel=Authentication WHERE nodename=Authentication.Successful_Authentication Authentication.src=\"$src$\" Authentication.dest=\"$dest$\" sourcetype IN (\"$sourcetype$\") earliest=\"$starttime$\" latest=\"$endtime$\" BY \"Authentication.user\" 
11| `drop_dm_object_name(\"Authentication\")` 
12| `potential_password_in_username_false_positive_reduction` 
13| eval incorrect_cred=\"$incorrect_cred$\" 
14| eval ut_shannon=\"$ut_shannon$\" 
15| sort count" 
16| where user!=incorrect_cred 
17| outlier action=RM count 
18| `potential_password_in_username_filter`

Data Source

Name Platform Sourcetype Source
Linux Secure Linux icon Linux 'linux_secure' '/var/log/secure'

Macros Used

Name Value
potential_password_in_username_false_positive_reduction search *
potential_password_in_username_filter search *
potential_password_in_username_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1078.003 Local Accounts Defense Evasion
T1552.001 Credentials In Files Initial Access
KillChainPhase.DELIVERY
KillChainPhase.EXPLOITAITON
KillChainPhase.INSTALLATION
NistCategory.DE_AE
Cis18Value.CIS_10
APT29
APT32
FIN10
FIN7
HAFNIUM
Kimsuky
PROMETHIUM
Play
Tropic Trooper
Turla
APT3
APT33
Ember Bear
FIN13
Fox Kitten
Indrik Spider
Kimsuky
Leafminer
MuddyWater
OilRig
RedCurl
Scattered Spider
TA505
TeamTNT

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Risk Event False
This configuration file applies to all detections of type hunting.

Implementation

To successfully implement this search, you need to have relevant authentication logs mapped to the Authentication data model. You also need to have the Splunk TA URL Toolbox (https://splunkbase.splunk.com/app/2734/) installed. The detection must run with a time interval shorter than endtime+1000.

Known False Positives

Valid usernames with high entropy or source/destination system pairs with multiple authenticating users will make it difficult to identify the real user authenticating.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
Potential password in username ($user$) with Shannon entropy ($ut_shannon$) 21 30 70
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset /var/log/secure linux_secure
Integration ✅ Passing Dataset /var/log/secure linux_secure

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 3