Pennyworth (Tier 1)

Description

  • Tier -> 1

  • Difficult -> Very Easy

  • OS -> Linux

  • Tags -> Common Applications / Jenkins / Java / Reconnaissance / Remote Code Execution / Default Credentials

Write-up

  • With a little research, I started answering the first questions

Answer: Common Vulnerabilities and Exposures


Answer: Confidentiality, Integrity, Availability


  • Then I did an initial port scan using Nmap


  • I also did an exhaustive scan to get more information about the service running on the open port


  • With this, I answered the next question

Answer: Jetty 9.4.39.v20210325


  • I found the service was using the HTTP protocol on port 8080, so I visited the content being deployed through the browser. There, I found a Jenkins login page, and with a little research, I learned this is an automation server for web services


  • I tried to log in with common credentials, and after trying with the username root and the password password, I got in successfully to an administration dashboard. I explored the site and noticed that by scrolling down to the bottom, the version of the Jenkins service was shown

snippet

  • With this, I answered the next question

Answer: 2.289.1


  • I searched for possible CVEs for this version of Jenkins but didn't find anything. So I explored the options of the dashboard and found that by scrolling down under the Manage Jenkins tab, there was an option named Script Console, and with some research, I learned that it would allow me to interact internally with the server via a type of script called Groovy

snippet
snippet
snippet

  • With this, I answered the next question

Answer: Groovy


  • With this, I could search for more exploitation options under this service to gain a shell from the target system. So, to find out possible payloads, I looked for help on the Reverse Shell Cheat Sheet from the PayloadsAllTheThings repository. After exploring and testing some payloads for Groovy, we found one that worked and helped me gain a shell as the root user. After that, I sanitized the terminal to interact better with the system


  • With this and a little research, I answer the next questions

Answer: cmd.exe


Answer: ifconfig


Answer: -u


Answer: Reverse Shell


  • Then, I went to the /root folder to see its contents and found a root.txt file, finally reading it to obtain the flag


  • With this, I got the root flag and pwned the machine

Answer: 9cdfb439c7876e703e307864c9167a15

Last updated