binarygolf / BGGP

Binary Golf Grand Prix
43 stars 10 forks source link

Python - 0 bytes cause why not #122

Open yo-yo-yo-jbo opened 2 months ago

yo-yo-yo-jbo commented 2 months ago

Please fill out the following:

---BEGIN BGGPx---
Submit Date: 2024-Aug-07
BGGP Challenge Number: 5
Author: Jonathan Bar Or ("JBO")
Contact Info (Optional): @yo_yo_yo_jbo
Online Presence (Website/Social Media): @yo_yo_yo_jbo
Target File Type: *.py
File Size: 0
SHA256 Hash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Target Environment (How do we run the file?): Linux or macOS:
1. Create an empty file: **touch /tmp/a.py**
2. Run with PYTHONSTARTUP from STDIN: **printf "import sys;sys.ps1='';import os;_=os.system('printf \\\\r>/dev/tty && curl https://binary.golf/5/5')\n" | PYTHONSTARTUP=/dev/fd/0 python3 -i /tmp/a.py**
Any additional info?: 
Link to PoC video, screenshot, or console output, if any: 
Link to writeup, if any: 
File contents (base64 encoded please): 
---END BGGPx---

If this is an update to an existing entry, please include a link to your entry below this text. Reminder that authors can only update an entry once during BGGP.

mebeim commented 2 months ago

Why do I feel like BGGP should have a forbidden loopholes policy :joy: LOL

yo-yo-yo-jbo commented 2 months ago

I agree, IMO everything that uses env vars, relies on path / filename etc cheating. Relying on externals (curl etc) is fine IMO. Anyway, I saw people really streching the limit and I was like "I'll do ot too".