πŸ•΅οΈ
VeryLazyTech
πŸ“œ MediumπŸ›’ My ShopπŸ‘Ύ GithubπŸ“© Telegram πŸ“Ί YouTubeβœ– Twitter
  • πŸ•΅οΈWelcome!
    • VeryLazyTech
    • Support VeryLazyTech
      • πŸ‘Ύ GitHub
      • πŸ“œ Medium
      • β˜• My Shop
      • πŸ“Ί YouTube
      • βœ– Twitter
      • πŸ“© Telegram
  • πŸ›‘οΈ Vulnerabilities and Exploits
    • CVE - POC
      • Unauthenticated RCE Flaw in Rejetto HTTP File Server - CVE-2024-23692
      • POC - CVE-2024–4956 - Nexus Repository Manager 3 Unauthenticated Path Traversal
      • POC - CVE-2024-45241: Path Traversal in CentralSquare's CryWolf
      • Telerik Auth Bypass CVE-2024-4358
      • Check Point Security Gateways Information Disclosure - CVE-2024-24919
      • CVE-2024-23897 - Jenkins File Read Vulnerability
      • CVE-2024–10914- Command Injection Vulnerability in name parameter for D-Link NAS
      • POC - CVE-2024-21534 Jsonpath-plus vulnerable to Remote Code Execution (RCE)
      • CVE-2024-9935 - PDF Generator Addon for Elementor Page Builder <= 1.7.5 - Unauthenticated Arbitrary
      • CVE-2024-50623- Cleo Unrestricted file upload and download
      • POC - WordPress File Upload plugin, in the wfu_file_downloader.php file before version <= 4.24.11
      • POC - Remote and unauthenticated attacker can send crafted HTTP requests to RCE - cve-2025-3248
      • POCβ€Š-β€ŠCVE-2025–2539 File Away <= 3.9.9.0.1β€Š-β€ŠMissing Authorization to Unauthenticated Arbitrary File
      • POC - CVE-2025-29306 FOXCMS /images/index.html Code Execution Vulnerability
  • πŸ•΅οΈβ€β™‚οΈDorks
    • GitHub Dorks
    • Google Dork Online Tool
  • πŸ“š Resources
    • Top Hacking Books for 2024: FREE and Paid
    • How to Study for OSCP with the PWK Book PDF
    • Top 20 phishing tools to use in 2024
    • Top 8 Bug Bounty Books for 2025: Must-Reads for Ethical Hackers
    • Top Hacking Tools and Skills You Need to Learn in 2025
    • Offensive Cloud
    • Penetration Testing & Hacking Tools List
    • Top Cybersecurity Books by Topic
  • The Ultimate Penetration Testing Methodology (2025 Edition)
  • πŸ•ΈοΈPentesting Web
    • Client Side Template Injection (CSTI)
    • Identify a Server’s Origin IP
    • 2FA/MFA/OTP Bypass
  • IDOR
  • Open Redirect
  • Subdomain Takeover
  • Penetration Testing WiFi Networks
  • Client-Side Path Traversal
  • Clickjacking
  • Command Injection
  • JWT Vulnerabilities
  • Bypass rating limit
  • CORS - Misconfigurations & Bypass
  • LDAP Injection
  • File upload vulnerabilities
  • Content Security Policy (CSP) bypass
  • Brute Force - Services, web, local, tools & wordlists
  • 🐧Linux
    • Practical Linux Commands
    • Bypassing Bash Restrictions - Rbash
    • Privilege escalation - Linux
  • Linux Environment Variables
  • πŸͺŸWindows
    • Active Directory Methodology
    • Antivirus (AV) Bypass
  • 🌐Network Pentesting
    • FTP - Port 21
    • SSH- Port 22
    • Telnet - Port 23
    • SMTP/s - Port 25,465,587
    • WHOIS - Port 43
    • TACACS+ - Port 49
    • DNS - Port 53
    • TFTP/Bittorrent-tracker - Port 69/UDP
    • Finger - Port 79
    • Web - Port 80,443
    • Kerberos - Port 88
    • POP - Port 110/995
    • Portmapper - Port 111/TCP/UDP
    • Ident - Port 113
    • NTP - Port 123/UDP
    • MSRPC - Port 135, 539
    • NetBios - Port 137,138,139
    • SMB - Port 139 445
    • IMAP - Port 143, 993
    • SNMP - Ports 161, 162, 10161, and 10162/UDP
    • IRC - Ports 194,6667,6660-7000
    • Check Point Firewall - Port 264
    • LDAP - Ports 389, 636, 3268, 3269
    • IPsec/IKE VPN - Port 500/UDP
    • Modbus - Port 502
    • Rexec - Port 512
    • Rlogin - Port 513
    • Rsh - Port 514
    • Line Printer Daemon (LPD) - Port 515
    • Apple Filing Protocol (AFP) - PORT 548
    • RTSP - Port 554, 8554
    • IPMI - Port 623/UDP/TCP
    • Internet Printing Protocol (IPP) - Port 631
    • EPP - Port 700
    • Rsync - Port 873
    • Rusersd Service - Port 1026
    • Socks - Port 1080
    • Java RMI - RMI-IIOP - Port 1098/1099/1050
    • MSSQL (Microsoft SQL Server) - Port 1433
    • Oracle TNS Listener - Port 1521,1522-1529
  • PPTP - Port 1723
  • MQTT (Message Queuing Telemetry Transport) - Port 1883
  • Compaq HP Insight Manager - Port 2301, 2381
  • NFS Service - Port 2049
  • Docker - Port 2375,2376
  • Squid - Port 3128
  • iScsi - Port 3260
  • SAPRouter - Port 3299
  • 😎Post-exploitation
    • File Transfer Cheatsheet: Windows andΒ Linux
  • πŸ§‘β€πŸ”§Technical guides
    • Kali Linux - Installation
