Tuesday, April 29, 2014

Daily Blog #310: NCCDC RedTeam Debrief Slides

Hello Reader,
                 Well the Raytheon National Collegiate Cyber Defense Competition has ended for 2014 with the University of Central Florida taking the Alamo cup home with them. For those not familiar CCDC is a network defense competition that colleges around the united states compete in. For the nationals the top 10 teams in the nation who have one their regional qualifier come to face my red team while trying to normally operate their businesses. At the end of the event I present a debrief of what the red team did and what they should have learned from it to be better at defending and responding in the competition and real life.

Here are my slides:
https://drive.google.com/file/d/0B_mjsPB8uKOALXNpRE9FeUk2NGc/edit?usp=sharing

If you are a current or former competitor, or just interested in the event, and have questions about what we did this year I will be doing a Reddit AMA on 2pm CST.  You can participate here:
http://www.reddit.com/r/IAmA/comments/24a0dg/iama_red_team_captain_for_the_national_collegiate/

Hopefully I can keep the AMA going for a couple hours while I finish work for the day, but I'll likely check back for unanswered questions later in the evening as well.

Monday, April 28, 2014

Daily Blog #309 Sunday Funday 4/27/14 Winner!

Hello Reader,
   Another Sunday Challenge completed as we now only have 56 days left in the year of blogging. This week we have a returning champion with Andrew Case being the only soul brave enough to attempt the challenge. This is a good answer and for those of you doing response in the real world or in defense competitions I would suggest reading it.

The Challenge:
You have a Windows 2008 server that you are reviewing logs for and notice that an attacker is currently logged in. What would you do to:
A. Remotely interact with the system without exposing credentials to the attacker to steal
B. Determine the attackers actions
C. Determine where the attacker is coming from
D. Determine which processes may be providing some kind of persistence for the attacker

The Winning Answer:
Andrew Case

 A. Remotely interact with the system without exposing credentials to the attacker to steal
 I would create an account that only had access to the compromised system. This way even if the attacker steals the credentials he does not get any further access than he already has. This account would be disabled after the analysis phase.

To perform remote investigation of the machine, the previously created account would be used to remotely load a F-Response agent. This agent securely exposes RAM and disks of the running system as read-only iSCSI devices. These can then be mounted on the analysis machine across the network, and tools such as Volatility, Sleuthkit, etc. can be run against the iSCSI nodes.

This process, generally called sampling, has the great advantage of only having to process the part’ of memory and the disk needed by the tools. For example, in our initial tests of F-response and Volatility we discovered that plugins such as pslist and modules only need to transfer about 500KB of data from the RAM of the analyzed system back to the analyst’s workstation. Another nice use of F-response is that if full imaging is determined to be required after analysis, the i-SCSI nodes can be imaged using tools like dd.

B. Determine the attackers actions

To determine the attacker’s actions I would use Volatility to recover information such as running processes, active network connections, loaded kernel drivers, and so on. I would also use the cmdscan and consoles plugins as they recover both input and output of cmd.exe. These could potentially uncover every action performed by the attacker (and have in the past). I would also run the Windows malware analysis plugins, such as apihooks, malfind, and callbacks in order to see if the attacker has loaded malware. While memory was being analyzed, I would run a script that gathered select files from the remote hard drive including event logs, registry hives, prefetch files, and the scheduled tasks directory. These all hold a wealth of information about activity that occurred on the system including program execution, user account activity, and network share access. The registry also contains many places that are utilized by malware for persistence.

C. Determine where the attacker is coming from
When analyzing memory of a Server 2008 system, the netscan plugin can be used to list active network connections. This would reveal the IP address of the attacker.

D. Determine which processes may be providing some kind of persistence for the attacker

Since this question lists processes as a persistence mechanism I assume it is referring to code being injected into long running processes (explorer.exe, svchost.exe, etc.) and not something like the attacker installing a rouge FTP or VNC server or enabling Terminal Services when it is normally disabled. If this was what the question was referring to then this activity can be trivially detected by looking for processes that do not normally run on the system. This can be determined through baseline analysis or by looking for programs installed during the timeframe the attacker was active. Volatility’s svcscan plugin can be used to enumerate running services and check for ones related to RDP, VNC, etc.

To detect code injection as a persistence mechanism, the Volatility plugins malfind, apihooks, and ldrmodules can be used. malfind will find regions of code that were injected into processes, apihooks will find hooks that malware places to control running applications, and ldrmodules will find libraries that delete themselves from the list of the host process’s DLLs in order to avoid detection on a live system. Combined, these plugins find the three main code injection techniques --- shellcode injection, remote library injection, and reflective DLL loading.

Another indirect artifact that can often be used to find malware is by looking at the active network connections of a system and determining which process initiated each connection. The Window’s networking data structures maintain a reference to the process that started them and these can be used to trivially map a network connection to a process. This will immediately flag
suspicious behavior such as when explorer.exe is connected to a remote IP address somewhere in China.

Sunday, April 27, 2014

Daily Blog #308: Sunday Funday 4/27/14

