Uploaded December 2024 | Updated November 2026, 3 hours ago
Today I'm given input with a list of pairs of pages where the first page must be before the second, and then a list of numbers referred to as jobs. In part one, I'll check each job to see if it is valid, and if so, add up the middle number. In part 2, I have to sort the invalid jobs to fix them, and then sum those middle numbers. I'll use a custom sort function here.
2024 AOC repo: gitlab.com/0xdf/aoc2024
2024 AOC Intro vide: youtube.com/watch?v=4XKZZrhhiQE
VSCode Debug video: youtube.com/watch?v=cNhtk2Ob4B8
☕ Buy Me A Coffee: buymeacoffee.com/0xdf
[00:00] Part1 introduction
[01:15] Genday changes
[01:47] Setup / data overview
[02:24] Processing input
[05:05] Creating map for invalid orders
[07:43] Function to check job
[10:00] Fixing bugs
[12:34] Solving part 1
[12:57] Part 2 challenge
[13:14] Part 1 refactor
[13:57] Structure for part 2
[14:34] Custom sorting function
[16:27] Solving part 2
[16:47] Conclusion
[17:06] Revisit day 4
#adventofcode #python
Today I'm given input with a list of pairs of pages where the first page must be before the second, and then a list of numbers referred to as jobs. In part one, I'll check each job to see if it is valid, and if so, add up the middle number. In part 2, I have to sort the invalid jobs to fix them, and then sum those middle numbers. I'll use a custom sort function here.
2024 AOC repo: gitlab.com/0xdf/aoc2024
2024 AOC Intro vide: youtube.com/watch?v=4XKZZrhhiQE
VSCode Debug video: youtube.com/watch?v=cNhtk2Ob4B8
☕ Buy Me A Coffee: buymeacoffee.com/0xdf
[00:00] Part1 introduction
[01:15] Genday changes
[01:47] Setup / data overview
[02:24] Processing input
[05:05] Creating map for invalid orders
[07:43] Function to check job
[10:00] Fixing bugs
[12:34] Solving part 1
[12:57] Part 2 challenge
[13:14] Part 1 refactor
[13:57] Structure for part 2
[14:34] Custom sorting function
[16:27] Solving part 2
[16:47] Conclusion
[17:06] Revisit day 4
#adventofcode #python
![Hacking Reportinator [Sans Holiday Hack 2023]
In the Reportinator challenge, Im asked to evaluate findings written by an AI and find ones that are wrong or dont make sense. In this video, Ill look at how the answers are submitted and use the Python httx async library to brute force all possible combinations and find the answer.
Holiday Hack 2023 Solution: https://0xdf.gitlab.io/holidayhack2023/
Holiday Hack 2023 Game: https://2023.holidayhackchallenge.com/
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[00:33] Looking at submit HTTP request
[01:38] Strategy for scripting
[02:25] Setting up async brute force with httpx
[04:18] main outline
[06:17] Testing combinations
[09:00] test_combination function
[11:28] Debugging small issues
[12:38] Getting solution
[13:15] Beautifying output
[14:58] Summary
#adventofcode #python Hacking Reportinator [Sans Holiday Hack 2023]](https://i.ytimg.com/vi/FscEgomjtzc/mqdefault.jpg)
![Python UV for Hackers
In 2025, uv is the way to go for Python tool install and script running. Ill walk through how to install it, how to install packages replacing pipx, how to change Python versions, and how to run and kind of install stand-alone scripts. At the end, Ill show where uv is holding these virtual environments.
uv: https://github.com/astral-sh/uv
uv Scripts: https://thisdavej.com/share-python-scripts-like-a-pro-uv-and-pep-723-for-easy-deployment
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[01:30] uv background
[02:40] Installing a tool (pipx)
[04:13] Python versions
[05:50] Running a script with venv
[07:37] Running a script with uv
[09:07] Fake installing a script
[11:30] uv venvs
[12:23] Conclusion
#python #uv Python UV for Hackers](https://i.ytimg.com/vi/G36QXtBXKBQ/mqdefault.jpg)
![Day 25 - Clock Signal [Revival of Code 2023 - Advent of Code 2016]
Python Discord is doing an event called Revival of Code, where we work through the 2016 Advent of Code, one challenge every two days. The day 25 challenge, Clock Signal, brings back the assembunny computer again, this time with an output command. Ill solve this challenge two ways - first by analysis of the instructions itself, and then with a brute force in Python.
Day 23: https://www.youtube.com/watch?v=O-a0pQc7pxw
Day 12: https://www.youtube.com/watch?v=Z-qDyL-vyNA
Repo for Advent of Code 2016 Solutions: https://gitlab.com/0xdf/aoc2016
Intro video for this event: https://www.youtube.com/watch?v=qEPpsS0StQI
Configuring VSCode to debug PyTest: https://www.youtube.com/watch?v=zL2YTdIj3R8
Real Python post with templates: https://realpython.com/python-advent-of-code/
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[00:16] Challenge part 1
[01:09] genday
[01:36] Analysis of assembunny
[13:50] Solving from analysis
[14:48] Getting computer from day 23
[15:22] Adding out instruction
[17:18] Setting up solve to find solution
[18:47] Adding pretty print status
[19:19] Fixing typos
[19:35] Solving
[19:54] Solving part 2, conclusion
#ctf #adventofcode #revivalofcode #python Day 25 - Clock Signal [Revival of Code 2023 - Advent of Code 2016]](https://i.ytimg.com/vi/G6o6wI_K3U0/mqdefault.jpg)
![Reading 700 QRs with Python [Quilt - Hacky Easter 2023]
Quilt is a challenge presented as a 25 by 28 grid of QRcodes. Ill write a short Python script to read these, and then show using a tool called zbarimg to solve it for me.
Hacky Easter: https://23.hackyeaster.com
PIL: https://pillow.readthedocs.io/en/stable/
pyzbar: https://github.com/NaturalHistoryMuseum/pyzbar/
zbarimg: https://manpages.ubuntu.com/manpages/xenial/man1/zbarimg.1.html
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[00:47] Challenge review
[01:25] Creating Python script
[02:50] Testing image read, size
[05:35] Troubleshooting exceptions
[05:55] pyzbar output
[07:19] Looping over all images to solve
[08:51] pyzbar
#ctf #HackyEaster Reading 700 QRs with Python [Quilt - Hacky Easter 2023]](https://i.ytimg.com/vi/GDINE2PKfok/mqdefault.jpg)
![Day 17: Clumsy Crucible [AOC2023 Python]
For Advent of Code 2023 Day 17, I get a grid of values showing the heat gained moving through each space. Ill have to traverse from the top left to the bottom right gaining as little heat as possible. In part one, I can only go straight 3 times before I have to turn. In part two, I have to go straight at least 4 times, but not more than 10. Ill use some Dijkstra-like logic with a heapq to move through the grid in order of lowest heat total.
Code 2023 AOC: https://gitlab.com/0xdf/aoc2023
Challenge Link: https://adventofcode.com/2023/day/10
heapq: https://docs.python.org/3/library/heapq.html
Dijkstras Algorithm: https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Part 1 description
[01:15] Strategy preview
[01:31] Input fetch and analysis
[02:13] heapq
[04:24] Initialize grid
[05:57] Process queue
[11:36] Solve part 1
[11:52] Part 2 description
[12:12] Refactoring part 1 to part 2
[13:42] Debugging starting dr/dc error
[15:07] Solving part 2 ex.txt
[15:30] Other example fail
[15:56] Solve part 2
[16:08] Summary
#adventofcode #python Day 17: Clumsy Crucible [AOC2023 Python]](https://i.ytimg.com/vi/HLdEpEn1Q9g/mqdefault.jpg)
![Creating a SSH Honeypot with Python
I recently needed to be able to capture the credentials of someone trying to log into an SSH server I controlled. There are tons of nice honeypot products out there that will do this, but I wanted to understand how to do this in python. This video is a walkthrough of that understanding, starting with a listening socket (and how that works) and building up to a threaded server that logs usernames / passwords.
paramiko: https://www.paramiko.org/
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
My blog: https://0xdf.gitlab.io
[00:00] Introduction
[00:59] Creating listening socket
[03:28] Interacting with listening socket
[05:03] accept and log connection, write to and read from socket
[06:11] Demonstrating basic socket with read / write
[06:51] Using paramiko to setup dummy SSH server
[08:50] Interacting with dummy SSH server
[09:46] Demonstrating issue with server key
[11:15] Giving server a static key
[12:26] Accepting in a while True loop
[13:11] Upgrading accept into a thread
[16:02] Adding SSH component that will handle password login
[17:27] Demoing password logging
[17:42] Wrap up, next steps Creating a SSH Honeypot with Python](https://i.ytimg.com/vi/HO1h57CiF98/mqdefault.jpg)
![Linen Layout [Day 19 - Advent of Code 2024 - Python]
Im given a list of patterns, and then a bigger list of much bigger patterns. For each bigger pattern, I first need to figure out if I can make it from some combination of the smaller patterns. Then I need to figure out how many ways I can make it from the smaller patterns. Ill use recursion and caching to solve this relatively quickly.
2024 AOC repo: https://gitlab.com/0xdf/aoc2024/
2024 AOC Intro video: https://www.youtube.com/watch?v=4XKZZrhhiQE
VSCode Debug video: https://www.youtube.com/watch?v=cNhtk2Ob4B8
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Part1 introduction
[01:26] Setup / data overview
[02:10] Parsing input
[03:00] Recursive function to check pattern
[04:48] Counting valid patterns
[05:18] Solving part 1
[05:41] Part 2 challenge
[06:08] Refactor to get count
[08:08] Fixing silly typo
[09:00] Adding cache
[09:45] Solving part 2
#adventofcode #python Linen Layout [Day 19 - Advent of Code 2024 - Python]](https://i.ytimg.com/vi/I8wXvENY9RY/mqdefault.jpg)
![Race Condition [Day 20 - Advent of Code 2024 - Python]
Im given a maze to work through, which is very easy. But, then Im told Im allowed a single shortcut of length two, effectively once walking through a wall, and I need to find the number of shortcuts that improve my time by at least 100 steps. Ill create a map of each position that can be visited and compare each pair of points to see if a shortcut is possible. In part 2, Im allow to go through much thicker walls, up to 19 spaces. The same logic applies.
2024 AOC repo: https://gitlab.com/0xdf/aoc2024/
2024 AOC Intro video: https://www.youtube.com/watch?v=4XKZZrhhiQE
VSCode Debug video: https://www.youtube.com/watch?v=cNhtk2Ob4B8
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Part1 introduction
[01:40] Strategy
[02:48] Setup / data overview
[03:25] Parsing input
[03:58] Getting start
[04:58] Calculating distance to each spot with bfs
[08:16] Debugging infinite loop
[09:38] Adding second seen check
[10:24] Finding shortcuts
[14:10] Checking examples
[14:47] Counting shortcuts
[15:06] Solving part 1
[15:25] Part 2 challenge
[16:30] Modifying loop to search more widely
[22:09] Collecting solution
[23:57] Solving part 2
[24:13] Conclusion
#adventofcode #python Race Condition [Day 20 - Advent of Code 2024 - Python]](https://i.ytimg.com/vi/IYB81SH7_7E/mqdefault.jpg)
![Brute-Forcing File Read with MD5s [HackTheBox Intentions]
In Intentions from HackTheBox, Ill get a binary with the capabilities to read any file on the file system. This file will get an MD5 sum on the first N bytes of a file, where I control the filename and N. In this video, Ill show how to write a simple Python script that allows for reading any file on the file system by brute forcing it byte by byte.
Intentions Blog Post: https://0xdf.gitlab.io/2023/10/14/htb-intentions.html
HTB Intentions: https://www.hackthebox.com/machines/intentions
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[01:13] Overview of scanner
[02:17] Outline of main Python script
[05:38] Forgot we didnt finish!
[06:11] Using subprocess to get hash from scanner
[07:33] Using PDB to figure out syntax for stdout
[08:36] Brute forcing next byte
[09:52] Fixing output print
[10:22] Catching error from scanner
[11:45] Weirdness of scanner
[12:02] Showing success
#pentest #ctf #bugbounty Brute-Forcing File Read with MD5s [HackTheBox Intentions]](https://i.ytimg.com/vi/IkUmlFklWEs/mqdefault.jpg)
![Digging into OFBiz Exploitation
There was a diary on the Sans Internet Storm Center page about increased exploitation attempts at their honeypots for CVE-2024-32113, which gives RCE against Apache OFBiz instances. Ill show how the exploit works on the HackTheBox Bizness machine, and then look at the patches to fix CVE-2024-32113, and then where the exploit is actually fixed in the patches for CVE-2024-36104.
Sans ISC Article: https://isc.sans.edu/diary/Increased+Activity+Against+Apache+OFBiz+CVE202432113/31132/
OFBiz Security Page: https://ofbiz.apache.org/security.html
TIO.run: https://tio.run/
HTB Bizness Blog Post: https://0xdf.gitlab.io/2024/05/25/htb-bizness.html
HTB Bizness: https://hacktheboxltd.sjv.io/g1jVD9?u=https%3A%2F%2Fapp.hackthebox.com%2Fmachines%2Fbizness
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[01:15] Article Review
[02:28] Exploiting CVE-2024-32113 on HTB
[05:45] Looking at fix on GitHub
[07:00] Trying fix on TIO
[08:10] Looking at next CVE, CVE-2024-36104
[09:30] Conclusion
#ofbiz #sansics #cve-2024-32113 #cve-2024-36104 Digging into OFBiz Exploitation](https://i.ytimg.com/vi/J_IxCBjd4Pw/mqdefault.jpg)
