# Cobalt Strike基本使用

### CobaltStrike目录结构 <a href="#start" id="start"></a>

```
|  cobaltstrike_cn.bat 【CS Windows客户端启动程序(中文)】
|  cobaltstrike_en.bat 【CS Windows客户端启动程序(英文)】
│  cobaltstrike.jar 【主体程序】
|  cobaltStrikeCN.jar 【翻译插件】
│  teamserver  【Linux服务端启动程序(linux shell脚本)】
|  teamserver.bat 【Windows服务端启动程序(windows bat批处理)】
|─third-party 第三方工具 【vnc远程功能的dll】
|        README.vncdll.txt
|        winvnc.x64.dll 【vnc服务端dllx64位】
|        winvnc.x86.dll 【vnc服务端dllx86位】
|—Win_Linux shell script.7z 一些脚本文件
```

Win\_Linux shell script.7z里主要是是一些脚本无后缀名的是Linux版的.bat后缀的是Windows版的

```
│  agscript [拓展应用的脚本]
│  c2lint  [检查c2配置文件的语法和预览]
|  cobaltstrike [客户端启动程序]
|  peclone [用来解析dll]
|  teamserver [服务端启动程序]
```

### 启动服务端

cobaltstrike.jar既是服务端程序也是客户端程序，一般情况Linux用**teamserver**启动服务端,Windows一般用**teamserver.bat**启动服务端

```bash
teamserver <host> <password> [/path/to/c2.profile] [YYYY-MM-DD]

    <host> is the (default) IP address of this Cobalt Strike team server
    <password> is the shared password to connect to this server
    [/path/to/c2.profile] is your Malleable C2 profile
    [YYYY-MM-DD] is a kill date for Beacon payloads run from this server
```

Windows和Linux通用这个命令，如果提示没有证书就按照提示创建证书，权限不够就以管理员权限运行。

第一个参数为服务器监听IP地址 **此选项为必填选项**

第二个参数为服务器连接密码客户端使用此密码连接服务器 **此选项为必填选项**

第三个参数为Malleable C2 profile配置文件如果不使用可以不用填写 **此选项为可选选项**

第四个参数为Beacon有效负载运行结束日期。如果设置此选项则CS生成的每个Beacon stage中都将嵌入此结束日期，Beacon payload在此日期后将拒绝运行，处于sleep状态的Beacon payload醒来后也将自动退出结束运行 **此选项为可选选项**

### 启动客户端

在Linux下或Windows下可以使用此命令行也可以直接运行**cobaltstrike\_xx.bat**

使用翻译插件

```bash
java -Dfile.encoding=UTF-8 -javaagent:CobaltStrikeCN.jar -XX:ParallelGCThreads=4 -XX:+AggressiveHeap -XX:+UseParallelGC -jar cobaltstrike.jar
```

不使用翻译插件

```bash
java -Dfile.encoding=UTF-8 -XX:ParallelGCThreads=4 -XX:+AggressiveHeap -XX:+UseParallelGC -jar cobaltstrike.jar
```

当 Cobalt Strike 客户端启动时，你会看到一个连接对话框

![CS客户端连接](https://3226329500-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDZyrMxFR2BnFjV82cS%2F-MDmztG_TNX6haPy1H8h%2F-MDn2N7ybkx5VqRWGMlu%2Fimage.png?alt=media\&token=8d053819-868e-4968-996b-5bfd1b6952ed)

输入主机ip，连接端口(默认50050)，以及你想使用的用户名和服务端启动时设置的密码然后点击连接就可以连接到服务器了。

![首次连接确认服务端SHA256](https://3226329500-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDZyrMxFR2BnFjV82cS%2F-MDmztG_TNX6haPy1H8h%2F-MDn3otm4eWxmOMsYs1f%2Fimage.png?alt=media\&token=6be62440-39e4-4555-a916-a4a9b32ed3fc)

首次连接的服务器会显示服务端的SSL 证书的SHA256哈希值请确认它是否和你的服务端SSL证书的SHA256哈希值一样，点击是，然后 Cobalt Strike 客户端就会连接到这个服务器。Cobalt Strike 也会记住这个 SHA256 hash下次连接到相同hash的服务器就不会在提醒

![](https://3226329500-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDZyrMxFR2BnFjV82cS%2F-MDn4S-O6TO8VC9DSVIZ%2F-MDn5DEQA2Hg8Dx5-njQ%2Fimage.png?alt=media\&token=dfee9c66-c484-45db-8085-c4879963f871)


---

# 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://wbglil.gitbook.io/cobalt-strike/cobalt-strikeji-ben-shi-yong.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.
