πŸ›‘οΈ Firewall and IDS/IPS Evasion


πŸ” Defense Layers: Endpoint vs. Perimeter Protection

🧍 Endpoint Protection

Protects individual hosts (e.g., PC, server, workstation).

🧰 Common components:

  • Antivirus (e.g., Avast, BitDefender)

  • Antimalware (e.g., Malwarebytes)

  • Host-based Firewall

  • Anti-DDoS tools

🌐 Perimeter Protection

Guards the network edge using physical or virtual appliances.

🏰 Key zones:

  • Outside: Public internet

  • DMZ (De-Militarized Zone): Public-facing servers

  • Inside: Private/internal systems


πŸ“‹ Security Policies

Similar to Access Control Lists (ACLs), policies are made of allow and deny rules.

πŸ”’ Categories:

  • Network Traffic

  • Application Behavior

  • User Access Control

  • File Permissions

  • DDoS Mitigation


🧠 Detection Methods

Type
Description

Signature-Based

Matches known attack patterns

Heuristic/Statistical

Detects anomalies from network baseline

Stateful Protocol Analysis

Compares traffic to protocol norms

Live Monitoring (SOC)

Human/automated real-time monitoring


πŸ•΅οΈβ€β™‚οΈ Evasion Techniques

🎭 Signature-Based AV Bypass

  • AV engines scan files/processes for known signatures

  • Detected threats are quarantined or terminated

πŸ’‘ Evade with MSFVenom AES Tunneling

πŸ”’ Meterpreter sessions support AES encryption for communication, protecting against:

  • Network-based IDS/IPS

  • Traffic inspection tools

Still vulnerable to static file scanning pre-execution.


🧬 Using Executable Templates

🎯 Embed payloads in legitimate executables (e.g., installers):

πŸ“ Flags:

  • -k β†’ Keep original behavior

  • -x β†’ Use custom executable

  • -e β†’ Encode (e.g., x86/shikata_ga_nai)

  • -i β†’ Encode iterations


πŸ“¦ Packing with Archives

βš™οΈ Password-protecting a file within nested archives helps bypass signature detection.

Steps:

  1. Create archive:

  2. Rename archive:

  3. Nest again & rename:


πŸ§ͺ Testing Against VirusTotal

🧰 Submit via:

🎯 Result

  • Initial test.js file β†’ Detected by ~11/59 AV engines

  • Final test2 file (double archived) β†’ 0 detections 🚫

πŸ”— VirusTotalarrow-up-right


🧳 Packers

A packer compresses an executable with decompression logic to:

  • Obfuscate contents

  • Avoid AV file scanning

🧰 Popular packers:

  • UPX

  • MPRESS

  • The Enigma Protector

  • Themida

  • ExeStealth

πŸ” Learn more: PolyPack Projectarrow-up-right


πŸ§‘β€πŸ’» Exploit Coding & Obfuscation

To avoid detection, write customized, non-patterned exploit code.

Example:

πŸ”₯ Avoid:

  • Obvious NOP sleds

  • Static buffer patterns

  • Reuse of popular signatures

πŸ› οΈ Test custom exploits in a sandboxed lab before deployment.


πŸ“š Further Reading


Let me know if you’d like this saved as a downloadable .md file or used to create a full presentation!

Last updated