Skip to content

Instantly share code, notes, and snippets.

View thinkycx's full-sized avatar
😀

thinkycx thinkycx

😀
View GitHub Profile
@thinkycx
thinkycx / dirtycow.c
Created November 25, 2018 06:53 — forked from KrE80r/c0w.c
PTRACE_POKEDATA variant of CVE-2016-5195
/*
* A PTRACE_POKEDATA variant of CVE-2016-5195
* should work on RHEL 5 & 6
*
* (un)comment correct payload (x86 or x64)!
* $ gcc -pthread c0w.c -o c0w
* $ ./c0w
* DirtyCow root privilege escalation
* Backing up /usr/bin/passwd.. to /tmp/bak
* mmap fa65a000
@thinkycx
thinkycx / ubuntu-root.c
Created November 24, 2018 09:04
4.4.0-116-generic
/*
* Ubuntu 16.04.4 kernel priv esc
*
* all credits to @bleidl
* - vnik
*/
// Tested on:
// 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64
// if different kernel adjust CRED offset + check kernel stack size
#!/bin/bash
# author: thinkycx
# update: 20190119
# tested on ubuntu 16.04 docker
# quit if the following commands has errors
set -e
# tools
sudo apt-get update &&
@thinkycx
thinkycx / install_latest_tmux.sh
Created November 2, 2018 04:39
install latest tmux version from github/tmux/tmux on ubuntu
#!/bin/bash
# date: 2018-11-02
# author: thinkycx
# reference: https://bogdanvlviv.com/posts/tmux/how-to-install-the-latest-tmux-on-ubuntu-16_04.html
# test on: ubuntu 16.04
sudo apt install -y automake
sudo apt install -y build-essential
sudo apt install -y pkg-config
sudo apt install -y libevent-dev
#!/usr/bin/env python
# Based on https://www.openwall.com/lists/oss-security/2018/08/16/1
# untested CVE-2018-10933
'''
# fixed - test by thinkycx and
Traceback (most recent call last):
File "10933.py", line 12, in <module>
new_auth_accept = paramiko.auth_handler.AuthHandler._handler_table[paramiko.common.MSG_USERAUTH_SUCCESS]
TypeError: 'property' object has no attribute '__getitem__'
@thinkycx
thinkycx / usrp_install.sh
Last active December 5, 2020 09:44
install USRP env
#!/bin/bash
# driver: https://github.com/EttusResearch/uhd
## http://files.ettus.com/manual/page_install.html
## sudo apt-get install libuhd-dev libuhd003 uhd-host
## install UHD software as well as allow you to receive package updates.
sudo add-apt-repository ppa:ettusresearch/uhd
sudo apt-get update
sudo apt-get install libuhd-dev libuhd003 uhd-host
@thinkycx
thinkycx / jekyll_env_ubuntu.sh
Last active October 2, 2018 14:26
install jekyll on ubuntu
# ref: https://jekyllrb.com/docs/installation/ubuntu/
# requirements
sudo apt-get install ruby ruby-dev build-essential
# env for bash
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME=$HOME/gems' >> ~/.bashrc
echo 'export PATH=$HOME/gems/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
@thinkycx
thinkycx / aosp_env_setup.sh
Created September 19, 2018 05:03
download dependency for building AOSP
#!/bin/bash
# author: thinkycx@gmail.com
# ref: https://source.android.com/setup/build/initializing
# License: Gnu GPL v. 2
# License is same as Linux kernel license, since the code helps compile the AOSP
sudo apt-get install apt-transport-https
# test date 201711: use for install openjdk on ubuntu14.04
download_old_jdk(){
@thinkycx
thinkycx / aosp_download.sh
Last active September 21, 2018 08:54
download msm kernel、aosp、 compile-tools 、vendors with this script
#!/bin/bash
# Use to download AOSP kernel build-chains and vendors
# vendors needs run by youself
# test in ubuntu:14.04 docker, contact me if you need it
# author: thinkycx@gmail.com
# License: Gnu GPL v. 2
# License is same as Linux kernel license, since the code helps compile the Linux kernel for a device
export BASE_FOLDER="/root/AOSP/"
export BASE_URL="https://aosp.tuna.tsinghua.edu.cn"
@thinkycx
thinkycx / wahoo_mybuild.sh
Last active November 1, 2018 19:04 — forked from atulprak/wahoo_mybuild.sh
Compiling Linux Kernel for Pixel 2 devices -- Bash script
#!/bin/bash
# Purpose: Script for building AOSP code and Linux kernel for walleye using open-source toolchains.
# Author: atulp@google.com
# License: Gnu GPL v. 2
# License is same as Linux kernel license, since the code helps compile the Linux kernel for a device
# Change these directory paths to point to your aosp and NDK folders.
# reference: https://www.digitalocean.com/community/tutorials/how-to-build-android-roms-on-ubuntu-16-04
# edited by thinkycx 201809
export KERNEL=/root/AOSP/msm