LOLBins (Complete Guide to Living Off the Land Binaries)

Listen to this Post

LOLBins are built-in system utilities exploited by attackers for stealthy, malicious activities. Learn how they work, their real-world abuse cases, and how to defend against them.
🔗 Read more: LOLBins (Complete Guide to Living Off the Land Binaries)

Practice-Verified Codes and Commands

1. Detecting LOLBins Usage on Windows:

Use PowerShell to monitor processes that might be leveraging LOLBins:

Get-Process | Where-Object { $_.ProcessName -in @("powershell", "cmd", "wmic", "mshta") } | Format-Table -AutoSize 

2. Monitoring LOLBins with Sysmon:

Configure Sysmon to log suspicious activities:

<Sysmon schemaversion="4.90"> 
<EventFiltering> 
<RuleGroup name="LOLBins Detection" groupRelation="or"> 
<ProcessCreate onmatch="include"> 
<Image condition="contains">powershell.exe</Image> 
<Image condition="contains">cmd.exe</Image> 
<Image condition="contains">wmic.exe</Image> 
</ProcessCreate> 
</RuleGroup> 
</EventFiltering> 
</Sysmon> 

3. Linux Command to Detect Suspicious Binaries:

Use `ps` and `grep` to identify unusual processes:

ps aux | grep -E '(curl|wget|bash|sh|python|perl)' 

4. Blocking LOLBins with AppLocker (Windows):

Create a policy to restrict execution of common LOLBins:

New-AppLockerPolicy -RuleType Script -User Everyone -Path "C:\Windows\System32*.exe" -Action Deny 

5. Auditing LOLBins with Auditd (Linux):

Configure `auditd` to monitor critical binaries:

auditctl -w /usr/bin/curl -p x -k LOLBins 
auditctl -w /usr/bin/wget -p x -k LOLBins 

What Undercode Say

LOLBins represent a significant threat in cybersecurity, as they allow attackers to operate stealthily by leveraging trusted system utilities. Defending against LOLBins requires a multi-layered approach, combining monitoring, logging, and restriction policies. On Windows, tools like Sysmon and AppLocker can help detect and block malicious usage of binaries like PowerShell, cmd, and wmic. Linux systems can benefit from `auditd` and `ps` commands to monitor suspicious activities. Regularly updating your knowledge of LOLBins and their abuse cases is crucial for staying ahead of attackers. Additionally, implementing endpoint detection and response (EDR) solutions can enhance your defense mechanisms. For further reading, explore resources like Mitre ATT&CK and LOLBAS Project.

By mastering these commands and strategies, you can significantly reduce the risk posed by LOLBins and improve your overall cybersecurity posture. Always remember to stay vigilant and keep your systems updated to mitigate emerging threats.

References:

initially reported by: https://www.linkedin.com/posts/housenathan_lolbins-complete-guide-to-living-off-the-activity-7302599446721187840-N94b – Hackers Feeds
Extra Hub:
Undercode AIFeatured Image