Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.71 KB

defense_evasion_python_library_load_and_delete.md

File metadata and controls

44 lines (30 loc) · 1.71 KB

Python Library Load and Delete


Metadata

  • Author: Elastic

  • Description: Detects when a Python process loads a library from a user's home directory and then deletes that library within a short time window. This may indicate an attempt to execute malicious code in memory and remove evidence from disk as a form of defense evasion.

  • UUID: 76a1f901-4495-4cbd-a35a-7ff8d116602b

  • Integration: endpoint

  • Language: [EQL]

  • Source File: Python Library Load and Delete

Query

sequence by process.entity_id with maxspan=15s
  [library where event.action == "load" and dll.path like "/Users/*" and process.name like~ "python"]
  [file where event.action == "deletion" and startswith~(file.path, dll.path)]

Notes

  • This hunting rule helps identify potential in-memory execution or anti-forensic behavior by Python-based malware.
  • Library load followed by quick deletion is suspicious, especially in user directories.
  • Consider pivoting on process.entity_id to examine surrounding process activity and file writes.

MITRE ATT&CK Techniques

References

License

  • Elastic License v2