Skip to content

Instantly share code, notes, and snippets.

View nghminh163's full-sized avatar
🐳
Focusing

Nguyễn Hoàng Minh nghminh163

🐳
Focusing
View GitHub Profile
@nghminh163
nghminh163 / main.c
Created April 29, 2024 17:01 — forked from andrew-d/main.c
Example of how to get current binary's path using Apple's Code Signing Services
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <Security/Security.h>
// Compile with:
// gcc -o ourpath -framework CoreFoundation -framework Security main.c
@nghminh163
nghminh163 / README.md
Created April 29, 2023 17:02 — forked from coaxial/README.md
unpinning SSL certs on Android apps with Frida to inspect network traffic with mitmproxy

Most of the time, applications won't pin the certificate. Running mitmproxy and passing all Android traffic through it is as simple as adb connect <IP> && adb shell settings put global http_proxy <mitmproxy host>:<mitmproxy port> (or use Android's UI)

Some applications, however, pin the certificate and will refuse to do any network calls if using mitmproxy.

Luckily, Frida is here!

This assumes Android x86 is running in a VM, that you are a developer in Android (tap the build version enough times), adb debugging is enabled, and that android tools are installed on the host.

  • start mitmproxy on host
  • visit mitm.it on the target (after setting the proxy) and install the spoofed cert
@nghminh163
nghminh163 / arm64-on-Win10.md
Created February 1, 2023 09:54 — forked from billti/arm64-on-Win10.md
ARM64 Linux on Win10

Below are the steps to get an ARM64 version of Ubuntu running in the QEMU emulator on Windows 10.

Install QEMU

Install for Windows from https://qemu.weilnetz.de/w64/ (I used qemu-w64-setup-20181211.exe)

Put C:\Program Files\qemu on your PATH, and run the below to check it's working (which will list out the CPUs the AArch64 emulator can emulate):

qemu-system-aarch64 -M virt -cpu help
{username:"aiden","img":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABzYAAAPUCAIAAABAeEgdAAAAAXNSR0IArs4c6QAAIABJREFUeJzs3Xd0FNUXB/A7M9tbNpX0ShICgdCkN2lSRZoixSAIAqKogEiRpgQpFn4IKCi9iDTpIF16D72mk953N5ts//2xcQkhJIugwfD9HA5nyntv7pvdA9mbt3cYi8VCL5N7MQnBQX6VHQUAAAAAAAAAAABUWSqVyv7G7D8XBwAAAAAAAAAAAACUDylaAAAAAAAAAAAAgErDq+wAAAAA7JWRlaNWF5jN5soOBAAAAF44LMvK5VI3F6fKDgQAAOCpIUULAAD/DRlZOSaT2dPdleW4yo4FAAAAXjhmkylPpcnIykGWFgAA/nNQ6AAAAP4b1OoCpUKG/CwAAACUieU4pUKmVhdUdiAAAABPDSlaAAD4bzCbzcjPAgAAQDlYjkNBJAAAeJFFRkaWeRwpWgAAAAAAAAAAAIB/ljU/W2aWFilaAAAAAAAAAAAAgH9Qyczs41lapGgBAAAAAAAAAAAA/imP52RLHeH9i8EAAAAAAAAAAAAAvFxWrVpVfgOsogUAAAAAAAAAAACoNEjRAgAAAAAAAAAAAFQapGgBAAAAAAAAAAAAKg1StAAAAAAAAAAAAACVBo8LAwAAAAAAAChtzbpfDx059vjxV1u3jBzUv8wuO3bt3fr7jkkTxoYEV3/87NxvFty+c3f50kXPK8LCwsI16369cu0GyzKfjhkd4O/3vEYuU2LSg0uXoxs2qO/t5fkijAMAUJUgRQsAAFXH7cT8Txaeu52gMlss66a2bFG7WmVHBAAAAP9Vrq4ugYEBRKRWqzMzs1xdXeRyufV4ZYdW7Lctv586c87J0dHZ2clsNv/Tl0tMTPp9x24Pd/dnTdE+p3EAAKoSpGgBAKDqmL32mqezZNPMNiIBj2OZyg4HAAAA/sM6dWzfqWN7Ijpx8vTPK1Z369Kpd

Callback là gì

Hiểu đơn giản thì callback là một function (A) được truyền vào 1 function khác (B) thông qua các tham số của B. Lúc này function B sẽ gọi đến function A để thực hiện 1 chức năng gì đó hoặc là khi function B hoàn thành chức năng của mình.

Ví dụ đơn giản:

function dihoc(callback){
// Làm các công việc cần thiết khi đi học. Và cuối cùng kết quả nhận được là thu lại kiến thức.
callback('Kiến thức');
}
@nghminh163
nghminh163 / resetteamviewer.py
Created October 22, 2018 11:46
Reset ID Teamviewer
#!/usr/bin/env python
#coding:utf-8
import sys
import os
import glob
import platform
import re
import random
import string