Code Monkey home page Code Monkey logo

threathunting_with_osquery's Introduction

Threat Hunting & Incident Investigation with Osquery

osquerylogo dart

The objective of this repo is to share 100+ hunting queries (osquery) that will help cyber threat analysts (hunter/investigator) in their hunting or investigation exercises. Broadly, I have covered persistence, process interrogation, memory analysis, driver profiling, and other misc categories. Persistence and Process Interrogations queries map to the multiple tactics & techniques/sub-techniques of MITRE ATT&CK framework.

The following are the key highlights under each category. Please have a look at the repo(windows) for the details.

Persistence

  • Registry Run Keys / StartUp Folder
  • RunKeys (with hashvalue)
  • Security Support Provider
  • Service Creation / Modification (auto_start)
  • look for suspicious dlls loaded by any service (with associated username & hash value of the dll)
  • WMI Event Consumers (commandline & script)
  • WMI Process interrogation
  • Application Shimming
  • Print Processors - Reg Keys
  • look for suspicious print drivers
  • Screensaver Backdoor
  • Image File Execution Options Injection (IFEO)(debugger/GolbalFlag)
  • PowerShell Process Interrogation
  • Dynamic Data Exchange (DDE)

Process Interrogation

  • Identify the parent & Grantparent processes for all OR a given process - look for any suspicious parent, child relationships
  • Identifying Suspicious Processes (processes) with usernames (users)
  • Identifying the programs that are running from "TEMP" locations
  • Identify the processes with open pipes (look for suspicious pipe and/or process)
  • Any processes spawning out of wow64 directory
  • Identifying suspicious dlls loaded by any service with user_account associated with it (with hash value)
  • Identify if the binary is signed or not
  • PowerShell Process Interrogation (Parent / children of PowerShell)
  • WMI Process Interrogation (Parent / children of PowerShell)
  • Identifying the excessive resources usage by a suspicious process - Excessive Memory Usage (In Bytes)
  • Identifying the processes that makes the remote network connections and look for any suspicious connections

Memory Analysis

Note:I have made an effort to create the queries equivalent to Volatility Plugins

  • pslist equivalent
  • pstree equivalent ( Parent & Child)
  • pstree equivalent ( Grandparent, Parent & Child)
  • dlllist equivalent ( with a specific pid )
  • dlllist - load all the dlls
  • getsids - equivalent
  • svcscan - equivalent
  • netscan - equivalent
  • Code Injection
  • malfind (not exactly) equivalent

Driver Profiling

  • Group By and Order By device_name
  • Drivers without manufacturer name with sign status
  • Unsigned drivers
  • Drivers with no service associated with sign status

Miscellaneous

  • File Profilig - Files with mtime<btime with hash values and sigcheck status in the critical directories
  • Tracking User Changes
  • look for any suspicious domain connection
  • Execution (PS,DDE)
  • Lateral Movement

Linux

Note: I will share "osquery.conf" file and queries related to Linux as I get some time to complete them.

threathunting_with_osquery's People

Contributors

kirtar22 avatar

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.