Hello Reader,
         It's Sunday and we just finished the second day of competition here at the National Collegiate Cyber Defense Competition. I thought it would be fun to see what kind of things you would do in the shoes of a defending college team against my team of all star bad guys. Good luck in this weeks live response challenge!

The Prize:
A $200 Amazon Gift Card





The Rules:
  1. You must post your answer before Monday 4/28/14 8AM CST (GMT -5)
  2. The most complete answer wins
  3. You are allowed to edit your answer after posting
  4. If two answers are too similar for one to win, the one with the earlier posting time wins
  5. Be specific and be thoughtful 
  6. Anonymous entries are allowed, please email them to dcowen@g-cpartners.com. Please state in your email if you would like to be anonymous or not if you win.
  7. In order for an anonymous winner to receive a prize they must give their name to me, but i will not release it in a blog post

The Challenge:
You have a Windows 2008 server that you are reviewing logs for and notice that an attacker is currently logged in. What would you do to:
A. Remotely interact with the system without exposing credentials to the attacker to steal
B. Determine the attackers actions
C. Determine where the attacker is coming from
D. Determine which processes may be providing some kind of persistence for the attacker

Saturday, April 26, 2014

Daily Blog #307: Saturday Reading 4/26/14

Hello Reader,
    It's Saturday and I'm still at the National Collegiate Cyber Defense Competition. So while we reveal our plans to the 10 top student teams competing here, get your coffee or tea ready for this weeks reading to keep your own intruders out. Time for more links to make you think in this weeks Saturday Reading!


1. We had a short forensic lunch http://forensicmethods.com/webshell-log-analysis this week, This week we had:

Shelly Giesbrecht, @nerdiosity,  talking about her upcoming talk at the SANS DFIR Summit called '10 Ways To Make Your SOC More Awesome', learn more about the event here and you can hear a leadup to it on a SANS Webinar here: https://www.sans.org/webcasts/10-ways-rock-soc-97975

We also talked a bit about the National Collegiate Cyber Defense Competition where I am currently leading the red team before I had to run back to the fun! Also no audio issues!
You can watch it here: https://www.youtube.com/watch?v=M9Xtq1ZH74I&list=UUZ7mQV3j4GNX-LU1IKPVQZg

2.  Mari DeGrazia is back with a new post this week on parsing thunderbird archives, http://az4n6.blogspot.com/2014/04/whats-word-thunderbird-parser-that-is.html.

3. Chad Tilbury has a new post on Forensic Methods all about getting to know your web logs, http://forensicmethods.com/webshell-log-analysis.

4. Yogesh Katri has a new post up all about additional locations where Windows 8.1 stores search history, http://www.swiftforensics.com/2014/04/search-history-on-windows-81-part-2.html. Going beyond lnk files to event logs and cache files.

5. Jake Williams has a new post up taking about how to get Sift 3.0 running in an Amazon EC2 instance, http://malwarejake.blogspot.com/2014/04/sift-in-ec2.html.

6. Brian Moran has a new post up all about geolocating a devices past history, and its not a mobile phone. http://brimorlabs.blogspot.com/2014/04/you-dont-know-where-that-device-has-been.html.

7. Dave Hull has a new post up talking about the release of a new windows response tool he's preparing for his talk at the DFIR Summit, http://trustedsignal.blogspot.com/2014/04/kansa-modular-live-response-tool-for.html.


Friday, April 25, 2014

Daily Blog #306: Forensic Lunch 4/25/14

Hello Reader,
             We had a short but fun Forensic Lunch today.

This week we had:

Shelly Giesbrecht, @nerdiosity,  talking about her upcoming talk at the SANS DFIR Summit called '10 Ways To Make Your SOC More Awesome', learn more about the event here and you can hear a leadup to it on a SANS Webinar here: https://www.sans.org/webcasts/10-ways-rock-soc-97975

We also talked a bit about the National Collegiate Cyber Defense Competition where I am currently leading the red team before I had to run back to the fun! Also no audio issues!




Daily Blog #305: The Forensic Lunch coming live to CEIC!

Hello Reader,
         Almost missed making this daily as I sit in San Antonio getting ready for NCCDC tomorrow morning. I thought this would be a good time to announce that we will be doing the Forensic Lunch live from CEIC next month! I'll post more details when I have them but if you are going to be there let us know so we can have you either on the stream or in live audience!

Wednesday, April 23, 2014

Daily Blog #304: How to use the Triforce Videos

Hello Reader,
        We just uploaded the first of Triforce tutorial videos, you can watch it here: https://www.youtube.com/watch?v=j42FD9jcB4s&list=PLzO8L5QHW0MGUivIBxbrsavk2NL9VwsYQ

We will be uploading a bunch more videos to walk through how to use all the features we've added and do your own analysis. In addition we are proofing our documentation and preparing sample images to test the tool against for your own validation.

Give the video a watch and let me know what you want to know most about first!

Tuesday, April 22, 2014

Daily Blog #303: Verizon DBIR 2014 early access

