Skip to content

Instantly share code, notes, and snippets.

View syjcnss's full-sized avatar

syjcnss syjcnss

View GitHub Profile
@syjcnss
syjcnss / CVE-2021-3156-exploit.c
Created February 1, 2021 10:38 — forked from WinMin/CVE-2021-3156-exploit.c
CVE-2021-3156-exploit
#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <string.h>
/*
author: swing @ bestswngs@gmail.com
swpwn-pd@ubuntu:~/glibc-2.31$ uname -a
Linux ubuntu 5.8.0-41-generic #46~20.04.1-Ubuntu SMP Mon Jan 18 17:52:23 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
swpwn-pd@ubuntu:~/glibc-2.31$ cat /etc/issue
@syjcnss
syjcnss / DumpHex.c
Created May 16, 2020 13:54 — forked from ccbrown/DumpHex.c
Compact C Hex Dump Function w/ASCII
#include <stdio.h>
void DumpHex(const void* data, size_t size) {
char ascii[17];
size_t i, j;
ascii[16] = '\0';
for (i = 0; i < size; ++i) {
printf("%02X ", ((unsigned char*)data)[i]);
if (((unsigned char*)data)[i] >= ' ' && ((unsigned char*)data)[i] <= '~') {
ascii[i % 16] = ((unsigned char*)data)[i];