Skip to content

Instantly share code, notes, and snippets.

View quinndiggity's full-sized avatar

Quinn Diggity quinndiggity

  • Vancouver, Canada
View GitHub Profile

MD5 Collision with CRC32 Preimage

Here's the scenario: We want to craft two different messages with the same MD5 hash, and a specific CRC32 checksum, simultaneously.

In other words, we want an MD5 collision attack and a CRC32 preimage attack.

This might seem like a contrived scenario, but it's exactly the one I faced while producing my PNG hashquine (Yes OK maybe that's also a contrived scenario, cut me some slack).

On its own, a CRC32 preimage attack is trivial. You can craft a 4-byte suffix that gives any message a specific checksum, calculated using a closed-form expression (which I am too lazy to derive, not even with assistance from Z3). It's not an attack per-se, since CRC32 was never meant to be cryptograpically secure in the first place.

@quinndiggity
quinndiggity / noMangleGoogle.user.js
Created September 27, 2021 23:00 — forked from radiantly/noMangleGoogle.user.js
Prevent Google from mangling links on the search results when clicking or copying on Firefox
// ==UserScript==
// @name Prevent link mangling on Google
// @namespace LordBusiness.LMG
// @match https://www.google.com/search
// @grant none
// @version 1.1
// @author radiantly
// @description Prevent google from mangling the link when copying or clicking the link on Firefox
// ==/UserScript==
@quinndiggity
quinndiggity / handler.lua
Created April 1, 2021 07:15 — forked from samael500/handler.lua
Validating payloads from GitHub webhooks with Nginx + Lua
-- luarocks install JSON4Lua
-- luarocks install luacrypto
local json = require "json"
local crypto = require "crypto"
local secret = '<MY SUPER SECRET>'
local event = 'push'
local branch = 'refs/heads/master'
init_by_lua_block { require "cjson" }
server {
listen 80 default_server;
server_name _;
log_by_lua_block {
print("I need no extra escaping here, for example: \r\nblah")
}
@quinndiggity
quinndiggity / README.md
Created May 27, 2020 02:50 — forked from ur0/README.md
SockPuppet 3

SockPuppet 3

This is a kernel exploit targeting iOS 12.0-12.2 and 12.4. It exploits a dangling kernel pointer to craft a fake task port corresponding to the kernel task and gets a send right to it.

This code is not readily compilable — some common sense is a prerequisite. If you do get it going though, it is extremely reliable on any device with more than a gigabyte of RAM. Interested readers may want to investigate how reallocations can be prevented -- this might improve reliability even more.

License

@quinndiggity
quinndiggity / git-merge-before-build.dsl
Created December 11, 2019 08:16 — forked from martinda/git-merge-before-build.dsl
Jenkins Pipeline DSL code to demonstrate git merge before build
// Jenkins Pipeline DSL to demonstrate git merge before build
node {
String path = '/tmp/jenkins/upstream-repo'
sh "rm -rf ${path}"
ws(path) {
sh 'git --version'
sh 'git init'
sh 'touch README.md; git add README.md; git commit -m "init"'
sh 'git checkout -b pull-requests/1/from'
sh 'touch file.txt; git add file.txt; git commit -m "Add file"'
#!/usr/bin/sudo ruby
#
# revealer.rb -- Deobfuscate GHE .rb files.
#
# This is simple:
# Every obfuscated file in the GHE VM contains the following code:
#
# > require "ruby_concealer.so"
# > __ruby_concealer__ "..."
@quinndiggity
quinndiggity / ssh_keyscan.yml
Created October 31, 2019 20:45 — forked from shirou/ssh_keyscan.yml
run ssh-keyscan to add keys to known_hosts. This is a playbook for ansible
---
- hosts: all
gather_facts: no
sudo: no
tasks:
- name: run ssh-keyscan to add keys to known_hosts
local_action: shell ssh-keyscan {{ ansible_ssh_host }} >> ~/.ssh/known_hosts
@quinndiggity
quinndiggity / macbook-pro-2011-defective-gpu-fix.md
Created August 23, 2019 19:02 — forked from cdleon/macbook-pro-2011-defective-gpu-fix.md
Macbook Pro 2011 GPU Defect fix macOS Sierra and High Sierra