# CS证书相关

## 默认证书

关于默认证书一共有三个cobaltstrike.store，proxy.store，ssl.store，首先分别来说一下这三个证书的作用

1. cobaltstrike.store证书用于服务端和客户端加密通讯
2. proxy.store证书用于浏览器代理也就是browserpivot功能
3. ssl.store证书，如果你没有配置https-certificate选项，并且使用的是https监听器那么Cs默认就会使用这个证书

### keytool工具介绍和命令

Keytool是一个Java数据证书的管理工具,Keytool将密钥（key）和证书（certificates）存在一个称为keystore的文件中,即.store后缀文件中。

```
密钥和证书管理工具

命令:

 -certreq            生成证书请求
 -changealias        更改条目的别名
 -delete             删除条目
 -exportcert         导出证书
 -genkeypair         生成密钥对
 -genseckey          生成密钥
 -gencert            根据证书请求生成证书
 -importcert         导入证书或证书链
 -importpass         导入口令
 -importkeystore     从其他密钥库导入一个或所有条目
 -keypasswd          更改条目的密钥口令
 -list               列出密钥库中的条目
 -printcert          打印证书内容
 -printcertreq       打印证书请求的内容
 -printcrl           打印 CRL 文件的内容
 -storepasswd        更改密钥库的存储口令

使用 "keytool -command_name -help" 获取 command_name 的用法
```

### 证书生成命令

```bash
keytool -keystore cobaltstrike.store -storepass 123456 -keypass 123456 -genkey -keyalg RSA -alias 别名 -dname "CN=(名字与姓氏), OU=(组织单位名称), O=(组织名称), L=(城市或区域名称), ST=(州或省份名称), C=(单位的两字母国家代码)"

例如
keytool -keystore cobaltstrike.store -storepass 123456 -keypass 123456 -genkey -keyalg RSA -alias cobaltstrike -dname "CN=Major Cobalt Strike, OU=AdvancedPenTesting, O=cobaltstrike, L=Somewhere, S=Cyberspace, C=Earth"


-alias 指定别名
-storepass pass 和 -keypass pass 指定密钥
-keyalg 指定算法
-dname 指定所有者信息
```

### 查看证书

```
keytool -list -v -keystore cobaltstrike.store
```

### cobaltstrike.store

此证书用来加密Cobalt Strike和客户端通信，带有默认hash而且比较敏感我建议自己生成一个

### ssl.store

这个是Beacon HTTPS默认使用的证书只要你配置了https-certificate选项就不会使用这个，也是非常敏感，千万不要使用这个默认证书要么配置https-certificate选项要么直接替换jar里的这个文件，（这里稍微提一句你如果你要直接替换这个文件请确保生成时使用的密码为123456）

### proxy.store

这个证书相比前两个比较特殊我估计用到browserpivot功能的人也不是特别多，这个东西我并没有去深入研究这个证书不用动他只是作为服务端证书使用

![](/files/-MF9oPs9bULNqmXAienS)

![](/files/-MF9ocNkgggg7WfXqkWu)

![](/files/-MF9ohQxDb2opR16UjC_)


---

# 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-strikekuo-zhan/csmo-ren-duan-53e3-zheng-4e66-za-xiang.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.
