Skip to content

Working SSH Remote Code Execution Working as of 3/1/2025

Notifications You must be signed in to change notification settings

SleepTheGod/SSH-RCE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a40a38f Β· Mar 2, 2025

History

7 Commits
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025

Repository files navigation

SSH Remote Code Execution Exploit (Zero-Day)

πŸš€ Exploiting a Buffer Overflow in malloc()

Created By: Taylor Christian Newsome

πŸ”₯ Overview

This exploit leverages a buffer overflow vulnerability in a custom SSH implementation that fails to properly allocate and manage memory. The program allocates only 28 bytes, but writes 29 bytes, leading to memory corruption, return address overwrite, and potential remote code execution.

This proof-of-concept (PoC) demonstrates exploitability by:
βœ… Overflowing the buffer beyond the allocated size.
βœ… Overwriting the return address with a controlled value.
βœ… Injecting shellcode for arbitrary command execution.
βœ… Bypassing protections (NX, Stack Canaries, ASLR).


πŸ›  Vulnerability Details

  • Function: malloc() allocates only 28 bytes but writes 29 bytes, corrupting adjacent memory.
  • Return address is miscalculated, leading to segmentation faults or arbitrary execution.
  • No error checking for open() and write(), causing silent failures.
  • system() call executes commands unsafely, allowing command injection.
  • Memory leak due to missing free(buffer) calls.

πŸ“œ Exploitation Steps

1️⃣ Identifying the Buffer Overflow

Run the vulnerable program in GDB:

gdb -q ./vulnerable_program
(gdb) run $(python3 -c 'print("A"*40)')  # Overwrite EIP

About

Working SSH Remote Code Execution Working as of 3/1/2025

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published