Search This Blog

Monday, October 24, 2016

The Windows Logging, File and Registry Auditing Cheat Sheets updated for Windows 10 and some cleanup and additions


The 'Windows Logging Cheat Sheet', 'Windows File Auditing Cheat Sheet' and 'Registry Auditing Cheat Sheet' have been updated for 2016.  The cheat sheets have been updated in part due to auditing improvments added by the 'Windows 10 Anniversary Update' released earlier this year.  We also took the opportunity to do some cleanup and add more autorun keys to the registry auditing cheat sheet.  Updates are easy to spot, just look for 'new'.



We also post the cheat sheet on SlideShare with our presentations, just search for "LOG-MD" and/or "MalwareArchaeology" 

LOG-MD is currently being updated to incorporate the changes, so watch for an announcement soon !

You can get the "LOG-MD Free edition" here:



Happy Hunting!

#InfoSec, #MalwareArchaeology

Thursday, September 15, 2016

Avoiding Ransomware with built in basic changes





Ransomware is a pain for those that have been unfortunate to get infected or had to respond to a ransomware event.  While presenting at ISC2 Congress ransomeware was a hot topic and I was asked what can you do to avoid users getting infected?  Notice I am saying "avoid" versus "prevent".  Prevention is difficult due to the constant changes by malware creators to get people to open the malware.  Avoidance means a reduction, not 100% prevention.

Turns out there are a couple easy things you can do that are built into Windows and FREE, just add a little effort that will drastically reduce the ransomware infections.  First, let's look at how users get ransomeware in the first place.

Drive by surfing:


While surfing the Internet ransomeware can infect a computer when a person just visits a compromised website.  A person does not have to do anything other than visit the wrong website at the wrong time to get infected.


Drive by RansomWare avoidance:

I tell people to do the following things...

  1. Stop using Internet Explorer or Edge to surf the Internet unless the website specifically requires one of these browsers.  Why?  because there are no script blockers available for IE and Edge as of yet.  Drive by ransomware uses javascript to auto execute the ransomware script using the browser as the execution device.  Using a script blocker will avoid these types of infections.  

  2. Use Chrome or FirsFox with a script block extension(s) such as uBlock Origin, Script Block or No Script to name a few.

  3. Use Ad block extentions to block ads, ransomware loves ads, they will pay real money to get their infection ads on a legitimate ad website  

Email RansomWare avoidance:

This is how most people contract ransomware infections.  An email comes in with an attachment or URL and the person opens the attachment or weblink and BAM! infected.  But there is hope.  Email attachments or the URL that will take a user to a website that then has the user download a file and open the file.  The vulnerability here is the auto execution of file types that just are NOT needed by the average user or most users.  These file types are heavily used to infect computers because Microsoft and their ultimate wisdom allows odd file types to be executed if a user opens them and ransomeware is capitalizing on this vulnerability.  You can however tell Windows using Group Policy or setting locally to change the default behavior for any file type like the ones used by ransomware:
  • .js
  • .jse
  • .vbe
  • .vbs
  • .wsh
  • .wsf
  • .scr
  • .pif
  • .hta
To change the file extension default program in Windows 7 thru 10 open:

Control Panel - Default Programs - Associate a file type or protocol with a specific program






Find these extensions and change them all to open Notepad.  In fact, any file type that opens a script program should be changed.  Anyone actually using these file types will know how to open the file in the correct program they need.  Your average user will never need these auto execution settings.  Change anything with "Microsoft Windows based script host" to Notepad and now the scripts will not execute when a person opens them, they will just see the contents in Notepad.





Block Email attachments that are scripts or executables:

Many Email gateways and mail servers have the ability to block certain file types from being delivered to the end user.  Most will have executables blocked like attachments containing ".EXE", but most will not have the scripts mentioned above blocked.  Add these file types to be blocked upon receipt and now users will never even see the bad emails with ransomware.  If you do need these file types for developers, then educate the users to encrypt the files in an archive format like .Zip or .7z and password protect them.

We have already seen ransomeware being emailed within zip files, but without passwords or with the password included in the email asking the recipient to open the archive.  At least you now only have one thing to educate your users to watch out for and never open an archive where the password is included in the same email.

