Skip to content

Instantly share code, notes, and snippets.

View SimonTheCoder's full-sized avatar

Simon Shi SimonTheCoder

  • Liaoning, China
View GitHub Profile
qSClcGGCZozOM1Vv-p4eXVw8uZEJifCt-pv_ns6fqp-Ji_bg3-4ZvH2e39C3n6_m37e87dvC_u3O-HI83Ys39e27htvx9puv59yvvC_5xvL_BzvU_Jw-Uv_M23w_x2X4_U338_43XB-c43F-A5XK-k5H_-T06rXfG77ZfY7Lcfq7bef87rgfO87ifg8Llfz8j6fd-w8-Gk-PW1Hteve9A4eG7Bx9e29htvx9puv5NE5yvhIvCOE55xhIvLOE5BzvU_JwPh-nE13qePa9u7e96d39M299sPs9FuP1NE5NvP_9VxPH_dyhIPQ_lzPZ_l7fTse3dfhqevb9u7_BR91r7wYfP7DbfhbIzTdfwrACIzjfFREReFsIiIzwhfXcIzDkfp8Tmfe_70fx_f4q3d-BqevY9u7PE1Hteve9ZsvnNiH2GgIiIzLcBAAAkn6KgAiIv5NiIiIe8bERER8K4nDHi8u4HI-S5nMvzjyfV_foq33IqvV9e06rXfGLEvnFA5htvxVABE5puREREv5NiIi4yvAAAAzrgDReO87ifg8LlX5N46jy-JR9tqPa91rR8M2Ak3w_xWBkX4KiIP1VERew7jfDRERE5VxPH_dyPQelXTrPrWfft_Qb9F36TvfDu_Y8Xl-Ti6bVvHt_61nyGi8e2H2_C3n6_m3QkH-_K4nD-u4HR-a6nV-_6Ha-i7ne-GcVfM_rzBAA5nE13qePa91rPjNE59shIPsNE5FuhIP1NE5NvP_9VxPHel3F-2Z9R06rp1nV-_a9h26Luf69bx1Hj-T_57QAIfi6bVvHt_61ny_e2H2_C3n6_m3H-_K4VeX8Dkfp8Tmf78jofN9wqff9Dt1Xc-073grPG-V5PP-n8DAz3hCQmPR9tq3jWf96wYfP7Dbfh7Tdfw7jfX5lzPZ_twPi_10Pr_91P0Wfy9TvfD_jyfVOAg8TsBAZ_qDAz85HAk5TUfr6jWf96wYfP7Dbfh7Tdfw7Dk1XKrPZWf7s_I6XTrPr_91P0Wfy9TvfD_jy
function load_lib(libname){
Java.perform(function(){
console.log("==========================load_lib Begin==========================");
var System = Java.use("java.lang.System");
var ret = System.loadLibrary(libname);
console.log("load ret:" + ret);
console.log("==========================load_lib Begin==========================");
});
}
@SimonTheCoder
SimonTheCoder / android_cmd_collection.txt
Last active June 18, 2020 14:36
Android commands collection
#Create a new keystore
keytool -genkey -alias android.keystore -keyalg RSA -validity 36500 -keystore android.keystore
#V1 sign apk
jarsigner -keystore .\android.keystore -signedjar apk-signed.apk .\unsigned_apk.apk android.keystore
#show sign info
androsign --all --show app-debug.apk
#verify apk sign
@SimonTheCoder
SimonTheCoder / frida_make_http_request.js
Created June 11, 2020 03:04
Test current HTTP request .
function get_url(url){
if(!url){
url = "http://www.baidu.com";
}
Java.perform(function(){
console.log("==========================get_url Begin==========================");
var URL = Java.use("java.net.URL");
var objURL = URL.$new(url);
var openstream = objURL.openStream();
var InputStream = Java.use("java.io.InputStream");
@SimonTheCoder
SimonTheCoder / frida_trace_open.js
Last active August 29, 2020 09:24
Trace libc open function using Frida.
var target_fn = "open"
//target module can be set to null, but it will cause lower speed.
var target_module = "libc.so"
var callback_obj =
{
onEnter: function (args) {
var path = Memory.readUtf8String(args[0]);
path = path.replace("\n","");
@SimonTheCoder
SimonTheCoder / frida_webview.js
Created June 1, 2020 03:00
Using frida to inspect an Android WebView
{
console.log("SIMON TEST Begin!");
console.log("Java.available:" + Java.available);
console.log("SIMON TEST End!");
if(Java.available){
Java.perform(function(){
@SimonTheCoder
SimonTheCoder / gzip_mod.py
Last active May 28, 2020 02:14
Ignore gzip CRC and length checking.
"""Functions that read and write gzipped files.
The user of the file doesn't have to worry about the compression,
but random access is not allowed."""
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
import struct, sys, time, os
import zlib
import io
@SimonTheCoder
SimonTheCoder / lets_chroot.sh
Created April 29, 2020 05:27
switch to chroot system
#!/bin/bash
#echo "Remount current udisk to remove 'nodev' option."
#sudo mount -t ext4 -o remount,rw,relatime,uhelper=udisks2 /dev/sda1 `pwd`/..
if [ -e ./chroot_root/dev/tty0 ]
then
echo "Nodes already binded. Skip."
else
echo "mount bind proc dev sys"
@SimonTheCoder
SimonTheCoder / mifarecrack.c
Created March 26, 2020 04:53
Find key from proxmark3 sniff data. found here: http://www.proxmark.org/files/Various%20Software/MIFARE%20Classic/mifarecrack/ . Compile : 1 clone https://github.com/nfc-tools/mfcuk; 2 gcc -O3 -o mifarecrack crapto1.c crypto1.c mifarecrack.c
// ported from Test-file: test2.c for crapto1-v2.2
// ver 2: fixed key ordering in output
// ver 3: allow direct cut & paste from sniffer log
#include "crapto1.h"
#include <stdio.h>
#include <string.h>
// Proxmark3 sniffer log
@SimonTheCoder
SimonTheCoder / init.vim
Last active March 2, 2020 14:57
put to C:\Users\<USERNAME>\AppData\Local\nvim
tnoremap <expr> <C-R> '<C-\><C-N>"'.nr2char(getchar()).'pi'
tnoremap <expr> <C-o> '<C-\><C-N>"'.trim(input('CMD:')).'i'
tnoremap <M-`> <C-\><C-N>
nnoremap <M-`> <ESC>
vnoremap <C-c> "+y
set mouse=a