Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Release
Browse files Browse the repository at this point in the history
  • Loading branch information
phutelmyer committed Mar 10, 2021
0 parents commit e0b9bc9
Show file tree
Hide file tree
Showing 5 changed files with 88,457 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog
Changes to the project will be tracked in this file via the date of change.

## 2021-3-10
### Added
- Initial release
33 changes: 33 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Contributor Covenant Code of Conduct

# Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

# Our Standards
Examples of behavior that contributes to creating a positive environment include:
Using welcoming and inclusive language
Being respectful of differing viewpoints and experiences
Gracefully accepting constructive criticism
Focusing on what is best for the community
Showing empathy towards other community members

Examples of unacceptable behavior by participants include:
The use of sexualized language or imagery and unwelcome sexual attention or advances
Trolling, insulting/derogatory comments, and personal or political attacks
Public or private harassment
Publishing others' private information, such as a physical or electronic address, without explicit permission
Other conduct which could reasonably be considered inappropriate in a professional setting

# Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

# Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

# Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at TTS-OpenSource-Office@target.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

# Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2021 Target Brands, Inc.


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Threat Hunting - Powershell Obfuscation
This is a tool that can be used by cyber threat hunters to find obfuscated Powershell commands. Threat actors frequently use obfuscated Powershell to do things like download toolkits and run malicious payloads. Finding this can be a very big "needle in haystack" problem. This tool uses statistical techniques to reduce the size of the haystack, and can be very effective for finding obfuscated Powershell in your environment.

# Get Started Using
Begin by collecting Windows Event ID 800 from endpoints across your environment, and forwarding them to a central collection point like a SIEM. Pseudo-search for:

Event_id:800
AND UserID:<regex for your user ID format>
AND NOT commandline:*.ps1*

From this, filter the results down to contain commands run only by human usernames (rather than system or automated usernames), and NOT run from a .ps1 file on disk. Search this over some timeframe, de-duplicate the results, and export to a file called "pscommands.csv". Make sure the column that contains the commands run is labelled "commandline".

To run hunt_powershell_obfuscation, first install Jupyter Notebook on the machine you will use to analyze the data. (See https://jupyter.org/install for instructions.) Start up Jupyter Notebook, and open the hunt_powershell_obfuscation.ipynb notebook file. Save your pscommands.csv file to the same directory as the notebook file. Then just execute each cell in the notebook. The output will be a list of commands found in your environment that are statistically most likely to contain obfuscation, if there is any to be found. This is output to a file called "regressionoutliers.csv". There will also be a graph of the data, helping to visualize any outliers that may require further investigation.

# Contributor Instructions
The entire .ipynb file can be opened and edited directly with Jupyter Notebook. Be sure to restart the kernel before any new commits, which will ensure that any data or output is committed with the code.

# Contacts
Joe Petroske, joe.petroske@target.com
88,379 changes: 88,379 additions & 0 deletions hunt_powershell_obfuscation.ipynb

Large diffs are not rendered by default.

0 comments on commit e0b9bc9

Please sign in to comment.