[null, null, null, null, null, {"document_url": "http://walidshaari.blogspot.com/", "unformatted_src": "http://3.bp.blogspot.com/-qF--ITNfZIk/Uua1wbmA9VI/AAAAAAAAASU/4XlidO3ig_I/s1600/pork_bun_redline.PNG", "src": "http://3.bp.blogspot.com/-qF--ITNfZIk/Uua1wbmA9VI/AAAAAAAAASU/4XlidO3ig_I/s1600/pork_bun_redline.PNG", "formatted_filename": "pork bun redline", "rendered_width": 320, "rendered_height": 91}, null, {"document_url": "http://walidshaari.blogspot.com/", "unformatted_src": "http://1.bp.blogspot.com/-eg005lM8jPY/Uua1zVwpmDI/AAAAAAAAAS8/GgIWm_FzGQs/s1600/redline-ssdt-hooks.PNG", "src": "http://1.bp.blogspot.com/-eg005lM8jPY/Uua1zVwpmDI/AAAAAAAAAS8/GgIWm_FzGQs/s1600/redline-ssdt-hooks.PNG", "formatted_filename": "redline ssdt hooks", "rendered_width": 320, "rendered_height": 171}, null, {"document_url": "http://walidshaari.blogspot.com/", "unformatted_src": "http://1.bp.blogspot.com/-f28Z7Ua7HM8/Uua3OdfiqEI/AAAAAAAAATA/oOx74K8XEhA/s1600/websiteblocked.png", "src": "http://1.bp.blogspot.com/-f28Z7Ua7HM8/Uua3OdfiqEI/AAAAAAAAATA/oOx74K8XEhA/s1600/websiteblocked.png", "formatted_filename": "websiteblocked", "rendered_width": 320, "rendered_height": 97}, null, {"document_url": "http://walidshaari.blogspot.com/", "unformatted_src": "http://4.bp.blogspot.com/-29n_i6CTBP8/Uua1v303DVI/AAAAAAAAASM/tEQEDKesTkg/s1600/imageinfo.PNG", "src": "http://4.bp.blogspot.com/-29n_i6CTBP8/Uua1v303DVI/AAAAAAAAASM/tEQEDKesTkg/s1600/imageinfo.PNG", "formatted_filename": "imageinfo", "rendered_width": 320, "rendered_height": 164}, null, {"document_url": "http://walidshaari.blogspot.com/", "unformatted_src": "http://4.bp.blogspot.com/-2s7MJ6XYUHM/UuqjSv2Ex_I/AAAAAAAAATY/e14REQyNAmY/s1600/psscan.PNG", "src": "http://4.bp.blogspot.com/-2s7MJ6XYUHM/UuqjSv2Ex_I/AAAAAAAAATY/e14REQyNAmY/s1600/psscan.PNG", "formatted_filename": "psscan", "rendered_width": 320, "rendered_height": 262}, null, {"document_url": "http://walidshaari.blogspot.com/", "unformatted_src": "http://3.bp.blogspot.com/-u3Wg6I-EsyY/Uuqj8TD8p2I/AAAAAAAAATg/KBuZZazVzms/s1600/psxview.PNG", "src": "http://3.bp.blogspot.com/-u3Wg6I-EsyY/Uuqj8TD8p2I/AAAAAAAAATg/KBuZZazVzms/s1600/psxview.PNG", "formatted_filename": "psxview", "rendered_width": 320, "rendered_height": 150}, null, {"document_url": "http://walidshaari.blogspot.com/", "unformatted_src": "http://4.bp.blogspot.com/-FU1yv3RSy5g/UuqlZfqXj-I/AAAAAAAAATo/WTyn7iqlDZs/s1600/connscan-connections.PNG", "src": "http://4.bp.blogspot.com/-FU1yv3RSy5g/UuqlZfqXj-I/AAAAAAAAATo/WTyn7iqlDZs/s1600/connscan-connections.PNG", "formatted_filename": "connscan connections", "rendered_width": 320, "rendered_height": 107}, null, {"document_url": "http://walidshaari.blogspot.com/", "unformatted_src": "http://1.bp.blogspot.com/-aqF4U1BqoXU/UuqmMS7VK5I/AAAAAAAAATw/ubS0d7cM2hI/s1600/China-ISP-Beijing.png", "src": "http://1.bp.blogspot.com/-aqF4U1BqoXU/UuqmMS7VK5I/AAAAAAAAATw/ubS0d7cM2hI/s1600/China-ISP-Beijing.png", "formatted_filename": "China ISP Beijing", "rendered_width": 254, "rendered_height": 320}, null, {"document_url": "http://walidshaari.blogspot.com/", "unformatted_src": "http://4.bp.blogspot.com/-P-J_EuBISVM/Uuqmvs2lhiI/AAAAAAAAAT4/eKg2RTMbFHM/s1600/pork_bun_vol.PNG", "src": "http://4.bp.blogspot.com/-P-J_EuBISVM/Uuqmvs2lhiI/AAAAAAAAAT4/eKg2RTMbFHM/s1600/pork_bun_vol.PNG", "formatted_filename": "pork bun vol", "rendered_width": 320, "rendered_height": 99}, null, {"document_url": "http://walidshaari.blogspot.com/", "unformatted_src": "http://1.bp.blogspot.com/-SU16PGTclDE/UuqoY90xwQI/AAAAAAAAAUI/KN-PU3xnke4/s1600/dll-vol.png", "src": "http://1.bp.blogspot.com/-SU16PGTclDE/UuqoY90xwQI/AAAAAAAAAUI/KN-PU3xnke4/s1600/dll-vol.png", "formatted_filename": "dll vol", "rendered_width": 320, "rendered_height": 87}, null, {"document_url": "http://walidshaari.blogspot.com/", "unformatted_src": "http://2.bp.blogspot.com/-r642AGBDhSg/UuqnsW7OoaI/AAAAAAAAAUA/REPxqgjStsE/s1600/virustotal-01.png", "src": "http://2.bp.blogspot.com/-r642AGBDhSg/UuqnsW7OoaI/AAAAAAAAAUA/REPxqgjStsE/s1600/virustotal-01.png", "formatted_filename": "virustotal", "rendered_width": 320, "rendered_height": 144}, null, {"document_url": "http://walidshaari.blogspot.com/", "unformatted_src": "http://2.bp.blogspot.com/-cOyz-t4rOLo/Uusu17YGwRI/AAAAAAAAAUg/VaQ5RJmqBGI/s1600/virustotal02.PNG", "src": "http://2.bp.blogspot.com/-cOyz-t4rOLo/Uusu17YGwRI/AAAAAAAAAUg/VaQ5RJmqBGI/s1600/virustotal02.PNG", "formatted_filename": "virustotal", "rendered_width": 320, "rendered_height": 154}, null, {"document_url": "http://walidshaari.blogspot.com/", "unformatted_src": "http://2.bp.blogspot.com/-IMTZAQYFG8s/UuqowjhUEHI/AAAAAAAAAUQ/A2MY2oOp_9U/s1600/filescan.png", "src": "http://2.bp.blogspot.com/-IMTZAQYFG8s/UuqowjhUEHI/AAAAAAAAAUQ/A2MY2oOp_9U/s1600/filescan.png", "formatted_filename": "filescan", "rendered_width": 320, "rendered_height": 84}, null, null, null, null]

