sobota, 6 kwietnia 2013

The Red Queen Effect Feedback Loop


It is more academic style to start the article/lecture with a definition, but for this case such approach will be the most straight forward.  Reading Bruce Schneier’s blog and book ( Liars & Outliers - How does society function when you can’t trust everyone? ) I am constantly finding great thoughts, conclusions, theories – and one of them I would like to comment, share my opinion. Bruce is widely known security pro – especially in the hard core mathematic and cryptography  - but is interesting writer, and shares his opinion about the evolution and the problem of trust in security itself.

Firstly, what is Red Queen Effect?
The Red Queen hypothesis, also referred to as Red Queen's, Red Queen's race or The Red Queen Effect, is an evolutionary hypothesis which proposes that organisms must constantly adapt, evolve, and proliferate not merely to gain reproductive advantage, but also simply to survive while pitted against ever-evolving opposing organisms in an ever-changing environment. Source: (http://en.wikipedia.org/wiki/Red_Queen_hypothesis). Please, check also attached graph showing never-ending war between Prey and Predators - one of the most famous example for Red Queen Effect.

(...) arms race is known as the Red Queen Effect…”It takes all the running you can do, to keep in the same place.” A species has to continuously improve just to survive, and any species that can’t keep up – or bumps up against psychological or environmental constraints – become extinct.
Red Queen Effect 

According to one of Gartner’s articles : Most companies respond to this challenge (Red Queen Effect) with an attitude of “work harder, faster” investing more in core competencies and familiar resources. This is a losing proposition. It amounts to doing more of the same, just at a quicker pace. Rather than accelerating innovation, this approach traps companies in what can be termed the “Red Queen Effect.” In another words: Most companies try to differentiate themselves from their competitors by better products or improved processes leading to a better cost structure. The problem is that their competitors do the same thing at the same time so after a firework of new products the situation is pretty much the same. You moved forward but your competitor also moved forward. If you do not move, you fall behind. 

Now, lets go back to security. So how Red Queen Effect is influencing security and what can be the best example for it?

The scope of defection increases with more technology. This means that the societal pressures we traditionally put in place to limit defections no longer work, and we need to rethink security. It's easy to see this in terms of terrorism: one of the reasons terrorists are so scary today is that they can do more damage to society than the terrorists of 20 years ago could--and future technological developments will make the terrorists of 20 years from now scarier still.



It is now  easily understood that the  old-school competition, dog eat dog and arms race have many disadvantages and in the worst case scenario the level of security and  trust may remain the same. What can be done to find the way to behave correctly without risk (incident response, innovations) and do not end with Red Queen Effect? The last fragment presented here from the book may be the answer or just truth about ourselves:

We are social mammals whose brains are highly specialized for thinking about others. Understanding what others are up to – what they know and want, what they are doing and planning – has been so crucial to the survival of our species that our brains have developed an obsession with all things human. We think about people and their intentions, talk about them; look for and remember them. 
Check http://www.schneier.com/ for more information about the author (Liars and Outliers: Enabling the Trust that Society Needs to Thrive) and read this great book for more fascinating knowledge and paths. Sources: http://blog.business-model-innovation.com, and http://blogs.gartner.com.

sobota, 23 marca 2013

Infrastructure Availability Monitoring


Here, just several words about physical infrastructure monitoring – somehow about one of  the component of CIA triad – availability. It is not new or surprising  that IT guys try to make their jobs easier by applying – to some degree - some automatization. Manual  log revision,  or  checking all servers one by one can be tiring and time consuming task.  Before making any statements let have a look why the monitoring is so important.

Why it is important to monitor physical infrastructure? On in other words, why availability monitoring is so crucial? First – the most prosaic one – because administrators want to know that their servers are working and performing tasks. In fact this is the most important argument – and the most difficult. Secondly, to check servers resiliency. What is the system load, what is the performance and how the servers can be used to increase efficiency. This also refers to the problem of virtualization and costs – which at the same time are additional arguments. One may say, that compliance/ regulations are arguments for availability monitoring – nobody wants their data to be lost due to downtime on machines (software and hardware). Security aspect – checking how the system is behaving, and looking for anomalies may be the indicator of DoS attack or any IT Sabotage going on. The last one, is testing purposes – it is sometimes nice to have  estimation how the particular appliance/software is working, if it is resource-demanding and so on.


Why it is important to monitor physical infrastructure?
-  servers resiliency (load distribution, load balancers)
-  virtualization (still performance issue)
- security (anomalies, downtime)
- regulations (data loss)
- costs
- development

There are of course tons of good software (open-source and commercial) that are designed to monitor different factors of our machines. Those are: load average, CPU, disk capacity, IN/OUT on multiple interfaces and others. Many of tools use round-robin databases (additionally use simple in configuration SNMP)  which is great option when there is no enough time for maintenance – such applications just work. It is of course possible to use more sophisticated scripts (using ssh for communication) which can report what is going on with particular processes on the remote server. And here starts interesting discussion. How far should we push administrators for monitoring? Should we monitor every working process on servers, or only the most important ones? 

The work flow is simply. We ‘add’ remote machines to our monitoring server, and present performance and other factors as simple graphs (aggregated!) , with colors or even sound warnings. The worst idea is to view tables with numbers, but it can also be applied, may be with additional visualizations or meaningful color (red/green?). To such solution it would be beneficial to add  some threshold alerts (moving average, moving average with dynamic deviation) and configure emails for notice/ warning and alert levels.  In my humble opinion, this is still not enough.


I would like to make here, a one step back. Imagine that you have really important process working on your remote machines. This process is responsible for collecting data or anything critical for your service. Due to performance issues, or unexpected bug in application (such bugs tend to reveal only when the system is overloaded, and the ‘catch-up’ behavior can be spotted) the ‘really important’ process stopped and your graphs do not show the problem! The solutions in this case is easy – why the machine was overloaded before, and why nobody solved it? What is the point of ‘monitoring the monitoring tool’ when nobody looks  and care for warnings? Human factor is crucial, and even the best availability monitoring tools cannot replace a man.

Combination of  dashboards, warning system, daily checks and human consciousness is the best option when dealing with infrastructure monitoring. 

niedziela, 3 marca 2013

Malware Forensics with Cuckoo


When it comes to malware forensics, it appears that live response is the best option. Imagine that you have infection -problem with one family of malware on multiple workstations -  miles away. The only way you can reach those hosts  is remote connections via multiple different technologies agent-less  - it would be great to have some servlet, agent installed -  or have prepared team on-site (this rarely happen).  Furthermore, when contacting user (whose workstation is infected), you should have some policy with you, clearly explain what is going on, and what do you want. This is not always an easy task. Moving step away from such discussion, it seems that the only information needed is memory – dump. It is always better option to get this first, without ‘old-shool’ approach – which tend to be more aggressive and evidence destructive.  Of course, when you have Encase, or combo X-Ways + F-Response, the task is much, much easier.  But here, I do not want to be ‘vendor-driven’ and just simply discuss the problem of memory-dump analysis.

After memory is preserved in a forensically sound manner, employ a strategy and associated methods to extract the maximum amount of information relating to the malware incident.

There are – literally – tons of specialized memory forensic tools for multi-layer interpretation, and multi-vector analysis. What is more very often those tools are specialized in memory carving, debugging, or disassembly. On the other hand there are many information in the dump that can be easily extracted using some old-school approaches. The first one is ‘strings’. This command can reveal variety of evidence, such as : URLs, fragments of files, web pages, commands run in the cli, IPs payloads, prefetch .etc.  This is always the first thing that – I suppose – should be done. It confirms or not, whether there are multiple hypothesis on the begging of analysis. (I am assuming here, that we have NBE stored, with accompaniment from SIEM). As I remember the first step – Encase – is to extract hidden as much information as it is possible from raw dump. This can be done with success with ‘foremost’ or ‘scalpel’.  Those file carving tools can give us executables, .pdf, and other types of files for further analysis. In this stage we have : file with readable text extracted from dump, and files reconstructed from the same RAM file. In my opinion, only reviewing this kind information is a waste of time. Of course, it gives great context of situation, but this is it.. When we have a really hard sample of memory, with hidden malware, I am sure that is would be very difficult just to check manually some hypothesis and be successful. I would like here to point great methodology that can be applied here, before moving with analysis on specialized forensic tools. After file carving procedure we are facing a problem of analysis. Here goes my question, is it better to analyze dump with forensics tools, looking for hypothesis and clues  and then extract some suspicious looking object for further examination,  or firstly use automated system to examine all extracted processes and objects? The first approach will end on static  analysis of extracted suspicious object. I think Farmer/Venema introduced nice categorization:

There are many ways to study a program's behavior. With static analysis, we study a program without actually executing it. Tools of the trade are disassemblers, decompilers, source code analyzers, and even such basic utilities as strings and grep.
With dynamic analysis, we study a program as it executes. Here, tools of the trade are debuggers, function call tracers, machine emulators, logic analyzers, and network sniffers. The advantage of dynamic analysis is that it can be fast and accurate. However, dynamic analysis has the disadvantage that "what you see is all you get".
A special case is "black box" dynamic analysis, where a system is studied without knowledge about its internals. The only observables are the external inputs, outputs, and their timing relationships.
Finally, there is post-mortem analysis, the study of program behavior by looking at the after effects of execution.


Taken from: http://www.porcupine.org/forensics/forensic-discovery/chapter6.html, a really good book by the way.

While static analysis is understood, I would like to discuss the problem of dynamic examination. Here it should be mentioned that there are two basic method to analyze unknown binary. Those are : program confinement with hard virtual machines and program confinement with soft virtual machines. First example of the soft environment is ReVirt :

ReVirt system allows an investigator to replay an "incident", and to rewind, pause or fast-forward the virtual machine at any point in time. This is possible because the ReVirt virtual monitor records all interrupts and external inputs including keystrokes and network packet contents. This information, combined with a complete record of the initial file system state, allows an investigator to replay every machine instruction and to view data before, while and after it is modified.



Another example of system designed for dynamic analysis is cuckoo. Cuckoo is a sandbox and can be explained using words taken form documentation (http://www.cuckoosandbox.org/):

As defined by Wikipedia, “in computer security, a sandbox is a security mechanism for separating running programs. It is often used to execute untested code, or untrusted programs from unverified third-parties, suppliers, untrusted users and untrusted websites.”. This concept applies to malware analysis’ sandboxing too: our goal is to run an unknown and untrusted application or file inside an isolated environment and get information and what it does. Malware sandboxing is a practical application of the dynamical analysis approach: instead of statically analyze the binary file, it gets executed and monitored in real-time.

 Installation can be tricky when attempting for the first time, for help please follow



Another awesome solution introduced by Lenny Zeltser (http://zeltser.com/remnux/:

REMnux incorporates a number of tools for analyzing malicious software that runs on Microsoft Windows, as well as browser-based malware, such as Flash programs and obfuscated JavaScript. The toolkit includes programs for analyzing malicious documents, such PDF files, and utilities for reverse-engineering malware through memory forensics. 
 
Step back. We have used some tools for memory carving and extracted multiple binaries. Now, this is the moment for automated job.  Cuckoo will be awesome only when prepared with plan. Multiple virtual machines should be prepared (with different version of software) , everything up-to-date and ready for malware object submission. All extracted files can be executed in prepared environment -  during analysis ‘agent’ will be capturing any information and then report what was going on test machine :  traffic, registry changes, files, new jobs and processes, any activity that was spotted during unknown object execution.  Having such results we can move on with static dynamic, or using forensic tool for confirming our hypothesis and look for other clues. On the other hand, the process of verification can be done after extracting suspicious files during ‘standard approach’ (without checking everything in virtual machine). For this purposes, you do not have to prepare environment and hard process of installation, instead go to http://malwr.com/ submit you file and wait for analysis! This web page uses cuckoo engine for analysis (check also https://www.virustotal.com/) .


What is the limit of malware forensics, and how far investigators are pushed to reveal the true hidden in extracted object? Any digital information found during investigation can be evidence, and only with context collected during previous steps (acquisition, ‘old-school’ approach, NBE, and clues found in memory with forensics tools) can be clearly and fully understood.  Simply, there are no limits. Stay focused.


wtorek, 26 lutego 2013

SSD Drives Destroy Evidence


Today, posting a short abstract: the most important facts, researches summary , conclusions and links to great documentation and conducted experiments.   

Authors of tests claim that solid-state drives (SSDs) have the ability to destroy evidence under their own will.  While the acquisition of forensic data from standard magnetic disks is fairly good described, is seems that much remain to be done on the field of SSDs. Here I would like to introduce some terms, such as; self-contamination, garbage-collector, or wear-leveling.
The most important, we need to know how the SSD technology works. For this, check google and find any article for most important facts, just to know and understand the principles. During acquisition stage of investigation we need to follow some ‘sound’ methodology; what is obvious is the importance to do not destroy evidence. To minimize alteration to the system, the recovery/collection process should include prevention of overwriting.

Here, the phenomenon of solid-state drive (SSD) self-corrosion is proven to exist through experimentation using real world consumer hardware in an experimentally reproducible environment.

SSD technology uses wear-leveling schema, which means that driver of ssd disk is trying not to continually write on the same place. Then we have something called ‘translation layer’ (Flash Translation Layer_that keeps in mind where the computer thinks is writing (also check TRIM). For performance purposes SSDs manufactures have developed ‘garbage collector’ or ‘self healing’ technique to reset particular sectors of SSD disk to be prepared for incoming writing.For full test review and conclusions please follow Solid State Drives: The Beginning of the End for Current Practice in Digital Forensic Recovery? Graeme B. Bell and Richard Boddington http://www.jdfsl.org/subscriptions/JDFSL-V5N3-Bell.pdf.

Another awesome article reveals additional portion of information:
Today’s SSDs self-destroy court evidence through the process that can be called “self corrosion”. Garbage collection running as a background process in most modern SSDs will permanently erase data marked for deletion, making it gone forever in a matter of minutes after the data has been marked for deletion. It is not possible to prevent garbage collection by moving the disk to another PC or attaching it to a write blocking device. The only way to prevent self-corrosion is physically detaching the disk controller from flash memory chips storing the data, and then accessing the chips directly via custom hardware. 

Blocks of data processed by garbage collector are physically erased. Information from such blocks cannot be recovered even with the use of  hardware and blockers. . Forensic researchers named this process as “self-corrosion” (Q3 2012: State of the art in SSD forensics)

 Preventing the operation of internal garbage collection is only possible by physically disconnecting the built-in controller from actual flash chips, and accessing information stored in  the chips directly.

The digital investigation science is changing on almost daily basic, so we need to stay focused, watch  how the scene is evolving ,be proactive and do not lose the big picture !:)

sobota, 23 lutego 2013

Security information and event management (SIEM)


SIEM systems perform two main functions, according  to documentation:

Security information management (SIM) : This sub-system (historically), was designed for      compliance purposes(policy) and threat management. SIM was designed to collect, report and prematurely analyze logs (it was not created to provide sophisticated methods of correlation or any). Logs/flows can be taken from any network/security devices but also from servers, databases and applications. Additionally , more often SIEMs are supporting variety of network appliances making the connections more effective and flexible.

Security event management (SEM): SEM is – or was – responsible for aggregating, correlating and analyzing logs for real time needs. It is crucial for incident response, clear and wide visibility into infrastructure and reporting.

During some lectures I was trying to figure out which type of data warehouse SIEM is – if SIEM is a warehouse at all.  Looking for words combination ‘warehouse SIEM’ I found some articles:

…approaches SIEM as a data management issue. …solution is built atop an event data warehouse that leverages a columnar database uniquely designed for time-stamped, unstructured data to be correlated and analyzed,  either in real time or over months or even years. The solution runs on a platform employing massively parallel processing and commodity hardware and storage for  enhanced load and query throughput, very high data compression (…)  and  extremely large data retention (up to petabytes a year). It provides the ability to correlate events across multiple data  sources and systems, either in real-time or on a historical basis.

Taken from : http://www.sensage.com. It seems that SIEM can be some kind of hybrid between OLAP and OLTP warehouses or even a modification of mediatory system – easy access to real time data (structured, parsed and correlated) but also giving information about trends, statistics and other historical patterns (which are capabilities of standard database warehouses). But before moving forward, let look at what ‘standard’ features provide SIEM:

Log management : supports effective correlation (indexing), collection. There are deployed mechanism for fast and efficient searches.  System should also support reporting and capability to attach external data sources – not only those standard (for example syslog or more exclusive opsec).

Compliance/event managment : allows for signatures creation (behavioral anomalies rules also) . What is more, it supports incident handling and documentation.

Visibility and dashboarding : SIEM provides clear dashboards to view system availability and performance (ideal situation) . Alert notificatiosn and trends can be viewed in easy format.

Log source management: system allows for maintenance, tuning, editing and additional extensions (third party software as example).

External data sources/feed: SIEM should be accessible and aggregate also non-standard information taken from outside of infrastructure.


Moving back to warehouses. Basing on this article http://www.networkworld.com  ,we are finding the definition for Security Data Warehouse, which is:

(…)  making security decisions based on mining business intelligence and combining it with security-related event data from security devices.
Today, security analysis more typically relies on what's known as security information and event management (SIEM) tools which can aggregate security and other technical information for a birds-eve view of network activity or detect possible unauthorized actions. (…) but it's now possible to go further through correlation of business activities, based on feeds from other sources too.
 A SIEM may have trouble "dealing with massive amounts of historical data," (…) but by using the Hadoop framework with core components that can handle "terabytes, even petabytes of information," it's possible to achieve better analysis by combining business and security data. " A SIEM becomes one main feed into the Security Data Warehouse. Improved historical analysis is also resulting," (…)

 The conclusion may be: SIEM is the sub-system for bigger mechanism that can provide predictive analytics and possibly track anomalies. Basing on that hypothesis SIEM alone is not typical data warehouse as it provides real time information and trends (rrd), collects information for compliance regulatory but very limited in terms of post-factum response or data mining. To some point it is a hybrid warehouse giving ideas (and even limited capabilities) of big data approach (statistics, historical patterns, rrd dashboards .etc)  but possibly to weak to compete with the typical one. SIEM is a main component in Security data warehouse that is now in developmental and evolutionary status - Big data.

(…) Security Data Warehouse approach is making it more possible to detect phishing attempts by analyzing email and other events, "and that allows you to respond more quickly than in the past."

I would like to stop here, and strongly  encourage you to read following materials.

http://csrc.nist.gov/publications/nistpubs/800-92/SP800-92.pdf - Guide to Computer Security Log Management (Recommendations of the National Institute of Standards and Technology)

środa, 20 lutego 2013

Threats - announcement


Today, just a little bit about threats that we are facing today, and that are getting to be more serious in coming years. Short and kind a ‘high-level’ discussion to give the wide context and ideas.

Firstly, it should be said that apart from new sophisticated types of attacks (APT, AET, ... ), we should not forget about legacy infrastructure, which still is fundamental and crucial. Just to mention, firewalls (NGFW are awesome, but still),  IDS/IPS, NIDS/HIPS, AVs, policy, standards, end-user awareness, etc. When saying and listing these ‘standard’ and essential ways of protection (layers of security) I have SIEM infrastructure in mind. It is impossible to have it all, and understand and  have wide and clean visibility into company protection. Event management system and correlation is a must in bigger companies with big infrastructure .etc, somebody may ask what does mean ‘big’ or when company needs specific type of protection. I suppose this is all about risk management. Having those applied into our company we have context and visibility – very often we are able to shorten incident response, and filter out tons of – let say – unknown activity.
Recently, on one of webinars, lecturer mentioned and pointed out, that 24x7 coverage is major component of efficient incident response. Attackers are smart guys, and very often they know when the risk of being caught is the lowest – summer/vacation time, weekends ... etc. Now, I would like to go through several important aspects of ‘modern threats’. BYOD and popularity of social media. In my opinion the increasing popularity and ease of using internet communicators app, smart devices are lowering security (on the other hand comfort level is growing).  Very often people who are using this devices/apps are not technical educated persons – they are not aware of risk and threats waiting for them. Cloud technologies, easy access to global net and fast internet are also a problem for security. Here I should write several words about insider threat. IT espionage, IT sabotage or just spying are known to IT security; and this is a serious problem in field of DLP/DRM.
Moving forward, to have a robust picture of what happened we should have digital forensic on board. Awesome technologies such as E-Discovery or Triage will be great idea for hunting or just quickly checking what happened. In depth-analysis could be performed with tools for post-mortem analysis (X-Ways, Encase, FTK, .etc). On the other hand we have wide range of capture – package appliances, which is a great source of alerts (+SIEM).
Having said that, do not forget about apps (huge problem with application in companies and validations/ white listing .etc). Pentesting and audit should be considerated. Another field and great opportunity for security is vulnerability scanning, code analysis and whitelisting.

poniedziałek, 7 stycznia 2013

How to detect malicious process?


Any process that we execute during our session, is done at our own risk and responsibility. There is no security mechanism or barrier preventing any processes from being infected or altered. On the other hand we have Bell–LaPadula model and controlled access to specific information within given security level. There are also AVs and other tools used for alerting. Apart from theoretical stuff, let focus on methods of host inspection and finding suspicious malware hiding somewhere, behind processes.

What problems can we face during host inspection?

We start looking for malicious files and processes when other automated tools and AV failed. You know, tons of security layers, but still our host got infected. What now? Possibly this can be a rootkit trying to hide itself and other malware, trojan – behaving as a normal, standard process or job. Just to quickly look at simplified work flow:

        1.  Try to stop spreading.
        2.  Terminate suspicious process. (processes can cooperate).
        3.  Delete binaries and files, verify  auto-run. 
        4.   Restart machine and check what is going on.

Basic and at the same time very often sufficient list of helpful tools : procexp.exe, procmon.exe, movefile.exe, msconfig.exe, autoruns.exe. Please follow  sysinternals -  the  best reference in this subject.

Great knowledge and comprehensive tool description can be found in “Windows Sysinternals Administrator’s Reference” written by Mark Russinovich. Please note that tools can be downloaded directly to the infected host, brought by investigator or executed from the web. To run the program from Internet Explorer just type http://live.sysinternals.com/nameOfTool.exe or just map drive  \\live.sysinternals.com with net use utility. The last thing to mention is.. practice makes perfect. So, the more systems you analyze (infected and clean) the better you are. Spend some time with listed utilities and start training.