➠ Let's Analyze: Dridex (Part 2)
Encrypted Strings
![]() |
A simple string comparison function |
By right clicking on the function and selecting "jump to xrefs to", we can just pick one at random and trace back each of the two string arguments and see if any start off as encrypted.
![]() |
Whoever said assumptions get you nowhere? |
import idc
import idautils
import idaapi
strings_info = []
def DumpStrings():
for string in strings_info:
print("%s at 0x%X" % (string[1], string[0]))
def BreakpointHandler(dec_string):
call_loc = PrevHead(Dword(GetRegValue("ESP")), 0)
string_info = (call_loc, dec_string)
if string_info not in strings_info:
strings_info.append(string_info)
print("Got string: %s @ %x" % (dec_string, call_loc))
def BreakpointHandlerAscii():
dec_string = GetString(Dword(GetRegValue("EAX")), -1, ASCSTR_C)
BreakpointHandler(dec_string)
def BreakpointHandlerUnicode():
dec_string = GetString(Dword(GetRegValue("EAX")), -1, ASCSTR_UNICODE)
BreakpointHandler(dec_string)
def main():
func_ascii = 0x0040C4A9 #Last byte of the ascii function
func_unicode = 0x0040F1C9 #Last byte of the unicode decrypted function
#Lets us use python functions for breakpoint conditions
RunPlugin("python", 3)
AddBpt(func_ascii)
SetBptCnd(func_ascii, "BreakpointHandlerAscii()")
print("Breakpoint at: %x" % func_ascii)
AddBpt(func_unicode)
SetBptCnd(func_unicode, "BreakpointHandlerUnicode()")
print("Breakpoint at: %x" % func_unicode)
if __name__ == '__main__':
main()
The following snippet creates a tuple containing the decrypted string and thhe address of the call, this is then pushed to an array if it hasn't already which allows us to output call_loc:dec_string combinations we've not already handled; it also allows us to call DumpString() from the python command line to dump all the unique decrypted string combinations.
string_info = (call_loc, dec_string)
if string_info not in strings_info:
strings_info.append(string_info)
print("Got string: %s @ %x" % (dec_string, call_loc))
Once we've run the script and gotten some data, we might notices that multiple calls came from the same address but decrypted different strings.
To resolve this, lets look back to how the decryption function is called.
There is a number in ecx which could be some kind of id or offset into a block which specifies to the decrypter which string gets returned. The next step would be to find some strings you're interested in, head to the address the call came from, then disassemble it to find out how the target string is determined and where in the call chain it was decided that specific string was needed. Once you've gotten all that information, you can merge some of the code from the last article and this one to comment all the places in which a given string is referenced.
Next we'll start looking at the C&C code, which will require you to have a good handle on how the strings are referenced. I've walked you through the first step and explained what the next step entails, so you should have something to work on while you wait for the next article! Hint: focus on HTTP related strings as the C&C protocol is encrypted XML over HTTPS (you can check you're in the right place by cross-referencing the string with calls to functions which might send data to a remote host).
Zur Startseite
Kommentiere zu Let's Analyze: Dridex (Part 2)
➤ Ähnliche Beiträge für 'Let's Analyze: Dridex (Part 2)'
AA19-339A: Dridex Malware
vom 1724.3 Punkte
Original release date: December 5, 2019SummaryThis Alert is the result of recent collaboration between Department of the Treasury Financial Sector Cyber Information Group (CIG) and the Department of the Treasury’s Financial Crimes Enforcement Network (FinCEN
Pure GraphQL OAuth
vom 541.39 Punkte
Before starting, this is my first article in Rust, I try my best to follow best practices, but unlike TypeScript, that I have been using for 3 years at this point. I have only learnt Rust 1 year ago, so my skills are a bit rusty pun intended.
Hence, if you ar
Angular Directive Grammar & Microsyntax: Demystifying the Hidden Parts
vom 231 Punkte
Introduction
<div *ngFor="let leaf of ['🍀', '🍀🍀', '🍀🍀🍀']; let i = index;">
<p>{{i + 1}}. {{leaf}}</p>
</div>
1. 🍀
2. 🍀🍀
3. 🍀🍀🍀
If you've worked with Angular, I'm sure you've com
Mastering Angular Structural Directives - Micro-syntax demystified
vom 222.44 Punkte
In the previous article of this series, we took a closer look at the context object and how we can use it to expose all kinds of data and even functions to our template. Combined with @Input()s and dependency injection, we got a first glimpse of how p
How to build a Barcode Widget in React Native (part II: iOS)
vom 221.45 Punkte
In this tutorial we are going to learn how to build a barcode widget for an iOS device.
In the previous part we focused on Android and Java, while in this part we're going to be using Swift.
The process will be similar in many ways, except for the br
3D Orbiting Split Images
vom 215.82 Punkte
Just messing around with 3D transforms and splitting images into pieces.. What is a 3d orbiting split images? How do you make a 3d orbiting split images?
3D Orbiting Split Images - HTML Code:
<!DOCTYPE html>
<html >
<head> <me
Recreating the Apple Calculator in Rust using Tauri, Yew and Tailwind
vom 214.58 Punkte
Introduction
In this tutorial, we will be rebuilding the Apple calculator using Rust. This project is designed to be a stimulating challenge, providing a hands-on experience with several key technologies:
Tauri: An innovative framework for building lightweight
Regular Expressions aka REGEX crash course
vom 203.75 Punkte
Regex aka Regular expressions
Regular expressions, also known as "regex", are patterns that help search, match or replace character combinations in strings. They are really powerful and hard to read at the same time. Many developers just decide
Introduction to Code Generation in Rust
vom 201.13 Punkte
This article is about generating Rust code from other Rust code, not for the code generation step of the rustc compiler. Another term for source code generation is metaprogramming, but it will be referred to as code generation here. The reader is expect
Rust Tutorial 4: Let's build a Simple Calculator! (Part 1)
vom 195.54 Punkte
Reading time: 20 minutes
Welcome back to the Rust Tutorial Series!
In this tutorial, we will be building a simple calculator! On the way, we will learn some more concepts like functions, generics, tuples, arrays, and more!
This tutorial will be a 2-parter sinc
Rust Tutorial 4: Let's build a Simple Calculator! (Part 1)
vom 195.54 Punkte
Reading time: 20 minutes
Welcome back to the Rust Tutorial Series!
In this tutorial, we will be building a simple calculator! On the way, we will learn some more concepts like functions, generics, tuples, arrays, and more!
This tutorial will be a 2-parter sinc
Understanding the basics of Smart Pointers in Rust
vom 194.9 Punkte
In today's post we'll delve into the basics of smart pointers in Rust, while we build from scratch a simple linked list - starting from a singly linked list and then evolving to a doubly one.
It's not intended to be an introduction about Rust. For that,