Giter Site home page Giter Site logo

joeavanzato / trawler Goto Github PK

View Code? Open in Web Editor NEW
293.0 2.0 32.0 2.05 MB

PowerShell script to help Incident Responders discover potential adversary persistence mechanisms.

License: MIT License

PowerShell 100.00%
dfir powershell blue-team incident-response malware persistence windows

trawler's People

Contributors

andrewrathbun avatar baileydauterman avatar joeavanzato avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

trawler's Issues

Pester-based Test Creation

Currently, the code base lacks any form of testing - Pester tests should be developed to help keep development stable and ensure that functionality is not impacted when making any changes.

Parse WMI Repository OBJECTS.DATA

For offline drive analysis, we cannot directly query CIM classes for obvious reasons.

Data related to WMI is stored in a few locations, provided below;
C:\Windows\System32\wbem\Repository\OBJECTS.DATA - Objects managed by WMI
C:\Windows\System32\wbem\Repository\INDEX.BTR - Index of files imported into OBJECTS.DATA
C:\Windows\System32\wbem\Repository\MAPPING*.MAP - Related OBJECTS.DATA with INDEX.BTR

Reference: https://netsecninja.github.io/dfir-notes/wmi-forensics/

A mechanism must be developed to, at minimum, extract CommandLine/Script FilterToConsumer Bindings to help assist alerting on suspicious CIM objects.

Multiple tools exist for this, taking slightly different approaches;

Need to research the above and determine what is enough for this use-case - probably the basic regex scan will work 'good enough' for detecting the relevant FilterToConsumer bindings for offline boxes but need to test first.

Json output instead of csv for detections

I have a thought on a somewhat easy way to transition from csv to json if that is something that you're interested in. In quite a few places where detections are created to be output they look similar to this:

$detection = [PSCustomObject]@{
            Name = 'Narrator Missing DLL is Present'
            Risk = 'Medium'
            Source = 'Windows Narrator'
            Technique = "T1546: Event Triggered Execution"
            Meta = "File: "+$item.FullName+", Created: "+$item.CreationTime+", Last Modified: "+$item.LastWriteTime
        }

I think we could take the Metadata and use the object directly so it will convert to json better. i.e.:

$detection = [PSCustomObject]@{
            Name = 'Narrator Missing DLL is Present'
            Risk = 'Medium'
            Source = 'Windows Narrator'
            Technique = "T1546: Event Triggered Execution"
            Meta =  $item | Select FullName, CreationTime, LastWriteTime
        }

This way we are able to convert the PSCustomObject into proper json using the headers that correlate to the object. I think a couple helper methods could be created to easily convert to either json or csv with somewhat minimal uplift.

Malformed character escape error running script

I got a script error when it was in the Registry parsing part.

parsing "C:\\Program Files (x86)\\Microsoft\\EdgeUpdate\\.*\psmachine.*\.dll" - Malformed \p{X} character escape.
At C:\Users\MyName\Downloads\trawler.ps1:11400 char:37
+ ...           if ($_.Value -match $default_hklm_com_lookups[$data.Name]){
+                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException

I'm not sure what the scanned string was, let me know how I can find out if you need help.

Allow specification of different Target Drive

In forensic investigations, investigators may end up mounting a target device from their analyst device - can we make Trawler work in these types of situations by allowing investigators to override the target drive?

For example, a drive may be mounted as 'D:', in which case the environment variables used throughout the script ($env:homedrive, $env:ProgramData, etc) will all be incorrect targets for analysis.

Variable Typo

On line 15,139 of trawler.ps1 there is a variable named "$finhert", which I believe should be "$finherit" (with an i) as it is in the following lines. This is in the function "Check-TerminalServicesInitialProgram".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.