Skip to content

Instantly share code, notes, and snippets.

View syjcnss's full-sized avatar

syjcnss syjcnss

View GitHub Profile
@syjcnss
syjcnss / .vimrc
Created January 4, 2017 08:30
highlight trailing spaces
" hight trailing spaces
highlight ExtraWhitespace ctermbg=red guibg=red
au InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
au InsertLeave * match ExtraWhitespace /\s\+$/
@syjcnss
syjcnss / exploit.c
Created June 5, 2017 08:20
exploit for cred_jar
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <pthread.h>
#define ALLOC_CTX _IO('t', 1)
@syjcnss
syjcnss / su.c
Created September 16, 2019 11:03
#define LOG_TAG "su"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include <time.h>
#include <pwd.h>
@syjcnss
syjcnss / hello.c
Created September 23, 2019 12:27
libfuse hello example
/*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU GPL.
See the file COPYING.
*/
/** @file
*
#!/bin/sh
#MIRROR=http://ftp.sjtu.edu.cn/
MIRROR=https://mirrors.cloud.tencent.com/
debootstrap --components=main,restricted,universe,multiverse --include=git-core,gnupg,flex,bison,gperf,build-essential,zip,curl,zlib1g-dev,gcc-multilib,g++-multilib,libc6-dev-i386,lib32ncurses5-dev,x11proto-core-dev,libx11-dev,libgl1-mesa-dev,libxml2-utils,xsltproc,unzip --arch=amd64 trusty trusty/ $MIRROR/ubuntu
@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];
@syjcnss
syjcnss / ida
Last active August 11, 2020 11:14
#!/bin/bash
IDA_PATH=/opt/idapro-7.4/
base=`basename $0`
fn=$1
if [ "$#" -ne 1 ]; then
exe=$IDA_PATH/$base
else
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.18.71 (f00l@work) (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) ) #68 SMP PREEMPT Fri Aug 14 01:06:41 CST 2020
[ 0.000000] CPU: AArch64 Processor [411fd070] revision 0
[ 0.000000] Detected PIPT I-cache on CPU0
[ 0.000000] alternative: enabling workaround for ARM erratum 832075
[ 0.000000] cma: Reserved 64 MiB at 0x00000000fc000000
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv0.2 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
@syjcnss
syjcnss / su.c
Created December 16, 2020 13:22
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include <time.h>
#include <pwd.h>
/*
@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