r/madeinpython • • May 05 '20

Meta Mod Applications

28 Upvotes

In the comments below, you can ask to become a moderator.

Upvote those who you think should be moderators.

Remember to give reasons on why you should be moderator!


r/madeinpython • • 3h ago

DNS Anal Sniffer (Open Resolver + Recursion Test) Any Recommendations??

0 Upvotes

My old DNS Sniffer that I created in 2012 originally, but updated for 2026 standards. For use on internal networks only! Anyways, I switched a few things like old ANY query to TXT with EDNS0 query now. My question is, do you guys/girls have any recommendations or suggestions to make this script any better or if I'm missing anything? Just looking for some feedback and or suggestions to improve. Thanks, -DD

#####################################################################################
# DNS-Anal-Sniffer v1.7
# Code-by-DirtyD
#
# Quickly Anal Sniff IP ranges for open recursive DNS resolvers and UDP aplification potential.
# Sends custom crafted TXT queries + EDNS0(8192 byte buffer) + DNSSEC(DO bit) with RRL detection.
#
#####################################################################################

import socket, sys, struct, ipaddress, csv, itertools, time, threading, os, secrets
from concurrent.futures import ThreadPoolExecutor, as_completed

TEST_DOMAINS = [
"cisco.com",
"hubspot.com",
"weather.com",
"oracle.com",
"salesforce.com",
"amazon.com",
"microsoft.com",
"ibm.com",
]
domain_cycle = itertools.cycle(TEST_DOMAINS)

stats = {
"scanned": 0, "found": 0, "ignored": 0, "bytes_sent": 0,
"bytes_recv": 0, "active_threads": 0, "start_time": 0.0,
"total": 0, "peak_rate": 0.0, "current_ip": "Initializing...",
"recent_finds": [], "last_found": "-"
}

stats_lock = threading.Lock()
stop_reporter = threading.Event()
HEADER_OVERHEAD = 28

def encode_dns_name(domain):
if isinstance(domain, str):
domain = domain.encode('utf-8')
encoded = b''.join(bytes([len(lbl)]) + lbl for lbl in domain.split(b'.') if lbl)
return encoded + b'\x00'

def craft_edns0_query(domain_str):
tid = secrets.token_bytes(2)
header = tid + b'\x01\x00\x00\x01\x00\x00\x00\x00\x00\x01'
question = encode_dns_name(domain_str) + b'\x00\x10\x00\x01'
opt_rr = b'\x00\x00\x29\x20\x00\x00\x00\x80\x00\x00\x00' # 8192 + DO bit
return header + question + opt_rr

def parse_dns_response(data):
if len(data) < 12:
return False
flags = struct.unpack('!H', data[2:4])[0]
rcode = flags & 0x000F
ra = (flags & 0x0080) != 0
qr = (flags & 0x8000) != 0
qdcount = struct.unpack('!H', data[4:6])[0]
if not qr or not ra or rcode != 0:
return False
ptr = 12
try:
for _ in range(qdcount):
while True:
label_len = data[ptr]
if label_len == 0:
ptr += 1
break
ptr += 1 + label_len
ptr += 4
except IndexError:
return False
return True

def send_single_probe(sock, target_ip, req_pkt, req_size):
with stats_lock:
stats["bytes_sent"] += req_size + HEADER_OVERHEAD
t0 = time.time()
sock.sendto(req_pkt, (target_ip, 53))
data, _ = sock.recvfrom(65535)
lat_ms = (time.time() - t0) * 1000
res_size = len(data)
with stats_lock:
stats["bytes_recv"] += res_size + HEADER_OVERHEAD
return data, res_size, lat_ms

def scan_resolver(target_ip, timeout=1.5):
ip_str = str(target_ip)
domain = next(domain_cycle)
req_pkt = craft_edns0_query(domain)
req_size = len(req_pkt)

with stats_lock:
stats["active_threads"] += 1
stats["current_ip"] = ip_str

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.settimeout(timeout)

