Triage of Agent.BTZ
March 5th, 2010I recently upgraded my copy of Responder 1.5 to Responder 2. I've got some great things to say about this product but I'll save that for another post. I ran an analysis some time ago in 1.5 against a dangerous little piece of malware that got quite a bit of press in 2008. The malware in question is Trojan.Agent.BTZ. This little gem is what ransacked the military and pentagon. Vendors like to call it Autorun malware, as that's really how it works but it's of course more than what a vendor will tell you.
Generally speaking I was looking for a piece of malware that infects removable media, phones home, gives remote control and downloads other malware. I arrived on scene a short while after the alert and after talking to the admin, decided to plug in my USB key, knowing full well what would probably happen to it. USB key defenses aside, I ran FastDump Pro and grabbed an .hpak memory dump.
So now I had a memory dump and I grabbed a disk image from the computer. In this case I decided to take the drive because I would use this later in a lab scenario for training. Triage requirements aside, this was a good case to capture for later use.
Let's analyze it quickly with 2.0 eh?
*note I've already done this in 1.5 I'm just re-doing it in 2.0 and during the middle of this I experienced a licensing hiccup*
My standard technique for beginning memory analysis in Responder is as follows:
1) Evaluate DDNA listing.
DDNA while not perfect, can be used to quickly hone in on oddities and badness. It helps identify WHAT is on the box, WHAT it might be, and HOW it might be working. Add a cross reference listing to the modules running on the box for more detailed information. DDNA is a boon to any analyst looking to conduct rapid analysis.
Here's what the DDNA output looked like for BTZ. Focusing on the left hand side, we don't see a whole lot that sticks out. A sea of Orange really...

2) Evaluate Network connections. This helps me answer two questions. WHAT is talking, and to WHOM? I tend to go for Network connections before Processes as network connections often identify the process I need to investigate. For all intensive purposes, 2&3 are interchangeable.
3) Evaluate Process lists.
Typically I evaluate processes in a number of ways. I'll look for processes that don't belong, those with odd names, those that are 'hidden', all svchost processes since they are a huge target for process and dll injection attacks, those processes that are "red flags" such as ones executing from the wrong directory or with incorrect paths and processes that don't normally exist.
4) Open file handles and Registry keys.
This should be fairly obvious as to the why. It allows me to find out what process has what file handles and reg keys open.
5) Use a DNS blacklist or keyword list. There are great blacklists out there plus I have a few extras. This immediately helps with data reduction in some cases. It can also assist in zeroing in on the malware. This is great for casting a drag net on a network to look for other infections.
6) Other poking - looking for clues that might tip me off to the true nature of the infection or compromise.
This usually does the trick for the overwhelming majority of malware cases I look at. Granted there are more difficult ones but with malware being as templated as it is..this tends to work.
So now let's work through this for real...
DDNA in this case didn't appear to be helpful, or was it? Looking at the listing, there's a wide variety of suspicious looking processes and modules. That's not really that helpful by all appearances. Let's add a little intelligence to this analysis by pulling up the module listing next to the DDNA listing for processes. This is what that looks like:

So, now we have even more orange...GREAT you might be thinking sarcastically..but what do we see if we look closely? Like a simple equation we can rule out common processes and modules that we have a possible explanation for now and I've highlighted something that looks REALLY suspicious..a process loading a module out of the user's profile. As I said DDNA is not perfect, but what it does is raise the interesting stuff to the top by severity and color coding. This is automated analysis and while it has limits, when we add human intelligence to the analysis process we get an immediate bead on the target.
So what are the key indicators?* The .dll
* rundll32.exe is calling a .dll out of the user profile
* The file path for the .dll.
Yeah that's pretty odd isn't it? What traits does it have?

