Learning Linux Attack & Defense through the “RickdiculouslyEasy” Capture the Flag (CTF)

Jay Beale, co-founder, COO and CTO, InGuardians
November 7th, 2018

In the latest installment of my attack-and-defense, Capture the Flag demo-focused webinar series, I demonstrate my attack on the Rick and Morty-themed “RickdiculouslyEasy Capture the Flag system” and then discuss  how to break that attack.

Through this CTF, you will learn how to:

  • Prevent the compromise through proactive measures
  • Contain the compromise to reduce the probability of lateral movement
  • Detect and respond to the compromise quickly

What’s New for this CTF?

For the Rickdiculously CTF exercise, I’ve added an extra vulnerability via a Docker container. The container brings a custom trojan horse to the system.

After we use the trojan horse to get root access, we turn around and use that access to introduce you to a powerful Linux kernel feature called “seccomp,” short for “secure computing mode.”

We then build a profile for our trojan horse application, one where the application can serve as a honeypot, revealing the bad actor who knows the trojan horse password, but depriving that actor of the root access they’d normally get.

Even if you’ve never heard of seccomp, the chances are good that you’ve used software that leverages it.  Google’s Chrome browser and Android mobile operating system both use seccomp. KVM, a hypervisor that powers public clouds, also uses seccomp, as do container runtimes like LXD and Docker.

If you’re already familiar with Linux security modules like AppArmor and SELinux, it’s useful to know that you can use seccomp with them as a complementary containment technology. While both AppArmor and SELinux focus on file path, network port, and root capability controls, seccomp confines a process based on the system call (syscall) list that it uses.

Want to learn more? Check out the webinar and play along using your own copy of Kali Linux, attacking the RickdiculouslyEasy virtual machine you’ll find on VulnHub.com.

Jay Beale, co-founder, COO and CTO, InGuardians

Jay Beale has created several defensive security tools, including Bastille Linux/UNIX and the CIS Linux Scoring Tool, both of which were used widely throughout industry and government. He has served as an invited speaker at many industry and government conferences, a columnist for Information Security Magazine, SecurityPortal and SecurityFocus, and a contributor to nine books, including those in his Open Source Security Series and the “Stealing the Network” series. He has led training classes on Linux Hardening and other topics at Black Hat, CanSecWest, RSA, and IDG conferences, as well as in private corporate training. Jay is a co-founder, Chief Operating Officer and CTO of the information security consulting company InGuardians.