Skip to content
Memory corruption Write-up Advanced

The Vulnerability

Serv-U FTP version 15.2.3.717 contains a vulnerability that allows an attacker to control the r9 register during the SSH handshake, leading to a call r9 instruction and potential remote code execution as NT AUTHORITY\System. The report describes building a ROP exploit to achieve code execution on modern Windows systems.

bishopfox.com

Published on bishopfox.com

As part of our work on the Cosmos platform (formerly known as CAST) we sometimes have a requirement to weaponize vulnerabilities in order to achieve specific customer requirements. In this case we were asked "can you guys write an exploit for this?" and we were happy to oblige.

The author, on bishopfox.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could execute arbitrary code with SYSTEM privileges on the affected server.

What the attacker needed

Network access to Serv-U SSH service; crafted SSH handshake payload

How it was found

  1. Trigger the vulnerability using a crafted SSH handshake payload to control the r9 register.
  2. Use a ROP gadget to pivot the stack pointer to the payload buffer.
  3. Find and call GetModuleHandleW to obtain a handle to kernel32.dll.
  4. Find and call GetProcAddress to locate VirtualProtect.
  5. Call VirtualProtect to make the stack executable.
  6. Jump to shellcode placed on the stack.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This is about a flaw in an FTP server program called Serv-U. An attacker can send a special message during the login process that lets them take control of the program's execution flow, potentially running their own code on the server with high privileges. The report explains how to build an exploit that works around modern security protections.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.