Giter Club home page Giter Club logo

domainborrowingc2's Introduction

DomainBorrowingC2

Domain Borrowing is a new method to hide C2 traffic using CDN. It was first presented at Blackhat Asia 2021 by Junyu Zhou and Tianze Ding. You can find the presentation slides here and here.

DomainBorrowingC2 was made as part of an internship at NVISO Security's Red Team. Follow their work on their blog and Twitter.

DomainBorrowingC2 is an extension for Cobalt Strike written in C# using Cobalt Strike's External C2 spec. It is based on Ryan Hanson's ExternalC2 library and the Covenant PoC provided in the Blackhat Asia 2021 slides.

I wrote a blogpost about it.

ClientC2

The ClientC2 project is responsible for connecting to the CDN and requesting a stager from ServerC2. It manages communications between Beacon and ServerC2.

Configuration for the client happens in Program.cs. The client takes 4 parameters:

  1. domain or ip address to reach the CDN edge server(s)
  2. the SNI
  3. OPTIONAL port to communicate with the CDN, default port is 443
  4. OPTIONAL sleep in milliseconds between messages, default is 60s
Client client = new Client("target.domain.or.ip.address.here", "target.sni.here", 443, 60000);

ServerC2

The ServerC2 project is responsible for relaying communications between the CDN and Cobalt Strike's Teamserver via the ExternalC2 socket.

Configuration for the server happens in SocketSettings.cs. Specify Cobalt Strike's ExternalC2 listener address and port here.

public SocketSettings()
{
    IpAddress = "127.0.0.1";
    Port = "2222";
}

Launch the server with: sudo dotnet run --url http://127.0.0.1:80/. You can customize the IP and port to your liking and configure your CDN appropriately.

Known issues

  • ServerC2 currently depends on ClientC2, so make sure to copy the ClientC2 project before running ServerC2.

domainborrowingc2's People

Contributors

cerbersec avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.