Of course there is always whitelisting using Applocker and/or Software Restriction Policies or other application whitelisting solution to block executable types and scripts that are not specifically approved.  This takes more work and effort by IT and is the most intrusive to users since you will block the execution of anything that drops onto a system, but will definitely block ransomware and other malware.

These simple improvements will reduce the ransomware risk your organization significantly.

Happy Hunting

Monday, August 1, 2016

LOG-MD Selected For Blackhat Arsenal Based On The 'Windows Logging Cheat Sheet'

https://www.blackhat.com/us-16/arsenal.html#log-md
Come on by Blackhat Arsenal Thursday and check out LOG-MD in action with the latest version on how to check, set, and harvest malwarious activity on Windows systems.


Michael Gough & Brian Boettcher
Palm Foyer, Level 3, Station 8
Thursday Aug 4th - 16:00 - 17:50
Based on the 'Windows Logging Cheat Sheet' LOG-MD audits a Windows system for compliance to the 'Windows Logging Cheat Sheet', CIS, US-GCB and AU-ACSC standards, and if it fails creates a nice report to help you know what to set and then guides you where to set the items needed to pass the audit check.  Once properly configured, LOG-MD then harvests security related log data to help you investigate a suspect system.
In addition LOG-MD can perform full file system hashing to create a baseline that can be used to compare against a suspect system.  LOG-MD can also baseline the registry and compare a suspect system registry to a known good baseline to find altered settings and even look for LARGE Reg keys where malware is hiding payloads.
Come by Blackhat Arsenal and check us out and maybe get a goody too ;-)

Thursday, June 16, 2016

The Windows PowerShell Cheat Sheet is now available!

We are proud to announce the release of the "Windows PowerShell Logging Cheat Sheet".  This latest cheat sheet is focused at what options to set, where to set them and what to monitor to detect PowerShell activity and more so, malicious PowerShell activity.

This cheat sheet covers PowerShell versions 2 through 4 and the new PowerShell version 5, or Windows Management Framework as it is now called.  There are links to other great PowerShell resources, settings to configure, either through Group Policy or manually in the registry.  What to gather and harvest as far as Event ID's and what to look for as far as malicious activity.

The first goal of yours, of course after downloading the cheat sheet will be to get some test systems configured and validate everything is collecting as you expect.  Then push out the settings to all your target systems you want to monitor, which should be all of them.

Also included is the use of Sysmon to catch PowerShell being called by another binary other than powershell.exe or powershell_ise.exe to catch misuse of the PowerShell Dll's.

Take a read, do some testing and of course, send us your thoughts.


#HappyHunting


Tuesday, March 29, 2016

PowerShell RansomeWare via Word Docs starting to rear its ugly head - completely detecable



Carbon Black last week released a report that PowerShell is being used in RansomWare attacks.  Why is this important?  By using PowerShell the RansomWare can be 100% diskless, meaning no malware binary needs to be dropped onto the system and stored on disk.  It can, but does not have to, it just uses PowerShell commands to encrypt your data!

So how do you detect this condition or attack?

First, the malware is delivered in Malicious Word documents, so your email gateway might be able to scan and execute these type of documents.  Most Email gateways do not detonate attachments without a usually expensive add-on feature, but of course, more $$$.

You can enable logging per the "Windows Logging Cheat Sheet" found here:
 And once your logs and auditing is configured, alert on the following with your Log Management solution;

1.  Execution of VSSAdmin.exe
2.  Execution of a PowerShell bypass

VSSAdmin is used to delete the volume shadow copies from your system by the RansomWare to make recovery without backups impossible.  The PowerShell bypass is used to bypass any restrictions you might have to keep PowerShell scripts from running.  Yes, Microsoft incldued a backdoor to execute PowerShell commands... YAY #FAIL

You would look for the following in the 'Process Command Line' being executed;
  • ExecutionPolicy bypass -noprofile
  • and possibly -windowstyle hidden
The first bullet will definitely alert you to PowerShell nefarious behavior, the hidden window may be used by admins to do maintenance items, so secondary on the alert.

