Git Product home page Git Product logo

kansa's People

Contributors

ahans003 avatar athegist avatar bryant1410 avatar c-khalid avatar davehull avatar dcode avatar dmoore44 avatar eagleonejk avatar jt-msft avatar jvaldezjr1 avatar karemfaisal avatar mgreen27 avatar murrayr0123 avatar mwilco03 avatar peasead avatar rcjyoung avatar slw07g avatar tbennett6421 avatar theflakes avatar tsousahs 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  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

kansa's Issues

Kansa Module: Get-FilesByHash.ps1

In my testing, I was able to get this collector to return a match on kansa.ps1 and another .ps1 script in a different path, but I'm unable to get it to return a match on C:\Windows\System32\cmd.exe. I'm working on figuring out why.

Kansa Core & Modules: Directives break .SYNOPSIS

Z4n4tsu pointed out that having the directives on the first (and second lines) breaks the .SYNOPSIS / help functionality in collector scripts.

I'm working on a change to Kansa.ps1 to read those directives from the .NOTES section. Directives will be the same as they were before OUTPUT must be at the start of a line, followed by a space and then the type of output (CSV/TSV/XML/TXT/Default/BIN/Zip). PUSHBIN must also be at the start of a line followed by a space and then the path to the executable to be copied to remote hosts. The ordering will no longer matter.

This will enable the .SYNOPSIS sections to work and will not be much additional overhead because it only has to be done once per module rather than once per host.

Marking this as a bug since it breaks .SYNOPSIS, thus it is my first priority for dev at the moment.

Kansa Module: Get-RegistryKeyValData.ps1

Create a generic script that will pull Value, Data and LastWriteTime from arbitrary keys supplied by the user, maybe it has its own configuration file with a list of keys provided.

Kansa Module: Get-LogUserAssist.ps1

I'm not sure what's going on, but on my dev machine, this module has stopped working when run via Kansa against localhost. It works stand-alone, run outside of Kansa and it works via Invoke-Command -ComputerName localhost -filepath ... (and remote hosts), but it won't work via Kansa against remote hosts. No errors are returned nor written to the error.log.

Kansa Analysis: Autoruns VT hash lookup

Write an analysis script for looking up hashes from Autoruns and other collected data against Virus Total, maintain a local db of known good/bad so they don't have to be looked up.

Kansa Module: Get-LogUserAssist.ps1

Possible bug here for user accounts that have been renamed. The SID resolution to username may not match the name of the user profile directory on disk. Need to investigate.

Kansa Module: Get-LogUserAssist.ps1

Modify script to return PS Objects.

Also, for locked ntuser.dat hives, they are locked because the user is logged on. Modify the script to parse the UserAssist for those logged on users, their hives should be accessible via HKEY_USERS... in theory.

Kansa Core: Review & refactor try/catch blocks

Kansa is littered with some try/catch blocks because I started writing it before I understood that those were only useful for terminating errors. All of them should be reviewed and refactored as necessary because some of them are probably positioned where they will never catch terminating errors.

Kansa Modules: All that take arguments

Modify all existing modules that currently require editing to set parameters so they will accept arguments from the command line, then modify modules\modules.conf with acceptable default arguments.

Kansa Core: Deprecate -ModulePath

I'd like to deprecate the -ModulePath argument's ability to point to an arbitrary directory in favor of a hard-coded .\Modules\ directory. I may modify the code such that -ModulePath can still be used to point to a single module, or make a new command line argument that can be used to point to a single collector module.

Kansa Core: Module arguments

It might be nice if modules could accept command line arguments via the modules.conf file. Today any modules that take arguments, Get-File.ps1, Get-FlsBodyFile.ps1, Get-ProcDump.ps1, etc., have to be edited at the module level. If a user could edit the modules.conf file, they could make all of their changes in one place and modules could be written with sensible defaults or they could simply not run, if they are missing necessary arguments.

Kansa Core & Analysis: DATADIR directive

Automated analysis depends on the DATADIR directive, which is currently the top line of each Analysis script. This breaks .SYNOPSIS.

  1. Refactor Kansa.ps1 to look for the DATADIR elsewhere in the Analysis scripts.
  2. Create .SYNOPSIS sections for all analysis scripts and move the DATADIR directive to the .NOTES section of the .SYNOPSIS.

Kansa Core: Pushbin is broken

Pushbin seems to be broken. Error log shows:
Failed to copy .\Modules\bin\Handle.exe to localhost.
Could not find a part of the path '\localhost\ADMIN$.\Modules\bin\Handle.exe'.

Kansa Analysis: Automate it

Let's make analysis automated in the same way that collection is. Collection is controlled by .\Modules\Modules.conf. Add functionality to Kansa.ps1 to read a configuration file for analysis that kicks off analysis scripts against the collected data and generates reports for the analyst to review.

Kansa Module: Get-LogUserAssist.ps1

Capturing this for consideration -- Get-LogUserAssist could alert investigators of renamed accounts, but of course this requires some code.

Kansa Module: Get-DNSCache

Current Get-DNSCache module has two different ways of collecting its data depending on whether or not Get-DnsClientCache, the Powershell cmdlet, is found or not. Get-DnsClientCache is a newer cmdlet in 2012. The output from ipconfig /displaydns, does not mix well with the output from Get-DnsClientCache so in mixed environments, analysis is broken.

Either create a second collector for the newer cmdlet or normalize the data from both methods so they are the same and can be analyzed.

Get-FilesByHash.ps1 can not bypass SysWOW64 redirection

As @davehull found in #41, the Windows API transparently redirects calls from a 32-bit PowerShell instance running on 64-bit operating systems from C:\Windows\System32 to C:\Windows\SysWOW64. Normally this can be bypassed by pre-pending .\ to the path, but the API call used in Get-FilesByHash.ps1 does not support this construction.

Cleanup option for PushBin

It would be nice to have a cleanup option when using PushBin. This option would delete all binaries that were pushed once Kansa was finished running. For some of the more adept adversaries that are looking to maintain a presence, it's best to not leave tools lying about that they can tamper with or possibly discover how you're finding them and get sneakier. Some enterprise systems might also flag a system having Sysinternals tools on a non-admin workstation.

Also, thanks for putting together such a great suite of tools and scripts!

Kansa Core: Add option to modify parallelism

Default parallel jobs for Powershell remoting is 32 hosts. Add a command line option that makes this adjustable, Powershell's Invoke-Command -ThrottleLimit command controls this.

Kansa Core: Add REQUIRES directive

Similar to the OUTPUT and PUSHBIN directives, would allow a module to specify a minimum PowerShell version required to run. Kansa would need to check the remote PowerShell version, throw a warning if a module cannot execute on a specific host, and then skip that module.

Kansa Analysis: Add -AnalysisOnly flag

Add a flag for running Kansa in an analysis only mode for data that has already been collected. The user will configure the .\Analysis\Analysis.conf file according to their needs, then run Kansa with the -AnalysisOnly flag and an -DataDir argument and Kansa will run through all the appropriate analysis scripts for the data found in the argument to -DataDir.

Kansa Core & Modules: Passing errors to core

Today only Kansa.ps1's errors make it to the error log. Figure out a way for collector scripts to pass error messages back to Kansa.ps1 and have Kansa.ps1 write them to the error log.

Kansa Modules: Add OUTPUT directive for delimiter specification

Collectors that return Powershell objects can specify how Kansa should save their data, text, xml, csv, tsv (binary and zip are also supported, but not for objects). For csv/tsv output, allow the collector author or user to add a delimiter so they aren't limited to commas or tabs.

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.