Dhahran-Docker November 2016 meetup

On Wednesday, 16th November, Dhahran Docker meetup participated in the global #learndocker event "Global Mentor Week." two useful resources that were used to some extent were PWD: Play With Docker and Katacoda.

There were lots of questions asked during and after the meetup. So here I am trying to capture to the best of my knowledge Docker and containers questions and some of the answers for the future meetup mentors as a taste of things to come, I will  try to update and answer more questions, however I encourage joining the Docker community Slack channel and Forum for any further questions.

Docker Dhahran Nov 2016 meetup from Walid Shaari


Q: I am still confused what is the difference between image, and containers, aren't container and image both the same thing?

A: Think of the image is the golden template, and when Docker run it, it creates an instance of it in memory with the required customization "port exposed, environment variables set to configure an aspect, volumes bound, network connected,.., etc";  when the process/container is done, it still exists but now in disk, in case you need to create a  template from it, otherwise one needs to clean them up periodically. Although that question seems easy to answer, it was the most asked question from everyone at some time;

from Stackoverflow.com docker-image-vs-container

Docker Images vs. Containers

In Dockerland, there are images, and there are containers. The two are closely related, but distinct. For me, grasping this dichotomy has clarified Docker immensely.

What's an Image?

An image is an inert, immutable, file that's essentially a snapshot of a container. Images are created with the build command, and they'll produce a container when started with a run. Images are stored in a Docker registry such as registry.hub.docker.com. Because they can become quite large, images are designed to be composed of layers of other images, allowing a minimal amount of data to be sent when transferring images over the network.
Local images can be listed by running docker images
Some things to note:
More info on images is available from the Docker docs and glossary.

