Jump to content

Featured Replies

Posted

Tool Preparation

A foreign server

Free Whale (VPN)

CS 4.4

nginx

CS Server Configuration

Server ping is disabled

1. When the server ping is disabled, it can be determined from a certain perspective that the host is inactive.

2. Edit the file /etc/sysctl.conf and add a line to it. net.ipv4.icmp_echo_ignore_all=1

Then the mission command sysctl -p makes the configuration take effect.

vim /etc/sysctl.conf

net.ipv4.icmp_echo_ignore_all=1

sysctl -p

1049983-20230227144827835-1460586883.jpg

3. After that, the ping will not be able to ping. In this way, nmap can still scan the server to survive.

1049983-20230227144828724-887380428.png

Modify port

1. Edit the teamserver file, search for 50050, and change it to any port, here it is changed to 65000

vim teamserver 1049983-20230227144829610-877637485.jpg

2. Save and exit, start teamserver, and find that the port has changed.

./teamserver xx.xx.xx.xx xiao

1049983-20230227144830703-410050090.jpg

Modify the default certificate

1. Because the certificate generated by the cs server contains all the relevant characteristics of cs, it is modified and replaced here. There are two ways to modify it, namely, generate a keystore and modify the startup file. No matter which way, you need to delete the original file cobaltstrike.store.

Method 1 Delete the keystore file cobaltstrike.store (recommended)

1. Generate a new keystore file

keytool -keystore ./cobaltstrike.store -storepass 123456 -keypass 123456 -genkey -keyalg RSA -alias baidu -dname 'CN=baidu.com, OU=service operation department, O=Beijing Baidu Netcom Science Technology Co.\, Ltd, L=beijing, S=beijing, C=CN'

keytool -importkeystore -srckeystore cobaltstrike.store -destkeystore cobaltstrike.store -deststoretype pkcs12

1049983-20230227144831550-104496929.jpg

2. Check the certificate

keytool -list -keystore cobaltstrike.store 1049983-20230227144832343-1207281071.jpg3. Start the server to check whether the certificate signature is the same, and the certificate signature is the same after checking.

1049983-20230227144833138-1324654750.jpg

Method 2 Modify the startup file

1. Teamserver is the startup file that starts the CSS server. There is an environment detection part, including the detection of the keystore. The way to write this part is that if the keystore cannot be detected, use the command to generate a new keystore and modify the generated command here.

2. The part circled in the teamserver needs to be modified

1049983-20230227144834432-2038016818.jpg

3. Modify it to the following content:

keytool -keystore ./cobaltstrike.store -storepass 123456 -keypass 123456 -genkey -keyalg RSA -alias baidu -dname 'CN=baidu.com, OU=service operation department, O=Beijing Baidu Netcom Science Technology Co.\, Ltd, L=beijing, S=beijing, C=CN'

1049983-20230227144835487-2027217953.jpg

4. Delete the original ./cobaltstrike.store keystore file, and the next time it starts, a new keystore file will be automatically generated.

rm -rf cobaltstrike.store

Hide with CDN

Apply for a free domain name

1. Enter the freenom official website, translate Chinese, pull to the bottom, and select the developer.

1049983-20230227144836612-1216181926.jpg

2. Pull to the bottom and click today to get a random domain account

1049983-20230227144837421-401393924.jpg

3. Enter the international email address and click Verify the email address. It is recommended to use a temporary email address.

1049983-20230227144838184-1636008870.jpg

4. After a few seconds, you will receive an email. Click on the email and click on confirmation to jump to the freenom website. After translating the current web page, click on the developer.

1049983-20230227144839006-1381884576.jpg

5. Pull the website to the end, translate Chinese, and click to get a random domain account immediately.

1049983-20230227144839826-1580750123.jpg

6. Then come to the personal information filling page

1049983-20230227144840800-1795941883.png

7. Because the address selected by the IP is Florida, it is necessary to use the Florida personal information generator and personal information generator, and the two need to be combined.

1049983-20230227144841675-865336806.jpg 1049983-20230227144842587-547291091.jpg

8. Just fill in the information according to the generator. After filling in it, check and click to complete the order. The account has been registered successfully.

1049983-20230227144843337-1650934063.jpg 1049983-20230227144844087-253020840.jpg

