Skip to content

Instantly share code, notes, and snippets.

@FlyTechVideos
FlyTechVideos / censor_oracle.py
Last active February 13, 2024 16:46
A not entirely inaccurate oracle for whether or not Windows XP will recognize a given string as being unicode (ref. IsTextUnicode).
#!/usr/bin/env python3
import sys
# Please excuse the awfully formatted code, I did not take the time to make it look nice.
def main():
print()
if len(sys.argv) != 2:
print(f' Usage: {sys.argv[0]}')
@FlyTechVideos
FlyTechVideos / IsTextUnicode.cpp
Created June 26, 2023 22:40
Calls IsTextUnicode from the WinAPI to figure out whether or not a text is recognized as Unicode. Meant for use in Windows XP.
#include "stdafx.h"
#include <windows.h>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
cout << "\r\n";
if (argc != 2) {
@FlyTechVideos
FlyTechVideos / generator.sh
Created January 13, 2023 18:37
For use with WSL. Generates all reserved Windows file names (files and folders), zips them, then deletes the intermediary files.
#!/bin/bash
mkdir illegal_files # no -p flag, we don't want to overwrite/delete actual data
cd illegal_files
mkdir -p folders
mkdir -p files
mkdir -p files_with_extension
ILLEGAL_NAMES="CON PRN AUX NUL \
@FlyTechVideos
FlyTechVideos / generator.sh
Created November 20, 2022 19:18
Bash script for generating reserved Windows file names and putting them in a ZIP file.
#!/bin/bash
mkdir illegal_files # no -p flag, we don't want to overwrite/delete actual data
cd illegal_files
mkdir -p folders
mkdir -p files
mkdir -p files_with_extension
ILLEGAL_NAMES="CON PRN AUX NUL \
@FlyTechVideos
FlyTechVideos / claimer.py
Last active March 11, 2024 18:46
Sets all DWORD/QWORD registry values for which the user has permission to edit to 0.
import winreg
VALUE_TO_WRITE = 0x69
root_dict = {
'HKEY_CLASSES_ROOT': winreg.HKEY_CLASSES_ROOT,
'HKEY_CURRENT_USER': winreg.HKEY_CURRENT_USER,
'HKEY_LOCAL_MACHINE': winreg.HKEY_LOCAL_MACHINE,
'HKEY_USERS': winreg.HKEY_USERS,
Set objFS = CreateObject("Scripting.FileSystemObject")
outFile = "clip.txt"
oldClip = ""
Do
newClip = ClipBoard(Null)
If newClip <> oldClip Then
Set objFile = objFS.OpenTextFile(outFile, 8, True)
objFile.Write "############" & vbCrLf & ClipBoard(Null) & vbCrLf
objFile.Close
@FlyTechVideos
FlyTechVideos / server.py
Last active January 3, 2024 14:02
Simple web server which logs accesses and data [https://www.youtube.com/watch?v=TB3OEG0bKwc]
#!/usr/bin/env python3
from flask import Flask, request, send_from_directory
from datetime import datetime
from user_agents import parse
app = Flask(__name__)
def censor_ip(ip):