Skip to content

Instantly share code, notes, and snippets.

View recolic's full-sized avatar
🏠
Working from home

Recolic recolic

🏠
Working from home
View GitHub Profile
@recolic
recolic / dirty_passwd_adjust_cow.c
Created March 4, 2017 21:51 — forked from ngaro/dirty_passwd_adjust_cow.c
A dirty cow exploit that automatically finds the current user in passwd and changes it's uid to 0
#include <stdio.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/stat.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>
@recolic
recolic / bbr_enable.sh
Created September 1, 2017 08:01
One-key enable bbr.
#!/bin/bash
uname -r | grep -E '^4\.(1[^\.]|9)' > /dev/null
(( $? == 1 )) && echo 'Linux kernel version must >= 4.9' && exit 1
[[ `whoami` != root ]] && echo 'You must be root' && exit 1
lsmod | grep bbr > /dev/null
(( $? == 1 )) &&
modprobe tcp_bbr &&
@recolic
recolic / junk_stupid_trunk.ino
Last active November 6, 2017 13:06
HUST junk.
/*
* Reconstructed by Recolic Keghart.
* Nov 1, 2017
* LICENSE := GPLv3
*/
#define STANDARD_SPEED 200
#define SLOW_WHILE_AUTO_DRIVE 0.9
int usual_speed = STANDARD_SPEED;
int bReverseMode = 0;
int bForceBoost = 0;
#!/bin/bash
height=$1
sleep_time=$2
[[ $height == '' ]] && echo 'Usage: ./hanoi.bash <height> [sleep_time = 0.6]' && exit 1
[[ $sleep_time == '' ]] && sleep_time=0.6
declare -a A=( $(seq 1 $height) )
declare -a B
@recolic
recolic / func.drive.recolic.net
Created August 7, 2018 08:34
tinc configuration file
Port = 655
Subnet = 10.143.0.127/32
-----BEGIN RSA PUBLIC KEY-----
MIICCgKCAgEAnjwfPNIG0EfokEo+Rlk81Djhqvp/KiB/UiBQy7l+g/3SJJ8halFO
D8AWFP520Epfn5PseGRMIwti745AGEMWYRnt2JgrMAJvg6AQmiiefBiCoaRtH9su
Tpfc9JekWKGzyw7E+kbxiawqQ3z7Uq85YXzrdNKKvVzKn4iU4QNI4mymAgnqPqXn
2YCCyc4oz5CTi16VYbMFq6DECvYU74QlhQLNgahmPfXhRWKi9bBCe0lCu8UfvTpJ
CVkZzJttyK+hJU6IX0u3ilwpCrnDED5cmhOamfE0IN/kkbW7egcLsmXvPQ6MYGfD
0yn1apGU27qp7zgh7IF0arT5rNylIBo+c+is2quoKoVGNXBJlY0GJBSYmA/6+Tr0
@recolic
recolic / virtualtype.py
Created August 26, 2018 07:28
Fuck the chinese shits who prevent you from pasting password.
#!/usr/bin/env python3
# Use this script with https://recolic.net/phy and https://recolic.net/phy2
# to avoid typing fucked numbers into page by hand.
# Fuck the chinese shits who prevent you from pasting password.
# E.x. Alibaba bitch
from pykeyboard import PyKeyboard
import time
def virtual_type_array(arrToType, noWait=False):
k = PyKeyboard()
@recolic
recolic / Pipfile
Last active October 6, 2018 15:04 — forked from qzed/Pipfile
Surface Book 2 / Surface Pro (2017) / Surface Laptop UART protocol proof-of-concept script.
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
crcmod = "*"
pyserial = "*"
[dev-packages]
@recolic
recolic / README.md
Created October 20, 2018 05:07
Download public shared google drive large file with wget. by vladalive

I've used @beliys code and made a bash command.

Setup: Add this code to your ~/.bash_aliases file.

function gdrive_download () {
  CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
  wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2
  rm -rf /tmp/cookies.txt
}
@recolic
recolic / forked_udpfwd.cc
Created December 14, 2018 04:18
naive udp forwarder with naive encryption. copied from an unknown guy. the code style is extremely horrible but it's good enough to fuck GFW.
#include<stdio.h>
#include<string.h>
#include<sys/socket.h>
#include<arpa/inet.h>
#include<stdlib.h>
#include<getopt.h>
#include <unistd.h>
#include<errno.h>
#include <fcntl.h>
@recolic
recolic / py3in2.py
Created February 10, 2019 00:00
Run python3 in a python2 code.
import tempfile, subprocess
def py3in2(func_text, arg):
# escape char in arg should be escaped twice.
payload = ['#/usr/bin/env python3', 'def _func(arg):']
for line in func_text.split('\n'):
payload.append(' ' + line)
payload.append('with open("/dev/fd/1", "w") as f:\n f.write(_func(\''+arg+'\'))\n')
payload = '\n'.join(payload)