What's a container?

To use a programming metaphor, if an image is a class, then a container is an instance of a class—a runtime object. Containers are hopefully why you're using Docker; they're lightweight and portable encapsulations of an environment in which to run applications.
View local running containers with docker ps:
Here I'm running a dockerized version of the docker registry, so that I have a private place to store my images. Again, some things to note:

How to avoid image and container buildup?

One of my early frustrations with Docker was the seemingly constant buildup of untagged images and stopped containers. On a handful of occassions this buildup resulted in maxed out hard drives slowing down my laptop or halting my automated build pipeline. Talk about "containers everywhere"!
We can remove all untagged images by combining docker rmi with the recent dangling=truequery:
docker images -q --filter "dangling=true" | xargs docker rmi
Docker won't be able to remove images that are behind existing containers, so you may have to remove stopped containers with docker rm first:
These are known pain points with Docker, and may be addressed in future releases. However, with a clear understanding of images and containers, these situations can be avoided with a couple of practices:
more from Stackoverflow "whats-the-difference-between-a-container-and-an-image"

Images are frozen immutable snapshots of live containers. Containers are running (or stopped) instances of some image.
Start with the base image called 'ubuntu'. Let's run bash interactively within the ubuntu image and create a file. We'll use the -i and -t flags to give us an interactive bash shell.
Don't expect that file to stick around when you exit and restart the image. You're restarting from exactly the same defined state as you started in before, not where you left off.
But, the container, now no longer running, has state and can be saved (committed) to an image.
Let's create an image from container ID 48cff2e9be75 where we created our file:
Now, we have a new image with our really important file:
Try the command docker images. You should see your new image ubuntu-foo listed along with the ubuntu standard image we started with.

Q: the "FROM" directive in Dockerfile, Shouldn't the best practice pin the image with a tag?

A: Yes, I think it would be a good practice to pin the base image in the FROM directive line in Dockerfile. The reasoning is the default is latest, that could mean if someone rebuilds the image again, he is not guaranteed original functionality as things might have changed in future base images that might affect the other layers, not guaranteed security also if it will be pulled from non-trusted repository/hub.

Q: What if my image was compiled with optimisation in mind, would that work with another platform that does not have the instruction set?

No, it would not work,  if one is targeting portability, he will build the image for the lowest denominator with no special platform specific compiler flags. There could be internal Enterprise use cases where different builds of the containers for particular platform, tags could be used to distinguish such images.

Q: How would containers help us startups? Do you have use cases?

Docker history has some good lessons to learn from, Docker by itself is a good use case. When Solomon Hykes the Docker founder started up dotcloud in Y Combinator and how the dotcloud team was supporting other Y Combinator startups build, deploy and ship their apps into AWS, and the 20 startups from YC that adopted Docker early. Check out the origin story of dotcloud and how it transformed to Docker.

