Adversaries may rely on a user installing a malicious library to facilitate execution. Threat actors may Upload Malware to package managers such as NPM and PyPi, as well as to public code repositories such as GitHub. User may install libraries without realizing they are malicious, thus bypassing techniques that specifically achieve Initial Access. This can lead to the execution of malicious code, such as code that establishes persistence, steals data, or mines cryptocurrency.(Citation: Datadog Security Labs Malicious PyPi Packages 2024)(Citation: Fortinet Malicious NPM Packages 2023)
In some cases, threat actors may compromise and backdoor existing popular libraries (i.e., Compromise Software Dependencies and Development Tools). Alternatively, they may create entirely new packages and leverage behaviors such as typosquatting to encourage users to install them.
User-Initiated Malicious Library Installation via Package Manager (T1204.005)
Limit Software Installation: Prevent users or groups from installing unauthorized or unapproved software to reduce the risk of introducing malicious or vulnerable applications. This can be achieved through allowlists, software restriction policies, endpoint management tools, and least privilege access principles. This mitigation can be implemented through the following measures:
Application Whitelisting
Restrict User Permissions
Software Restriction Policies (SRP)
%AppData%, %Temp%, and external drives..exe, .bat, .msi, .js, .vbs) to trusted directories only.Endpoint Management Solutions
Monitor Software Installation Events
Implement Software Inventory Management
Tools for Implementation
Application Whitelisting:
Endpoint Management:
Software Restriction Policies:
Monitoring and Logging:
Inventory Management and Auditing:
Network Intrusion Prevention: Use intrusion detection signatures to block traffic at network boundaries.
User Training: User Training involves educating employees and contractors on recognizing, reporting, and preventing cyber threats that rely on human interaction, such as phishing, social engineering, and other manipulative techniques. Comprehensive training programs create a human firewall by empowering users to be an active component of the organization's cybersecurity defenses. This mitigation can be implemented through the following measures:
Create Comprehensive Training Programs:
Use Simulated Exercises:
Leverage Gamification and Engagement:
Incorporate Security Policies into Onboarding:
Regular Refresher Courses:
Emphasize Real-World Scenarios:
No cross-framework mappings available