Skip to content

Instantly share code, notes, and snippets.

@zwned
zwned / io.sts level05
Created March 5, 2012 18:54
io.sts level05
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv) {
char buf[128];
if(argc < 2) return 1;
strcpy(buf, argv[1]);
@zwned
zwned / io.sts level04
Created March 5, 2012 18:39
io.sts level04
#include <stdlib.h>
int main() {
system("id");
return 0;
}
@zwned
zwned / io.sts level03
Created March 5, 2012 17:29
io.sts level03
#include <stdio.h>
#include <unistd.h>
#include <string.h>
int good(int addr) {
printf("Address of hmm: %p\n", addr);
}
int hmm() {
printf("Win.\n");
@zwned
zwned / io.sts level02_alt
Created March 5, 2012 17:09
io.sts level02_alt
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define answer 3.141593
void main(int argc, char **argv) {
float a = (argc - 2)?: strtod(argv[1], 0);
@zwned
zwned / io.sts level02
Created March 5, 2012 15:57
io.sts level02
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <setjmp.h>
void catcher(int a)
{
setresuid(geteuid(),geteuid(),geteuid());
printf("WIN!\n");
system("/bin/sh");
@zwned
zwned / ctf.stri.pe level05
Created March 4, 2012 23:06
ctf.stri.pe level05
cat /levels/level05
#!/usr/bin/env python
import logging
import json
import optparse
import os
import pickle
import random
import re
import string
@zwned
zwned / ctf.stri.pe level04
Created February 27, 2012 17:36
ctf.stri.pe level04
#include <stdio .h>
#include <string .h>
#include <stdlib .h>
void fun(char *str)
{
char buf[1024];
strcpy(buf, str);
}
@zwned
zwned / ctf.stri.pe level03
Created February 27, 2012 17:34
ctf.stri.pe level03
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#define NUM_FNS 4
typedef int (*fn_ptr)(const char *);
int to_upper(const char *str)
@zwned
zwned / ctf.stri.pe level02
Created February 27, 2012 17:31
ctf.stri.pe level02
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Congratulations on making it to level02!\n");
printf("Point your browser to http://ctf.stri.pe/level02.php for the next challenge.\n");
}
@zwned
zwned / ctf.stri.pe level1
Created February 27, 2012 17:30
ctf.stri.pe level1
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
printf("Current time: ");
fflush(stdout);
system("date");
return 0;
}