Skip to content

Instantly share code, notes, and snippets.

static int sanity_check_name(char *s)
{
char buf[256];
int error;
error = 0;
error |= (!! strstr(s, "ssh"));
error |= (!! strstr(s, "/."));
@andrewg-felinemenace
andrewg-felinemenace / structure.c
Created August 19, 2011 11:40
Structure integrity example code
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <stdio.h>
u_int32_t wordhash(u_int32_t a)
{
a = (a+0x7ed55d16) + (a<<12);
a = (a^0xc761c23c) ^ (a>>19);
@andrewg-felinemenace
andrewg-felinemenace / repro.c
Created July 15, 2011 04:07
Per-thread user ids and capabilities
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <stdio.h>
#include <pthread.h>
#include <sys/syscall.h>
/*
* This can be used to demonstrate a grsecurity chroot_findtask bug, recent glibc cross thread