365 字
2 分钟
Cobalt Strike Notes
2021-03-27
无标签
中文版

The difference between Windows Executeable (s) and Windows Executeable#

Windows Executeable (s) corresponds to a stage (stageless) Windows Executeable corresponds to a stager A stager is a small program whose job is to download a stage and run it. A stage, on the other hand, is a large payload that contains many features and is used to receive and execute tasks from our C2 and return the results. The process of a stager downloading a stage through various means and running it is called Payload Staging. Cobalt Strike also offers a way similar to traditional RAT check-ins: packaging all functionality together so it can communicate with the teamserver immediately after running — this is called Payload Stageless. To generate a Stageless payload, you can do it directly under Attack -> Package -> Windows Executeable (s).

Removing the CS certificate fingerprint#

The CS certificate store default password is 123456. First add a certificate, then delete the default one.

View the certificates

Terminal window
keytool -list -v -keystore cobaltstrike.store

Add a certificate

Terminal window
keytool -keystore ./cobaltstrike.store -storepass 123456 -keypass 123456 -genkey -keyalg RSA -alias microsoft -dname "CN=microsoft, OU=Microsoft, O=SoftwareSecurity, L=Washington, S=DC, C=US"

Delete the default certificate

Terminal window
keytool -delete -alias cobaltstrike

DNS beacon#

In general, a service called systemd-resolved occupies port 53, so you need to manually release the port before you can use CS’s DNS listener.

Finally, use nslook ns1.xxxxx to verify the configuration is correct.

When setting up the listener, DNS Host (Stager) doesn’t have to be an IP address — you can fill in any one of the DNS Host entries above.

Hiding C&C behind Cloudflare#

Register a domain at Freenom, then add it to Cloudflare.

Cloudflare -> SSL/TLS -> Origin Server -> Create Certificate

Choose the PEM format, save the origin certificate as server.pem. Save the private key as server.key. Then

Terminal window
openssl pkcs12 -export -in server.pem -inkey server.key -out cfcert.p12 -name cloudflare_cert -passout pass:123456
sudo keytool -importkeystore -deststorepass 123456 -destkeypass 123456 -destkeystore cfcert.store -srckeystore cfcert.p12 -srcstoretype PKCS12 -srcstorepass 123456 -alias cloudflare_cert

Then add this to the Malleable C2

https-certificate {
set keystore "cfcert.store";
set password "123456";
}

Also, be sure to modify the X-Forwarded-For header configuration, otherwise the check-in IP will be Cloudflare’s datacenter.

http-config {
set trust_x_forwarded_for "true";
}

Then you can visit https://www.cloudflare.com/ips/ to add all Cloudflare addresses to the cloud server’s security group, allowing only Cloudflare connections.

Cobalt Strike Notes
https://tski.uk/blog/en/cobalt-strike-notes/
作者
Tokisaki Galaxy
发布于
2021-03-27
许可协议
CC BY