Prevention - Whitelisting: 

Whitelisting is about the only protection you have from RansomWare other than GREAT backups!!!
 
You can setup Software Restriction Policies found on all versions of Windows except Windows Home versions for FREE!  Just deny execution of:
  • C:\Users\* 
  • You can do this for other directories too and make exceptions for what you want to execute
You can also use AppLocker to block an unknown executable or script.  AppLocker requires Windows Ultimate or Windows Enterprise.  There is an audit mode for AppLocker so you can test and allow what normally runs before enforcing the policy to block.

Both Software Restriction Policies and AppLocker write blocks or potential blocks to their respective logs.  The Application Log for Software Restriction Policy violations and the AppLocker 'EXE and DLL' Log under Applications and Services - Microsoft Windows log.

There you go, you better start logging PowerShell if you are going to keep up with the malwarians and this Crypto RansomWare!

Carbon Black article on PowerWare 

Happy Hunting

#InfoSec #IncidentResponse #RansomWare

Wednesday, February 17, 2016

Detecting port scans between hosts on the same segment, could you detect this? Windows could help





Thanks to one of my fellow InfoSec brethren and fellow security product developer, he got me thinking as to how to detect a situation he presented me, and well, I finally had an engram kick-in and off I went to see how I would I detect this condition.

We are all too familiar with port scans against our firewalls from a myriad of ne'er-do-wellers and how a firewall or other specialty network device detects and blocks reconnaissance behavior. Simply stated, one IP hitting multiple ports, OK, a lot of ports in a fairly short period of time, is the main indicator.

But what about inside your network, not just Internet facing systems, how would you detect a port scan occurring? Say, recon by a malwarian already inside a compromised box, a misguided employee, rogue admin, Pen Test consultant, etc. As long as there is a firewall or network device between the source (bad guy) and target that is being logged you could detect a port scan. Or if you have an IDS/IPS inline between the two hosts involved, you could detect the port scan IF you have logs being monitored and alerting on this kind of behavior. If you have a managed service IDS/IPS provider then they should be calling you, or at a minimum alerting you to an internal port scan, so this is a way to see if they are doing what you pay them for, or you have short comings in malicious network detection capabilities.  I will also assume that switches are not being logged as this produces more noise versus value in most cases.

But what about same segment port scanning? What if a malwarian is on one host and scans ONLY that subnet and surrounding IP's, could you detect a port scan?  Is your IDS/IPS connected to a span port that can see ALL traffic going between systems within a switch or network segment?  If not, what else could you do?  Would you believe Windows Logs to the rescue if the target is Windows?  You could do the same with IPTables on NIX systems by the way.

The Windows Firewall Logs can detect this behavior, but not a setting I normally recommend because of the noise it normally generates that is not of much value.  And thus why this blog post.  So if you test your port scan detection capabilities, and I suggest you do, this is where my InfoSec Musketeer comes into play.  Thanks Marcus for planting the seed and "Hey.. where is my avatar on the main page???".  VThreat is an all browser based solution that enables you to test your ability to detect various nefarious activities and your ability to detect them, one of which is a port scan.  Many of you might be wondering right about now, does my IDS/IPS cover this condition?  Could you detect a port scan between two hosts, workstations or servers or the same segment, an IP or two apart?  Check out VThreat if you want to test for it!  Or play with what I list below, at a minimum if you can detect a local segment port scan successfully.  You should be able to detect most of them with well tuned tools that VThreat can help you test.
For Windows systems and Group Policy, if you enable "Filtering Platform Connection" under Object Access found in Advanced Audit Policy and you enable "Failure", where normally I recommend only "success", you can detect a local port scan where your network devices may fail you.  The logs will provide you with EventCode 5156 "failed" attempts to create a connection to the Windows host, and in quantities that are never normal.  An example where I generally recommend not to enable this option, but an example of why you might want to.