Also, the rich Docker Hub app repository, regarding application subsystems, and ready components. If one have an idea how to help a customer, it can be fast and easy to prototype into a fully working application or build an appliance. The entire Docker Ecosystem to create a full working operational and development workflow for the prototype and help the application scale.

In most cases, containers are an alternative to virtual machines. So it's easier to talk to people that already have virtual machines in use as they can relate. Containers could prove faster, more performant, and easy to manage.

One case I had seen recently with Zenoss when they moved their architecture to Docker containers, it helped them ship a standalone version of a complex distributed application in a scalable, manageable approach. That customers can install Zenoss behind their firewall. The Zenoss distributed architecture is very complicated, it uses a mix of many solutions, but still user's the whole installation, upgrade, and management experience have been inspiring.

How does Docker differ or relate to vagrant? How about docker-machine vs. vagrant?

The essence of Docker is the a-z of the software application lifecycle regarding build, ship, and run; that could be in any environment, development, production, QA, and could be multiple of environments mixed. Vagrant, on the other hand, is meant to be mainly for development, the Vagrant file is more or less like  the Docker compose YAML file describes the environment setup but doesn't describe how  the application instances or images are created, in Docker the images can be described using Dockerfile if not pulled from a registry/repository/Docker hub.

How can swarm allocate a container that might later overuse memory resources of the host?

How does Docker hub ensure images pushed to are lawfully licensed?

Some questions related to differences between images and containers
some questions when to use virtualizations vs. container or can one use both?
Will it be possible to run Windows containers on Linux platform, or the opposite without docker-machine?
Can one enforce network usage limits,? Bandwidth on a container?
Not yet in current Docker versions at the time of this blog writing. There are several closed/open Github issues related to throttling/limiting network bandwidth for a container.  For example, Github shivacherukuri Docker-Network-Bandwidth solution is one way to go about it.

One questions about build Docker images for a legacy app that its container size reached 10G in size have asked him to follow up with me with details?

What is the size limit or expectations of container size?

it depends on the storage driver, Docker version used, and file system limits. for example for Docker 1.10+ and devicemapper it can be increased over 10G: Docker 1.10 daemon option to increase the basedevice size

Questioning the numbers of 7B+ downloads, the percentage of Docker in production? Having access to the application survey would have helped.?

As for the downloads number these were from Docker Hub, and most of it is the community images, a quick search today in the newly store, shows around 439,440 community images, and as one can see captured image below, some of these images had already been downloaded over 10M+ times there are several surveys done that report different statics regarding the adoption of Docker in production and in the Enterprise, however, all of them almost agree on the rate of growth of using Docker in production. one good resource discussing some of these statistics earlier this year is
Coscale Docker usage statistics increased adoption by enterprises and for production use

Some other example surveys:

All these numbers are obsolete by now due to the rapid growth Docker and containers, in general, are seeing.

Non-technical  questions:

I did register for the Docker community, I do not see the general/ Global-Mentor-Week channel?

After you sign up for the Docker community group, you will get in your email a Slack invite, this is a manual process and could take some from few hours to a couple of days. Also double check your spam folder for any Docker/Slack related emails.

Can I download the training instructions offline?

I have raised the question in Docker community slack.  However, all training is now accessible free online; you should note that the practice is based on Docker community GitHub repos for the development course check it out at  Docker Github Labs, as for the operations, you can find it here Docker Orchestration Workshop

Some business related questions to local support, and resellers/partnerships in Saudi?

check  https://www.docker.com/docker-support-services#/faq and email email@example.com

Other questions:

Why the voter app breaks build breaks in Linux platform but does not on Windows? And using proposed solution makes the app not function right?

What is the percentage of serious critical/stateful business enterprise applications compared to web/cloud apps? Is Docker mostly for web/cloud apps?

Will there be professional certifications and exams on Docker ECO system?

As far as I know, Red Hat have some courses and exams:

As well as  Mirantis : Mirantis instructor-led training for kubernetes and Docker certification exam kdc100

