Skip to content

Instantly share code, notes, and snippets.

View hellok's full-sized avatar

Chen Qin hellok

View GitHub Profile
@hellok
hellok / Linux ASLR comparison.md
Created June 1, 2017 03:39 — forked from thestinger/Linux ASLR comparison.md
Comparing ASLR between mainline Linux, grsecurity and linux-hardened

These results are with glibc malloc on x86_64. The last public PaX and grsecurity patches don't support arm64 which is one of the two architectures (x86_64 kernels including x32/x86_32 and arm64 kernels including armv7 userspace) focused on by linux-hardened. There isn't anything other than x86_64 to compare across all 3 kernels although linux-hardened has the same end result for both x86_64 and arm64 (with slightly different starting points) and there are few mainline differences. The linux-hardened implementation of ASLR is a very minimal modification of the mainline implementation to fix the weaknesses compared to grsecurity. The intention is to upstream all of these changes, although care needs to be taken to properly justify them to avoid getting anything rejected unnecessarily.

Explanation of differences between kernels:

  • Mainline and linux-hardened base randomization entropy for the mmap base and executable to the vm.mmap_rnd_bits sysctl for 64-bit and
--- a/drivers/video/logo/logo_linux_clut224.ppm 2014-06-09 02:19:54.000000000 +0800
+++ b/drivers/video/logo/logo_linux_clut224.ppm 2014-08-21 20:07:31.729230596 +0800
@@ -1,5 +1,5 @@
P3
-# Standard 224-color Linux logo
+# 224-color Minami Kotori bootup logo for Linux
80 80
255
0 0 0 0 0 0 0 0 0 0 0 0
@@ -11,8 +11,6 @@
@hellok
hellok / endian.h
Created April 21, 2014 17:46 — forked from yinyin/endian.h
#ifndef __FINK_ENDIANDEV_PKG_ENDIAN_H__
#define __FINK_ENDIANDEV_PKG_ENDIAN_H__ 1
/** compatibility header for endian.h
* This is a simple compatibility shim to convert
* BSD/Linux endian macros to the Mac OS X equivalents.
* It is public domain.
* */
#ifndef __APPLE__
@hellok
hellok / 1.txt
Last active August 29, 2015 13:59
{"ap":10,"bp":20,"services":{"freebsd":"11","bb":"22","c":"33","dd":"44"},"scores":10,"name":{"a" : "Hello","b" : "World"}}
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
#!/usr/bin/env ruby
require 'eventmachine'
require 'logger'
require File.expand_path("../blue.rb", __FILE__)
TIMER = 5
host = "0.0.0.0"
port = (ARGV[0].to_i > 0) ? ARGV[0].to_i : 12345
/*
shell_reverse_tcp_shellcode
* 72 bytes
* null-bytes free if the port and address are
* the ip address and port number are easily changeable (2nd to 5th bytes are the IP) and (9th and 10th are the Port)
# gcc -m32 -fno-stack-protector -z execstack shellcode.c -o shellcode
@hellok
hellok / -
Created March 15, 2014 14:14
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
require 'colorize'
RANDOM = false
MARGIN_TOP = 2
MARGIN_LEFT = 3
SERVICE_CELL = " " * 3
#!/usr/bin/env ruby
require 'eventmachine'
require 'logger'
require File.expand_path("../blue.rb", __FILE__)
TIMER = 5
host = "0.0.0.0"
port = (ARGV[0].to_i > 0) ? ARGV[0].to_i : 12345
@hellok
hellok / nisl.log
Created January 20, 2014 05:59
thunisl_2012~
Session Start: Sat Dec 15 22:42:05 2012
Session Ident: #ctf
03[22:42] * Now talking in #ctf
02[22:49] * YueLiu (lieanu@tu132228.ip.tsinghua.edu.cn) Quit (Ping timeout: 121 seconds)
02[22:51] * adrian (adrian@222.195.149.190) Quit (Quit: Going offline, see ya! (www.adiirc.com))
03[23:06] * luke (luke@115.171.179.197) has joined #ctf
Session Time: Sun Dec 16 00:00:00 2012
01[00:05] <hellok> 登陆密码是?
02[00:31] * Disconnected