Skip to content

Instantly share code, notes, and snippets.

@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 / 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 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 level04
Created March 5, 2012 18:39
io.sts level04
#include <stdlib.h>
int main() {
system("id");
return 0;
}
@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 level06
Created March 5, 2012 20:10
io.sts level06
#include<string.h>
// The devil is in the details - nnp
void copy_buffers(char *argv[])
{
char buf1[32], buf2[32], buf3[32];
strncpy(buf2, argv[1], 31);
strncpy(buf3, argv[2], sizeof(buf3));
@zwned
zwned / base.py
Created May 16, 2013 00:23
kippo base.py
# Copyright (c) 2009 Upi Tamminen <[email protected]>
# See the COPYRIGHT file for more information
import os, time, anydbm, datetime
from kippo.core.honeypot import HoneyPotCommand
from twisted.internet import reactor
from kippo.core.config import config
from kippo.core.userdb import UserDB
from kippo.core import utils
#!/bin/sh
# author: joda
openssl=/usr/bin/openssl
certdir=$SSL_CERT_DIR
if [ ! -f $openssl ]; then
echo "ERROR: Can't find $openssl. openssl-util installed?" >&2
fi
if [[ "$1" = "-f" ]]; then
overwrite=1
shift # remove $1
@zwned
zwned / gist:8425506
Created January 14, 2014 20:55
Ansible question
hosts:
[local]
localhost
ext_vars.yml:
users:
user1:
password: password01
@zwned
zwned / gist:8460581
Last active January 3, 2016 12:09
multiple ssh keys in ansible
task:
...
- name: Add authorized_key file
authorized_key: user={{item.username}} key='{{ "\n".join(item.authkey) | string }}'
with_items: users
...