Skip to content

Instantly share code, notes, and snippets.

View 0xTowel's full-sized avatar

0xTowel

View GitHub Profile
@0xTowel
0xTowel / solve_inaction.py
Last active March 18, 2020 18:19
My solution to Inaction from SuSeC CTF 2020
"""inaction_solve.py
CTF: SuSeC CTF 2020 - https://ctftime.org/event/1007
Challenge: Inaction - https://ctftime.org/task/10729
Flag: SUSEC{5m4Rt___p0W___cH4lL3n93}
twitter.com/0xTowel
"""
import re
@0xTowel
0xTowel / limit_calls.py
Created October 15, 2019 23:51
A decorator to limit the number of calls to a function
"""For my friends in OTA.
--Towel, 2019
"""
from functools import wraps
class LimitCalls:
"""A decorator to limit the number of calls to a function.
@0xTowel
0xTowel / snippet.sh
Created October 9, 2019 06:42
List last touched files
# https://www.reddit.com/r/netsec/comments/biu9kc/moddetective_small_python_tool_that_analyzes_the/em3siw8
find / -type f -exec stat --format '%Y :%y %n' "{}" \; | sort -nr | cut -d: -f2- | head
@0xTowel
0xTowel / rsrcdump.py
Created May 14, 2019 09:08
An example tool to dump resources from a file using radare2
#!/usr/bin/env python3
"""A small example utility to demonstrate r2pipe scripting
by extracting resources from a file.
Written as an example for someone on IRC.
--Towel, 2019
"""
import r2pipe
@0xTowel
0xTowel / .gef.rc
Created January 28, 2019 22:13
gef config for a simpler layout (more like peda)
[context]
clear_screen = True
layout = regs code stack memory args extra
show_registers_raw = False
nb_lines_stack = 6
@0xTowel
0xTowel / biggars_fireshell2019.sage
Last active July 25, 2019 18:37
Compute multi-prime RSA using CRT due to large modulus (Biggars challenge, FireShell CTF 2019)
#!/usr/bin/env sage
# -*- coding: utf-8 -*-
# Towel 2019
"""
Solution to 'Biggars' challenge from FireShell CTF 2019.
A multi-prime RSA computation with large N requiring CRT
to compute d rather than normal fast-power algorithm.
"""
@0xTowel
0xTowel / whitespace_bytes.md
Last active February 22, 2019 03:25
A list of bytes which are considered whitespace in C and POSIX locales and terminate calls such as scanf("%s")

The following bytes are considered whitespace in C and POSIX locales:

0c0a0d090b20

They will end input to functions such as scanf("%s").

Byte Escape Sequence Name
0c \f form-feed
0a \n newline
@0xTowel
0xTowel / shell_32.asm
Last active September 1, 2020 02:04
Simple 21-byte x86 shellcode
BITS 32
global _start
section .text
SYS_EXECVE equ 0x0b
_start:
xor ecx, ecx ; argv to zero
mul ecx ; envp to zero, eax to zero
add al, SYS_EXECVE ; syscall 11 for execve
@0xTowel
0xTowel / .vimrc
Last active November 5, 2018 03:48
A bare-minimum, portable vimrc. Not pretty or fancy.
" My bare-minimum, portable vimrc
inoremap <special> jk <ESC>
inoremap <special> kj <ESC>
set clipboard^=unnamedplus
set relativenumber
set number
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
set ignorecase
/*
* ------------------------------------------------------------
* "THE MATEWARE LICENSE" (Revision 1):
* <author> wrote this code. As long as you retain this notice,
* you can do whatever you want with this code. If you meet
* <author> someday, and you think this code is worth it,
* you can buy <author> a mate in return.
* ------------------------------------------------------------
*/