Doing an ldd/pmap inside a container, how can the view from inside the container relate to the outside view from the host system, and what is static vs. dynamic in here?

Posted by Walid Shaari at 07:50 No comments: Labels: #learndocker, containers, Dhahran, Docker, Global Mentor Week, Linux, meetup, Saudi, Walid Shaari
Location: Dhahran Saudi Arabia

Friday, 2 December 2016

Devops and traditional HPC

Last April, I have co-presented in Saudi HPC 2016 a short talk titled "What HPC can learn from DevOps." It was meant to bring awareness to DevOps culture and mindset to HPC practitioners. Following day, the talk was complemented by an Introductory tutorial to containers. This talk and tutorial were my second contribution promoting DevOps locally. The first attempt was In Saudi HPC 2013 with the DevOps afternoon; in which we had speakers from Puppet and Ansible with good examples back then of how automation "Infrastructure as code" frameworks encourage communications, visibility and feedback loops within the organisation.

Talk Abstract:

Cloud, Web, Big Data operations and DevOps mindsets are changing the Internet, IT and Enterprise services and applications scene rapidly. What can HPC community learn from these technologies, processes, and culture? From the IT unicorns "Google, Facebook, Twitter, Linkedin, and Etsy" that are in the lead? What could be applied to tackle HPC operations challenges? The problem of efficiency, better use of resources? A use case of automation and version control system in HPC enterprise data centre, as well a proposal for utilising containers and new schedulers to drive better utilizations and diversify the data centre workloads, not just HPC but big data, interactive, batch, short and long-lived scientific jobs.

Here are some of my personal talk notes at that time. Apparently, they did not fit the 15 minutes window I was given.

What hpc can learn from devops? from Walid Shaari

Talk reflections and thought points:

Definitions: Presenting the different possible HPC workloads: HTC, HPC, HSC, and the recent trend in Data Centre convergence by considering BigData “Analytics” and more recently MLDM “Machine learning, Data mining.” Highlighting the diversity and variability of HPC workload, then moving to what DevOps means to HPC, Why it did not pick up as much? What HPC can learn from Enabling, cloud, and Big Data operations?

The disconnect: Traditional HPC software changes are infrequent; HPC does not need to be agile handling frequent continuous deployments. Each HPC cluster deployment is a snowflake unique in its way, making it hard for group users to port their work to other clusters, a process that takes days, weeks, often months.  The concept of application instrumentation and performance monitoring is not the norm, nor the plumbing and CI/CD pipelines.

The motivation: However, HPC infrastructures inevitably have to grow, innovations in HPC hardware requires a new look into HPC software deployments and development, HPC data centres will need them few highly skilled operational engineers to scale operations with fewer resources efficiently. The defragmented use of system resources needs to be optimised. The scientific and business applications might be rearranged, refactored, reworked to consider better workflows. Analysing application and data processing stages and dependencies looking at them as a whole and connected parts while avoiding compartmentalization and infrastructure silos.

The scalability Challenge: What could be the primary HPC driver to introduce DevOps culture and tooling?  Can't stress enough on scalability (the imminent growth due to initiative like national grids, and International Exascale computing, the workload, number of nodes, number of personalities or roles an HPC node might take)

DevOps tools: Emphasise richness of the tool set and culture that have driven tools evolution. Pointing out it is not about the tools, more than the concepts that tools enable. Not just automation, building, shipping and delivery workflows, but the ever engaging feedback loops, the collaboration, ease because of integration, highlight that communication and feedback are not just the human face-to-face but also the meaningful dashboards and actionable metrics,  the importance of code reviews, the rich API, the natural UX.  Such comprehensive set of tools and unlike the current HPC defragmented alternatives or in some cases Enterprise tools used wrongly for HPC.

Use case of differences:  The case of Provisioning; and how the terminology differs between the HPC and web/cloud communities. Taking this example further to pivot to the false assumptions of HPC can be just bare-metal provisioning.

Validation: Validation of the hypothesis of serious HPC workload in the cloud, and recent use cases for containers deployment in HPC from surveys and production ready vendor solution trending the last couple of years may be present some of the related HPC cloud news.

