Pennyworth (Tier 1)
Last updated
Was this helpful?
Last updated
Was this helpful?
Tier -> 1
Difficult -> Very Easy
OS -> Linux
Tags -> Common Applications / Jenkins / Java / Reconnaissance / Remote Code Execution / Default Credentials
With a little research, I started answering the first questions
Answer: Common Vulnerabilities and Exposures
Answer: Confidentiality, Integrity, Availability
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 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
With this, I answered the next question
Answer: 2.289.1
With this, I answered the next question
Answer: Groovy
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
Then I did an initial port scan using
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 , I learned this is an automation server for web services
To learn more about the HTTP protocol you can go
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 , I learned that it let to interact internally with the server via a type of script called Groovy
With this, I could search for more exploitation options under this service, being the objective 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 repository. After exploring and testing some payloads for Groovy, we found that worked, and let me gain a shell as the root user. After that, I sanitized the terminal to interact better with the system
To learn about the sanitization process you can go