Building a Windows Reverse Shell in C Before Converting It to Shellcode

· 6:12 · Watch on YouTube ↗

Summary

The video demonstrates a lab reverse shell in C: a Windows process connects back over a socket, redirects its standard streams to that socket, and accepts commands through a Netcat listener. The series plans to convert the working program to shellcode.

Key points

  • The presenter uses a C program to establish and test reverse-shell behavior before implementing it in shellcode.
  • The program spawns command.exe and redirects standard input, output, and error to the socket.
  • The lab uses virtual machines on a VMware NAT network and checks connectivity between them with ping.
  • Netcat listens on the configured address and port; running the program connects the victim-role machine to the listener.
  • The demonstrated shell runs with the permissions of the user running the program and terminates with Ctrl+C.
  • The presenter says this demonstration does not add persistence or process migration; later videos will examine the code and shellcode implementation.

Article Details

Topics
  • [00:00] Plan to build and test reverse-shell behavior in C before converting it to shellcode
  • [01:52] Socket connection, command.exe process creation, and redirecting standard streams
  • [02:44] Virtual-machine lab setup and network connectivity checks
  • [04:06] Compiling the program and starting a Netcat listener
  • [05:17] Testing the reverse shell, stopping it, and noting the absence of persistence

MITRE ATT&CK

Products

Tools

Related Articles