Skip to content

Instantly share code, notes, and snippets.

View LevitatingBusinessMan's full-sized avatar
🕴️
Levitating

Rein Fernhout LevitatingBusinessMan

🕴️
Levitating
View GitHub Profile
@LevitatingBusinessMan
LevitatingBusinessMan / brute.rb
Last active July 8, 2022 11:19
Bruteforce exploit demo
#!/usr/bin/ruby
# Usage: ./brute.rb hostname port wordlist
HOST = ARGV[0]
PORT = ARGV[1]
WORDLIST = ARGV[2] || "/home/rein/wordlists/1000-passwords.txt"
words = File.read(WORDLIST).split("\n")
ERRORSTRING = "Wrong!"
@LevitatingBusinessMan
LevitatingBusinessMan / what_window.sh
Created June 9, 2022 20:55
Find the process name of a window quickly
#!/bin/bash
xwininfo -tree -root > /tmp/win_first
read -p 'Open/Close window and press enter '
xwininfo -tree -root > /tmp/win_second
diff --color=always /tmp/win_first /tmp/win_second
#!/usr/bin/env bash
# makepkg wrapper that calls customizepkg first
set -euf -o pipefail +o history
CURRENT_DIR_PATH="$(readlink -f "$(realpath -e "$(pwd)")")"
GLOBAL_CONF_DIR_PATH='/etc/customizepkg.d'
USER_CONF_DIR_PATH="${HOME}/.customizepkg"
pkgbuild_path="${CURRENT_DIR_PATH}/PKGBUILD"
pkgbuild_copy_path="${pkgbuild_path}.original"
@LevitatingBusinessMan
LevitatingBusinessMan / r2-iaito-git.patch
Created March 4, 2022 19:40
Patch file for the r2-iaito-git aur package
diff --git a/PKGBUILD b/PKGBUILD
index 28e0f9a..f6d7e5e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -17,7 +17,7 @@
pkgname=r2-iaito-git
epoch=1
-pkgver=5.2.2.r2.g54dc54d5
+pkgver=5.5.0.beta.r16.g24a2eba2
@LevitatingBusinessMan
LevitatingBusinessMan / re_stappenplan.md
Last active February 28, 2022 16:41
Reverse Engineering stappenplan

Stappenplan reverse engineering

Wat voor binary is het?

Eerst kijken wat voor binary het is. Is het static of linked? Is het ELF of PE?

$ file <binary>

Als de binary PE is kunnen we misschien beter verder in FlareVM.
Als de binary ELF is kunnen we Kali gebruiken.

@LevitatingBusinessMan
LevitatingBusinessMan / gef_prompt.patch
Created February 22, 2022 18:46
Fixes the prompt from gef when using TUI.
--- /tmp/gef.py.bckp 2022-02-22 19:37:04.589652454 +0100
+++ /bedrock/strata/arch/usr/share/gef/gef.py 2022-02-22 19:42:11.126081267 +0100
@@ -151,7 +151,8 @@
CROSS = "\u2718 "
TICK = "\u2713 "
BP_GLYPH = "\u25cf"
-GEF_PROMPT = "gef\u27a4 "
+#GEF_PROMPT = "gef\u27a4 "
+GEF_PROMPT = "gef> "
GEF_PROMPT_ON = f"\001\033[1;32m\002{GEF_PROMPT}\001\033[0m\002"
@LevitatingBusinessMan
LevitatingBusinessMan / osc_mpd.rb
Last active October 21, 2022 15:18
Control MPD via OSC
#!/usr/bin/ruby
puts <<-"EOF"
____ _____ _____ __ __ __ _____ _____
/ __ \\ / ____|/ ____| \\ \\ | \\/ | __ \\| __ \\
| | | | (___ | | _____\\ \\ | \\ / | |__) | | | |
| | | |\\___ \\| | |______> > | |\\/| | ___/| | | |
| |__| |____) | |____ / / | | | | | | |__| |
\\____/|_____/ \\_____| /_/ |_| |_|_| |_____/
@LevitatingBusinessMan
LevitatingBusinessMan / lightshot-orc.rb
Created December 4, 2021 15:22
A piece of code for running OCR on random lightshot screenshots. Made while on vacation on my boat a while back.
require 'net/https'
require 'open-uri'
require 'fileutils'
require 'rtesseract'
require 'leveldb'
FileUtils.mkdir_p "images"
$db = LevelDB::DB.new "data.db"
diff --git a/init.c b/init.c
index 8b32a1a..fd17692 100644
--- a/init.c
+++ b/init.c
@@ -935,7 +935,7 @@ static int cutorch_isManagedPtr(lua_State *L)
lua_pushboolean(L, 0);
} else {
THCudaCheck(res);
- lua_pushboolean(L, attributes.isManaged);
+ lua_pushboolean(L, attributes.type == cudaMemoryTypeManaged);
@LevitatingBusinessMan
LevitatingBusinessMan / nlruby.h
Created September 16, 2021 12:52
Piglatin in dutch ruby, compile via a C preprocessor: "gcc -xc -E piglatin.rb 2> /dev/null"
#define is =
#define plus +
#define min -
#define juist true
#define onjuist false
#define einde end
#define krijgd gets
#define plaatsd puts
#define hak chomp
#define als if