Skip to content

Instantly share code, notes, and snippets.

@doegox
doegox / fingerprint_mfc.py
Created September 10, 2024 20:22
Crappy script for fingerprinting MFC cards
#!/usr/bin/env python3
import time
MFINFO = True
ATS = True
FDT = True
NACK = True
SF = True
CMD00 = True
@doegox
doegox / ECDSA_public_key_recovery.py
Created September 16, 2020 14:36
Public Key Recovery from the ECDSA Signature
#!/usr/bin/env python3
# Example from https://cryptobook.nakov.com/digital-signatures/ecdsa-sign-verify-examples
# updated to latest pycoin & OpenSSL APIs (2020-09)
# pip install --user pycoin
# pip install --user secrets
from pycoin import intbytes
from pycoin.ecdsa.secp256k1 import secp256k1_generator
import hashlib, secrets
@doegox
doegox / hf-mf-A2D9B91E-dump.eml
Last active July 10, 2020 22:09
PoC MFC image being also a ZIP and a PDF
A2D9B91EDC88040044C2770731343938
00000000000000000000000000000000
00000000000000000000000000000000
FFFFFFFFFFFFFF078069FFFFFFFFFFFF
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
FFFFFFFFFFFFFF078069FFFFFFFFFFFF
00000000000000000000000000000000
00000000000000000000000000000000
@doegox
doegox / example.txt
Created July 18, 2019 20:41
Crappy script to get some stats on Proxmark3 FW
proxmark3-RRG.git$ ./show-sizes.sh
Bootphase1 @00000: 512/512
Bootphase2 @00200: 3488/7680 = 45.4167%
Text+Data @02000: 234576/253952 = 92.3702%
234576/516096 = 45.452%
10 largest .text:
=================
text data bss dec hex filename
21339 166 132 21637 5485 armsrc/obj/iso14443a.o
@doegox
doegox / test-flash.sh
Last active August 1, 2019 09:19
Testing script for Proxmark3 RDV4 external flash
#!/bin/bash
for ((i=0; i<100; i++)); do
echo -e "\n\nIteration $i"
rm -f test_flash_in.bin test_flash_out.bin
dd if=/dev/urandom of=test_flash_in.bin bs=65536 count=3
./proxmark3.sh -c "
mem wipe p 0;
mem wipe p 1;
mem wipe p 2;
@doegox
doegox / troopers2019_img2badge.py
Last active April 16, 2019 04:18
Image to badge shitty script, with script helper for uploading it directly on the badge via USB
#!/usr/bin/env python3
# TROOPERS2019
# @doegox
# The script will resize the image and convert it to BW image if needed but
# I would advise to do it yourself first with e.g. Gimp for a better control
# of the aspect ration and the BW threshold.
# Target: 296x128, black & white (no grey)
# Shall we display the result locally?
@doegox
doegox / notmydigest.cpp
Created October 20, 2017 19:08
Write-up of the Hack.lu 2017 CTF challenge "Not My Digest"
/*
MIT License
Copyright (c) 2017:
Marc Stevens
Cryptology Group
Centrum Wiskunde & Informatica
P.O. Box 94079, 1090 GB Amsterdam, Netherlands
[email protected]
@doegox
doegox / RPi3_readonly.sh
Created September 11, 2017 00:10
Commands to make a RPi3 read-only
# From https://hallard.me/raspberry-pi-read-only/
# DON'T APPLY IT BLINDLY! USE IT AS A GUIDE
apt-get install -y busybox-syslogd; dpkg --purge rsyslog
sed -i 's/rootwait/rootwait fastboot noswap ro/' /boot/cmdline.txt
rm -rf /var/lib/dhcp/ /var/run /var/spool /var/lock /etc/resolv.conf
ln -s /tmp /var/lib/dhcp
ln -s /tmp /var/run
ln -s /tmp /var/spool
ln -s /tmp /var/lock
@doegox
doegox / st_srx.c
Created August 31, 2017 23:37
LIBNFC: Quick start example that presents how to discover a ST SRx tag
/**
* @file st_srx.c
* @brief Quick start example that presents how to discover a ST SRx tag
*/
// To compile this simple example:
// $ gcc -o st_srx st_srx.c -lnfc
#include <stdlib.h>
#include <nfc/nfc.h>
@doegox
doegox / gh16_stego200.py
Last active November 23, 2016 15:20
GreHack 2016 CTF Daytonaaaaaaaaaa!!!!! write-up
#!/usr/bin/env python3
import struct
import zlib
# Daytonaaaaaaaaaa!!!!!
# by iggy
# 200 points
#
# Never look down and go ahead !