Heyserial - Programmatically Create Hunting Rules For Deserialization Exploitation With Multiple Keywords, Gadget Chains, Object Types, Encodings, And Rule Types
2022-5-12 22:30:0 Author: www.kitploit.com(查看原文) 阅读量:32 收藏

Programmatically create hunting rules for deserialization exploitation with multiple

  • keywords (e.g. cmd.exe)
  • gadget chains (e.g. CommonsCollection)
  • object types (e.g. ViewState, Java, Python Pickle, PHP)
  • encodings (e.g. Base64, raw)
  • rule types (e.g. Snort, Yara)

Disclaimer

Rules generated by this tool are intended for hunting/research purposes and are not designed for high fidelity/blocking purposes.

Please test thoroughly before deploying to any production systems.

The Yara rules are primarily intended for scanning web server logs. Some of the "object prefixes" are only 2 bytes long, so they can make large scans a bit slow. (Translation: please don't drop them all into VT Retrohunt.)

Usage

Help: python3 heyserial.py -h

Examples:

python3 heyserial.py -c 'ExampleChain::condition1+condition2' -t JavaObj  python3 heyserial.py -k cmd.exe whoami 'This file cannot be run in DOS mode'  python3 heyserial.py -k Process.Start -t NETViewState -e base64 "base64+utf16le"  

utils/checkyoself.py

This is a tool to automate bulk testing of Snort and Yara rules on a variety of sample files.

Usage: python3 checkyoself.py [-y rules.yara] [-s rules.snort] [-o file_output_prefix] [--matches] [--misses] -d malware.exe malware.pcap

Examples: python3 checkyoself.py -y rules/javaobj -s rules/javaobj -d payloads/javaobj pcaps --misses -o java_misses

utils/generate_payloads.ps1

YSoSerial.NET v1.34 payload generation. Run on Windows from the ./utils directory.

utils/generate_payloads.sh

YSoSerial payload generation. Run on Linux from the ./utils directory.

utils/install_snort.sh

Installing Snort on a Debian based system was a bit finnicky for me, so I wrote my install notes here.

Use at your own risk in a VM that you have snapshotted recently.

utils/server.py

Simple Python script that runs an HTTP server on 127.0.0.1:12345 and accepts POST requests.

Handy for generating test PCAPs.

Copyright (C) 2021 Alyssa Rahman, Mandiant, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: [package root]/LICENSE.txt Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Check out the Developers' guide (DEVELOPERS.md) for more details on extending HeySerial!

Tools

Vulnerabilities

Talks and Write-Ups

Heyserial - Programmatically Create Hunting Rules For Deserialization Exploitation With Multiple Keywords, Gadget Chains, Object Types, Encodings, And Rule Types Heyserial - Programmatically Create Hunting Rules For Deserialization Exploitation With Multiple Keywords, Gadget Chains, Object Types, Encodings, And Rule Types Reviewed by Zion3R on 5:30 PM Rating: 5


文章来源: http://www.kitploit.com/2022/05/heyserial-programmatically-create.html
如有侵权请联系:admin#unsafe.sh