Skip to content

Instantly share code, notes, and snippets.

@FrankSpierings
FrankSpierings / hookalloverloads.js
Created October 14, 2017 18:57
Hook all overloads - Java/Android - Frida
function getGenericInterceptor(className, func, parameters) {
args = []
for (i = 0; i < parameters.length; i++) {
args.push('arg_' + i)
}
var script = "result = this.__FUNCNAME__(__SEPARATED_ARG_NAMES__);\nlogmessage = '__CLASSNAME__.__FUNCNAME__(' + __SEPARATED_ARG_NAMES__ + ') => ' + result;\nconsole.log(logmessage);\nreturn result;"
script = script.replace(/__FUNCNAME__/g, func);
script = script.replace(/__SEPARATED_ARG_NAMES__/g, args.join(', '));
script = script.replace(/__CLASSNAME__/g, className);
@ChiChou
ChiChou / macho.js
Last active April 13, 2023 04:46
Frida in-memory Mach-O parser
// to speed up, I removed all data validation
function MemoryBuffer(address, size) {
this.base = address
if (!size) {
// const range = Process.findRangeByAddress(address)
// if (!range)
// throw new Error('invalid address: ' + address)
@mackwage
mackwage / windows_hardening.cmd
Last active June 16, 2024 19:15
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Obligatory 'views are my own'. :)
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
:
@authenticationfailure
authenticationfailure / FridaEnableRemoteDebuggingAndroidWebViews.js
Created July 14, 2018 10:24
Enable Remote Debugging of Android WebViews at Runtime with Frida
/*
Enable remote debugging of Android WebViews at Runtime using Frida
*/
Java.perform(function() {
Java.choose("android.webkit.WebView", {
"onMatch": function(o) {
try {
// Use a Runnable to invoke the setWebContentsDebuggingEnabled
// method in the same thread as the WebView
var Runnable = Java.use('java.lang.Runnable');
@nullenc0de
nullenc0de / auto_git_query
Last active June 16, 2024 08:30
Automated Github Queries (Can open 29 tabs at a time)
https://github.com/search?q=BROWSER_STACK_ACCESS_KEY= OR BROWSER_STACK_USERNAME= OR browserConnectionEnabled= OR BROWSERSTACK_ACCESS_KEY=&s=indexed&type=Code
https://github.com/search?q=CHROME_CLIENT_SECRET= OR CHROME_EXTENSION_ID= OR CHROME_REFRESH_TOKEN= OR CI_DEPLOY_PASSWORD= OR CI_DEPLOY_USER=&s=indexed&type=Code
https://github.com/search?q=CLOUDAMQP_URL= OR CLOUDANT_APPLIANCE_DATABASE= OR CLOUDANT_ARCHIVED_DATABASE= OR CLOUDANT_AUDITED_DATABASE=&s=indexed&type=Code
https://github.com/search?q=CLOUDANT_ORDER_DATABASE= OR CLOUDANT_PARSED_DATABASE= OR CLOUDANT_PASSWORD= OR CLOUDANT_PROCESSED_DATABASE=&s=indexed&type=Code
https://github.com/search?q=CONTENTFUL_PHP_MANAGEMENT_TEST_TOKEN= OR CONTENTFUL_TEST_ORG_CMA_TOKEN= OR CONTENTFUL_V2_ACCESS_TOKEN=&s=indexed&type=Code
https://github.com/search?q=-DSELION_BROWSER_RUN_HEADLESS= OR -DSELION_DOWNLOAD_DEPENDENCIES= OR -DSELION_SELENIUM_RUN_LOCALLY=&s=indexed&type=Code
https://github.com/search?q=ELASTICSEARCH_PASSWORD= OR ELASTICSEARCH_USERNAME= OR EMAIL_NOTIFI
@nullenc0de
nullenc0de / auto_git_query_fav
Created August 29, 2019 00:02
Auto_git Favs
https://github.com/search?q=\?AccessKeyId= OR _02ddd67d5586_key= OR 0HB_CODESIGN_GPG_PASS= OR 0HB_CODESIGN_KEY_PASS=&s=indexed&type=Code
https://github.com/search?q=0VIRUSTOTAL_APIKEY= OR ACCESS KEY ID = OR ACCESS_KEY_ID= OR ACCESS_KEY_SECRET= OR ACCESS_KEY=&s=indexed&type=Code
https://github.com/search?q=ACCESS_SECRET= OR ACCESSKEY= OR ACCESSKEYID= OR ADZERK_API_KEY= OR ALGOLIA_ADMIN_KEY_1=&s=indexed&type=Code
https://github.com/search?q=ALGOLIA_ADMIN_KEY_2= OR ALGOLIA_ADMIN_KEY_MCM= OR ALGOLIA_API_KEY_MCM= OR ALGOLIA_API_KEY_SEARCH=&s=indexed&type=Code
https://github.com/search?q=ALGOLIA_API_KEY= OR ALGOLIA_SEARCH_API_KEY= OR ALGOLIA_SEARCH_KEY_1= OR ALGOLIA_SEARCH_KEY=&s=indexed&type=Code
https://github.com/search?q=ALIAS_PASS= OR ALICLOUD_ACCESS_KEY= OR ALICLOUD_SECRET_KEY= OR AMAZON_SECRET_ACCESS_KEY=&s=indexed&type=Code
https://github.com/search?q=ANSIBLE_VAULT_PASSWORD= OR aos_key= OR API_KEY_MCM= OR API_KEY_SECRET= OR API_KEY_SID= OR API_KEY=&s=indexed&type=Code
https://github.com/search?q=API_SECRE
@zzzzfeng
zzzzfeng / frida-android-tricks.js
Last active June 15, 2023 11:26
frida android tricks
frida -U --no-pause -l xx.js -f pkgname (or -p pid)
# PrintStack 输出当前调用堆栈
var Throwable = null;
Java.perform(function () {
Throwable = Java.use("java.lang.Throwable");
});
function PrintStack() {
var stackElements = Throwable.$new().getStackTrace();
@the-xentropy
the-xentropy / gist:05ab1c5efd7ae7651b14e0fb85c6312c
Created January 6, 2020 19:19
Use wfuzz or ffuf to enumerate s3
Ffuf (faster):
ffuf -u "https://s3.REGION.amazonaws.com/COMPANYDELIMITERENVIRONMENT" -w "aws-regions.txt:REGION" -w "company.txt:COMPANY" -w "delimiters.txt:DELIMITER" -w "/usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt:ENVIRONMENT" -mc 200 -v
Wfuzz:
wfuzz -u "https://s3.FUZZ.amazonaws.com/FUZ2ZFUZ3ZFUZ4Z" -w aws-regions.txt -w company.txt -w delimiters.txt -w "/usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt" --sc 200 -v -t 50
The files:
const simulated_latitude = 48.8534
const simulated_longitude = 2.3488
Java.perform(function(){
const Location = Java.use('android.location.Location')
var location = Location.$new("gps")
location.setLatitude(simulated_latitude)
location.setLongitude(simulated_longitude)
@FrankSpierings
FrankSpierings / openssl-frida.js
Last active December 7, 2023 10:58
Some OpenSSL hooks in Frida - Work in progress....
const utils = {
colors: {
red: function(string) {
return '\x1b[31m' + string + '\x1b[0m';
},
green: function(string) {
return '\x1b[32m' + string + '\x1b[0m';
},