Skip to content

Instantly share code, notes, and snippets.

View pich4ya's full-sized avatar

LongCat pich4ya

View GitHub Profile
@pich4ya
pich4ya / macos_rbenv_build_failed.txt
Created February 19, 2019 23:08
MacOS's rbenv BUILD FAILED - error: unknown type name 'uint8_t'
Problem:
$ rbenv install 2.6.0-dev
ruby-build: use openssl from homebrew
Cloning https://github.com/ruby/ruby.git...
Installing ruby-trunk...
ruby-build: use readline from homebrew
BUILD FAILED (OS X 10.14.3 using ruby-build 20181019)
@pich4ya
pich4ya / docker_context.txt
Created February 16, 2019 22:53
How to fix "ERROR: No build stage in current context"
Problem:
$ docker-compose up --build
Building xxx
ERROR: No build stage in current context
Analysis:
Dockerfile
@pich4ya
pich4ya / kali_repo.txt
Created February 12, 2019 18:11
How to Fix Broken Kali Repo in Thailand ISPs
Problem:
$ apt -y upgrade
..
E: Failed to fetch http://http.kali.org/kali/pool/main/a/apt/apt-utils_1.8.0~alpha3_amd64.deb 404 Not Found [IP: 192.99.200.113 80]
E: Failed to fetch http://http.kali.org/kali/pool/main/s/sysvinit/sysvinit-utils_2.93-2_amd64.deb 404 Not Found [IP: 192.99.200.113 80]
E: Failed to fetch http://http.kali.org/kali/pool/main/s/systemd/systemd-sysv_240-2_amd64.deb 404 Not Found [IP: 192.99.200.113 80]
E: Failed to fetch http://http.kali.org/kali/pool/main/i/iproute2/iproute2_4.19.0-2_amd64.deb 404 Not Found [IP: 192.99.200.113 80]
E: Failed to fetch http://http.kali.org/kali/pool/main/c/chardet/python-chardet_3.0.4-2_all.deb 404 Not Found [IP: 192.99.200.113 80]
@pich4ya
pich4ya / pip_pycurl.txt
Last active March 26, 2020 11:58
Fix PyCurl on MacOS + SSL problem
Problem:
$ pip install wfuzz
Collecting wfuzz
Using cached https://files.pythonhosted.org/packages/76/7a/6e3ee024a9a6edf9e9affbcff0c03e8538da03292514ff17b9204b71e650/wfuzz-2.3.1.tar.gz
Collecting pycurl (from wfuzz)
Using cached https://files.pythonhosted.org/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz
Complete output from command python setup.py egg_info:
Using curl-config (libcurl 7.62.0)
Traceback (most recent call last):
@pich4ya
pich4ya / capfuzz_error.txt
Created December 13, 2018 13:06
Fix CapFuzz error on MacOS
Problem:
$ pip install git+https://github.com/MobSF/CapFuzz.git
Or
$ git clone https://github.com/MobSF/CapFuzz.git
$ cd CapFuzz
$ python setup.py install
causes this error..
"fatal error: 'openssl/opensslv.h' file not found"
@pich4ya
pich4ya / rails_session_decryptor-5.rb
Created November 29, 2018 05:50
Ruby on Rails 5.1.6 Session Decryptor
# @author longcat (Pichaya Morimoto)
# Tested on ruby 2.5.3 on rails 5.1.6
# modded from https://gist.github.com/erose/36a514bc5ac9c5f18552369265b4d449
# $ gem install application_config
# $ gem install activesupport
require 'cgi'
require 'json'
require 'active_support'
require 'application_config'
# $ rails runner 'Rails.application.config.action_dispatch.tap { |c| p encrypted_cookie_salt: c.encrypted_cookie_salt, encrypted_signed_cookie_salt: c.encrypted_signed_cookie_salt }'
@pich4ya
pich4ya / magisk.txt
Last active October 11, 2024 00:49
Unlock bootloader / install TWRP / *root* with Magisk / install Magisk Manager on Google Pixel 1 using MacOS
@author LongCat (Pichaya Morimoto)
-- Unlock bootloader
Note: this will unlock bootloader & perform factory reset.
1. Prepare the device
Remove all screen unlock methods.
Enable Developer Mode: Settings > About phone > tap seven times on "Build number"
Enable USB Debgging: Settings > Developer options > Select "USB debugging"
Enable OEM Unlock: Settings > Developer options > Select "OEM unlocking"
@pich4ya
pich4ya / hashcat_macos.sh
Last active February 4, 2022 00:34 — forked from chadmayfield/hashcat_macos.sh
Install Hashcat on macOS
#!/bin/bash
git clone https://github.com/hashcat/hashcat.git
mkdir -p hashcat/deps
git clone https://github.com/KhronosGroup/OpenCL-Headers.git hashcat/deps/OpenCL
cd hashcat/ && make && make install
./hashcat --version
./hashcat -b -D 1,2
./example0.sh
@pich4ya
pich4ya / MainActivity.kt
Last active April 1, 2022 12:56
Android: Preventing Sensitive Information From Appearing In Background Screenshot (Recent App)
/*
@author longcat (Pichaya Morimoto)
This code snippet can be used to resolve BOT (Bank Of Thailand) mobile security requirement "insecure background"
without hurting user experience in mobile app.
Briefly, when the app is pushed into background mode (user presses the Home button)
Android phone will create screenshot of the current Activity for displaying it in recent apps menu
The recent's app screenshots will be stored at:
@pich4ya
pich4ya / SCM_backdoor.txt
Last active April 9, 2024 17:06
Persistence (Backdoor) access to Windows with SCM (Service Control Manager) a.k.a. psexec without admin users
@author LongCat (Pichaya Morimoto)
By default, only admin users have right to manage SCM
but if you (mistakenly) grant a non-admin user to manage SCM,
he will be able to perform tasks on behalf admin / nt authority system rights.
This fact is a known system design mentioned in ..
1. Service Security and Access Rights
https://docs.microsoft.com/en-us/windows/desktop/Services/service-security-and-access-rights