Skip to content

Instantly share code, notes, and snippets.

View jaybosamiya's full-sized avatar
🦊

Jay Bosamiya jaybosamiya

🦊
View GitHub Profile
# Drop this into ~/.local/share/nautilus-python/extensions
# (creating the directory if needed) and restart nautilus.
#
# Provides a new option to "Download from Clipboard" in the
# context menu of folders, which uses `wget` to download
# whatever is in the clipboard.
import gi
from gi import require_version
require_version('Gtk', '3.0')
// Krautflare Solution
// Author: f0xtr0t
let early_object_only_for_addresses = [1,2,3,4,5.1];
// Server/Local differences
const SERVER = true;
const FPUTC_OFFSET = SERVER ? 0x877e0n : 0x6ef10n;
const PRINTF_OFFSET = SERVER ? 0x64e80n : 0x4f190n;
@jaybosamiya
jaybosamiya / Makefile-for-codeblue.mk
Created November 5, 2018 20:49
CODE BLUE CTF '18
# Makefile to simplify Docker stuff for CODE BLUE CTF
# Author: Jay Bosamiya (f0xtr0t)
PROBLEM_NAME=todo
TEAM_USN=todo
TEAM_PASS=todo
TEST_FLAG="testing{flagtest}"
SUBMIT_TO_PROBLEM_NAME=$(PROBLEM_NAME)
all:
@jaybosamiya
jaybosamiya / pdf-un-poster4.sh
Created April 15, 2018 04:55
Split a 2x2 "poster" pdf
#!/bin/bash
function usage() {
echo "Usage:"
echo " pdf-un-poster4 {in.pdf} [out.pdf]"
}
if [ -z "$1" ]; then
usage
exit 1
@jaybosamiya
jaybosamiya / hacky-interp.py
Created April 8, 2018 04:12
Hacky interpreter for a subset of brainfuck
#######################################################
# A hacky interpreter for the ><+-[] language
# 2018 (c) Jay Bosamiya
#######################################################
#######################################################
# Update "program" and "cells" to whatever you chose
#######################################################
program = "INPUT PROGRAM HERE" # For example, try "+>+"
@jaybosamiya
jaybosamiya / fstar-profile-query
Last active June 19, 2018 21:20
A quick script to point out the parts that are slowing down the proof; Find updated script at https://github.com/jaybosamiya/dotfiles/blob/master/random-localbin-scripts/.local/bin/fstar-profile-queries
#! /bin/bash
# Updated script at https://github.com/jaybosamiya/dotfiles/blob/master/random-localbin-scripts/.local/bin/fstar-profile-queries
set -o pipefail
function usage() {
echo "Usage:" 1>&2
echo " $0 {filename.fst} [queryname]" 1>&2
echo "" 1>&2
echo "Useful Environment Variables:" 1>&2
@jaybosamiya
jaybosamiya / fstar-indent.el
Last active March 22, 2018 00:25
[WIP] Provide the ability for Emacs to indent F-Star Code
(require 'subr-x)
(require 'fstar-mode)
(defun fstar-indent-file-to-string (file)
(string-trim
(with-temp-buffer (insert-file-contents file)
(buffer-string))))
(defun fstar-indent-string (str)
(let*
@jaybosamiya
jaybosamiya / attack-repeating-key-xor.py
Created October 14, 2017 03:57
Attack repeating key xor
def attack_repeating_key_xor(ciphertext, keysize=None, score=None):
from itertools import cycle
def xor(enc, k):
return ''.join(chr(ord(a) ^ k) for a in enc)
def score_english(string):
freq = dict()
freq['a'] = 834
freq['b'] = 154
@jaybosamiya
jaybosamiya / python-emacs.md
Last active April 21, 2018 21:02
My [outdated] Python configuration for Emacs

Python Autocompletion

Do the following:

M-x package-install RET jedi
M-x jedi:install-server

and then add the following lines to ~/.emacs:

@jaybosamiya
jaybosamiya / IO_Netgarage_Level11.md
Last active October 2, 2019 16:39
IO Netgarage Level11 Solution

IO Netgarage Level 11

Whoo! This was a fun challenge with loads to learn. :)

Understanding the given code

The given code level11.c checks whether the two inputs (as argv[1] and argv[2]) both MD5 hash to the same value or not. If they do, it uses both inputs as brainfuck code, and executes them. Then it checks if the outputs differ. Upon differing outputs, they are checked against the strings "io.sts Rules!" and "io.sts Sucks!". If prog1's output is the first, and prog2's output is the second, we are granted shell.

Understanding the vulnerability