2nd Generation Data Centre provisioning tools: Alternatives, offer open source alternatives to traditional HPC provisioning tools and highlight their diversity in handling bare-metal, virtual images instances, and containers. As well the possibilities for combining this with diskless and thing OS hosts.

The current state of the HPC Data Centre:  Highlight the problem of static partitioning (silos), and the various workload needed to either support or complement the bigger business/scientific application and discuss valid reasons of partitioning.

Resource Abstraction:  What if we abstract the data centre resources, and break down the silos? How should that be done?  What core components need to be addressed? Why? Present an example proposal of such tooling with the reasoning behind it.

Unit of change:  Containers technology is a useful enabling technology for such problems. Does not have the performance overhead issues that HPC shied away from in virtualisation related solutions, and will enable portability for the various HPC workload deployments. Not to mentions the richness of its ecosystem to enhance the current status quo of scheduling, resources, and workload management to greater levels of efficiency and better utilisation of Data Centre resources.

The software-defined data Centre:  Everything so far can be either code or managed and monitored by code. How flexible is that? And what new opportunities it brings?  How can everything be broken down into components? How parts integrate and fit together? enabling a “Lego style” Compose-able infrastructure driven and managed by code, policies, and desired state models. How has code opened new possibilities to stakeholders?

Some Docker evaluation use cases:

Challenges ahead: The road ahead expectations? The unique differences and requirements?  Which underlying container technologies need to be in place and for what?  The right amount of namespace isolation vs. cgroups control, how about LXC, LXD, Singularity, Docker? What would we see coming next?

In the future we'll see more container runtimes, not less, purpose built for the target application platform, and largely invisible.
— Kelsey Hightower (@kelseyhightower) December 2, 2016

The importance of having the right mindset to evaluate, experiment new paradigms and technologies, eventually deploy and utilise them in production; introduce new workflows, enable better communication between the different teams (developers, users, security, operations, business stakeholders). The concept of indirection and abstraction to solve computer problems, in this case, the 2-level indirection scheduling for granular resource management. The container unit concept for the workload is not just for applications; it could also be for data.

to be continued ...



Posted by Walid Shaari at 12:56 2 comments: 

What if Ansible Run Hangs?

Running  Ansible against 1000s of nodes, not fully aware of some of the node status before the run, some were heavily loaded, and busy, some were down. such highly loaded of  OOM nodes or even some of the play-book tasks are prone to wait, and blockage, all of these conditions will cause Ansible to hang. below are some of the steps that I followed or were collected from Ansible mailing list* to help debug such a hang:

Is it the initial connection?

use -vvvv to trouble shoot the connection

What you call hung could be normal unless not intended:

from Ansible playbooks async :

By default tasks in play-books block, meaning the connections stay open until the task is done on each node. This may not always be desirable, or you may be running operations that take longer than the SSH timeout.

Is it the remote executed task ?

$ python -m trace --trace
2>&1 | head
--- modulename: command, funcname: <module>
command(21): import sys
command(22): import datetime
command(23): import traceback
command(24): import re
command(25): import shlex
--- modulename: shlex, funcname: <module>
shlex.py(2): """A lexical analyzer class for simple shell-like syntaxes."""
shlex.py(10): import os.path
shlex.py(11): import sys

Possible causes of hangs :

* Thanks to Michael Dehaan and Ansible developers for a an awesome code,  and thanks to James Tanner for his help and pointers in the Ansible users mailing list, and IRC.

* This was written at the time of Ansible 1.4.2 in RHEL/CENTOS based environment,  ssh connections could even be further improved by enabling ControlPersist nor pipelining mode

Posted by Walid Shaari at 23:39 No comments: 

DFIR Dec. 2013 Memory Forensics Challenge notes :

