Skip to content

Instantly share code, notes, and snippets.

View n0ncetonic's full-sized avatar
🙃
Staring intensely at my macbook screen

noncetonic n0ncetonic

🙃
Staring intensely at my macbook screen
View GitHub Profile
@n0ncetonic
n0ncetonic / scraping.js
Last active August 20, 2023 03:16
Archiving Apple's Developer Documentation Archive
// ninjaVanish hides from webdriver/headless browser detection
//
// Focused specifically on HeadlessChrome / Puppeteer.
// When using Puppeteer this should be instrumented with the
// `Page.evaluateOnNewDocument()` method which injects our code
// after the document loads but before any scripts run
//
// Techniques leveraged are:
// - Removes "Headless" from User-Agent
// - Deletes `navigator.webdriver` to mimick standard navigator object properties
property delayInterval : 15 -- seconds
on run
activate
tell application "System Events" to set UIAccessStatus to UI elements enabled
end run
on idle
try
tell application "System Events"
tell process "NotificationCenter"
@n0ncetonic
n0ncetonic / pathogen.sh
Created April 3, 2019 02:03
Command Injection via Homebrew $PATH trickery
#!/bin/bash
# Command Injection via Homebrew $PATH trickery
# n0ncetonic
# Blacksun Research Labs 2019
# https://github.com/n0ncetonic
# https://github.com/BlacksunLabs
banner=$(/bin/cat <<EOF
@n0ncetonic
n0ncetonic / .htaccess
Created June 9, 2018 15:27 — forked from curi0usJack/.htaccess
Drop into your apache working directory to instantly redirect most AV crap elsewhere.
RewriteEngine On
# Uncomment the below line for verbose logging, including seeing which rule matched.
#LogLevel alert rewrite:trace5
# BURN AV BURN
# AWS Exclusions. Cloudfronted requests by default will have a UA of "Amazon Cloudfront". More info here: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html#header-caching-web-device
RewriteCond expr "-R '54.0.0.0/8'" [OR]
RewriteCond expr "-R '52.0.0.0/8'" [OR]
@n0ncetonic
n0ncetonic / aliases.txt
Created March 8, 2019 02:47
Just some bash aliases I find useful
vim -c 'execute "silent !echo " . &fileencoding | q' {filename} # Extremely good file encoding detection
@n0ncetonic
n0ncetonic / TCC_Services.md
Created March 7, 2019 05:56
macOS Automation Research

Strings dump of TCC.framework as a starting point

$ strings /System/Library/PrivateFrameworks/TCC.framework/TCC | grep kTCCService

kTCCServiceAll
kTCCServiceAddressBook
kTCCServiceCalendar
kTCCServiceReminders
kTCCServiceTwitter
kTCCServiceFacebook
@n0ncetonic
n0ncetonic / MegaBonusCashbackExtDetect.js
Created September 4, 2018 17:48
Cashback Ext Detection
var detectExt = {
is_install: "",
/**
* поиск расширения в chrome
* @param onload
* @param onerror
*/
detect_ext_chrome: function (onload, onerror) {
var detect = function (base, if_installed, if_not_installed) {
var s = document.createElement('script');
@n0ncetonic
n0ncetonic / gimmeAuthToken
Created June 15, 2018 00:10
macOS < 10.13 Keychain-less Passwordless iCloud authentication token dumper
#!/bin/bash
#filename :gimmeAuthToken
#description :macOS < 10.13 Keychain-less Passwordless iCloud authentication token dumper
#author :noncetonic
#date :20180614
#version :0.1
#usage :./gimmeAuthToken
#notes :Leverages the Accounts(3|4).sqlite file to dump cached plaintext iCloud tokens
#copyright :© 2018 Blacksun Labs
#===============================================================================

Intercepts HTTPs Traffic with Python & mitmproxy

Introduction

Modern applications usually make use of back-end API servers to provide their services. With a non-transparent HTTPs proxy, which intercepts the communication between clients and servers (aka the man-in-the-middle scheme), you can easily manipulate both API requests and responses.

This manual helps you create your own proxy with Python and mitmproxy/libmproxy. Mitmproxy ships with both a standalone command-line tool (mitmproxy) and a Python library (libmproxy).

@n0ncetonic
n0ncetonic / xcode_markdown.py
Created June 11, 2018 14:41 — forked from pudquick/xcode_markdown.py
Abuse Xcode's embedded CommonMark framework to generate HTML from markdown
# hax hax hax hax hax
import ctypes, os, sys
newstderr = os.dup(2) # This is to mute dyld LC_RPATH warnings
os.dup2(os.open('/dev/null', os.O_WRONLY), 2) # because we're loading Xcode frameworks from python
CM = ctypes.CDLL('/Applications/Xcode.app/Contents/SharedFrameworks/DVTMarkup.framework/Versions/A/Frameworks/CommonMark.framework/CommonMark')
sys.stderr = os.fdopen(newstderr, 'w') # This restores stderr
cmark_markdown_to_html = CM.cmark_markdown_to_html
cmark_markdown_to_html.restype = ctypes.c_char_p