Nothing sticks out a whole lot, but there are some good clues in there.
So now I've found something odd and definitely worth looking in to a bit further. This happens to be the jackpot but let's keep evaluating.
How about the DNS blacklist for connections to known bad domains?
The list of hits was far too many to show here. The matches numbered upwards of 336 bad domains. That's too many domains to be helpful but it's definitely a sign that the computer was talking to a lot of known bad actors.
And Network Connections?
The network cable in this incident was unplugged when I arrived. No joy for active connections.
And the process listing?
There's one above the rest that sticks out:
C:\WINDOWS\system32\rundll32.exe" "C:\Documents and Settings\ctuser\Application Data\HELP\system32\rtn.dll"
That just about settles it for me. rtn.dll does not belong. Let's go ahead and process it. I always start by right clicking and taking a look at the strings. This allows me to drill right in to what I am interested in.
Immediate strings of interest:
C:\DOCUME~1\ctuser\LOCALS~1\Temp
C:\DOCUME~1\ctuser\LOCALS~1\Temp
C:\DOCUME~1\ctuser\LOCALS~1\Temp\
C:\DOCUME~1\ctuser\LOCALS~1\Temp\~DFD.tmp
C:\Documents and Settings\ctuser\Application Data\Help
C:\Documents and Settings\ctuser\Application Data\Help
C:\Documents and Settings\ctuser\Application Data\HELP\
C:\Documents and Settings\ctuser\Application Data\HELP\\system32\
C:\Documents and Settings\ctuser\Application Data\HELP\\system32\mswmpdat.tlb
C:\Documents and Settings\ctuser\Application Data\HELP\\system32\wmcache.nld
C:\Documents and Settings\ctuser\Application Data\HELP\system32
C:\Documents and Settings\ctuser\Application Data\HELP\system32\rtn.dll
Yep, this tells us a little about the files the malware is using. Point of interest here is that the malware created a directory structure for the user the malware was run under, and one of the few directories it could write to was in the profile as the user had no elevated privileges. Many people still think that Administrator rights is a means of stopping the execution of modern malware. Those people couldn't be more wrong but I digress...
Right now we don't know what the files are are specifically but we will soon...
How about this?
1dM3uu4j7Fw4sjnbcwlDqet4F7JyuUi4m5Imnxl1pzxI6as80cbLnmz54cs5Ldn4ri3do5L6gs923HL34x2f5cvd0fk6c1a0s
My that's odd isn't it? And it's referenced in three different memory locations. So just what is that string? The following code should give you a big hint.