This is my first memory forensics outside of SANS 508 SIFT workstation investigating Timothy Dungan
workstation "Stark Research Labs Intrusion case by Hydra" . So even though I believe that I have answered the questions that were asked in the SANS DFIR blog , there are lots still to learn and more skills to sharpen.  Using lots of  curiosity, volatility, redline, and SIFT workstation it is easy to run a memory investigation especially if one is quipped by SANS508 course material and volatility IRC channel.  Below are my scattered notes from three separate sessions, the overall time it took is over 7-8 hours, it could have been done in one session with more focus and less distraction form the kids.

[ note to oneself : collect reports and screenshots more next time, and write report as you go along ]

Using Mandiant Redline:

Used Redline white listing to filter out a large amount of data that is not likely to be interesting: data that corresponds to unaltered, known-good software components, however, I was not successful at finding red flags "rouge processes" straight away, There were  three suspicious processes i was targeting ,  however could not find the obvious anomaly malware introduced to systems,  so started looking for other low hanging fruits/signals that could give me a good pivot point to start using also the low frequency of occurrence technique and focusing on the DFIR challenge questions asked to keep me focused.

·        Suspicious untrusted  handle pork_bun associated with the explorer.exe process (pid:1672) Possible Gobal root kit cloaking activity via  System  Service Descriptor hook:
The hooking module name looks suspicious irykmmww.sys hooked to ntoskrnl.exe with NtEnumerateKey  , and NtEnumerateValueKey , as well as NtQueryDirectoryFile which are used to hide things:
o   NtEnumerateValueKey : : Allows an application to identify and interact with registry values.   Malware use this insert itself between any registry value request and filter out what value it wants to hide.
o   NtEnumerateKey  : Allows an application to identify and interact with registry Keys.   Malware use this insert itself between any registry key request and filter out any registry keys it may want to hide its value.
o   NtQueryDirectoryFile : Gives the application the ability to perform a directory listing. By hooking this function a malware can hide directories or files from normal file managers as well as anti-malware tools
o   NtDeviceIoControlFile, the API Windows uses to do network related stuff and has been widely mentioned in malware behavior analysis papers. Malware can use it to replay network traffic, how cool is that?! Not to mention my company campus ISP blocks me from doing some more research ;-) Not that it cannot be overridden with any vpn connection.

Tried to acquire the driver for further analysis, however Redline couldn’t dump it, you will see later i was able to dump it with volatility which proves why you need to know more than one tool, as most likely one tool will not be fit for all situations and always tools will fail you most when you need them.

Using Volatility to cross check and dig deeper:

Treating it as a real case, preserving the initial image as read only image and its hash value:

$ sudo chattr +i dfir-challenge/APT.img

To start processing we need to know more about the image file profile, so we run imaginfo sansforensics@SIFT-Workstation:/cases/dfir-challenge$ vol32.py -f ./APT.img imageinfo
Volatile Systems Volatility Framework 2.1_alpha
Determining profile based on KDBG search...

Suggested Profile(s) : WinXPSP3x86, WinXPSP2x86
AS Layer1 : JKIA32PagedMemoryPae (Kernel AS)
AS Layer2 : FileAddressSpace (/cases/dfir-challenge/APT.img)
PAE type : PAE
DTB : 0x319000
KDBG : 0x80545b60L
KPCR : 0xffdff000L
Image date and time : 2009-05-05 19:28:57
Image local date and time : 2009-05-05 19:28:57
Number of Processors : 1
Image Type : Service Pack 3