Powered by GitBook
On this page
  • Stop Windows Defender (Bypass Microsoft Defender)
  • defendnot – Kill Defender in One Click
  • no-defender – Fake AV Method
  • Manual Defender Disable (Admin Rights Required)
  • AV Evasion Methodology
  • Static Detection β€” "Caught Without Even Running"
  • πŸ› οΈ How to Bypass It:
  • Dynamic Analysis β€” "Let's See What It Actually Does"
  • πŸ› οΈ How to Avoid Sandboxes:
  • πŸ›‘οΈ EXE vs DLL Payloads for AV Evasion
  • πŸ” Case Comparison – EXE vs DLL Detection Rates
  • πŸ” DLL Proxying: Preserving Application Functionality
  • πŸ› οΈ Building a Proxy DLL with SharpDLLProxy
  • ❄️ Freeze: Stealthy Shellcode Execution via Direct Syscalls & Suspended Processes
  • βš™οΈ How Freeze Works
  • πŸ› οΈ Using Freeze with Havoc Shellcode

Was this helpful?

  1. Windows

Antivirus (AV) Bypass

In this guide, we provide a deep dive into Windows Antivirus (AV) and Endpoint Detection and Response (EDR) bypass techniques, empowering red teamers and advanced penetration testers with up-to-date,

  • Become VeryLazyTech member! 🎁

  • Follow us on:

    • βœ– Twitter @VeryLazyTech.

    • πŸ‘Ύ Github @VeryLazyTech.

    • πŸ“œ Medium @VeryLazyTech.

    • πŸ“Ί YouTube @VeryLazyTech.

    • πŸ“© Telegram @VeryLazyTech.

    • πŸ•΅οΈβ€β™‚οΈ My Site @VeryLazyTech.

  • Visit our shop for e-books and courses. πŸ“š

Stop Windows Defender (Bypass Microsoft Defender)

When performing red team operations or malware testing in lab environments, disabling or bypassing Windows Defender (Microsoft Defender) is often a necessary first step. While modern Defender versions are harder to disable, there are still a few common tools and techniques used to neutralize it β€” especially if you have administrative privileges.

defendnot – Kill Defender in One Click