9. Return to the homepage of the website, select the domain name, enter xxx.tk, click check availability, and if available, click checkout.

1049983-20230227144844825-600153102.jpg

10. Select the 12-month free version and finally click continue.

1049983-20230227144845602-1239189976.jpg

11. Final order

1049983-20230227144846398-62631944.jpg 1049983-20230227144847138-956029880.jpg

12. Select my domains and see that the domain name is alive.

1049983-20230227144847955-2046821606.jpg

1049983-20230227144848912-1360974677.jpg

CDN configuration

1. There are actually quite a lot of options for cdn part. I chose cloudflare here

2. After logging in to cloudflare, select Add Site

1049983-20230227144849797-584795960.jpg

3. Choose a free plan

1049983-20230227144850575-1858358753.jpg

4. Add DNS records and enter the IP and A records to be protected.

1049983-20230227144851699-664827035.jpg

5. Modify the dns server of xxx.tk to cloudflare. It takes a certain amount of time to take effect after the modification is completed

1049983-20230227144852553-675923245.jpg 1049983-20230227144853458-201526483.jpg 1049983-20230227144854220-1629371275.jpg

6. Turn off automatic https rewrite and always use https and broti compression

1049983-20230227144854987-1863074172.jpg

7. Click finish

1049983-20230227144855745-1923565084.jpg

8. The following interface appears and the settings take effect. You can use cloudflare to perform domain name resolution operation.

1049983-20230227144856530-714652068.jpg

9. Analyze a www.xxx.tk to test it

1049983-20230227144857198-628058662.jpg

10. Using Global Ping, I found that CDN has been successfully added

1049983-20230227144858256-1387941751.jpg

11. Configure SSL/TLS encryption mode to complete

1049983-20230227144859102-1493880580.jpg

cloudflare generates certificate

1. Find SSL/TLS-source server-create the certificate on the dash page of cloudflare, and then save the public and private keys, namely server.pem and server.key, respectively. It must be saved during generation, otherwise the private key may not be found.

1049983-20230227144859811-609125808.jpg

2. Apply for a certificate and package the keystore, package the certificate and generate the store file.

openssl pkcs12 -export -in server.pem -inkey server.key -out www.xxx.tk.p12 -name www.xxx.tk -passout pass:123456

//Use keytool to generate certificate pairs in cs available store format

keytool -importkeystore -deststorepass 123456 -destkeypass 123456 -destkeystore www.xxx.tk.store -srckeystore www.xxx.tk.p12 -srcstoretype PKCS12 -srcstorepass 123456 -alias www.xxx.tk

1049983-20230227144900727-1863377161.jpg

3. Configure the certificate to the https listening method. If you want to use the certificate we applied for, you need to use the ‘Malleable C2 profile’ method to operate. Here we take cloudflare.profile as an example. Put the generated key file.store in the cs directory and want to add cloudflare.profile to the certificate configuration: What you need to note is that https-certificate is a certificate-related configuration. The Host value in other client.header should be the domain name we applied for, and the other parts should be configured according to personal circumstances.

//Copy the store certificate generated above to the teamserver directory

cp ./www.xxx.tk.store /opt/cs44/

//Create cloudflare.profile file

vim cloudflare.profile

//cloudflare.profile file content

https-certificate {

set keystore 'www.xxx.tk.store';

set password '123456';

}

http-stager {

set uri_x86 '/api/1';

set uri_x64 '/api/2';

client {

header 'Host' 'www.xxx.tk';}

server {

output{

print;

}

}

}

http-get {

set uri '/api/3';

client {

header 'Host' 'www.xxx.tk';

metadata {

base64;

header 'Cookie';

}

}

server {

output{

print;

}

}

}

http-post {

set uri '/api/4';

client {

header 'Host' 'www.xxx.tk';

id {

uri-append;

}

output{

print;

}

}

server {

output{

print;

}

}

}4. Verify that there is any problem with the configuration file. The following is the configuration for verification successfully (the current directory needs to have cobaltstrike.jar)

//Create a new c2lint file

vim c2lint

//c2lint file content

java -XX:ParallelGCThreads=4 -XX:+UseParallelGC -classpath ./cobaltstrike.jar c2profile.Lint $1

//Verify if there is any problem with the configuration file

./c2lint cloudflare.profile

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Important Information

HackTeam Cookie PolicyWe have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.