Hello Reader,
             This is our second year contributing to the Verizon DBIR, Data Breach Investigations Report, and its something that I think is worth the time to do. One thing that most firms who are handling incidents and litigation as we do may not realize is that all your data is anonymous so your clients aren't at risk from sharing what you've seen over the year. One other benefit is that you can choose to have a member of the DBIR team come out to your site to collect all the information about your incidents and buy you lunch!

Beyond that though the other nice benefit to contributing is you get early access to the report, we've been seeing early drafts for quite some time so it helps in educating our clients of trends. As a benefit to you keeping up with the daily blogs I thought I would extend the courtesy to you and provide a link to download the 2014 DBIR a day early, http://verizonenterprise.com/dbir/2014/insider.

 So go check out the 2014 DBIR and get a wider picture of what trends are out there and this time its not just full of the word cyber (though it does contain the word cyber 93 times). You can also join in the fun of the Verizon DBIR cover puzzle challenge! Read more about last years challenge here: http://www.securitysift.com/solving-the-2013-verizon-dbir-cover-challenge/

Have fun reading!

Monday, April 21, 2014

Daily Blog #302: Sunday Funday 4/20/14 Winner!

Hello Reader,
        When I make these Sunday Funday Challenges and I include a specific version I'm usually looking to see how common the knowledge of something is. This challenge was no different as Android 4.4 offers a new logical acquisition option called the Android Backup which I was happy to see in this weeks winning answer. Though I did receive many good responses this week I thought this one best answered the question in terms of acquiring data in the context of an Android 4.4 device.

The Challenge:
Answer the following questions for an Android 4.4 device:

1. What effect would device encryption being on have on a physical acquisition?
2. What effect would device encryption being on have on a chip off acquisition?
3. What effect would device encryption being on have on a logical  acquisition?
4. What are the different types of logical acquisition available for an Android 4.4 device?

The Winning Answer:
Joerie de Gram

In answering the questions I'm assuming the credentials required for decryption are unknown to the examiner.

1. What effect would device encryption being on have on a physical acquisition?

Naive physical acquisition methods would result in the /data partition being inaccessible due to device encryption. If the required passphrase is not available to the examiner, a dictionary or brute force attack may be launched in an attempt to recover it.

As argued in literature by Casey et al. [1], overcoming device encryption requires adapting the legal framework, tactical approach and acquisition procedures. For Android devices utilising device encryption, tailored acquisition methods could allow key recovery through means other than brute force or dictionary attacks. For example, if a target device is acquired while it's fully booted (i.e. the encryption keys are memory-resident) and the lock screen is not barring access to the phone, combining ADB (Android Debug Bridge) with privilege escalation exploits might allow acquisition of volatile memory using LiME [2].

If the device is fully booted, yet the lock screen is barring access to the device, a way of either disabling or bypassing the lock screen is required first if ADB is unavailable. A thorough analysis of the target device model might yield surprising results, as demonstrated by Ossman and Osborn [3], whom leverage port multiplexing on the Samsung Galaxy Nexus to gain a shell on the device.

If the lockscreen cannot be disabled or circumvented, hardware attacks (e.g. JTAG) might allow for acquistion of volatile memory (and subsequently encryption keys) or unencrypted data directly. Finally, 'cold boot' attacks apply to smartphones as they apply to PC hardware and could lead to recovery of encryption keys [4] if the target device allows booting 'custom' images.

2. What effect would device encryption being on have on a chip off acquisition?

A chip off acquisition would yield a similar result to a 'naive'
physical acquisition. If volatile memory has not been acquired prior to performing a chip off, the examiner will have to resort to attempting to crack the encryption key.

3. What effect would device encryption being on have on a logical  acquisition?

- None if the target device is fully booted and either no lock screen is present, or the acquisition method is able to bypass it, as device encryption is transparent to filesystem-level acquisition methodologies.
- If the acquisition method would normally work regardless of whether a device lock (pattern, password, pin, etc.) is present, device encryption prevents logical acquisition if a device is initially powered off.

4. What are the different types of logical acquisition available for an Android 4.4 device?

- File transfer via ADB (optionally combined with privilege escalation exploits)
- Usage of the 'backup' functionality [5].
- I believe backup functionality was introduced in 4.0 (as per Nikolai Elenkov's great writeup [6], which I forgot to cite in my deadline-haste - I cited the backup extraction tool only). There have been some changes to key derivation which affect backups in 4.4 though [7].

[1]: Casey, E, Fellows G, Geiger M, et al, The growing impact of full disk encryption on digital forensics, Digital Investigation, Volume 8, Issue 2, November 2011
[2]: LiME - Linux Memory Extractor, https://code.google.com/p/lime-forensics/
[3]: Ossman, M and Osborn, K, Multiplexed Wired Attack Surfaces, https://media.blackhat.com/us-13/US-13-Ossmann-Multiplexed-Wired-Attack-Surfaces-WP.pdf
[4]: Müller, T and Spreitzenbarth, M, FROST: Forensic Recovery Of Scrambled Telephones, https://www1.informatik.uni-erlangen.de/frost
[5]: Android backup extractor,