Skip to content

Instantly share code, notes, and snippets.

View pmarkowsky's full-sized avatar
🎅
Keeping Santa Jolly

Pete Markowsky pmarkowsky

🎅
Keeping Santa Jolly
View GitHub Profile
(
    args.exists(arg, arg == "-create" || arg == "create") &&
    args.join(" ").contains("/Users/")
) && (
    args.join(" ").contains("$(") ||
    args.join(" ").contains("`") ||
    args.join(" ").contains("${") ||
    args.join(" ").matches(".*\\$[A-Za-z_].*")
) ? BLOCKLIST : ALLOWLIST
@pmarkowsky
pmarkowsky / sploitlight.md
Last active July 31, 2025 00:48
Santa FAA rule to prevent spotlight plugins from being registered
# Description: Convert Santa JSON rules to static rules
#
#$ python3 ./json-rules-to-static-rules.py --help
#usage: json-rules-to-static-rules.py [-h] input output
#
#Convert Santa JSON rules to static rules
#
#positional arguments:
# input Input JSON file
# output Output file
@pmarkowsky
pmarkowsky / Approvals.md
Created September 15, 2024 16:42
GIST FOR DEMO

Your Approvals UI from your Sync Service goes here

Approve or Deny?

Approve

@pmarkowsky
pmarkowsky / CLA.md
Created September 14, 2024 01:00
North Pole Security, Inc. Individual Contributor License Agreement

North Pole Security, Inc. Individual Contributor License Agreement

In order to clarify the intellectual property license granted with Contributions from any person or entity, North Pole Security, Inc. ("North Pole Security") must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of North Pole Security; it does not change your rights to use your own Contributions for any other purpose. You accept and agree to the following terms and conditions for Your present and future Contributions submitted to North Pole Security. Except for the license granted herein to North Pole Security and recipients of software distributed by North Pole Security, You reserve all right, title, and interest in and to Your Contributions.

  1. Definitions. "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is maki

Mermaid on Github Examples

All of these diagrams are dynamically rendered during html display by Github, the images generated from text inside the Github-Flavored Markdown. None are static images. Mermaid support was released for Github on 2022-02-14

Pros & Cons:

  • Pro: You don't need to care about the layout.
  • Con: You cannot control the layout.

Notes:

  • Not all the features of Mermaid (in particular symbols B-->C[fa:fa-ban forbidden], hyperlink and tooltips) are supported by Github.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@ubuntu23:/home/user# vim foo.bat
Error detected while processing /usr/share/vim/vim90/defaults.vim:
line 1:
E492: Not an editor command: ^?ELF^B^A^A
line 2:
E492: Not an editor command: <fa>^A
line 9:
E492: Not an editor command: )^B
line 11:
@pmarkowsky
pmarkowsky / kpc_demo.c
Created May 18, 2023 04:05 — forked from ibireme/kpc_demo.c
A demo shows how to read Intel or Apple M1 CPU performance counter in macOS.
// =============================================================================
// XNU kperf/kpc demo
// Available for 64-bit Intel/Apple Silicon, macOS/iOS, with root privileges
//
//
// Demo 1 (profile a function in current thread):
// 1. Open directory '/usr/share/kpep/', find your CPU PMC database.
// For M1 (Pro/Max), the database file is '/usr/share/kpep/a14.plist'.
// 2. Select a few events that you are interested in,
// add their names to the `profile_events` array below.
@pmarkowsky
pmarkowsky / simplevm.c
Created May 16, 2023 16:32 — forked from imbushuo/simplevm.c
Demonstrates Hypervisor.Framework usage in Apple Silicon
// simplevm.c: demonstrates Hypervisor.Framework usage in Apple Silicon
// Based on the work by @zhuowei
// @imbushuo - Nov 2020
// To build:
// Prepare the entitlement with BOTH com.apple.security.hypervisor and com.apple.vm.networking WHEN SIP IS OFF
// Prepare the entitlement com.apple.security.hypervisor and NO com.apple.vm.networking WHEN SIP IS ON
// ^ Per @never_released, tested on 11.0.1, idk why
// clang -o simplevm -O2 -framework Hypervisor -mmacosx-version-min=11.0 simplevm.c
// codesign --entitlements simplevm.entitlements --force -s - simplevm
@pmarkowsky
pmarkowsky / lkvh.c
Created March 15, 2023 18:14 — forked from ryanwoodsmall/lkvh.c
get linux kernel version from linux/version.h header and uname() syscall
#include <stdio.h>
#include <linux/version.h>
#include <sys/utsname.h>
/*
* from rhel7's linux/version.h:
* #define LINUX_VERSION_CODE 199168
* #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
*/