Remember, you do not have to send this data to Splunk or other log management solution. You can collect it locally and craft some script to query for this data as you see fit. Of course LOG-MD will collect this information if enabled for a tactical solution, IR work or you want to test if your network devices and logging are up to snuff.
Here is a sample Splunk query for you to ponder and expand upon. Just adjust the ports you want to cover (<20000) and the quantity over time (>10) and then search over the past hour and do some testing.

index=win_logs LogName=Security EventCode=5156 | table host Source_Address, Source_Port, Destination_Address, Destination_Port, Protocol, Keywords | search Source_Port < 20000 | stats count dc(Source_Port) AS Port_Count values(Source_Port) AS Port values(Keywords) by Destination_Address | where Port_Count > 10

Happy Hunting!

#InfoSec #MalwareArchaeology

Wednesday, February 3, 2016

Japanese National Cert Blog on Windows commands abused by attackers




Japan's National CERT released a blog on the breakdown of Windows commands abused by attackers. This is GREAT WORK and one of the best articles to reinforce what I have been saying in my presentations, Windows Logging training and of course the 'Windows Logging Cheat Sheet'. Logging command line execution is critical for a mature Detection and Response program.

JP-CERT broke down the commands into 3 categories:
  1. Initial investigation: Collect information of the infected machine
  2. Reconnaissance: Look for information saved in the machine and remote machines within the network
  3. Spread of infection: Infect the machine with other malware or try to access other machines

This is the first time someone has tried to break up the commands into categories to better understand what the hackers are doing and at what stage. I have a slightly different opinion on this, but I do not have the luxury of compiling data like they do to create this kind of breakdown.

Most of the p0wnage I have been involved with is pure 'spread the infection' with some recon or investigation occurring during the spread. Much of what they do is scripted, so identical behavior, other attacks had indications that there was more than one malwarian involved by the mistakes made (the Newb) and the way the other hacker worked and the commands used.

I have never really thought of breaking these commands into these three categories or more, but it might lead to so ideas to craft some logging alerts or tool tweaks From the behavior based solutions and our own work.

I promote The concept of 'Malware Management', the review of malware reports and analysis to gain artifacts used by the malwarians. These artifacts are used to help tune, tweak and improve your SecOps, Active Defense and Blue Team capabilities. I also promote the 'Windows Logging Cheat Sheet' to encourage enabling Command Line Logging to catch malicious behavior. You can get the Cheat Sheets here:
I have been involved in some hairy advanced attacks by a very persistent hacker group and the commands the malwarians executed can be a fantastic way to separate normal admin or developer behavior from malwarian behavior. I recently saw a Tweet and disagreed on the point that 'a good hacker in indistinguishable from a developer'. I just don't agree and the commands attackers execute as the data from JP-CERT show is something that can be distinguished from normal behavior and the quanties of execution is key as the data shows.

While doing malware analysis in my lab I also get to see what commodity malware of all types do from crapware to RansomeWare to the Dridex Trojan. What commands are built into the delivery, execution and call back and the follow on commands executed are also telling and help to improve Detection and Response, if we listen.

If you look up some of my presentations On SlideShare (MalwareArchaeology) you will see what commands were executed, malware payloads used, and built-in Windows commands abused by the malwarians.

I further the need to log command line execution and the importance by providing a sample query I created in Splunk for my 2015 Splunk .Conf presentation which can be found in the 'Windows Splunk Logging Cheat Sheet' also found on my website at the link above.

Now my list of commands to watch out for is more extensive than the ones in the JP-CERT blog for what I recommend people monitoring for. But all the commands I monitor for have been added in part to practicing Malware Management, analyzing malware to see what commands were executed, actual infected and compromised systems and all the reports folks and companies like us put out. Once you see and experience an actual advanced attack and are able to capture and see the malwarians behavior first hand, a light will go off and you will be able to tweak and adjust your tools to improve your Detection and Response capabilities.

Keep in mind that combining the Windows commands with other process executions, minus your normal program executions will allow you to separate the developers and admins from your adversaries. Consider looking at where the commands are executed, such as user space \AppData\ versus All Users \ProgramData to the program and Windows core directories. The data will begin to speak to you, of course ONLY if you have adequately configured logging like the Cheat Sheets recommend.

Happy Hunting!

JPCERT blog on Windows commands used by hackers

