• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

My TechDecisions

  • Best of Tech Decisions
  • Topics
    • Video
    • Audio
    • Mobility
    • Unified Communications
    • IT Infrastructure
    • Network Security
    • Physical Security
    • Facility
    • Compliance
  • RFP Resources
  • Resources
  • Podcasts
  • Subscribe
  • Project of the Week
  • About Us
    SEARCH
Compliance, IT Infrastructure, Network Security, News

How to Secure PowerShell and Use it for Cybersecurity Defense

Cybersecurity agencies say organizations should take several steps to secure PowerShell and keep it from being used in cyberattacks.

July 6, 2022 Zachary Comeau Leave a Comment

PowerShell Cybersecurity

PowerShell is an incredibly effective tool that allows IT administrators to automate repetitive tasks and is particularly useful in helping to protect and manage the cybersecurity of Windows operating systems.

However, those same capabilities are just as useful for hackers after gaining initial access to a network,  with PowerShell scripts being used to weaken intrusion prevention systems, move laterally and maintain persistence.  According to cybersecurity researchers, the tool has been used in several notable incidents, including the Kaseya VSA compromise that led to a mass deployment of the REvil ransomware last year.

Several other threat actors have leveraged PowerShell to infect Word and Excel files with malware and spread fileless malware, according to new information provided by the U.S. Cybersecurity and Infrastructure Security Agency and a host of other nations’ cybersecurity agencies.

The new document released gives IT and cybersecurity professionals recommendations on how to secure PowerShell and prevent it from being used against the organization in the event of a cyberattack, rather than simply disabling PowerShell.

Make sure PowerShell is up to date

PowerShell 7.2 is the latest version of the scripting tool, and an earlier version, 5.1, is included with Windows 10+. However, version 7.2 can fully integrate with and access all components created for version 5.1. Agencies recommend disabling and uninstalling the “deprecated second version on Windows 10+,” as newer versions of PowerShell provide enhanced security measures.

PowerShell Remoting security

PowerShell includes built-in security features that enable administrators, analysts and users to remotely execute commands on Windows hosts. The underlying protocol used is Windows Remote Management (WinRM), and Kerberos or New Technology Lan Manager (NTLM) are the default authentication protocols. Those protocols do not send the actual credentials to remote hosts, thus avoiding direct exposure of credentials.

Agencies also advise organizations to configure Windows Firewall rules on endpoints to control permitted connections. The client and server editions of Windows include PowerShell remoting capabilities, but access to endpoints with PowerShell remoting requires the requesting user to have admin privileges at the destination by default. Enabling PowerShell remoting on private networks will introduce a Windows Firewall rule to accept all connections. Those rules can be customized to restrict connections to only trusted endpoints and networks to reduce lateral movement and harden networks.

According to the cybersecurity agencies, PowerShell 7 permits remote connections over Secure Shell in addition to WinRM connections, allowing for public key authentication and convenient and secure remote management. New capabilities can establish remote connections without requiring the use of HTTPS with SSL/TLS certificates. PowerShell over SSH does not require Trusted Hosts as when remoting over WinRM outside of a domain, allowing for secure remote management over SSH without a password for all commands and connections. This also allows for PowerShell remoting between Windows and Linux hosts.

Antimalware Scan Interface (AMSI) integration

The agencies also say the Antimalware Scan Interface feature, integrated into different Windows components, can scan for in-memory and dynamic file contents for malicious content using an anti-virus product registered with Windows. Built-in scripting languages, including PowerShell, use AMSI so that scripts are scanned by registered and supported anti-virus software.

Limiting PowerShell’s capabilities

Using AppLocker or Windows Defender Application Control, admins can block certain actions on a Windows host and cause PowerShell to operate in Constrained Language Mode, restricting PowerShell operations unless allowed by administrator defined policies, according to the agencies. This corrects an AppLocker script enforcement flaw that blocks PowerShell commands in a script but allows them interactively entered into the PowerShell command console. A proper configuration can prevent a malicious actor from gaining full control over a PowerShell session.

Detecting abuse

Organizations should maintain logs and monitor PowerShell activities to detect when malicious actors are leveraging the tool. However, deep script block logging, module logging and over-the-shoulder transcription are all disabled by default. The agencies recommend enabling those capabilities where feasible.

Deep script block logging records each PowerShell command in the Windows Event Log, while module logging captures the pipeline execution details of PowerShell. Meanwhile, over-the-shoulder transcription records every PowerShell input and output, whether functional or not, to help defenders decipher intended actions.

Don’t block PowerShell

Some organizations have taken to blocking PowerShell altogether to prevent malicious actors from utilizing the tool, but the agencies warn against that tactic, as it can hinder defensive capabilities that current versions of PowerShell provide.

Tagged With: Cybersecurity, PowerShell

Related Content:

  • ScreenBeam Logo ScreenBeam Invites K-12 Institutions to Apply for Wireless…
  • 1E Patch Insights, Patch Management, Software update 1E Releases Patch Insights to Augment Microsoft Patching…
  • Google AI Investment, Anthropic, OpenAI, ChatGPT Google Makes Key AI Investment as Microsoft Begins…
  • AVer CAM550 and VB342 Pro Certified for Microsoft Teams AVer CAM550, VB342 Pro 4K PTZ Cameras Certified…

Free downloadable guide you may like:

  • Harnessing the Power of Digital SignageHarnessing the Power of Digital Signage

    Choosing the best solutions for messaging, branding, and communicating in today’s content-everywhere landscape

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Get the FREE Tech Decisions eNewsletter

Sign up Today!

Latest Downloads

Harnessing the Power of Digital Signage
Harnessing the Power of Digital Signage

Choosing the best solutions for messaging, branding, and communicating in today’s content-everywhere landscape

Blueprint Series Cover: What works for hybrid work
Blueprint Series: What Works for Hybrid Work

Download this free resource to learn about how IT leaders can effectively manage and implement a hybrid work model.

Guide to creating a ransomware response plan download
Blueprint Series: Creating a Ransomware Response Plan

Chances are ransomware hackers are researching your company right now. They’re investing time and money to choose the most profitable targets and a...

View All Downloads

Would you like your latest project featured on TechDecisions as Project of the Week?

Apply Today!
Sharp Microsoft Collaboration HQ Logo

Learn More About the
Windows Collaboration Display

More from Our Sister Publications

Get the latest news about AV integrators and Security installers from our sister publications:

Commercial IntegratorSecurity Sales

AV-iQ

Footer

TechDecisions

  • Home
  • Welcome to TechDecisions
  • Subscribe to the Newsletter
  • Contact Us
  • Media Solutions & Advertising
  • Comment Guidelines
  • RSS Feeds
  • Twitter
  • Facebook
  • Linkedin

Free Technology Guides

FREE Downloadable resources from TechDecisions provide timely insight into the issues that IT, A/V, and Security end-users, managers, and decision makers are facing in commercial, corporate, education, institutional, and other vertical markets

View all Guides
TD Project of the Week

Get your latest project featured on TechDecisions Project of the Week. Submit your work once and it will be eligible for all upcoming weeks.

Enter Today!
Emerald Logo
ABOUTCAREERSAUTHORIZED SERVICE PROVIDERSTERMS OF USEPRIVACY POLICY

© 2023 Emerald X, LLC. All rights reserved.