try:
data, res_size, lat1 = send_single_probe(sock, ip_str, req_pkt, req_size)
if not parse_dns_response(data):
return None

replies, lats, max_res = 1, [lat1], res_size

for _ in range(2):
time.sleep(0.15)
try:
s_data, s_size, s_lat = send_single_probe(sock, ip_str, req_pkt, req_size)
if parse_dns_response(s_data):
replies += 1
lats.append(s_lat)
if s_size > max_res:
max_res = s_size
except (socket.timeout, ConnectionRefusedError):
pass

if replies < 3:
with stats_lock:
stats["ignored"] += 1
return None

factor = round(max_res / req_size)

return {
"ip": ip_str,
"factor": factor,
"latency_ms": round(sum(lats) / len(lats), 1),
"res_size": max_res
}
except Exception:
return None
finally:
sock.close()
with stats_lock:
stats["scanned"] += 1
stats["active_threads"] -= 1

def render_dashboard(cidr, csv_file, threads, rate, min_amp, final=False):
with stats_lock:
sc = stats["scanned"]
fd = stats["found"]
ign = stats["ignored"]
act = stats["active_threads"]
snt = stats["bytes_sent"]
tot = stats["total"]
st = stats["start_time"]
pk = stats["peak_rate"]
cur = "COMPLETE" if final else stats["current_ip"]
rec = list(stats["recent_finds"])
last = stats["last_found"]

el = max(time.time() - st, 0.001)
rate_cur = round(sc / el)
if rate_cur > pk:
with stats_lock:
stats["peak_rate"] = rate_cur
pk = rate_cur

eta = (tot - sc) / rate_cur if (rate_cur > 0 and not final) else 0
r_str = "Unlimited" if rate <= 0 else f"{rate} hosts/sec"

lines = [
"-------------------------------------------------------",
" DNS-Anal-Sniffer v1.7 Code-by-DirtyD ",
"-------------------------------------------------------",
f" Target Range: {cidr}",
f" Output CSV: {csv_file}",
f" Current Host: {cur}",
f" Progress: {sc} / {tot} ({(sc/tot*100 if tot else 0):.1f}%)",
f" Scan Rate: {rate_cur} hosts/sec",
f" Rate Limit: {r_str}",
f" Min Amp Factor: {min_amp}x",
f" Active Threads: {act} / {threads}",
f" Net Uplink: {((snt/el)*8)/1024:.1f} KB/s",
f" Vulnerable Found: {fd}",
f" RRL / Ignored: {ign}",
f" Elapsed / ETA: {int(el)}s / {int(eta//60):02d}:{int(eta%60):02d}",
"-------------------------------------------------------",
" Recent Vulnerable Resolvers:",
]

for i in range(5):
lines.append(f" {rec[i]}" if i < len(rec) else " -")
lines.append("-------------------------------------------------------")

print("\033[H\033[J" + "\n".join(lines), flush=True)

def reporter(cidr, csv_file, threads, rate, min_amp):
while not stop_reporter.is_set():
render_dashboard(cidr, csv_file, threads, rate, min_amp, False)
time.sleep(0.20) # slightly faster refresh

def main():
if len(sys.argv) < 3:
print("[?] Usage: python Anal_Sniff.py <CIDR> <Output_CSV> [threads] [rate_limit] [min_amp]")
print("[+] Example: python Anal_Sniff.py 1.2.64.0/18 results.csv 40 20 10")
sys.exit(1)

cidr = sys.argv[1]
csv_file = sys.argv[2]
threads = int(sys.argv[3]) if len(sys.argv) > 3 else 40
rate = float(sys.argv[4]) if len(sys.argv) > 4 else 0
min_amp = int(sys.argv[5]) if len(sys.argv) > 5 else 10

try:
net = ipaddress.ip_network(cidr, strict=False)
except ValueError:
print(f"[!] Error: {cidr} is not a valid CIDR.")
sys.exit(1)

