Skip to content

Instantly share code, notes, and snippets.

View Wind010's full-sized avatar

Jeff Tong Wind010

View GitHub Profile
@Wind010
Wind010 / find_unused_dependencies.sh
Created February 9, 2024 21:55
Compare actually installed vs what the requirements.txt or setup.py references
#!/bin/bash
# Work in progerss. Currently the diff is not accurate.
# TODO: Take in setup.py and requirements_*.txt.
# Exit immediately if a command exits with a non-zero status
set -e
# Uncomment for debugging
#set -x
@Wind010
Wind010 / update_packages.sh
Last active February 9, 2024 22:03
Script to pull the existing packages from a setup.py, pip install latest versions of those packages, pip freeze those versions and repopulate the setup.py
#!/bin/bash
# Work in Progress
# The pip freeze will bring in a lot more packages explicitly than expected.
# Still need to populate/paste into setup.py correctly.
SETUP_PY_PATH="./setup.py"
# Extract install_requires values without versioning
INSTALL_REQUIRES=$(grep -oP '"[^"]+"' $SETUP_PY_PATH \
| grep -oP '"[^"]+"' \
@Wind010
Wind010 / dep_to_setup.py
Created February 9, 2024 03:00
Regenerate the setup.py with dependencies found in project. Useful if requirements.txt is missing
#!/bin/bash
# Requires existing template setup.py
SETUP_PY_PATH="./setup.py"
# Requires pipdeptree
pip install pipdeptree
# Generate a dependency tree for your project
pipdeptree --warn silence --warn silence -r --warn silence --warn silence --warn silence > dependencies.txt
@Wind010
Wind010 / m2_macbook_air_benchmark.txt
Last active January 28, 2024 05:11
Hashcat benchmark for M2 MacBook Air 15
hashcat --benchmark
hashcat (v6.2.6) starting in benchmark mode
Benchmarking uses hand-optimized kernel code by default.
You can use it in your cracking session by setting the -O option.
Note: Using optimized kernel code limits the maximum supported password length.
To disable the optimized kernel code in benchmark mode, use the -w option.
* Device #2: Apple's OpenCL drivers (GPU) are known to be unreliable.
You have been warned.
@Wind010
Wind010 / azure-pipelines.yaml
Last active January 12, 2024 01:48
Sample Azure Devops pipeline for .NET8+ (no pack)
#name: $(TeamProject)--$(Build.SourceBranchName)-$(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
name: SomeProject
trigger: none
pr:
branches:
include:
- "*"
@Wind010
Wind010 / brute_force_transformation.py
Last active January 15, 2024 04:04
Transformation PicoCTF reverse engineering challenge
enc_dec = [28777, 25455, 17236, 18043, 12598, 24418, 26996, 29535, 26990, 29556, 13108, 25695, 28518, 24376, 24421, 14128, 13154, 13368, 13949]
# Up to 0 to 126 because of pairs of characters.
for val in enc_dec:
for i in range(127):
if 0 <= (val - (i << 8)) <= 126:
print(chr(i) + chr(val - (i * 256)), end='', flush=True)
# OR
@Wind010
Wind010 / adv_edit_to_local_setttings.ps1
Last active December 23, 2023 01:28
Script to convert Advanced Edit format of WebApp/Azure Function to local.settings.json format.
# This works if your function app is functional :)
# func azure functionapp fetch-app-settings <function app name>
# If it isn't, use this.
# {
# "IsEncrypted": false,
# "Values": {
# "AzureWebJobsStorage": "UseDevelopmentStorage=true",
@Wind010
Wind010 / hashcat.ipynb
Created November 26, 2023 22:09
Databricks Notebook for Hashcat
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Wind010
Wind010 / flag_decoder.py
Last active November 26, 2023 00:36
Hack-the-Box: Racecar PWN challenge flag decoder
#!/usr/bin/env python3
import re
import sys
def main(payload=None):
if payload is None:
payload = input("Enter exfiltrated memory addresses: ")
raw_flag = payload.split()
@Wind010
Wind010 / hc_benchmark_4080.txt
Last active October 12, 2023 21:16
Hashcat benchmark - Zotac 4080 FTW; Ryzen 3700X; MSI 570X Gaming Plus - 32GB DDR4 hc_benchmark.txt
Hashcat Version: 6.2.6
NVIDIA DRIVER Version: 537.58
CUDA Version 12.2.140
GPU: ZOTAC 4080
CPU: Ryzen 3700X
MOBO: MSI 570X Gaming Plus
RAM: 32GB DDR4