Resources

People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!

Securing Internet-Critical Software: How We Could Have Backdoored Bash- 2243

HacktronPosted 21 Days Ago
  • GNU Savannah is a software collaboration, and project management suite. It hosts many important projects, including Bash, Coreutils, and other Coreutils projects. A vulnerability in this project could enable the largest backdoor in Internet history.
  • On Savane, every user can manage their account's GPG key. This feature has a Test GPG keys button that runs a Shell command in PHP via proc_open(). In classic fashion, this was vulnerable to a command injection via the provided email. So, if you register an email with bash metacharacters, then you get command injection on the server.
  • An email to exploit this bug would look like this: a`touch${IFS}/tmp/savane-rce-proof`@attacker.example. The backticks execute the commands, and since no spaces are allowed they use the {IFS}. By repeating this, you can eventually execute a bash script of your choosing. This happens because the RFC accepts many of these characters as technically allowed.
  • Once they had a reverse shell on the system, they were the backend user on the web server. Since the database is trivial to read, they made themselves admin by modifying the database. To compromise any project, they only need to change the public keys that accept pushes for a project. At this point, an attacker can backdoor any code they choose, and do it stealthily.
  • The web shell was unprivileged. Since this ran an out-of-date kernel (only a few days old), they used a public N-day exploit to become root. They also found other vulnerabilities, such as stored XSS, an authorization bypass in the admin group, and several other access control issues. Overall, a good, no-nonsense exploit on the Savannah project.