if os.name == 'nt':
os.system('')

hosts = list(net.hosts())
stats["total"] = len(hosts)
stats["start_time"] = time.time()

t = threading.Thread(target=reporter, args=(cidr, csv_file, threads, rate, min_amp), daemon=True)
t.start()

exists = os.path.isfile(csv_file) and os.path.getsize(csv_file) > 0
with open(csv_file, 'a', newline='', encoding='utf-8') as f:
writer = csv.DictWriter(f, fieldnames=['Host', 'Amp_Factor', 'Latency_ms'])
if not exists:
writer.writeheader()

with ThreadPoolExecutor(max_workers=threads) as ex:
futures = []
last_sub = time.time()
interval = 1.0 / rate if rate > 0 else 0

for ip in hosts:
if rate > 0:
slp = interval - (time.time() - last_sub)
if slp > 0:
time.sleep(slp)
last_sub = time.time()
futures.append(ex.submit(scan_resolver, ip))

for fut in as_completed(futures):
res = fut.result()
if res:
if res["factor"] >= min_amp:
ent = f"{res['ip']:<16} | Amp: {res['factor']}x ({res['res_size']}B)"
with stats_lock:
stats["found"] += 1
stats["recent_finds"] = ([ent] + stats["recent_finds"])[:5]
stats["last_found"] = ent
writer.writerow({
'Host': res['ip'],
'Amp_Factor': res['factor'],
'Latency_ms': res['latency_ms']
})
f.flush()
else:
with stats_lock:
stats["ignored"] += 1

stop_reporter.set()
time.sleep(0.4)
render_dashboard(cidr, csv_file, threads, rate, min_amp, True)
print(f"\n[+] Anal Sniffing finished. {stats['found']} resolvers ={min_amp}x saved to {csv_file}\n")

if __name__ == "__main__":
main()


r/madeinpython • • 6h ago

GitHub - moisesz10/FISCALFIXTURES-BR: Open-source Python toolkit for Brazilian fiscal XML fixtures, generators, validators, and automated testing scenarios (NF-e, NFC-e, CT-e).

Thumbnail
github.com
0 Upvotes

r/madeinpython • • 8h ago

Watch the whole game.

0 Upvotes

Things are finally taking shape.


r/madeinpython • • 2d ago

Hice Bether, un gestor de marcadores para la terminal en Python + SQLite — busco feedback, ideas y que me ayuden a romperlo

Thumbnail
reddit.com
0 Upvotes

r/madeinpython • • 3d ago

[Project Release] Llama-UI v0.7.2 – Keyboard Navigation & Streaming Markdown

Post image
0 Upvotes

r/madeinpython • • 3d ago

Need Help With My Selenium Spotify Playlist Scraper

0 Upvotes

r/madeinpython • • 3d ago

My first lightweight Python project: TChef, a CLI alternative to Cyberchef

Post image
1 Upvotes

Hey everyone, during CTF's, I got a little tired of switching back and forth to the browser everytime I needed to encode, decode, XOR etc. something. So I built TChef, a really lightweight CLI tool that handles basic encoding, decoding, hashing, and XOR operations in terminal.

You can download it by pip:

pip install tchef-cli

Github repo: https://github.com/kotiaeion2512/TChef

Any feedback, bug reports, ideas etc. would be really welcome!


r/madeinpython • • 3d ago

Using Constraint Solvers to Solve Sudoku Puzzles in Python

Thumbnail
leetarxiv.substack.com
1 Upvotes

r/madeinpython • • 3d ago

Framework in python for people who have a raspberry pi lying around

Thumbnail
github.com
1 Upvotes

r/madeinpython • • 3d ago

So I made a project - Twelly Terminal

Thumbnail reddit.com
0 Upvotes

r/madeinpython • • 4d ago

Handset: I made a Linux app in Python that takes your phone calls over Bluetooth (PySide6 + D-Bus)

