Skip to content

Instantly share code, notes, and snippets.

void reset_vm()
{
for(ebp_04h = 0; ebp_04h < 0x10; ebp_04h++) {
bss_804abc0h[ebp_04h] = 0;
}
bss_804ac00h = 0;
}
int opcode_valid(arg_0, arg_4)
{
@hhc0null
hhc0null / jackshit.c
Last active August 29, 2015 14:19
[PlaidCTF2014 Pwnables200] jackshit
int main(void)
{
// Local variables.
struct passwd *passwd;
gid_t ebp_d0h;
uid_t ebp_cch;
size_t ebp_bch;
int ebp_b8h;
struct sockaddr_in ebp_b4h;
struct sigaction ebp_a4h;
@hhc0null
hhc0null / 20150415-libseccomp_pseudo_syscall.md
Last active February 26, 2020 21:52
[メモ書き] libsecompのpseudo syscallについて

libsecompのpseudo syscallについて

 PlaidCTF 2014のjackshitを読む際に, libseccompのseccomp_rule_addでsyscallに負数を渡していることが気になったのでメモ書きとして残しておく.


1. Seccomp

 Secure Computing(Seccomp)は, プロセスのサンドボックス化のためのLinuxカーネルの機構である. read/write/exit/sigreturn以外を制限するMode 1はLinuxの2.6.12でマージされた機能である[1].
 Linux 3.5ではMode 2が追加され, 任意のシステムコールの制限が可能となり, 記述もBSD Packet Filter(BPF)を利用することとなった[2].

1.2 libseccomp

 libseccomp[3]は, Seccompを使う上で生じるアーキテクチャ毎の差異などの吸収を行うライブラリである. 現在, x86, ARM, MIPSがサポートされている[4].

@hhc0null
hhc0null / superman_brainfuck.c
Last active May 26, 2017 16:25
[NDH2k15 Crackme_Reverse-Superman-500pts] The superman is a brain fucker.
// get origin address.
// 08077008 E81C060000 call dword 0x8077629
// 0807700D 83EE05 sub esi,byte +0x5 // esi - 5: 0x8077008
origin = (void *)0x8077008;
int sub_08077010()
{
ebp_c04h = sub_080775B2(origin, 0x621);
if(getuid() != 0) {
sub_08077259(origin+0x628, ebp_c04h);
@hhc0null
hhc0null / superman_brainfuck.disas
Last active August 29, 2015 14:18
In progress...
// get origin address.
08077008 E81C060000 call dword 0x8077629
0807700D 83EE05 sub esi,byte +0x5 // esi - 5: 0x8077008
origin = (void *)0x8077008;
sub_08077010()
{
08077010 55 push ebp
08077011 89E5 mov ebp,esp
08077013 81EC00040000 sub esp,0x400
@hhc0null
hhc0null / team.c
Last active August 29, 2015 14:18
BackdoorCTF 2015 team-600pts
int sub_80486ad(char *arg0, char *arg1)
{
// Local variables.
char *ebp_80h;
char *ebp_7ch;
int ebp_74h;
ebp_7ch = arg0;
ebp_80h = arg1;
ebp_74h = fopen("flag.txt", "r");
@hhc0null
hhc0null / exploit_template.py
Last active October 4, 2015 20:49
exploit template
#!/usr/bin/env python2
import binascii
import re
import socket
import struct
import subprocess
import sys
import telnetlib
import time
@hhc0null
hhc0null / login.c
Last active August 29, 2015 14:17
0CTF 2015 Quals Exploit-Login-300pts
// [0CTF 2015 Quals] Exploit-Login-300pts
int sub_cb5(char *arg0, int arg1)
{
// Local variables.
int rbp_1ch;
char *rbp_18h;
rbp_18h = arg0;
rbp_1ch = arg1;
@hhc0null
hhc0null / exploit.py
Last active August 29, 2015 14:17
0CTF 2015 Quals Exploit-FlagGenerator-250pts Writeup? Just exploit code?
#!/usr/bin/env python2
import binascii
import re
import socket
import struct
import subprocess
import sys
import telnetlib
import time
@hhc0null
hhc0null / freenote.c
Last active August 29, 2015 14:17
0CTF 2015 Quals Exploit-freenote-400pts
// [0ctf 2015 quals] exploit-freenote-400pts
/*
* memo of bss_6020a8h.
* offset_00h: limit number of memo.
* offset_08h: current number of memo.
* offset_10h[memo_limit]: content.
*/
const unsigned long long memo_limit = 0x100;