Skip to content

Instantly share code, notes, and snippets.

@Omar-Ikram
Omar-Ikram / EndpointSecurityDemo.m
Last active July 12, 2024 08:01
A demo of using Apple's EndpointSecurity framework - tested on macOS Monterey 12.2.1 (21D62)
//
// main.m
// EndpointSecurityDemo
//
// Created by Omar Ikram on 17/06/2019 - macOS Catalina 10.15 Beta 1 (19A471t)
// Updated by Omar Ikram on 15/08/2019 - macOS Catalina 10.15 Beta 5 (19A526h)
// Updated by Omar Ikram on 01/12/2019 - macOS Catalina 10.15 (19A583)
// Updated by Omar Ikram on 31/01/2021 - macOS Big Sur 11.1 (20C69)
// Updated by Omar Ikram on 07/05/2021 - macOS Big Sur 11.3.1 (20E241)
// Updated by Omar Ikram on 04/07/2021 - macOS Monterey 12 Beta 2 (21A5268h)
@jamieparfet
jamieparfet / macOS-mojave-iso.sh
Last active February 11, 2023 19:16
Create an ISO from the mojave installer app
#!/bin/bash
# This assumes that the ~6GB mojave installer is in the /Applications folder.
# If it's not, just open the App Store, search Mojave, and you can download the installer file from there.
hdiutil create -o /tmp/mojave.cdr -size 6g -layout SPUD -fs HFS+J
hdiutil attach /tmp/mojave.cdr.dmg -noverify -mountpoint /Volumes/install_mojave
sudo /Applications/Install\ macOS\ mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_mojave
mv /tmp/mojave.cdr.dmg ~/Desktop/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ mojave
@amarcu5
amarcu5 / muteonsleep.swift
Last active March 5, 2021 01:35
Small macOS utility to ensure system is muted when asleep to prevent potential sounds during Power Nap; Addresses reddit issue: https://www.reddit.com/r/apple/comments/8t041u/my_macbook_creeps_me_out_by_starting_to_talk_in/
//
// MuteOnSleep
// Ensures system is muted when asleep to prevent potential sounds during Power Nap
//
// Install by pasting the following in a terminal prompt:
// curl https://s3.amazonaws.com/muteonsleep-tool/muteonsleep.tar.gz | tar xvz -C /usr/local/bin/; osascript -e 'tell application "System Events" to make login item at end with properties {path:"/usr/local/bin/muteonsleep", hidden:true}'; nohup /usr/local/bin/muteonsleep &
//
// Uninstall with:
// pkill muteonsleep; osascript -e 'tell application "System Events" to delete login item "muteonsleep"'; rm /usr/local/bin/muteonsleep
//
@deyixtan
deyixtan / sublime_text_patch.md
Last active April 8, 2024 06:11
Sublime Text Patching Guide

Automated Patching

Download slt.py python script (supports multiple build) from this repository.

Usage

python slt.py <"sublime_text file path">


Manual Patching

@c910335
c910335 / answers.json
Last active March 10, 2018 13:46
SITCON 知識王
{
"資安趨勢部落格在文章中指出「伺服器變挖礦機將是未來日漸嚴重的問題」,並以 JenkinsMiner 為例,含有漏洞的伺服器一旦被 JenkinsMiner 入侵且成功部屬挖礦程式,將會造成 ___________ 影響,請問 _________ 為?":"效能嚴重變慢",
"趨勢科技在〈典範轉移〉一文中提出,BEC 詐騙已開始放棄使用鍵盤側錄程式,而改用 ____________ 進行。":"網路釣魚 PDF 附件",
"請問下列何者不為剖析器?":"LSR",
"chroot 是在 UNIX 系統的一個操作,針對正在運作的軟體行程和它的子行程,改變它外顯的根目錄。chroot 程式可歸類為何種資安相關的應用?":"Sandbox",
"下列何者是 Ubuntu 的套件管理程式?":"APT",
"可以用哪個程式查詢從本地到另一個 IP Address 所經過的 router?":"traceroute",
"140.128.77.10/25 這個網段有多少可用的 IP?":"126",
"在二元樹走訪的方法中,我們常聽到 LVR、LRV、VLR 三種方法,請問 V 代表?":"Visiting,對當前的 node 進行print、assign或其他操作",
"Linux 裡有許多與系統相關的操作需要有 root 的權限,哪個指令可以幫助我們切換成 root?":"su",
@0xPwny
0xPwny / exploit.py
Last active September 12, 2017 22:14
ASIS CTF FINALS 2017 - mary_morton pwnable
#!/usr/bin/python
from pwn import *
#r = process("./mary_morton")
r = remote('146.185.132.36',19153)
def fmtstr(pld):
r.recvuntil('Exit')
r.sendline("2")
#! /bin/bash
# Sets up outgoing dummynet in pf firewall suitable for use to throttle outgoing network
# connections. gtihub.com/tylertreat/comcast is a much nicer tool but I couldn't get it to work due
# to shell issues and more - it seemed to only setup inbound rules in pf which don't affect outbound
# TCP connections in my tests.
TARGET=$1
PIPECFG=${2:-"plr 1"}
@yaci
yaci / google-drive-md5-checksum
Last active May 31, 2024 15:50
List google drive md5 checksum for all files
#!/usr/bin/python3
"""
!! IMPORTANT !!
!! READ THIS !!
In order to run this script you need python3 and pip3 installed.
You also need some additional python modules. Please run
sudo pip3 install httplib2 oauth2client
sudo pip3 install --upgrade google-api-python-client
@igv
igv / adaptive-sharpen.glsl
Last active July 7, 2024 23:55
Optimal sharpening strength (according to objective metrics) - 0.5. Can be applied only to luma channel (change OUTPUT to LUMA). To use it on-demand add the following line to input.conf: n change-list glsl-shaders toggle "~~/adaptive-sharpen.glsl"
// Copyright (c) 2015-2021, bacondither
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer
// in this position and unchanged.
// 2. Redistributions in binary form must reproduce the above copyright
@wkrsz
wkrsz / gist:3d5ff7f908a180b87498
Last active December 11, 2018 07:03
Stop Safari hanging when selecting the address bar or opening a new tab
This shit has been bugging me for too long, so I went on a hunt and found a workaround.
The Symptoms are as follows:
* Clicking the address bar results in a 1-4 second delay
* Opening links in new tabs results in a 1-4 second delay
* +T results in a 1-4 second delay
* `PressAndHold[<pid>]: IMKServer Stall detected` is present in `/var/log/system.log` at the time of the hang.
It appears to be to do with the PressAndHold helper - the thing that shows an IOS style selection of accents when you hold a key down.
The fix may have some unwanted effects, I haven't really noticed any.