defendnot is a lightweight tool designed to disable Windows Defender by modifying key services and registry entries. It's often used in post-exploitation stages where persistence is already achieved. Keep in mind that many versions of this tool are flagged as malicious, so execution must be stealthy or obfuscated.

Features:

  • Disables real-time protection

  • Stops Defender services

  • Modifies registry keys to prevent reactivation

no-defender – Fake AV Method

The no-defender script uses a clever method to fool Windows into thinking another antivirus solution is installed. This triggers Windows Security Center to automatically disable Defender to prevent conflicts.

How it works:

  • Fakes the presence of another AV solution by editing WMI or registry entries

  • Causes Defender to automatically shut itself down

  • Requires minimal permissions and leaves fewer traces than brute-force disabling

βœ… Effective in environments where you cannot fully disable Defender, but need to suppress its real-time scanning.

Manual Defender Disable (Admin Rights Required)

If you have administrative privileges, the most direct method is to disable Defender manually via PowerShell or Group Policy.

PowerShell (Run as Admin):

Set-MpPreference -DisableRealtimeMonitoring $true

Group Policy:

  1. Run gpedit.msc

  2. Navigate to: Computer Configuration > Administrative Templates > Windows Components > Microsoft Defender Antivirus

  3. Set Turn off Microsoft Defender Antivirus to Enabled

This will completely shut down Defender, though modern Windows versions may automatically reactivate it after a while or after reboot.


AV Evasion Methodology

If you’ve ever created a tool or payload for a red team exercise, malware lab, or ethical hacking test, you’ve probably seen your file get instantly flagged or deleted by antivirus software β€” even before you could run it.

That’s because modern security tools like Windows Defender and EDR (Endpoint Detection and Response) software are much smarter than they used to be. They don’t just look for viruses β€” they analyze how files behave, both before and after execution.

In this guide, we’ll break down how AVs detect malware and how attackers try to bypass each layer using real-world examples.

Static Detection β€” "Caught Without Even Running"

Static detection is the simplest and fastest method. The antivirus scans your file before it runs, and checks:

  • Known virus signatures (patterns of code)

  • Suspicious or malicious strings (e.g., mimikatz, powershell -enc)

  • Metadata (file name, version, company name, icon)

  • File structure (e.g., abnormal PE headers or compressed sections)

You download a public reverse shell script called meterpreter.exe from GitHub. Before you even run it, Defender deletes it. Why? Because it's already flagged and fingerprinted in their database.

πŸ› οΈ How to Bypass It:

πŸ”’ Encryption

Attackers encrypt the malicious part of the code so antivirus can’t see it. A loader program decrypts it during runtime.

Encrypting a Cobalt Strike beacon and using a C# loader to inject it into memory.

πŸŒ€ Obfuscation

They change the code's appearance without changing what it does. This confuses signature scanners.

Replace all strings like "mimikatz" with "miXXkz" and decode them at runtime.

βš™οΈ Custom Tools

They build their own tools from scratch, so there's no existing signature.

Writing a custom LSASS dumper in C instead of using mimikatz.exe.

βœ… Pro Tip: Use ThreatCheck

It’s a tool that helps you test which parts of your file Defender doesn’t like. It breaks your file into pieces and checks which ones trigger detection.

Dynamic Analysis β€” "Let's See What It Actually Does"

If your file passes the static checks, AVs may run it in a sandbox β€” a fake computer environment β€” to see what it tries to do.

If your file starts:

  • Dumping passwords

  • Spawning PowerShell

  • Reading browser cookies …it’ll probably get blocked.

πŸ› οΈ How to Avoid Sandboxes:

⏳ Sleep Before Execution

They delay the malicious action. Sandboxes only run files for a short time.

Add a sleep(60) command. If the sandbox only watches for 10 seconds, it won’t catch anything.

⚠️ Advanced sandboxes may skip sleep calls, so attackers use tricky sleep methods (like CPU loops or encryption delays).

πŸ’» Check for Low Resources

Most sandboxes have very little RAM and CPU to stay fast.

If RAM < 2GB, exit the program.

πŸ–₯️ Machine Checks (Anti-Sandbox Tricks)

They check if the file is running on a real user’s machine or a fake one.

Microsoft Defender's sandbox uses a computer name called HAL9TH. So malware can do:

if (computer_name == "HAL9TH") exit();

➑️ Example: Only run if the system is part of a real company domain like contoso.local.

It turns out that Microsoft Defender's Sandbox computername is HAL9TH, so, you can check for the computer name in your malware before detonation, if the name matches HAL9TH, it means you're inside defender's sandbox, so you can make your program exit.


πŸ›‘οΈ EXE vs DLL Payloads for AV Evasion

When it comes to bypassing antivirus (AV) detection, Dynamic Link Libraries (DLLs) often present a lower detection profile compared to standard executable (EXE) files. This observation is especially true in the context of offensive security tools like Havoc, where detection signatures for EXEs are more mature and widely distributed among endpoint protection platforms.

In practical red team operations, it's generally advisable to favor DLL payloads over EXEs whenever feasible. This is because DLL files tend to attract less immediate scrutiny, both from static and dynamic analysis engines. There are several reasons for this:

  • Less common as direct execution targets: DLLs are typically loaded by another process rather than executed directly, making them less likely to be flagged during casual analysis.

  • Execution context control: DLLs can be injected into trusted processes (e.g., via rundll32.exe, regsvr32.exe, or manual injection), allowing more stealthy execution chains.

  • Fewer behavioral triggers: Since DLLs are often executed through indirect methods, they may not immediately display suspicious behavior, helping them evade heuristic or behavioral detection models.

πŸ” Case Comparison – EXE vs DLL Detection Rates

As demonstrated in the following virustotal.com comparison, a standard Havoc DLL payload showed a significantly lower detection rate compared to its EXE counterpart:

  • EXE Payload: Detected by 7 out of 26 engines

  • DLL Payload: Detected by only 4 out of 26 engines

This doesn't imply DLLs are undetectable β€” all payloads can and eventually will be caught if reused enough β€” but the lower signature profile makes DLLs a better starting point for stealthy execution.


🧬 DLL Sideloading & Proxying for Stealthy Payload Execution

DLL Sideloading is a well-known and highly effective technique for achieving stealthy execution of malicious code by exploiting the Windows DLL search order. The concept is simple: many applications load DLLs from their own directory before searching system paths. By placing a malicious DLL alongside a trusted application, you can trick the application into loading your code instead of the legitimate library.

This technique is particularly valuable in red team engagements, especially when you want to blend into legitimate application behavior.

πŸ” Identifying DLL Sideloading Opportunities

To discover applications susceptible to DLL sideloading, tools like Siofra are incredibly useful. Below is a PowerShell script that recursively scans executables within C:\Program Files\ and checks for potential DLL hijack opportunities:

powershellCopyEditGet-ChildItem -Path "C:\Program Files\" -Filter *.exe -Recurse -File -Name | ForEach-Object {
    $binaryToCheck = "C:\Program Files\" + $_
    C:\Users\user\Desktop\Siofra64.exe --mode file-scan --enum-dependency --dll-hijack -f $binaryToCheck
}

This will produce a list of applications and the DLLs they attempt to load β€” helping you target candidates for hijacking.

⚠️ Important Note: Many public sideloading targets are widely known and monitored by EDRs. Always test and verify before using them in an engagement. Prefer discovering new, lesser-known targets for stealthier operations.


πŸ” DLL Proxying: Preserving Application Functionality

Simply dropping a DLL with the correct filename is not enough. Applications often expect the loaded DLL to expose specific exported functions. If these are missing, the application may crash or fail to load the DLL.

To overcome this, we use DLL Proxying (or Forwarding) β€” a technique where the malicious DLL:

  1. Implements required exports that forward calls to the original DLL.

  2. Executes the payload alongside this forwarding logic.

This preserves the original functionality of the application while allowing malicious code execution β€” making it extremely stealthy.

πŸ› οΈ Building a Proxy DLL with SharpDLLProxy

We’ll use the excellent SharpDllProxy tool by @flangvik to automate the creation of proxy DLLs:

Steps to Create a Working Proxy DLL:

  1. Identify a vulnerable application Use tools like Siofra or Process Hacker to find a binary that loads external DLLs insecurely.

  2. Generate shellcode For example, using Havoc C2.

  3. (Optional) Encode the shellcode To further obfuscate detection, you can use an encoder like Shikata Ga Nai (SGN).

  4. Generate the proxy code Use SharpDllProxy to generate forwarding stubs and inject the shellcode:

    .\SharpDllProxy.exe --dll .\mimeTools.dll --payload .\demon.bin

    This will generate:

    • A C source file that proxies the original DLL and executes your payload.

    • The renamed original DLL to forward calls to.

  5. Compile the proxy DLL

    • Open Visual Studio and create a new C++ DLL project.

    • Paste the proxy code from output_dllname/dllname_pragma.c.

    • Build the DLL.

  6. Deploy your proxy DLL Place it alongside the target executable under the expected DLL name.


❄️ Freeze: Stealthy Shellcode Execution via Direct Syscalls & Suspended Processes

Freeze is a lightweight and powerful payload delivery toolkit developed by Optiv. It is designed to evade modern Endpoint Detection and Response (EDR) solutions by leveraging several advanced evasion techniques, including:

  • Suspended process injection

  • Direct system calls (syscalls)

  • Custom shellcode encryption and execution

  • Bypassing userland API hooks

Freeze is particularly effective in situations where traditional injection techniques (e.g., CreateRemoteThread, VirtualAllocEx) are flagged by AV/EDR.

βš™οΈ How Freeze Works

Freeze creates an executable payload stub that, when launched, will:

  1. Decrypt and load embedded shellcode.

  2. Spawn a suspended legitimate process (e.g., notepad.exe or dllhost.exe).

  3. Inject the shellcode using direct syscalls instead of standard Windows APIs β€” avoiding common detection triggers.

  4. Resume the target process, executing your shellcode in memory.

This approach minimizes behavioral anomalies and avoids detection by user-mode hooks that most EDRs rely on.


πŸ› οΈ Using Freeze with Havoc Shellcode

Here’s a quick walkthrough for building and using Freeze with shellcode generated from Havoc C2:

  1. Clone and build Freeze:

    git clone https://github.com/optiv/Freeze.git
    cd Freeze
    go build Freeze.go
  2. Generate your shellcode (e.g., raw .bin payload from Havoc C2 or any shellcode generator like msfvenom or Donut).

  3. Build the Freeze payload with encryption enabled:

    ./Freeze -I demon.bin -encrypt -O demon.exe
    • -I demon.bin: Input shellcode.

    • -encrypt: Encrypt the payload in the stub for obfuscation.

    • -O demon.exe: Output filename.

  4. Execution Run the resulting demon.exe. It will launch a trusted process in a suspended state, inject your shellcode using direct syscalls, and resume execution β€” without triggering Microsoft Defender or most commercial EDRs (as of the last test).

βœ… Result: In controlled tests, Freeze-enabled payloads executed silently with no alerts from Windows Defender, thanks to its combination of encryption, syscalls, and stealthy process manipulation.


Learn & practice For the Bug Bounty

Support VeryLazyTech πŸŽ‰
  • Become VeryLazyTech member! 🎁

  • Follow us on:

    • βœ– Twitter @VeryLazyTech.

    • πŸ‘Ύ Github @VeryLazyTech.

    • πŸ“œ Medium @VeryLazyTech.

    • πŸ“Ί YouTube @VeryLazyTech.

    • πŸ“© Telegram @VeryLazyTech.

    • πŸ•΅οΈβ€β™‚οΈ My Site @VeryLazyTech.

  • Visit our shop for e-books and courses. πŸ“š

PreviousActive Directory MethodologyNextFTP - Port 21

Last updated 16 hours ago

Was this helpful?

πŸͺŸ
E-Book - Evading EDR: The Definitive Guide to Defeating Endpoint Detection SystemsGumroad
Logo
source: https://youtu.be/StSLxFbVz0M?t=1439