Thumbnail gallery
2 Upvotes

You're scrolling on your phone, headset on, and a call comes in. With Handset you click Answer on your PC and talk through your headset, and the phone stays free in your hand.

What it does: it makes a Linux PC act like a car's Bluetooth hands-free kit. Pair the phone once, and calls show up on the desktop: answer from the notification, dial, mute, keypad tones, call waiting and hold. If the phone shares them, it also shows contacts, favourites and recent calls. No app on the phone, so Android and iPhone both work.

How it's built (the Python part):

  • PySide6 + QML (Kirigami) for the UI. Python holds the state and exposes it to QML as properties and slots; QML just draws it.
  • jeepney for D-Bus. I started with QtDBus, but from Python it can't unpack PipeWire's call list (an a(oa{sv}) reply), so the D-Bus side moved to jeepney, a pure-Python D-Bus library.
  • No Bluetooth stack of my own. PipeWire 1.4 added Bluetooth telephony, so answering, dialing and hanging up are just D-Bus calls to PipeWire's telephony API, and audio is a normal PipeWire device.
  • Contacts over Bluetooth PBAP, through BlueZ's obexd: one session pulls the phonebook, favourites and call history as vCards, which a small Qt-free module parses and matches to caller numbers.
  • pytest covers the parsing and telephony logic, and GitHub Actions builds the Flatpak and attaches it to each release.

About 750 lines of Python and 1,000 of QML. MIT licensed, built with Claude Code.

https://github.com/KennyPorto/handset

(The phone numbers in the screenshots are all made up.)


r/madeinpython • • 4d ago

Doku2D Game Engine

0 Upvotes

Doku2D is an open-source engine for making 2D games in Python. It uses SFML through PySFML for graphics, windowing, input, and audio, and Pymunk for physics. OpenAI Codex wrote the engine code. I decided which features to build and how they should work, then playtested the sample games and guided development based on what I found.

Doku2D loads Tiled maps and supports animated tiles, collisions, and NPC pathfinding and route following. The UI supports themes and localization. You can write branching conversations in .dialogue files, with typewriter text, character portraits, player choices, and the ability to save and resume a conversation.

The doku2d build command uses Nuitka to compile your game into a standalone desktop application for Windows or Linux. You can also build a test APK or a signed Android App Bundle. The repository includes English and Turkish documentation, step-by-step tutorials, and sample games.

If you’re making 2D games in Python, I’d like to hear where you get stuck, whether it’s during setup, while reading the docs, or when using the API.

Explore Doku2D on GitHub


r/madeinpython • • 4d ago

I built Pyzzel: A lightweight PostgreSQL ORM for Python with SQLAlchemy-like syntax and performance close to raw Psycopg 3

Thumbnail
reddit.com
0 Upvotes

r/madeinpython • • 5d ago

School Python vs Modern Python 🤯 | If-Else vs NumPy #Shorts

Thumbnail
youtu.be
1 Upvotes

Interesting python problem


r/madeinpython • • 6d ago

Lifelong Learning Management System - Conceptual.fyi

Thumbnail
conceptual.fyi
0 Upvotes

Conceptual.fyi is up and made in Python

TLDR:
Search -> Bookmark a goal -> Sign in -> Answer questions on what you do know -> Learn toward your goal -> Build on that learning for a lifetime when you need it.

Seems easy enough... right? :)
I built a way to learn and keep up to date on research. I'm searching for concept-based learning on the internet. I'm ranking concepts by memorability, effort and brevity.

Sign in and I'll save your progress on any goal you choose. Once you've bookmarked a goal, I'll ask you ~5 questions to see what the next step is you should learn on your way to your goal. If you want to know why you're learning something, I'll explain it in the right column.

The over-egregious estimates assume you know nothing about anything. So take those with a grain of salt. Let me know if you have other ideas on how to present estimates better.

