> For the complete documentation index, see [llms.txt](https://wbglil.gitbook.io/cobalt-strike/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wbglil.gitbook.io/cobalt-strike/cobalt-strikeji-ben-shi-yong.md).

# 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客户端连接](/files/-MDn2N7ybkx5VqRWGMlu)

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

![首次连接确认服务端SHA256](/files/-MDn3otm4eWxmOMsYs1f)

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

![](/files/-MDn5DEQA2Hg8Dx5-njQ)