#InfoSec #MalwareArchaeology

Thursday, January 21, 2016

Malware Management is even spelled out in ISO 27002



I have mentioned many times how Malware Management is a much needed practice for improving an Information Security program and your Security Operations team. If you want to begin hunting and find malware in your environment, you must first learn what and where to look as far as artifacts and IOC's.

It is not just me suggesting you do this, it can also be found in the industry's leading information security framework standard ISO 27002. Below is an excerpt of the standard discussing the need for Malware Management.

A.12.2.1 Controls against malware

j) implementing procedures to regularly collect information, such as subscribing to mailing lists or verifying websites giving information about new malware.

In my Malware Discovery training I teach people to go out and read virus/malware write ups, malware analysts reports and IR firms reports to collect the artifacts and IOC's that you can then populate into your security solutions, scripts or detection and response and incident response practices.

So you should consider adding this to your 2016 list of security goals and objectives to spend the one hour a week to research and read the materials available to start a practice of Malware Management.

You can find a list of Malware Reports from some of the more recognized malware campaigns on our websites:

www.MalwareArchaeology.com/analysis

or
www.IMFSecurity.com/malware-reports

And read what and how to do Malware Management here:

The Malware Management Framework

By all means, send us links to other good reports so we can share. Generally You can find these reports discussed or released in Articles from RSS Feeds from many of the vendors who work in the IR space, InfoSec Blogs and many podcasts like "Brakeing Down Security" where I have been a guest discussing the subject.

So don't take our word for it, take the advice straight from ISO 27002 and use this to help justify starting a Malware Management program in your organization.

Happy Hunting

#InfoSec #MalwareArchaeology #MalwareManagement

Wednesday, January 6, 2016

For the love of humanity retailers, read the PoS malware reports and stop the BREACHES! Malware Management can save you, seriously!

I have blogged many times before about how Malware Management helps information security professionals and organizations improve their detection, Active Defense and Incident Response capabilities. The Hyatt breach and MODPoS proves yet again Malware Management would have saved Hyatt and many other retailers after Jan 2014.  Retailers must evolve or continue to be compromised.  For that matter, all of us must evolve our detection capabilities or suffer a breach at some point.  The ultimate goal of security operations is to detect an intrusion BEFORE the mass loss of data resulting in a breach and your firms name in the news and possibly new employment opportunities for you.

In October 2015 iSight Partners released another good analysis report on the MODPoS malware.  Much like their first report from Jan 2014 on BlackPoS, one of the main conclusions is the same, the malware installed a new service!  

For the love humanity information security professionals, monitor your systems for the creation of new services!  This is Malicious Detection 101 people.  The one item that by default is enabled and available on Windows systems are the events for services starting, stopping, changing and installing.  Yes, there were many more artifacts in these two malware reports, but one thing is common in both and many other malware reports, a new service was installed and is the core persistence mechanism used in retail Point of Sale (PoS) infections.  Many advanced malware attacks also use a new or existing service to maintain persistence, it's very common technique.


Detect Event ID 7045 or a change of a service state Event ID 7040 and you can detect and stop PoS malware and many other advanced malware dead in their mag stripes.


Malware Management to the rescue!


Take it from someone who has lived there, too many times and caught the malwarians within an hour or so of the initial compromise.  You CAN detect most advanced attacks and many commodity malware infections, but you must practice Malware Management.  Read the malware analyst reports these experienced and seasoned professionals create, for the very reason of educating all of us to improve from real world events and experiences.


Read more on Malware Management here:



Read more on Windows Logging and use several cheat sheets we created to help you begin and refine your Windows logging ability available here:



And of course, use LOG-MD to audit your system, help setup proper logging to gather the needed log data.  Even if you have a Log Management solution, use LOG-MD to refine your logging improving what you collect and help you reduce the noise, the quantity of events and help you reduce your license and storage requirements.  You can get LOG-MD here:



So come on retailers, it is time to get with the times and read the malware reports on your own breaches to learn and improve and better defend yourselves.  Everyone else too.

More Malware Analyst reports are available on our website:

Happy Hunting!