Technologies used:

  • Python 3.14
  • django 6 + templates
  • htmx + alpine.js
  • postgres
  • nltk
  • NetworkX
  • Shoutout to django cookiecutter which helped me put the web stuff together originally
  • Claude models helped build initial content curation and bad/better/recent UI.
  • Content is found on the internet by its respective authors.

r/madeinpython • • 6d ago

I’ve been working on my little Python project – KVC-BASIC has some new features!

Thumbnail
reddit.com
1 Upvotes

r/madeinpython • • 7d ago

Made a simple usage-detector and alert system in python!

Thumbnail
github.com
1 Upvotes

Released the first beta version of ChillinPC- a program that checks your computer's temps and usage meters and marks if they hit near 100%. it's extremely lightwieght and usefull (at least for me). I also madde a short promotional video: https://www.youtube.com/watch?v=kPHKgyFfBoM


r/madeinpython • • 7d ago

I built a small BASIC-inspired programming language interpreter in Python — KVC-BASIC

Thumbnail
reddit.com
1 Upvotes

r/madeinpython • • 7d ago

[Open Source] I'm a music producer (not a coder) and built a zero-latency 80s Eurodisco / Modern Talking stem generator in pure NumPy/SciPy with instant Ableton Live export – looking for contributors!

2 Upvotes

Hi everyone! As a non-coder music producer, I built eurodisco-mixer in pure Python (NumPy, SciPy, Gradio) to generate 6 synchronized 80s Eurodisco / Modern Talking WAV stems + full mix in ~0.1 seconds, complete with Guidance Scale DSP, Master EQ, and instant Ableton Live clipboard export.

Open-source (MIT License) on GitHub: https://github.com/mojsony13a-png/eurodisco-mixer

Looking for Python/DSP developers or synth fans to contribute ideas, MIDI export, or new 80s synth patches!


r/madeinpython • • 7d ago

TUI for llama.cpp

Post image
0 Upvotes

Hi everyone!

I've been working on my first Python/PyPI project: Llama-UI, a Rich-powered terminal frontend for "llama.cpp", designed with Termux on Android in mind.

I wanted a simple terminal interface to manage llama.cpp, models and chats without having to manually manage everything through commands.

Features:

- Rich-powered terminal interface

- Import or download GGUF models

- Start, stop and inspect llama-server

- Chat history (save, load and delete)

- Per-model system prompts and generation parameters

- Edit and regenerate messages

- Server logs and controls

Installation:

pip install llama-ui-termux

Run it with:

llama-ui

GitHub: https://github.com/user01234-sl/Llama-UI-Python

PyPI: https://pypi.org/project/llama-ui-termux/

This is my first published PyPI project. I'd appreciate feedback, bug reports or suggestions for improvement!

Thanks for reading.


r/madeinpython • • 8d ago

Added sound to my GameBoy Color emulator written in purely python and pygame (full handwritten)

1 Upvotes

r/madeinpython • • 8d ago

I built AlphaEngine: A quantitative portfolio optimization and financial analysis web app in Python

2 Upvotes

I wanted to share a project I've been developing: AlphaEngine, an interactive web application built with Python and Flask that computes optimal asset allocations using Modern Portfolio Theory (MPT).

Instead of manually guessing asset weights, the app fetches real-time market data, calculates daily and annual returns, and uses mathematical optimization to find the minimum-variance portfolio configuration.

Key features:

  • Real-Time Data Integration: Automatically pulls historical close prices using the Yahoo Finance API (yfinance).
  • Mathematical Optimization: Leverages SciPy's SLSQP algorithm to minimize portfolio variance subject to asset weight constraints.
  • Interactive Dashboard: Features a clean web interface built with Flask, dynamic JavaScript input fields, and pre-filled popular stock tickers.
  • Visual Analytics: Renders a responsive, customized donut chart using Plotly to visualize the ideal asset distribution.

I'll drop the GitHub repository link in the first comment below. I'd love to hear your feedback or thoughts on the implementation!