The normal process scan for the processes that are not supposedly hidden by unlinking the double linked list process structure. Cross examining the processes seen normally via the doubly linked list vs. the ones scrapped from memory structures: Scanning for network artifacts, since this is assumed to be an APT "advanced persistent threat" case, one good lead would if the box was infected at some time malware will have to connect with Covert Command-and-control (C2) channels, or if this was not the one with the originally  infected malware, data exfiltration activity should leave some bread crumbs for us to trace. interestingly enough from the connection scan above we see port 443 which is usually firewall friendly port appears to be either inactive or stealth.  However it is from the same process to the same IP, the process is explorer.exe (1672). trying to find where is that ip using whois for the ip 22.214.171.124, as seen below we find out that the ip belongs to our friends in China state owned ISP in Beijing Usually malware will set a mutant so that it does not cause issues again to the system or itself by trying to install or over configure itself,  that is done by checking if a certain mutant exists. one interesting mutant I have seen In both redline and volatility was: The pork_bun mutant Now that I am quite confident that expolere.exe pid:1672 is the rouge process. Finding which process file have the malware  in case it was injected or hollowed is quite tedious task, however double cheking least frequent strange named unsigned handles starting with the executable DLLs , as well as SDT hooks, both dll search, and  ssdt hooks via volatility arrived at the same conclusion as Redline, and this time I was able to dump the driver irykmmww.sys and confirmed its rouge using virustotal Most of the virustotal findings point to a generic trojan/backdoor root kit installed using an exploit not spread like a virus, via social engineering, probably phishing as is the norm with APT, however i am not able to tell with the existing research so far. virustotall also confirmed that an alternative of the notorious Poison Ivy Trojan was used, which famously was used to attack RSA's SecurID infrastructure in 2011, going strong after eight years and is being used in targeted attacks.

Other findings that the malware logs its findings or activity to :


So doing filescan and saving it to file for further analysis I can see a suspicious other files explorer file or two, for example

'\\WINDOWS\\system32\\exploder.exe' does not make sense to be running under system32?! and with that i have the 5 DFIR questions answered almost, the process was 1672 explorer.exe, thirykmmww.sys is what is hiding the malware artifacts from the system, and persistence  most likely achieved with dll injection  via the irykmmww.dll.

there is more for me to follow up, and research, and more notes that I should have collected real time and post. hopefully next investigation would prove more conclusive and complete, and I would be then more familiar with windows internals.

final note: SANS recommends highly that "Intrusion/Incident  reports" not  to state personal opinions and present facts only, however for my learning process I have put some of my opinions, and hopefully will validate them soon if SANS DFIR publish their  solution.
Posted by Walid Shaari at 11:52 2 comments: 

Dynamic Test/Evaluation Environment

Vagrant, Ganeti , Openstack are great tools for a dynamic data-driven test environment. couple them with a configuration management CFEngine3, Chef, puppet, , Ansible, or Saltstack and you will start having more time on your hand, and appreciating life around you. The possibilities are endless if you are looking for a backend highly available infrastructure Ganeti is your solution, used already by "Open Source Labs", Google, Mozilla, Greek Research and Technology Network, among others to manage cluster of virtual environments with resilience in mind. if you are looking for flexibility and providing your users with a private cloud solution Openstack will do. for testing new administration tools, policies, cookbooks, manifests, play books and blue prints than Vagrant is the way to go add the combination of these three together and you have dynamic solutions that scale in your own laptop or workstation from few virtual nodes to Amazon EC2, or your own company private cluster environment.
Posted by Walid Shaari at 06:46 No comments: 
Devops afternoon in Khobar- Saudi Arabia

Devops, and web operations did not pick up in the middle-east as it did in US, Europe, China, and India. We had a chance to present at the HPC Saudi 2013 user group conference that was coordinated by our technology planning engineer Khalid Chatilla, and Intel/IDC. we decided to check with CFEngine, PuppetLabs, Ansibleworks, and Opscode if they can participate, and they showed interest even though it is already end of year, and budgets already consumed, not to mention the short notice , logistics and planning that needs to take in action to secure their coming to Saudi Arabia. at the end Ansibleworks, and Puppetlabs managed to come and delivered an awesome afternoon, my colleague and friend Ahmed bu Khamessin with his limited graphical resources was able to capture some of these moments by his video camera and even though the sound quality is not great, he made it public to the world.  you can see my intro slides, and Ahmed videos below

Prezi Introduction to Saudi Devops Days  with use cases from CFEngine, and Chef.

Ansible presentation :

Puppetlabs presentation in youtube

Posted by Walid Shaari at 06:40 No comments: 

MeLinux Blog Archive