Undetected Windows Reverse Shell — Live Demo & Mitigations

Controlled, lab-only analysis of a process-injection reverse shell: why it can evade signature-based static checks and dynamic analysis, plus measured tests against a private Secure Web Gateway and defender-focused mitigations.
Malware Analysis Detections Windows Internals Sandboxing Network Forensics Code

This is lab style study of a process-injection reverse shell performed in VMs. The focus is explanation and measurement — why certain delivery and runtime techniques can avoid simple static/dynamic checks. I then test it against my Pi Secure Web Gateway to compare endpoint vs. gateway behavior. The VirusTotal scan also does sandbox tests and behavior analysis which will show how the code may be detected.

How it attempts to evade analysis

  1. Static evasion by obfuscation: The loader contains an encrypted payload rather than plain shellcode or strings that match malware signatures; this prevents simple signature and pattern matching from triggering on download.
  2. Minimal on-disk footprint: because the active code is reconstructed in memory inside another process, the original file on disk appears small and benign; reputation checks that rely on file hashes or obvious PE characteristics can therefore return “unknown” or “benign.”
  3. Runtime injection into trusted processes: the loader creates or hijacks a normally-trusted process and writes the payload into the target process memory — the behavior blends into otherwise normal process activity and can defeat simplistic sandbox heuristics that only look for suspicious processes spawning or unusual filenames.

Demo walkthroughs

Short clips showing the payload execution on the Windows victim and the listener session receiving the beacon.

Victim VM executing the staged loader and spawning the reverse shell.
Listener machine receiving the callback and granting an interactive session.

The program is ran with no issues. The code used successfully bypasses Windows Defender. Windows Defender comes with every windows machine by default, and is rarely changed to another anti-virus or used in combination with other defense measures. This shows that there is a huge security issue if one depends on an anti-virus alone. Using the Secure Web Gateway ensures that users do not need to change anything on their machines making it a great choice to defend many machines without even touching them. The Secure Web Gateway is not just limited to Windows or computers but can be used to protect any device that can browse the web.

Testing the Secure Web Gateway

As seen in the Pi Secure Web Gateway project's page, even though it bypasses Windows Defender, the reverse shell does not bypass the SWG.

Placeholder: SWG decision screenshot (deny with reason)

Mitigations & detections found from Sandbox findings

MITRE ATT&CK mapping

Key flagged API calls

These calls appearing in sequence form a high-confidence pattern for process injection; treat them as prioritized triage signals.

Network and DNS observations

Observed IP/port: 192.168.1.110:1337 — this address found in the sandbox run represents what could be for example a simulated C2 endpoint but in case is the IP address I chose for the reverse shell to connect to my linux machine.

Possible mitigation: correlate process IDs and parent/child chains with DNS and TCP events to determine whether the injected process generated the network traffic.

Process tree & suspicious parent/child relationships

The sandbox shows program.exe interacting with C:\Windows\System32\calc.exe as the injection target before spawning cmd.exe and related children. Seeing a trusted system binary such as calc.exe used as a host for malicious code is a high-signal indicator that the loader intentionally leveraged a benign process. Correlate the timestamp of the WriteProcessMemory and CreateRemoteThread events to confirm the injection path.

Recommended SIEM correlation rules

Endpoint (Windows)

What this demonstrates