Akzium
  • Home
  • Solutions
    • Distributed File Systems
    • Security
    • Cloud Computing >
      • Enterprise File Sync and Sharing
    • SD-WAN
    • Secure Internet
    • Virtualization
    • Backup and Replication >
      • AS400 Backup and Replication
      • DICOM Image Backup and Archival
    • Disaster Recovery
  • Services
    • Cloud Migration Services
  • About
  • Blog

Malware Lateral Movement Prevention

7/31/2024

0 Comments

 
Picture
If your endpoint protection software fails or is bypassed/over-ridden by user-error, the next step in your prevention policy should be to do everything possible to restrict lateral movement. PCs on your network should NOT be talking to each other, yet by default Microsoft allows this behavior. You can use netstat -ano to determine existing applications and their listening ports. Here are a few steps to take to lock down your Windows 10/11 network PCs to prevent lateral movement of malware using Windows Firewall Rules and other settings:


  1. Block SMB-in traffic (port 445)
  2. Block Netbios/NBT-in traffic (TCP/UDP ports 137,138,139)
  3. Block RPC/DCom/WMi-in traffic (TCP/UDP ports 135,593)
  4. Block RDP-in traffic (TPC port 3389)
  5. Block IRC ports (TCP 194, 6660-6669, 6697, 7000)
  6. Block Calc.exe outbound traffic (\system32 and \syswow64)
  7. Block Notepad.exe outbound traffic (\system32 and \syswow64)
  8. Block Conhost.exe outbound traffic (\system32 and \syswow64)
  9. Block mshta.exe outbound traffic (\system32 and \syswow64)
  10. Block CertUtil.exe outbound traffic (\system32 and \syswow64)
  11. Block cscript.exe outbound traffic (\system32 and \syswow64)
  12. Block wscript.exe outbound traffic (\system32 and \syswow64)
  13. Block runscripthelper.exe outbound traffic (\system32 and \syswow64)
  14. Block regsvr32.exe outbound traffic (\system32 and \syswow64)
  15. Block hh.exe outbound traffic (\system32 and \syswow64)
  16. Disable SSH server and Block inbound connections on Port 22
  17. Disable Windows Update Optimization (this allows other PCs on your network to get updates from your PC and vice versa): Select Start > Settings > Windows Update > Advanced options Select Delivery Optimization. Under Allow downloads from other PCs, select Devices on my local network. Disable. Also, block Inbound and Outbound traffic on port 7680 in Windows Firewall..
  18. Disable firewall inbound-outbound rules for superfluous Windows applications. Do you use Skype? Why is Xbox even installed on your office PC? Do your users really need the News and Weather "gadget" on the taskbar?
  19. Run Powershell as administrator. Execute: Disable-PSRemoting to disable remote powershell execution. Execute: Set-ExecutionPolicy Restricted to restrict powershell execution.
  20. Use gpedit.msc or AD GPO to restrict the following commands from running (admin templates section): cmd.exe, netstat.exe, ipconfig.exe, powershell.exe, psexec.exe, paexec.exe, regedit.exe, and powershell_ise.exe
  21. Use gpedit.msc or AD GPO to disable LLMNR (computer-admin templates-network-dnsclient-turn off multicast name resolution)
  22. Disable RDP (see additional RDP information below)
  23. Disable Windows Remote Management service
  24. Associate Commonly Abused File Extensions such as .WS, .WSF, .HTA, .PIF, .VB, .VBS, .JS, .JSE, .WSC, .WSH, .PS1, .PS1XML, .PS2, .PS2XML, .PSC1, .PSC2, .MSH, .MSH1, .MSH2, .MSHXML, .MSH1XML, .MSH2XML, .SCF, .LNK, .INF and .REG (just to name a few) with Notepad.exe. This is becoming more difficult with the newer versions of Windows10/11 thanks to Microsoft's recent updates. Check out this list of dangerous file extensions over on HowToGeek: https://www.howtogeek.com/137270/50-file-extensions-that-are-potentially-dangerous-on-windows/
  25. Disable Macros in MS Office applications
  26. Ensure that PDF sandboxing is enabled in your PDF reader. *note: It is advisable to scan ALL pdf files before opening
  27. User logins should not be given local administrator rights
  28. Users should not be allowed to install software on their PC; this should only be done by administrators, and only after testing to ensure app safety.
  29. UAC should be enabled and set to high security


The most common lateral movement techniques abuse the Windows PC local admin$ and c$ administrative shares. These cannot be disabled nor can permissions be changed. However, restricting SMB-in traffic prevents the use of these shares. On a domain-joined PC you may have to allow SMB-in from Domain Controllers for group policies, but in that case only allow traffic by the DC's IP address and only via an encrypted session. The second most-abused lateral movement technique is RDP. It should be disabled. If RDP is a requirement, then restrict RDP-in to specific IP addresses and USERIDs, and enable encrypted traffic only. Secure RDP by requiring successful kerberos authentication from trusted computers and users and installing a 2FA solution such as Duo. Coming in third is Powershell. Disabling Remote Powershell (psexec), restricting powershell script execution, and disabling the use of powershell executables helps prevent this tactic. Dane Stucky has a great write-up over on Medium regarding endpoint isolation tactics, including how to implement secure RDP: https://medium.com/@cryps1s/endpoint-isolation-with-the-windows-firewall-462a795f4cfb
While this is by far not an exhaustive list of all of the tactics that can be implemented to prevent lateral movement, it is a great starting point. Implement rules one at a time, test your applications to make sure the rule doesn't "break" the application, and as always, back up your computer, your registry and local/domain group policies BEFORE attempting any of the above steps.


One added note. On your test system where you're implementing all of these changes, one way to get better visibility into the results is to install Glasswire ($36/yr subscription) on the test box and monitor for open ports, applications attempting outbound or inbound connections, etc.

​Oh, and if I missed anything, please add to the list in the comments.
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Author

    Akzium team blog

    Archives

    May 2025
    April 2025
    March 2025
    January 2025
    December 2024
    November 2024
    October 2024
    July 2024
    November 2022
    September 2022
    August 2022
    July 2022

    Categories

    All
    Alias Gmail
    Apache Log4J
    AWS EC2 IIS File Share
    BypassNRO
    Chrome Browser GPU
    Default Gateway
    DHCP
    DHCP Backup
    DHCP Restore
    DiskPart
    Endpoint Security
    File Server Migrations
    File Server Registry Key
    File Server Resource Manager
    File Shares Registry Key
    Ghost Network Adapters
    Gmail Alias
    Gmail Email Alias
    IBM 5250 Terminal
    IBM BOMC
    IBM Firmware Updater
    IBM FlashSystem Firmware Update
    IIS
    Internet Information Services
    Lenovo BOMC
    Lenovo Firmware Updater
    NTP
    RaspberryPi 4b
    RaspberryPi 4b 5250
    Recovery Partition Relocate
    Security Registry Edits
    Self Signed SSL
    Set Chrome To Use GPU
    Time Server Change
    Uptime Kuma
    Uptime Kuma Ubuntu Install
    Virus Scanner
    VMware
    Windows 11
    Windows 11 Developer Console
    Windows File Server
    Windows IIS File Sharing
    Windows Quick Assist
    Windows Route Command
    Windows Sandbox
    Windows Script Host
    Windows Server 2022 Recovery Partition
    Windows Shared Experiences
    Windows Time

    RSS Feed

Akzium, LLC | 601-841-2499     .     [email protected]
Copyright 2011-2025, Akzium, LLC.  All rights reserved.