Skip to content

Instantly share code, notes, and snippets.

@muzlightbeer
muzlightbeer / windbg.md
Last active September 26, 2025 16:47
WinDbg for Linux Users

The Windows Debugger (WinDbg) for Linux users

The following provides commands for getting started with WinDbg if you've come from a Linux only background and have only used GDB and LLDB.

VMware Fusion and VHD images

Some Windows operating system trials come as virtual hard disk (VHD) images, that state Hyper-V is required to use them. With macOS and VMware Fusion (at the time of writing, VMware Fusion 12.1.2), you can drag the executable files into VMware (the same as with ISO images) and install them normally. No subscriptions are required to obtain access to a DVD or ISO image if you do not have a system that uses Windows as the base operating system.

Microsoft symbols

@st98
st98 / nekodesu.s
Last active March 17, 2021 19:13
DiceCTF 2021 - TI-1337 Plus CE
BITS 64
; ref: https://starfleetcadet75.github.io/posts/plaid-2020-golf-so/
ehdr: ; Elf64_Ehdr
db 0x7f, "ELF", 2, 1, 1, 0 ; e_ident
times 8 db 0
dw 3 ; e_type
dw 0x3e ; e_machine
dd 1 ; e_version
@MaskRay
MaskRay / mallocng.md
Last active September 30, 2025 05:40
musl mallocng

Introduced in musl v1.2.1. Design goal: "Strong hardening against memory usage errors by the caller, including detection of overflows, double-free, and use-after-free, and does not admit corruption of allocator state via these errors."

context

// Singleton: ctx
struct malloc_context {
  uint64_t secret;
#ifndef PAGESIZE
  size_t pagesize;
#!/usr/bin/python3
from pwn import *
from past.builtins import xrange
from time import sleep
import random
import subprocess
def PID():
print(subprocess.check_output(['pidof','still-printf']))
@vient
vient / kek.py
Created June 9, 2020 09:52
Python abomination
#!/usr/bin/env python3
import π—Œπ”Άπ˜΄
import πš›π–Ίπ”«β…†om
import π’”π˜΅π“»π’Ύπš—π’ˆ
import ο½•π˜―π•šο½ƒπ• π’Ήο½…π–½π™–π•₯𝖆
from ο½π”Άπ˜¨ο½π‘’π™£t𝑠 import β‚—β…‡β‚“β‚‘ο½’ΕΏ as Lπ˜¦π—‘πšŽα΅£π¬
𝖀𝗑𝕴π‘ͺO𝑫ℰ_π˜Ύπ΄π™²β„‹π„π•Ύ = {}
def π˜§π•šπ“΅π˜­_ο½•π™£β±π™˜π—ˆde_π“·π™–π¦π™šπ•€():
@hellman
hellman / 0_writeup.md
Last active October 18, 2019 07:20
Balsn CTF 2019 - Collision (crypto)

In this challenge we see a password-verification program. The password is quite long:

assert 16 < len(passwd) < 70

The first few checks verify md5, sha1 and sha3_224 digests. Due to long password, it is unlikely to use them to recover the password. Then, three transformations applied aiming to "destroy" the password: exponentiation modulo a prime, iterated encryption with DES and AES. Though, it is easy to see that they are trivially invertible. For the final "destroyed" value, the omnihash tool is used, which checks the password using 72 different hash functions, including many CRC variants. We are given the digests of these functions in the hash.json file.

CRC functions are totally not cryptographically secure: they are affine functions. Therefore, we can efficiently use them to deduce information about the hashed value. One may try to use the definition of CRC functions as modular reductions in the ring of polynomials over GF(2) and use the Chinese Remainder Theorem to reconstruct the va

@codebrainz
codebrainz / gist:8ece2a9015a3ed0d260f
Last active July 23, 2018 23:49
Using std::hash with char* as a C string rather than a pointer.
namespace std
{
template <>
struct hash<char *>
{
size_t operator()(const char *s) const
{
// http://www.cse.yorku.ca/~oz/hash.html
size_t h = 5381;
int c;
@dergachev
dergachev / squid-deb-proxy_on_docker.md
Last active September 23, 2025 16:12
Caching debian package installation with docker

TLDR: I now add the following snippet to all my Dockerfiles:

# If host is running squid-deb-proxy on port 8000, populate /etc/apt/apt.conf.d/30proxy
# By default, squid-deb-proxy 403s unknown sources, so apt shouldn't proxy ppa.launchpad.net
RUN route -n | awk '/^0.0.0.0/ {print $2}' > /tmp/host_ip.txt
RUN echo "HEAD /" | nc `cat /tmp/host_ip.txt` 8000 | grep squid-deb-proxy \
  && (echo "Acquire::http::Proxy \"http://$(cat /tmp/host_ip.txt):8000\";" > /etc/apt/apt.conf.d/30proxy) \
  && (echo "Acquire::http::Proxy::ppa.launchpad.net DIRECT;" >> /etc/apt/apt.conf.d/30proxy) \
  || echo "No squid-deb-proxy detected on docker host"