Code Monkey home page Code Monkey logo

darkgate-install-script-via-dns-txt-record's Introduction

DarkGate Install Script retrieval via DNS TXT Record

Recently, I came across a tweet from Unit 42 showcasing a interesting new technique utilized by DarkGate in order to retrieve DarkGate install script via DNS TXT Records leading to DarkGate infection on the victim machine in their recent campaign.

I developed a PoC for the new DarkGate Install script retrieval technique via DNS TXT Record and uploaded it in the following repo which consists of -

  • PDF with embed link (Name: Bank-Statement-poc.pdf)
  • ZIP Archive (Name: Bank-Statement-20231523-poc.pdf.zip)
    • consists of the LNK (Shortcut) file which retrieves install script via DNS TXT Records (Name: Bank-Statement-20231523-poc.pdf.lnk)

Disclaimer: The PoC does not contain any malicious code =) - also it is a working PoC so you can just use it easily

Infection Chain: Working

Following in the infection chain similar to the one seen in the ITW DarkGate campaign -

At first we open the PDF (Bank-Statement-poc.pdf) which consists of an embedded link which when clicked downloads the ZIP Archive (Bank-Statement-20231523-poc.pdf.zip)

1

The ZIP Archive consists of a LNK (Shortcut) file which once executed runs a command which uses nslookup to retrieve the TXT records from my testing domain "pocdomain[.]linkpc[.]net". Further I customized the LNK command a bit as the one in the ITW sample was unstable. The command then parses & dequotes the retrieved TXT record and saves it in the TEMP Directory as "poc.cmd" and then further executes it.

3

Here in the below screenshot you can see the retrieved TXT record using nslookup for pocdomain[.]linkpc[.]net. As seen the TXT records consists of a command ;)

5

Now as explained previously the commands in the TXT record response are parsed, dequoted and then saved as "poc.cmd" in the TEMP Directory and further executed - which in turn would execute calc.exe | waits for 5 seconds | kills the calc process and deletes the "poc.cmd"

7

The complete process tree along with the commands can be seen below:

6

Also the retrieved TXT record can be seen:

10

In the case of DarkGate ITW sample the TXT records retrieved by the malicious LNK file from the domain consists of commands to download copy of autoit3 and malicious .au3 file further leading to DarkGate infection as shown below

unit42

Image credits - Unit42_Intel

Thanks - knight0x07

darkgate-install-script-via-dns-txt-record's People

Contributors

knight0x07 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.