Skip to content

Instantly share code, notes, and snippets.

#include <arpa/inet.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <err.h>
typedef unsigned int uint;
@arsv
arsv / ansi256.c
Created September 16, 2019 16:04
#include <stdio.h>
int main(void)
{
char esc=033;
int i;
printf(" ");
for(i = 0; i < 16; i++)
printf(" %X", i % 16);
@arsv
arsv / ansi.c
Created September 16, 2019 16:03
#include <stdio.h>
int main(void)
{
int i;
for(i = 30; i <= 37; i++)
printf("\033[0;%im-- 0:%i --\033[1;%im-- 1:%i --\033[0m\n", i, i, i, i);
for(i = 40; i <= 47; i++)
printf("\033[0;%im-- 0:%i --\033[1;%im-- 1:%i --\033[0m\n", i, i, i, i);
@arsv
arsv / ansi.c
Created September 16, 2019 16:02
#include <stdio.h>
int main(void)
{
int i;
for(i = 30; i <= 37; i++)
printf("\033[0;%im-- 0:%i --\033[1;%im-- 1:%i --\033[0m\n", i, i, i, i);
for(i = 40; i <= 47; i++)
printf("\033[0;%im-- 0:%i --\033[1;%im-- 1:%i --\033[0m\n", i, i, i, i);
diff --git a/src/net2/ifmon_netlink.c b/src/net2/ifmon_netlink.c
index c697af4..f61195d 100644
--- a/src/net2/ifmon_netlink.c
+++ b/src/net2/ifmon_netlink.c
@@ -9,6 +9,7 @@
#include <netlink/dump.h>
#include <string.h>
+#include <printf.h>
#include <util.h>
@arsv
arsv / echo.sh
Last active October 2, 2018 09:57
#!/bin/sh
sysname=`uname`
case "$sysname" in
Darwin*)
nonl() { /bin/echo -n "$@"; }
;;
*)
nonl() { echo -n "$@"; }
adduser
apt
base-files
base-passwd
bash
bsdutils
bzip2
coreutils
dash
debconf
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <inttypes.h>
#include <sys/time.h>
static char *
coolsize_f(off_t size)
{
static const char * const U = "BKMGTPEZY";
Quick explanation of the KRACK bug and exploit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The announcement of the vulnerability caused a lot of discussion around
wpa_supplicant and WPA2, and since I'm coincidentally releasing my own
supplicant soon, I expect a lot of questions to be asked on this.
The initial announcement sadly did not provide much context for people
unfamiliar with the WPA2/RSN key exchange or the inner workings
of wpa_supplicant, and the patches were likely even more confusing.
Since I still have lots of it in mind, I'll try to provide some additional
interface Foo {
getstuff();
}
class RealFoo implements Foo {
backend: Backend;
RealFoo(injectedBackend: Backend) {
backend = injectedBackend;
}