# Cobalt Strike Basics

### Starting Cobalt Strike Team Server

![./teamserver {IP} {password}](https://1846927083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mj9GKP_mf1AnaApJEIA%2Fuploads%2FzosTaRSuD2YmJ9gOHXDb%2Fimage.png?alt=media\&token=bcf3bcc6-c7d3-4b7a-84fd-d5cb70c05007)

### Connecting to Team Server

![Connecting From a Windows Clinet](https://1846927083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mj9GKP_mf1AnaApJEIA%2Fuploads%2FddTNEgr9CuIY9W0NE1qp%2Fimage.png?alt=media\&token=9939c1a5-1463-4aff-b87e-283d7b9928b7)

![Verifing the Connection in Kali linux.](https://1846927083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mj9GKP_mf1AnaApJEIA%2Fuploads%2FSk0isOLJvGji9EwSkZ4P%2Fimage.png?alt=media\&token=f7e6cc3a-55b0-4ca4-87b7-fdc82168f442)

### Listener Management

A "listener" is a host/port/protocol combination that "listens" for incoming communication from Cobalt Strike's payload, Beacon. The two main flavours of listeners are egress and peer-to-peer. The egress listener that you will use the majority of the time is the HTTP listener. This listener acts like a web server, where the Team Server and Beacon will encapsulate their communications over HTTP. The "appearance" (bodies, headers, cookies, URIs etc) of this HTTP traffic can be tightly controlled using Malleable C2 Profiles.

**Peer-to-peer** listeners allow Beacons to chain their communications together over SMB or TCP. These are particularly useful in cases where a machine that you compromise cannot reach your Team Server directly over HTTP. To create an HTTP listener, go to Cobalt Strike > Listeners and a new tab will open. Click the Add button and a New Listener dialogue will appear. Select Beacon HTTP as the payload type and enter a descriptive name. This listener name is used in several Beacon commands (such as when moving laterally), so make sure it describes the listener well. Click the + button next to HTTP Hosts which should autocomplete to the Kali IP address (10.10.5.120). This is fine, so click OK. Leave everything else as it is and click Save.

![](https://1846927083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mj9GKP_mf1AnaApJEIA%2Fuploads%2FLbbPKfx9hfTwQ8VaG1q5%2Fimage.png?alt=media\&token=44303f52-15f6-4c9e-9f1b-fb1996ce03e8)

### Generating Payloads

To generate a payload for this listener, go to `Attacks > Packages > Windows Executable (S`). Cobalt Strike is able to generated both staged and stageless payloads. Whenever you see (S) within the Ul,it's an indication that it's using a stageless payload.&#x20;

**OPSEC:** Staged payloads are good if your delivery method limits the amount of data you can send. However,they tend to have more indicators compared to stageless. Given the choice, go stageless. Select the HTTP listener created previously, select Windows EXE as the output and tick Use x64.&#x20;

**OPSEC:** The use of 64-bit payloads on 64-bit Operating Systems is preferable to using 32-bit payloads on 64-bit Operating Systems.

![Click Generate and save the file to C:\Payloads. Now execute that EXE and you should see a new Beacon appear](https://1846927083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mj9GKP_mf1AnaApJEIA%2Fuploads%2FjRiMsQCvdrTykx5CCDxg%2Fimage.png?alt=media\&token=6cafd342-a089-4fa2-be18-e85d736077f0)

![Beacon Appearing in the listener tab.](https://1846927083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mj9GKP_mf1AnaApJEIA%2Fuploads%2FyrO0dEunRi1C8hKPmnhF%2Fimage.png?alt=media\&token=f5f18241-9954-4f5c-81fe-b347cf932ce9)

### Interacting with beacon

![](https://1846927083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mj9GKP_mf1AnaApJEIA%2Fuploads%2Fp9BkWniYbeNRpJ0uwD9w%2Fimage.png?alt=media\&token=80bda32a-da78-40f9-a2a3-0c5d15c3415a)

![](https://1846927083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mj9GKP_mf1AnaApJEIA%2Fuploads%2FgJEmVVHI3yD7Ic69Ofri%2Fimage.png?alt=media\&token=07ca4c2d-cb5f-4760-bdd8-7a86cade02a0)

{% hint style="info" %}
Tips and Shortcuts
{% endhint %}

![](https://1846927083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mj9GKP_mf1AnaApJEIA%2Fuploads%2FY8fgAD5LgtU0dwDWRAid%2Fimage.png?alt=media\&token=3306061e-b0fe-49a3-a372-6d12fb3a5ce6)
