Skip to content

Instantly share code, notes, and snippets.

View JarLob's full-sized avatar

Jaroslav Lobačevski JarLob

View GitHub Profile
@JarLob
JarLob / solver.py
Created June 10, 2019 09:05 — forked from karanlyons/solver.py
Why PRNGs are not the same as CSPRNGs
import z3
def sym_xoroshiro128plus(solver, sym_s0, sym_s1, mask, result):
s0 = sym_s0
s1 = sym_s1
sym_r = (sym_s0 + sym_s1)
condition = z3.Bool('c0x%0.16x' % result)
solver.add(z3.Implies(condition, (sym_r & mask) == result & mask))
@JarLob
JarLob / pwn.js
Created December 26, 2019 10:03 — forked from saelo/pwn.js
Exploit for the "roll a d8" challenge of PlaidCTF 2018
//
// Quick and dirty exploit for the "roll a d8" challenge of PlaidCTF 2018.
// N-day exploit for https://chromium.googlesource.com/v8/v8/+/b5da57a06de8791693c248b7aafc734861a3785d
//
// Scroll down do "BEGIN EXPLOIT" to skip the utility functions.
//
// Copyright (c) 2018 Samuel Groß
//
//
@JarLob
JarLob / hook_location_frida.js
Created March 14, 2020 09:04 — forked from Areizen/hook_location_frida.js
Frida script to fake location on Android
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)
@JarLob
JarLob / TestAssembly.cs
Created March 14, 2020 16:33 — forked from Arno0x/TestAssembly.cs
This code shows how to load a CLR in an unmanaged process, then load an assembly from memory (not from a file) and execute a method
/*
================================ Compile as a .Net DLL ==============================
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /target:library /out:TestAssembly.dll TestAssembly.cs
*/
using System.Windows.Forms;
namespace TestNamespace
@JarLob
JarLob / get_call_flows_from_exports.py
Created March 14, 2020 19:51 — forked from ophirharpaz/get_call_flows_from_exports.py
The script generates and prints a graph of all function-call flows that start in exported functions and end in the function being pointed at in IDA. This functionality is useful when you need to trigger a function in a DLL and wish to know which exported function leads to it.
"""
The script generates and prints a graph of all function-call flows that start in exported functions and end
in the function being pointed at in IDA.
This functionality is useful when you need to trigger a function in a DLL and wish to know which exported function
leads to it.
"""
import idaapi
import idautils
import idc
@JarLob
JarLob / MSVC_AST_GEN.cmd
Created March 17, 2020 21:39 — forked from K2/MSVC_AST_GEN.cmd
MSVC AST generation
REM AST generation from MSVC
cl /analyze /d1Aprintast %1 > %1.ast
@JarLob
JarLob / machineKeyFinder.aspx
Created March 19, 2020 11:04 — forked from irsdl/machineKeyFinder.aspx
To find validation and decryption keys when AutoGenerate has been used in Machine Key settings
<%@ Page Language="C#" %>
<%
// Read https://soroush.secproject.com/blog/2019/05/danger-of-stealing-auto-generated-net-machine-keys/
Response.Write("<br/><hr/>");
byte[] autoGenKeyV4 = (byte[]) Microsoft.Win32.Registry.GetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\ASP.NET\\4.0.30319.0\\", "AutoGenKeyV4", new byte[]{});
if(autoGenKeyV4!=null)
Response.Write("HKCU\\Software\\Microsoft\\ASP.NET\\4.0.30319.0\\AutoGenKeyV4: "+BitConverter.ToString(autoGenKeyV4).Replace("-", string.Empty));
Response.Write("<br/>");
byte[] autoGenKey = (byte[]) Microsoft.Win32.Registry.GetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\ASP.NET\\2.0.50727.0\\", "AutoGenKey", new byte[]{});
if(autoGenKey!=null)
ActivateActCtxWorker
AddLocalAlternateComputerNameA
AddLocalAlternateComputerNameW
AddRefActCtxWorker
AdjustCalendarDate
AppXGetOSMaxVersionTested
BaseCheckAppcompatCache
BaseCheckAppcompatCacheEx
BaseCheckAppcompatCacheExWorker
BaseCheckAppcompatCacheWorker
@JarLob
JarLob / bunny.js
Created March 22, 2020 08:24 — forked from luruke/bunny.js
draw bunny on terminal
const drawille = require('drawille')
const bunny = require('bunny')
const glmatrix = require('gl-matrix')
const width = 200
const height = 200
const canvas = new drawille(width, height)
const mat4 = glmatrix.mat4
const vec3 = glmatrix.vec3
let points = []