Skip to content

Instantly share code, notes, and snippets.

View genbtc's full-sized avatar

genBTC genbtc

  • NJ, USA
View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active April 25, 2024 23:45
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@erikw
erikw / znp
Last active March 2, 2024 17:43
znp: Wrap shell command in ZFS pre-post snapshots and log outputs.
#!/usr/bin/env bash
# Runs a command wrapped in ZFS pre-post snapshots. The whole data pool is recursively snapshotted.
# Analogous to my snp script for BTRFS: https://gist.github.com/erikw/5229436
# Usage: $ znp <commands>
# e.g.: $ znp pgk upgrade
# e.g.: $ znp portmaster -aG
# e.g.: $ znp freebsd-upgrade install
zfs_pool=zroot
@tosyu
tosyu / image_mount
Last active July 7, 2023 15:40
image mounting
#!/bin/sh
WHICH=/bin/which
REALPATH=$($WHICH realpath)
SED=$($WHICH sed)
GPG=$($WHICH gpg)
MV=$($WHICH mv)
LN=$($WHICH ln)
LOSETUP=$($WHICH losetup)
SUDO=$($WHICH sudo)
MOUNT=$($WHICH mount)
@riyazwalikar
riyazwalikar / findelevate.py
Last active April 17, 2022 12:34
Python script to find all Windows binaries with autoElevate=True (uses sigcheck obviously)
# Usage: findelevate.py C:\Windows\System32\
# Needs sigcheck.exe in path [https://technet.microsoft.com/en-us/sysinternals/bb897441.aspx]
import sys
import os
import glob
import subprocess
if len(sys.argv) < 2:
print "Usage: findelevate.py <PATH>"
#!/bin/bash
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
done
@Lovesan
Lovesan / fftutorial.cs
Created February 3, 2017 23:32
FFmpeg & SDL2 - play audio & video
#define __STDC_CONSTANT_MACROS
#include <stdint.h>
#include <inttypes.h>
#include <windows.h>
#include <stdio.h>
extern "C"
{
#include <libavfilter/avfilter.h>
@njsmith
njsmith / ucrt-csv.py
Last active April 6, 2024 18:04
Information on linking to the new Windows UCRT
import sys
import subprocess
import csv
def describe_ucrt_lib(platform):
lib_path = "windows-10-sdk/Lib/10.0.10240.0/ucrt/{}/ucrt.lib".format(platform)
output = subprocess.check_output(["nm", lib_path])
output = output.decode("utf-8")
# Output (x86 32-bit) looks like:
@nissuk
nissuk / get-exif.ps1
Created November 12, 2011 14:33
PowerShell: PowerShell Image module Get-Exifの改変
<#
PowerShell Image module(http://archive.msdn.microsoft.com/PSImage/)のget-exif.ps1を改変して下記のプロパティを追加します。
- Latitude (緯度。度表記)
- Longitude (経度。度表記)
- Name (ファイル名)
使用例
dir "*.jpg" | get-exif | select name, latitude, longitude | export-csv out.csv
ライセンス
@pyropeter
pyropeter / LICENSE
Last active December 2, 2016 12:25
python module de/encoding bencoded data
Copyright (c) 2015, PyroPeter <$nickname@$nickname.eu>
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.