Skip to content

Instantly share code, notes, and snippets.

View suedadam's full-sized avatar

Adam Syed suedadam

View GitHub Profile
@suedadam
suedadam / cacher.c
Created April 22, 2018 04:29
Quick PoC cache implementation for mmap/munmap
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
typedef struct s_node
{
void *content;
size_t size;
struct s_node *next;
#include <stdio.h>
#include <stdlib.h>
#define ITTERATIONS 3
static inline __attribute__((always_inline)) unsigned long long rdtsc(void)
{
unsigned long long int x;
@suedadam
suedadam / bench.c
Created April 11, 2018 20:24
Simple benchmark program to monitor CPU cycles elapsed from start -> finish of allocations
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <errno.h>
#include <string.h>
#define SIZE 1
/*
**
@suedadam
suedadam / poc.c
Last active March 30, 2018 21:57
This won't print anything to STDOUT because the FD I'm grabbing is from open :) A POC for b_system
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
@suedadam
suedadam / get_next_line.c
Last active March 24, 2018 11:01
Example leaking program for Forum post on 42 forums to explaining how to trace back leaks!
#include "get_next_line.h"
char *ft_strcat(char *s1, const char *s2)
{
int x;
x = strlen(s1);
while (*s2 != '\0')
s1[x++] = *s2++;
s1[x] = '\0';
@suedadam
suedadam / filter.go
Created August 31, 2017 18:11
Small script to show a friend how to check for read a file and check for empty lines and how to filter for duplicates in a small file.
package main
import (
"bufio"
"strings"
"log"
"fmt"
"os"
"hash/fnv"
)
#!/usr/bin/env python
"""Checks the status (availability, logged-in players) on a Minecraft server.
Example:
$ %(prog)s host [port]
available, 3 online: mf, dignity, viking
or
>>> McServer('my.mcserver.com').Update().player_names_sample
frozenset(['mf', 'dignity', 'viking'])
Based on:
https://gist.github.com/barneygale/1209061
<div class="container">
<p>
<a class="btn btn-primary btn-lg" href="http://www.youtube.com/watch?v=6w4FI0Jq0lI" role="button">Open a Video</a>
</p>
</div>
<!-- Video / Generic Modal -->
package proxy
import (
"bytes"
cryptoRand "crypto/rand"
"crypto/rsa"
"encoding/base64"
"encoding/json"
"errors"
"fmt"

Keybase proof

I hereby claim:

  • I am suedadam on github.
  • I am suedadam (https://keybase.io/suedadam) on keybase.
  • I have a public key whose fingerprint is F2F4 D2EA 918D 2B10 0135 0D8D 6996 A203 DF40 D852

To claim this, I am signing this object: