> For the complete documentation index, see [llms.txt](https://docs.prismacloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prismacloud.io/admin-guide/runtime-defense/incident-types/reverse-shell.md).

# Reverse shell

Reverse shell is a method used by attackers for gaining access to a victim’s system. A reverse shell is a established by a malicious payload executed on a targeted resource which connects to a pre-configured host and provides an attacker the means to execute interactive shell commands through that connection.

## Investigation

In the following incident, you can see that a reverse shell was used to provide a remote user interactive shell on this host, potentially enabling an attacker to execute any command that the user used to launch the reverse shell is authorized to execute.

<figure><img src="https://991698089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjkReOE2QgjHPl2bpbcR3%2Fuploads%2Fgit-blob-62a10c5ac800add77bcdf8306ee77c8e92b04647%2Freverse_shell.png?alt=media" alt="reverse shell"><figcaption></figcaption></figure>

The first step in an investigation is to validate that the reverse shell represent a bona fide security incident. While it is unlikely that a legitimate application or user is using a reverse shell for legitimate reasons, the first step should be validation that the reported application and user have not used reverse shell intentionally.

In this case it appears that a user used nc in order to allow a remote shell via ssh. "View forensics data" can be used to gain better understanding on what was done via the shell and understand whether this was for legitimate activity.

Having determined that this is a bona fide incident, the next steps focus on determining how an attacker managed to execute the process that allowed them to initiate the remote shell.

Check Incident Explorer for additional incidents. Review additional runtime audits for the source to see if there are other clues.

Review access to the resources and ensure that the affected account(s) weren’t subsequently used for further access to systems and data.

## Mitigation

A full mitigation strategy for this incident begins with resolving the issues that allowed the attacker to execute the process that initiated the remote shell.

Ensure that compliance benchmarks and patches are appropriately applied to the affected resources. For example, an unpatched critical vulnerability can be abused to execute a process that allows for the remote shell to be triggered remotely.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.prismacloud.io/admin-guide/runtime-defense/incident-types/reverse-shell.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
