Skip to content

Instantly share code, notes, and snippets.

View Creased's full-sized avatar

Baptiste MOINE Creased

View GitHub Profile
@Creased
Creased / README.md
Created March 25, 2021 08:09
Create symbol file from kallsyms

Generate symbol file:

python kernel_syms.py
as -o kernal_syms.o kernel_syms.s

Load the symbols into gdb:

@Creased
Creased / README.md
Last active November 27, 2020 23:34
Dharma.exe short writeup

Dharma.exe

This challenge is fairly simple, a first binary (dharma) drops a second one (2O3naSbh, but let's call it stage2) using a well-known in-memory loading technique (please refer to this article for details).

As this is a CTF challenge, we're looking for the shortest path to get the flag: let's just patch the binary to make it drops the binary to a common file descriptor (e.g., stdout, stdin, stderr).

Because I'm lazy, I decided to apply the following patch:

--- dharma
@Creased
Creased / create_users.sh
Created June 16, 2020 12:01
Bulk user creation (with sudo)
#!/bin/bash
while IFS=';' read -r USER PASSWORD; do
echo "Creating ${USER} user..."
useradd -s /bin/bash -d /home/${USER} -m ${USER}
usermod -aG sudo ${USER}
echo "${USER}:${PASSWORD}" | chpasswd
echo "Default password set to ${PASSWORD} for ${USER} user."
done < users.txt
@Creased
Creased / chall_left.py
Created June 3, 2020 18:43
RM scripts
#!/usr/bin/env python3
import requests
import html
creased = 14542
s = requests.Session()
def get_chall_ids():
finished = False
@Creased
Creased / exploit.py
Last active May 11, 2020 07:20
Sharky CTF - Give Away 2
from pwn import *
context.clear(arch='amd64', log_level='info')
LOCAL = False
p = None
def create_process():
global p
if LOCAL:
@Creased
Creased / exploit.py
Created May 11, 2020 06:55
Sharky CTF - Captain Hook
from pwn import *
context.clear(arch='amd64', log_level='info')
PROMPT = b'peterpan@pwnuser:~$ '
LOCAL = False
p = None
def create_process():
@Creased
Creased / exploit.py
Created May 15, 2019 07:59
Pwntools example
from pwn import *
# Doc: docs.pwntools.com/en/stable/
context.log_level = 'debug' # debug/info/error/warning.
context.arch = 'i386' # i386/x64/arm, etc.
## OPEN SOCKET.
sock = remote('challenges.ecsc-teamfrance.fr', 2000)
## OR, OPEN LOCAL PROCESS.
@Creased
Creased / exploit.py
Created April 14, 2019 19:12
BreizhCTF 2019 - Hallowed be thy name
import base64
from pwn import *
context.log_level = 'info'
PROMPT = '>>> '
def get_con():
p = remote('ctf.bzh', 11000)
@Creased
Creased / containerd.io_1.2.2-1_amd64.deb
Last active April 4, 2019 15:07
CVE-2019-5736 exploit
This file has been truncated, but you can view the full file.
@Creased
Creased / format_protostar.sh
Last active June 14, 2018 09:32
Protostar Stack Overflow (0-7), Format String (0-4), Heap Overflow (0-3) and Net (0-2)
export TMP=$(mktemp -d)
/bin/cat <<-EOF >${TMP}/exploit.py
#!/usr/bin/env python
# -*- coding:Utf-8 -*-
#==========================================================#
# [+] Title: Exploitation code for Protostar format 0 #
# [+] Author: Baptiste M. (Creased) #
# [+] Website: bmoine.fr #