If you can't tell that's an XOR key and function. We can use that bit of information later when we want to do deeper analysis. As we learn from later analysis, this XOR key is used to encode data written to log files by the malware.
When I did this analysis for real I completed the analysis and decoded the log files kept by the malware, and conducted a more thorough disk based analysis. The purpose of this posting is to illustrate a quick analysis method that pays off with the extraction of the XOR key to encode log files created by malware. In all, doing it this way takes about 15 minutes to get actionable intelligence. Think about it. In a just a few minutes we've gathered:
* Filenames on a filesystem. Pass that information off to your windows admins, and they can search desktops for the files.
* The XOR key to decrypt any discovered log files
* There's more to be seen in the memory dump that allows us to create a snort signature if need be(of course one already exists at present time).
* The malware does not require administrative privileges to execute or maintain persistence.
I realize this post is a bit incomplete..hopefully I'll get back to a continuation piece.
Miscarriage of justice? Open debate
March 4th, 2010
The DNA evidence, described in NewScientist (http://www.newscientist.com/article/dn18215-knox-murder-trial-evidence-flawed-say-dna-experts.html) and alluded to in the BBC (http://news.bbc.co.uk/1/hi/world/europe/8389940.stm), points to a trivial presence of DNA, perhaps transfer from the casual acquaintance between the victim and the accused.
Yet, it seems that the courts dismissed this expert advice in favour of media hype and hyperbole. In addition, there was dismissal for no clear reason, of the alibis of both accused. ‘In Seattle her grandmother, Elisabeth Huff, added: “They didn’t listen to the facts of the case. All they did was listen to the media’s lies.”‘ BBC- http://news.bbc.co.uk/1/hi/world/europe/8396826.stm
On the other hand, the Kercher family are reported to be “pleased” with the verdict. Well, of course, they have come into a lot of money, but it is hard to understand why they didn’t find closure in the conviction in October last year of the former boyfriend (Rudy Guede) of murdered Meredith Kercher. Instead, their Lawyer’s statements after sentence was passed on Knox and Sollecito suggest that they were seeking more than simply justice (which was already served with the conviction of Guede): ‘Miss Kercher’s family lawyer, Francesco Maresca, said they were satisfied with the verdict. He said: “They got the justice they were expecting. We got what we were hoping for. “With what we got with the Guede sentence last year, we have obtained truth and justice for this tragic event.”‘ BBC - http://news.bbc.co.uk/1/hi/uk/8394750.stm
Of particular alarm is the action of the Italian courts: ‘The closing speech of prosecuting magistrate Giuliano Mignini is a good example. To the genuine surprise of the court, he changed key facts put forward at the beginning of the case. He moved the official time of the murder back an hour to around 2330 and modified the motive.’ BBC- http://news.bbc.co.uk/1/hi/world/europe/8396433.stm ‘Miss Knox’s father, Curt Knox, insisted: “Our attorneys have more than presented evidence that would show that she’s innocent.”‘ BBC- http://news.bbc.co.uk/1/hi/world/europe/8394737.stm
Can we, as international practitioners of forensic science stand by and let this happen? Is it indeed a miscarriage of justice? We don’t know the full facts of course, but I rather think we haven’t heard the end of this case.
*Dr Whittington is a Consultant Entomologist; Honorary Fellow of the School of Molecular and Clinical Medicine, University of Edinburgh; Adjunct Lecturer, Department of Medicinal Chemistry, College of Pharmacy, University of Florida; Registered Expert Advisor (EA), National Policing Improvement Agency (NPIA).
Dr. Whittington will moderate this debate.
Un WE de vacances
March 3rd, 2010Pediatric radiological diagnostic procedures in cases of suspected child abuse
March 2nd, 2010March 2009
February 27th, 2010Teacher’s corner: Laboratory safety in schools and academia under investigation
February 26th, 2010
Oliver Grundmann sent us a very interesting article based on a recent laboratory accident (see below). Thanks Oliver!
In a recent incident at an Onteora High school, a teacher and seven students were injured and had to be taken to hospitals for treatment of burns and removal of glass particles. The teacher was demonstrating the reactivity of the strong oxidizing agent potassium chlorate. The sudden reaction which involved a food item of undetermined nature, led to an explosion which blasted the windows of the classroom. This and other examples in high school and academic laboratories are sad reminders of the importance of safety in an environment where personnel and students are exposed to higher risks.
Although safety training is often considered mandatory before a new student or laboratory worker can enter the work place, it appears that often the prevention of significant accidents is more a result of chance than good preparation. Several examples that are even regulated as part of a well implemented laboratory quality assurance (QA) and quality control (QC) program are often overlooked. Whether it be the storage of acids and bases together or with flammable substances, reactive or volatile chemicals in not well ventilated safety cabinets, or waste disposal and storage – there are a number of risks that can be avoided or significantly reduced if the right procedures are being followed.
Some of the more recent laboratory accidents in academia will now be under increased scrutiny through investigation by the Chemical Safety Board (CSB). For more information, see a recent article in the Chemical & Engineering News: http://www.cendigital.org/cendigital/20100201?sub_id=4eVDgLgGcFIf&folio=25#pg27.
TACTICAL trial by fire
February 24th, 2010When I arrived on scene I was briefed and went to search for the requisite equipment to perform the acquisition. As it turned out, the entire stock of wiped drives was gone. A 500GB drive was located, but it needed to be wiped. Wiping a 500GB drive takes up to a few hours, so that was no good. I did have some clean space on an acquisition RAID device though. Given the sensitivities of the operation I had to do this quickly, efficiently, and right the first time. The margin for error was slim as there was information on the desktop that couldn't be lost.
I went for the Ace up the sleeve. I had up to this point only used it in testing, but I went for a tool I knew could trust. The tool was none other than F-response TACTICAL. Yeah that's right, I went for live imaging in a Law Enforcement case. There are still plenty of those doubters and naysayers out there, so let me be clear. The time to adapt has passed, the need to preserve evidence when lives are at stake is paramount. It's time you adopt modern techniques. There is no such thing as forensic purity, in any forensic discipline when you've got volatile evidence. That's a myth created by those that have never worked in the field.
Photos taken, and requisite documentation completed, I plugged the victim system in to a local switch I had for this purpose. I then proceeded to insert the subject dongle in to the subject computer. I quickly popped the examiner dongle in to my station attached to the acquisition RAID. Configuration, always quick, included physical memory. Then I simply clicked on "auto connect" on the examiner console. Just like that, the disk and memory objects I needed were exposed. Firing up FTK imager, I made the acquisitions I needed. The case proceeded as many do, with hurried phone calls and stress like no normal incident can create. The evidence was secured for examination and the subject laptop was turned over.
I'm an Incident Responder, and a Forensic Examiner. I need tools I can rely on, tools that work in the clutch, tools that don't break the bank, tools to use when life and limb are at stake. For me, that's F-response. A very big thanks to Matt Shannon and the folks at F-response. I'm not sure how the field got along without you and you've made technology available that makes a real difference.
