Stealth Symphony: Unveiling Untraceable Windows Reverse Shells with Nim

Ba Anasxs
4 min readNov 10, 2023

--

Hello, Cyber Sleuths! Today, we’re taking a peek into Nim Reverse Shell developed by Sn1r, a nifty Windows reverse shell making waves in the tech world. Join me for a quick spin through its features, unraveling the digital magic it brings to the table. Ready for a byte-sized exploration? Let’s dive in!

Setup

1. git clone https://github.com/Sn1r/Nim-Reverse-Shell.git

2. edit rev_shell.nim using nano. replace IP and PORT with yours

3. Save the rev_shell.nim after changing the v1 = IP and v2 = PORT. check the screenshot above.

4. The command nim c -d:mingw --app:gui rev_shell.nim is used to compile a Nim program into a Windows executable. Let's break down each part of the command:

  • nim c: This is the command to compile a Nim program. nim is the command-line tool for the Nim programming language, and c is the command to compile a program nim-lang.org.
  • -d:mingw: This is a compiler option that tells Nim to use the MinGW compiler, which produces a Windows executable. The -d: option is used to define a symbol that can be used in the Nim code, in this case, mingw nim-lang.org.
  • --app:gui: This is another compiler option that tells Nim to create a GUI application. GUI applications run in the background, which is useful for programs like a reverse shell that run in the background on the victim's machine nim-lang.org.
  • rev_shell.nim: This is the name of the Nim file to compile. In this case, it's a file named rev_shell.nim.

The Reverse Shell is ready now. check the output of the nim c -d:mingw — app:gui rev_shell.nim. in my case the path is out: /home/kali/Desktop/NIm/Nim-Reverse-Shell/rev_shell.exe [SuccessX]

In ethical hacking, tweaking a reverse shell’s icon or adding signatures is a common experiment. I’ll transfer the payload to check if it connects to my Metasploit listener or triggers AV/EDR detection. This process helps understand security tool dynamics. Remember, ethical and legal boundaries must be respected to avoid consequences.

I’ve initiated the Metasploit multi-handler as a listener to capture incoming connections from the target machine

Under authorized testing conditions, our ‘revshell.exe’ demonstrated its ability to operate effectively, successfully evading AV/EDR on the target machine. This controlled scenario underscores the significance of staying informed about evolving security challenges and the ongoing need for robust defense mechanisms. It’s a reminder that ethical and authorized testing remains pivotal in strengthening cybersecurity measures.

After executing ‘rev_shell.exe’ on the target machine, the reverse shell successfully connected to the Metasploit listener, granting us a shell. This opens up opportunities to deploy a backdoor or establish an SSH session, providing a stable connection to the target system.

For educational purposes, I executed ‘rev_shell.exe’ on the target machine, resulting in a successful connection to the Metasploit listener, granting us a shell. This demonstration is solely for learning and understanding the mechanics of security testing. It’s important to approach these exercises responsibly and within ethical boundaries

Thank you for taking the time to explore the intricacies of cybersecurity with us. Your commitment to understanding the nuances of ethical hacking contributes to a safer digital landscape. Stay curious, stay secure!

--

--

Ba Anasxs

Cyber Security Consultant |Penetration Tester | CEHv12 Practical |CTF Hacking