Skip to content

Instantly share code, notes, and snippets.

View Lense's full-sized avatar
🤔
?

Lense Lense

🤔
?
View GitHub Profile
@Lense
Lense / randomware.md
Last active March 6, 2018 03:34
SECCON 2016 quals: randomware

randomware

SECCON 2016 quals

description

300 points
My PC suddenly got broken. Could you help me to recover it please?
NOTE: The disk can be virus-infected. DO NOT RUN any programs extracted from the disk outside of sandbox.
disk.qcow2.zip
Challenge files is huge, please download it first. Password will release after 60min.
password: h9nn4c2955kik9qti9xphuxti

@Lense
Lense / README.md
Last active July 12, 2018 22:01
CSAW quals 2015 forensics 400: Sharpturn

First thing I did was figure out that it was a git repo, search Google for how to extract the code, and run git archive master | tar x -C code. It asks for 2 prime factors of a number which doesn't have exactly 2 prime factors, from which it can be assumed that something was wrong with the code.

Running git fsck (after more Google searching) showed 3 hashes not matching up, which means that the hash of the file contents (plus header metadata) didn't match the filename. I then read https://git-scm.com/book/en/v2/Git-Internals-Git-Objects (side-note: the Pro Git book is a fantastic introduction to and reference for git). 3 Files are corrupted: sharp.cpp in each of the 3 commits (see git log).

Then I tool a leap of faith and assumed that a single byte was wrong (corrupted, hence the SATA controller comment) in each blob, and wrote a script to brute force it. It worked for first one, and then doom had to remind me to propagate the changes: the first

@Lense
Lense / fix_bold.diff
Last active October 12, 2019 19:25
Updated for st 0.8.2 commit 2b8333f553c14c15398e810353e192eb05938580
diff --git a/x.c b/x.c
index 5828a3b..ace044f 100644
--- a/x.c
+++ b/x.c
@@ -116,8 +116,6 @@ typedef struct {
int width;
int ascent;
int descent;
- int badslant;
- int badweight;
@Lense
Lense / ctftime_scoreboard.py
Created October 26, 2020 02:15
CTFtime scoreboard generator for CTFd
#!/usr/bin/python3
import json
from CTFd import create_app
from CTFd.models import Users, Challenges
scoreboard = dict()
scoreboard["standings"] = list()