Skip to content

Instantly share code, notes, and snippets.

View Creased's full-sized avatar

Baptiste MOINE Creased

View GitHub Profile
@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 / 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 / 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 / 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 / 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: