> For the complete documentation index, see [llms.txt](https://docs.fusion.vectra.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fusion.vectra.ai/detection-models/library/post-compromise/comm_with_malware_external_internal.md).

# comm\_with\_malware\_external\_internal

**Explanation**

The comm\_with\_malware\_external\_internal NDM is designed to detect connections from identified malware command and control (C2) nodes to hosts on your network. Because flows occur in both directions within a TCP/IP connection, this NDM determines the direction of a connection by comparing source and destination ports - usually TCP/IP connections flow from a higher port to a lower port. This NDM triggers on the response traffic flows from the server that received the connection (the source host) back to the malware command and control (C2) node that initiated it (the destination host).

These detections can indicate a serious event. In some cases, malware, and especially web-shells, are controlled by attackers using inbound traffic. However, these detections may also be the result of probing and scanning of your external infrastructure from a malware command and control node. That scenario may be a lower risk than an infection.

**What to Look For**

Internal hosts involved in a comm\_with\_malware\_external\_internal event should be reviewed for unknown or unauthorized ports exposed to inbound Internet traffic, and web server logs should be reviewed for suspicious requests. External hosts should be blocked to prevent further communication with C2 nodes.

**Related MITRE ATT\&CK Categories**

[Command and Control: Application Layer Protocol, Technique T1071 - Enterprise](https://attack.mitre.org/techniques/T1071)

[Command and Control: Non-Application Layer Protocol, Technique T1095 - Enterprise](https://attack.mitre.org/techniques/T1095)

[Command and Control: Non-Standard Port, Technique T1571 - Enterprise](https://attack.mitre.org/techniques/T1571)


---

# 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 dynamically by asking a question.

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

```
GET https://docs.fusion.vectra.ai/detection-models/library/post-compromise/comm_with_malware_external_internal.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
