repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/InCTF/2022/pwn/k32/pow.py | ctfs/InCTF/2022/pwn/k32/pow.py | import hashlib
def solvepow(x, target):
x = bytes.fromhex(x)
target = bytes.fromhex(target)
for i in range(256**3):
if hashlib.md5(x + i.to_bytes(3, "big")).digest() == target:
return x.hex()+hex(i)[2:] | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/InCTF/2022/web/Vuln-Drive2/app/app.py | ctfs/InCTF/2022/web/Vuln-Drive2/app/app.py | from lib2to3.pgen2 import token
import re
from flask import Flask,request
app = Flask(__name__)
import sqlite3
import os
FLAG = os.environ.get('FLAG',"flag{fakeflag}")
def db_query(query):
conn = sqlite3.connect(os.path.join(os.path.realpath(os.curdir),'users.db'))
cursor = conn.cursor()
result = cursor.e... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/InCTF/2020/Secret_Service/exp.py | ctfs/InCTF/2020/Secret_Service/exp.py | Not doing that mistake
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/InCTF/2020/speedy/server.py | ctfs/InCTF/2020/speedy/server.py | #!/usr/bin/python3
import sys
import tempfile
import os
print ("Enter the file size and then the file >>")
size = int(input())
assert(size < 1024*1024) #1MB max
script = sys.stdin.read(size) # reads one byte at a time, similar to getchar()
temp = tempfile.mktemp()
with open(temp, "w") as f:
f.write(script)
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BreachCTF/2025/misc/Pyshell/shell.py | ctfs/BreachCTF/2025/misc/Pyshell/shell.py | class File:
def __init__(self, filename, content=""):
self.filename = filename
self.content = content
class Directory:
def __init__(self):
self.entries = {}
class Symlink:
def __init__(self, target):
self.target = target
class VirtualShell:
MAX_ENTRIES = 100
MAX... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BreachCTF/2025/misc/Mining_Mania/bitcoin_sim_public.py | ctfs/BreachCTF/2025/misc/Mining_Mania/bitcoin_sim_public.py | import hashlib
import time
import struct
import json
import threading
from typing import List
from flask import Flask, request, jsonify
def little_endian(hex_str, length):
"""Convert a hex string to little-endian format with a fixed length."""
return bytes.fromhex(hex_str)[::-1].hex().ljust(length * 2, '0')
c... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BreachCTF/2025/crypto/Transfer_into_Oblivion/source.py | ctfs/BreachCTF/2025/crypto/Transfer_into_Oblivion/source.py | import sys
import random
import string
from Crypto.Util.number import bytes_to_long, long_to_bytes
from secret import FLAG
NUM_CHUNKS = 64
CHUNK_LEN = 8
LEFT_CHUNKS = []
RIGHT_CHUNKS = []
N = 1371522847411458783144137668483253459492833367451021763232465789842100876419700009903473335447577103217843098286829621819140807... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2024/rev/Imperfect_Guesser/chall.py | ctfs/TCP1P/2024/rev/Imperfect_Guesser/chall.py | import torch, random
import torch.nn
import numpy as np
flag = "TCP1P{REDACTED}"
def floatify(ip):
flag = [float(ord(i)) for i in ip]
normalized = torch.tensor([flag], dtype=torch.float32)
return normalized
def tf(_in,_out):
weight = np.round(np.random.uniform(-1, 1, (_out, _in)).astype(np.float32),2)
bias = np... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/misc/PyMagic/pymagic.py | ctfs/TCP1P/2023/misc/PyMagic/pymagic.py | #!/usr/bin/env python3
import re
class something_to_do_huh:...
eval = eval
code = input('>>> ')
if not re.findall('[()\'"0123456789 ]', code):
for k in (b:=__builtins__.__dict__).keys():
b[k] = None
eval(code, {'__builtins__': {}, '_': something_to_do_huh}) | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/misc/vampire/sandbox.py | ctfs/TCP1P/2023/misc/vampire/sandbox.py | #!/usr/bin/env python3
import re
import sys
class Nobuffers:
def __init__(self, stream):
self.stream = stream
def write(self, data):
self.stream.write(data)
self.stream.flush()
def writelines(self, datas):
self.stream.writelines([f"{data}\n" for data in datas])
sel... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/misc/Nuclei/src/app.py | ctfs/TCP1P/2023/misc/Nuclei/src/app.py | from flask import Flask, render_template, request, redirect, url_for
import subprocess
import re
app = Flask(__name__)
@app.route('/', methods=['GET'])
def index():
return render_template('index.html')
@app.route('/submit', methods=['POST'])
def submit():
url_pattern = re.compile(r'^(https?://[A-Za-z0-9\-._~... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/misc/Cat_Kompani/chall.py | ctfs/TCP1P/2023/misc/Cat_Kompani/chall.py | #!/usr/bin/env python3
import string, sys
meow = '''|>Yy!G&vPBz:k-D;M+XxO?%ERqZ<VS`j#A/KC*L@$,WwFTNU^~I\\JQHh''' + string.whitespace + string.digits
hisss = ['import', 'builtins', 'sys', 'any', 'register', 'ord', 'ascii', 'string', 'exec', 'breakpoint', 'eval', 'compile', 'exit', 'print', 'meow', 'hisss', 'nyaa', 'mi... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/crypto/Jacks_Worst_Trials/app.py | ctfs/TCP1P/2023/crypto/Jacks_Worst_Trials/app.py | # flask imports
from flask import Flask, request, jsonify, make_response, render_template, redirect, url_for, flash, Response, send_file
from flask_sqlalchemy import SQLAlchemy
import uuid # for public id
from werkzeug.security import generate_password_hash, check_password_hash
import jwt
from datetime import datetim... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/crypto/Open_the_Noor/chall.py | ctfs/TCP1P/2023/crypto/Open_the_Noor/chall.py | from Crypto.Cipher import AES
import os
import random
import string
CHARSET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
KEY = os.urandom(16)
class Systems:
def __init__(self):
self.adminpass = self.gen_password()
def pad(self, s):
return s + (16 - len(s) % 16) * chr(16 - len(s) % 16).... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/crypto/Spider_Shambles/web.py | ctfs/TCP1P/2023/crypto/Spider_Shambles/web.py | import os
from flask import Flask, flash, request, redirect, render_template, send_file
import io
import random
from Crypto.Util.number import long_to_bytes as l2b
app=Flask(__name__, template_folder='./template')
app.secret_key = "OFCOURSETHISISNOTHEREALSECRETKEYBOI"
app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 10... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/crypto/One_Pad_Time/one_pad_time.py | ctfs/TCP1P/2023/crypto/One_Pad_Time/one_pad_time.py | import os
from pwn import xor
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad, unpad
key = os.urandom(16)
iv = os.urandom(16)
cipher = AES.new(key, AES.MODE_CBC, iv)
pt = open("flag.txt", "rb").read()
ct = pad(cipher.encrypt(pt), 16)
ct = xor(ct, key)
print(f"{iv = }")
print(f"{ct = }") | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/crypto/Eclairs/eclairs.py | ctfs/TCP1P/2023/crypto/Eclairs/eclairs.py | from Crypto.Util.number import getPrime, bytes_to_long
from sympy.ntheory.modular import crt
from libnum.ecc import *
import random
import time
while (p:=getPrime(256)) % 4 != 3: pass
while (q:=getPrime(256)) % 4 != 3: pass
e = 3
n = p*q
a = getPrime(256)
b = getPrime(256)
E = Curve(a, b, n)
flag = bytes_to_long(open(... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/crypto/Cherry_Leak/cherry_leak.py | ctfs/TCP1P/2023/crypto/Cherry_Leak/cherry_leak.py | from Crypto.Util.number import getPrime, bytes_to_long
p = getPrime(1024)
q = getPrime(512)
n = p * q
e = 65537
FLAG = b"TCP1P{???????????????????????????????????????}"
lock = False
while True:
print("1. Get new prime")
print("2. Get leak")
print("3. Get flag")
print("4. Exit")
print("> ", end=""... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/crypto/Final_Consensus/chall.py | ctfs/TCP1P/2023/crypto/Final_Consensus/chall.py | from Crypto.Cipher import AES
import random
from Crypto.Util.Padding import pad
a = b""
b = b""
FLAG = b"TCP1P{REDACTED}"
def generateKey():
global a, b
a = (str(random.randint(0, 999999)).zfill(6)*4)[:16].encode()
b = (str(random.randint(0, 999999)).zfill(6)*4)[:16].encode()
def encrypt(plaintext, a, b):
cipher... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/crypto/Shiftgner/shiftgner.py | ctfs/TCP1P/2023/crypto/Shiftgner/shiftgner.py | import os
flag = open('flag.txt','r').read()
assert flag.startswith('TCP1P{') and flag.endswith('}')
flag = flag[6:-1]
assert len(flag) == 32
class Shiftgner:
def __init__(self, mask):
self.mask = int.from_bytes(mask, byteorder='big')
def next(self):
c = self.state & self.mask
x = 0
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/forensic/scrambled_egg/scramble.py | ctfs/TCP1P/2023/forensic/scrambled_egg/scramble.py | from struct import unpack
png = open('flag.png', 'rb').read()
new = [b'\x89PNG\r\n\x1a\n']
i = 8
while i < len(png):
size = png[i:i+4]
chunk = size[::-1]
chunk = png[i+4:i+8] + chunk
chunk = png[i+8:i+8+unpack('>I', size)[0]] + chunk
new.append(chunk)
new = new[::-1]
i = i + 8 + unpack('>I', size)[0] + 4
open... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/TCP1P/2023/web/PDFIFY/src/backend/vendor/codeigniter4/codeigniter4/tests/_support/MigrationTestMigrations/Database/Migrations/2018-01-24-102300_Another_migration.py | ctfs/TCP1P/2023/web/PDFIFY/src/backend/vendor/codeigniter4/codeigniter4/tests/_support/MigrationTestMigrations/Database/Migrations/2018-01-24-102300_Another_migration.py | <?php namespace Tests\Support\MigrationTestMigrations\Database\Migrations;
class Migration_another_migration extends \CodeIgniter\Database\Migration
{
public function up()
{
$this->forge->addField([
'key' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
]);
$this->forge->createTable('foo',... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/MidnightFlag/2023/crypto/SilentWhisper/chall.py | ctfs/MidnightFlag/2023/crypto/SilentWhisper/chall.py | #!/usr/bin/env python3
from Crypto.Cipher import AES
import random
def cipherData(data,key):
cipher = AES.new(key, AES.MODE_ECB)
data = cipher.encrypt(data)
return data
def decipherData(data,key):
cipher = AES.new(key, AES.MODE_ECB)
data = cipher.decrypt(data)
return data
def pad(data):
toPadd = 16 - (len... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/MidnightFlag/2023/crypto/m4g1c/encrypt.py | ctfs/MidnightFlag/2023/crypto/m4g1c/encrypt.py | import sys
import os
def get_key(length):
return os.urandom(length)
def encrypt(filename, key):
filename_lock = filename + ".lock"
data = open(filename, "rb").read()
os.remove(filename)
locked = open(filename_lock, "wb")
for idx, i in enumerate(data):
locked.write((i ^ key[idx % len(k... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/MidnightFlag/2023/web/comme_dans_une_chaussette/src/redis_logger.py | ctfs/MidnightFlag/2023/web/comme_dans_une_chaussette/src/redis_logger.py | import redis
import sys
import socket
host = sys.argv[1]
port = 6379
try:
r = redis.Redis(host=host, port=port, db=0)
except:
f = open("/root/redis_error","w")
f.write("[-] Unable to join redis instance\n")
f.close()
exit(-1)
for key in r.keys():
data = r.get(key)
#send the data to the ph... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/NoHackNoCTF/2024/crypto/Lion_RSA/chal_18.py | ctfs/NoHackNoCTF/2024/crypto/Lion_RSA/chal_18.py | from Crypto.Util.number import *
from Secret import flag2
def leak_info(primes):
mod=getPrime(4096)
parameters=[getPrime(4096) for _ in range(3)]
cnt=0
for i in range(3):
cnt+=primes[i]*parameters[i]
cnt%=mod
print(f"---leak info---\n{cnt=}\n{parameters=}\n{mod=}")
primes=[getPrime... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/NoHackNoCTF/2024/crypto/Secret_ROT13/source.py | ctfs/NoHackNoCTF/2024/crypto/Secret_ROT13/source.py | def encrypt(text, key):
encrypted_text = ""
for i, char in enumerate(text):
offset = ((i + 1 + key) * (i + 1)) % 26
if 'A' <= char <= 'Z':
new_char = chr((ord(char) - ord('A') + offset) % 26 + ord('A'))
elif 'a' <= char <= 'z':
new_char = chr((ord(char) - ord('a'... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/NoHackNoCTF/2024/crypto/Lion_Prime/source.py | ctfs/NoHackNoCTF/2024/crypto/Lion_Prime/source.py | import numpy as np
import random
banner="""⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⠀⣀⣠⣤⣤⣶⣶⣿⣯⣤⣤⣤⣤⣤⣤⣤⣄⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⣿⣿⣿⠿⣿⣿⡿⠿⠛⠋⠉⠀⠐⠉⠉⠉⣀⣀⣤⣤⣤⣼⣿⣿⣿⣿⣿⣿⣿⣿⣶⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⡿⠋⠀⠉⠀⠚⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠛⠛⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⠓⠂⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡼⠟⠃⠀⠀⠀⠀⢀⣠⣤⠤⢶⣤⣄⠀⠀⠀⠀... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/NoHackNoCTF/2024/crypto/Duplicated/source.py | ctfs/NoHackNoCTF/2024/crypto/Duplicated/source.py | from flask import Flask, request, jsonify
import base64
import hashlib
app = Flask(__name__)
def base64_decode(data):
try:
return base64.b64decode(data)
except Exception:
return None
def validate_pair(data1, data2):
decoded1 = base64_decode(data1)
decoded2 = base64_decode(data2)
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/NoHackNoCTF/2024/crypto/Baby_RSA/chal_17.py | ctfs/NoHackNoCTF/2024/crypto/Baby_RSA/chal_17.py | from Crypto.Util.number import *
from Secret import flag1
primes=[getPrime(512) for _ in range(3)]
p, q, r=primes[0], primes[1], primes[2]
n=p*q*r
e=0x10001
leak=p*q+q*r+r*p-p-q-r
c=pow(bytes_to_long(flag1), e, n)
print(f"{n=}\n{e=}\n{c=}\n{leak=}")
# output
'''
n=158831394081158367038890100879997964322750834792172650... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/NoHackNoCTF/2025/crypto/RANDES/chal.py | ctfs/NoHackNoCTF/2025/crypto/RANDES/chal.py | #!/bin/python3
import os
import random
import des
import des.core
from Crypto.Util.number import *
from secret import FLAG
def shuffle(iterable):
iterable = list(iterable)
random.shuffle(iterable)
return iterable
des.core.EXPANSION = shuffle(des.core.EXPANSION)
des.core.ROTATES = shuffle(des.core.ROTATES... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/NoHackNoCTF/2025/web/Catch_The_Goose/server.py | ctfs/NoHackNoCTF/2025/web/Catch_The_Goose/server.py | import grpc
from concurrent import futures
import user_pb2, user_pb2_grpc
import sqlite3
class UserService(user_pb2_grpc.UserServiceServicer):
def __init__(self):
self.conn = sqlite3.connect('ctf.db', check_same_thread=False)
self.cursor = self.conn.cursor()
def GetUser(self, request, context)... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2021/crypto/Sleeves/challenge.py | ctfs/UTCTF/2021/crypto/Sleeves/challenge.py | from challenge.eccrng import RNG
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
rng = RNG()
# I'll just test it out a few times first
print("r1 = %d" % rng.next())
print("r2 = %d" % rng.next())
r = str(rng.next())
aes_key = SHA256.new(r.encode('ascii')).digest()
cipher = AES.new(aes_key, AES.MODE_ECB)
p... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2021/crypto/Sleeves/eccrng.py | ctfs/UTCTF/2021/crypto/Sleeves/eccrng.py |
# This file was *autogenerated* from the file eccrng.sage
from sage.all_cmdline import * # import sage library
_sage_const_115792089210356248762697446949407573530086143415290314195533631308867097853951 = Integer(115792089210356248762697446949407573530086143415290314195533631308867097853951); _sage_const_0x5ac635d8... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2021/crypto/ABitWeird/main.py | ctfs/UTCTF/2021/crypto/ABitWeird/main.py | from Crypto.Util import number
from secret import flag
import os
length = 2048
p, q = number.getPrime(length//2), number.getPrime(length//2)
N = p*q
e = 3
m = number.bytes_to_long(flag)
x = number.bytes_to_long(os.urandom(length//8))
c = pow(m|x, e, N)
print('N =', N);
print('e =', e);
print('c =', c);
print('m&x ='... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2024/crypto/Cryptordle/main.py | ctfs/UTCTF/2024/crypto/Cryptordle/main.py | #!/usr/bin/env python3
import random
wordlist = open('/src/wordlist.txt', 'r').read().split('\n')
for word in wordlist:
assert len(word) == 5
for letter in word:
assert letter in 'abcdefghijklmnopqrstuvwxyz'
for attempt in range(3):
answer = random.choice(wordlist)
num_guesses = 0
while T... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2024/crypto/numbers_go_brrr/main.py | ctfs/UTCTF/2024/crypto/numbers_go_brrr/main.py | #!/usr/bin/env python3
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
from Crypto.Random import random
seed = random.randint(0, 10 ** 6)
def get_random_number():
global seed
seed = int(str(seed * seed).zfill(12)[3:9])
return seed
def encrypt(message):
key = b''
for i in range(8... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2023/crypto/ReallyLooksWrongtomE/main_fixed.py | ctfs/UTCTF/2023/crypto/ReallyLooksWrongtomE/main_fixed.py | #!/usr/bin/env python3
import secrets
import random
import math
def mat_mul(a, b, mod):
c = [[0] * len(b[0]) for _ in range(len(a))]
for i in range(len(a)):
for j in range(len(b)):
for k in range(len(b[0])):
c[i][k] = (c[i][k] + a[i][j] * b[j][k]) % mod
return c
def mat... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2023/crypto/ProvablyInsecure/server.py | ctfs/UTCTF/2023/crypto/ProvablyInsecure/server.py | #!/usr/local/bin/python
from cryptography.hazmat.primitives.asymmetric import rsa
from secrets import randbits
if __name__ == '__main__':
alice = rsa.generate_private_key(public_exponent=65537, key_size=2048)
print("Alice's pk: ", alice.public_key().public_numbers().n, alice.public_key().public_numbers().e)
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2023/crypto/LooksWrongtomE/main_fixed.py | ctfs/UTCTF/2023/crypto/LooksWrongtomE/main_fixed.py | #!/usr/bin/env python3
import secrets
import random
import math
def mat_mul(a, b, mod):
c = [[0] * len(b[0]) for _ in range(len(a))]
for i in range(len(a)):
for j in range(len(b)):
for k in range(len(b[0])):
c[i][k] = (c[i][k] + a[i][j] * b[j][k]) % mod
return c
def mat... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2023/crypto/Affinity/encrypt_pub.py | ctfs/UTCTF/2023/crypto/Affinity/encrypt_pub.py | #!/usr/bin/env python3
from aes import AES
import sys
key = <REDACTED>
while True:
print("plaintext hex string: ", end="")
msg = bytes.fromhex(input())
if len(msg) % 16 != 0:
msg += b"\x00"*(16 - (len(msg) % 16))
ciphertext = b""
aes = AES()
for i in range(0, len(msg), 16):
m... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2023/crypto/Affinity/aes.py | ctfs/UTCTF/2023/crypto/Affinity/aes.py | #!/usr/bin/python
#
# aes.py: implements AES - Advanced Encryption Standard
# from the SlowAES project, http://code.google.com/p/slowaes/
#
# Copyright (c) 2008 Josh Davis ( http://www.josh-davis.org ),
# Alex Martelli ( http://www.aleax.it )
#
# Ported from C code written by Laurent Haan ( http://www.prog... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2025/pwn/E_Corp_Part_2/server.py | ctfs/UTCTF/2025/pwn/E_Corp_Part_2/server.py | #!/usr/bin/env python3
import os
import subprocess
import sys
import tempfile
print("Size of Exploit: ", flush=True)
input_size = int(input())
print("Script: ", flush=True)
script_contents = sys.stdin.read(input_size)
with tempfile.NamedTemporaryFile(buffering=0) as f:
f.write(script_contents.encode("utf-8"))
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2025/crypto/Espathra_Csatu_Banette/main.py | ctfs/UTCTF/2025/crypto/Espathra_Csatu_Banette/main.py | #!/usr/bin/env python3
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
key = open("/src/key", "rb").read()
secret = open("/src/flag.txt", "r").read()
cipher = AES.new(key, AES.MODE_ECB)
while 1:
print('Enter text to be encrypted: ', end='')
x = input()
chksum = sum(ord(c) for c in x) % (... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2022/crypto/FailedHashFunction/main.py | ctfs/UTCTF/2022/crypto/FailedHashFunction/main.py | #!/usr/bin/env python3
import sys, os
def trailing(x):
a = 0
for _ in range(15):
if x & 1:
break
x >>= 1
a += 1
return a
def print_hash(s):
for x in s:
for y in s:
print(hex(trailing((k1 ^ x) * (k2 ^ y)))[2:], end='')
print()
for num in rang... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UTCTF/2022/crypto/Sunset/main.py | ctfs/UTCTF/2022/crypto/Sunset/main.py | import random
import hashlib
N = 111
MOD = 10**9+7
def get_secret_key():
key = []
for i in range(1, N):
x = random.randrange(1,10)
key += [i] * x
random.shuffle(key)
return key
def compute_arr(arr, sk):
for x in sk:
new_arr = arr.copy()
for y in range(N):
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/pwn/TriDroid/server.py | ctfs/GoogleCTF/2021/pwn/TriDroid/server.py | #!/usr/bin/env python3
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/pwn/Atheris/autorunner.py | ctfs/GoogleCTF/2021/pwn/Atheris/autorunner.py | #!/usr/bin/python3
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/pwn/Atheris/send_zip.py | ctfs/GoogleCTF/2021/pwn/Atheris/send_zip.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/pwn/Atheris/setup.py | ctfs/GoogleCTF/2021/pwn/Atheris/setup.py | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/pwn/Full_Chain/run_chromium.py | ctfs/GoogleCTF/2021/pwn/Full_Chain/run_chromium.py | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/pwn/Full_Chain/run_qemu.py | ctfs/GoogleCTF/2021/pwn/Full_Chain/run_qemu.py | #!/usr/bin/python3 -u
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/pwn/memsafety/chal.py | ctfs/GoogleCTF/2021/pwn/memsafety/chal.py | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/hw/Parking/game.py | ctfs/GoogleCTF/2021/hw/Parking/game.py | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/crypto/pythia/server.py | ctfs/GoogleCTF/2021/crypto/pythia/server.py | #!/usr/bin/python -u
import random
import string
import time
from base64 import b64encode, b64decode
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from cryptography.hazmat.primitives.kdf.scrypt import Scrypt
max_queries = 150
query_delay = 10
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/crypto/H1/chall.py | ctfs/GoogleCTF/2021/crypto/H1/chall.py | #!/usr/bin/python3
import os
import hashlib
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import padding
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
flag = open('flag.txt').read()
INF = (1, 1, 0)
mod = 894896220765023255165660281515915342... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/crypto/tiramisu/challenge_pb2.py | ctfs/GoogleCTF/2021/crypto/tiramisu/challenge_pb2.py | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pb/challenge.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _sym... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/crypto/tiramisu/client_skel.py | ctfs/GoogleCTF/2021/crypto/tiramisu/client_skel.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/crypto/tonality/challenge_pb2.py | ctfs/GoogleCTF/2021/crypto/tonality/challenge_pb2.py | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pb/challenge.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _sym... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/crypto/tonality/client_skel.py | ctfs/GoogleCTF/2021/crypto/tonality/client_skel.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2021/web/gpushop/paymeflare/jwk.py | ctfs/GoogleCTF/2021/web/gpushop/paymeflare/jwk.py | import requests
import json
import base64
from Crypto.PublicKey import RSA
res = requests.get('https://www.googleapis.com/oauth2/v3/certs')
keys = json.loads(res.content).get('keys')
for k in keys:
n = k['n']
e = k['e']
n = base64.urlsafe_b64decode(n + '==')
e = base64.urlsafe_b64decode(e + '=='... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2018/Quals/sftp/sftp_exploit.py | ctfs/GoogleCTF/2018/Quals/sftp/sftp_exploit.py | #!/usr/bin/env python
from pwn import *
def authenticate():
p.recvuntil(' (yes/no)? ')
p.sendline('yes')
p.recvuntil('password: ')
p.sendline('C\x80\x10\x01\xff')
if __name__ == '__main__':
#p = remote('sftp.ctfcompetition.com', 1337)
p = process('./sftp')
authenticate()
gdb.attach... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2019/Quals/secureboot/run.py | ctfs/GoogleCTF/2019/Quals/secureboot/run.py | #!/usr/bin/python3
import os
import tempfile
fname = tempfile.NamedTemporaryFile().name
os.system("cp OVMF.fd %s" % (fname))
os.system("chmod u+w %s" % (fname))
os.system("qemu-system-x86_64 -monitor /dev/null -m 128M -drive if=pflash,format=raw,file=%s -drive file=fat:rw:contents,format=raw -net none -nographic 2> /... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/misc/NPC/encrypt.py | ctfs/GoogleCTF/2023/misc/NPC/encrypt.py | # Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/misc/Mine_The_Gap/minesweeper.py | ctfs/GoogleCTF/2023/misc/Mine_The_Gap/minesweeper.py | import sys
import itertools
import hashlib
from typing import List, Tuple
# pip install pygame
import pygame
from pygame.locals import *
pygame.init()
FPS = 60
FramePerSec = pygame.time.Clock()
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
SCREEN_WIDTH = 1280
SCREEN_HEIGHT = 720
DISPLAYSURF = pygame.display.set_mode... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/pwn/kconcat/run_qemu.py | ctfs/GoogleCTF/2023/pwn/kconcat/run_qemu.py | #!/usr/bin/python3 -u
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/pwn/Storygen/chal.py | ctfs/GoogleCTF/2023/pwn/Storygen/chal.py | import time
import os
time.sleep(0.1)
print("Welcome to a story generator.")
print("Answer a few questions to get started.")
print()
name = input("What's your name?\n")
where = input("Where are you from?\n")
def sanitize(s):
return s.replace("'", '').replace("\n", "")
name = sanitize(name)
where = sanitize(where... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/rev/OldSchool/flag_maker.py | ctfs/GoogleCTF/2023/rev/OldSchool/flag_maker.py | #!/usr/bin/env python3
# GCTF'23 - Old School - Flag Maker
import hashlib
# Find the passwords for the following 50 usernames, substitute them inside the pairs,
# and then run the script to get the flag.
pairs = [
('gdwAnDgwbRVnrJvEqzvs', '{password}'),
('ZQdsfjHNgCpHYnOVcGvr', '{password}'),
('PmJgHBtIpaWNEMKiD... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/rev/Turtle/turt.py | ctfs/GoogleCTF/2023/rev/Turtle/turt.py | #!/usr/bin/python3
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/sandbox/v8box/run.py | ctfs/GoogleCTF/2023/sandbox/v8box/run.py | #!/usr/bin/python3 -u
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/crypto/Cursved/chal.py | ctfs/GoogleCTF/2023/crypto/Cursved/chal.py | # Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/crypto/Least_Common_Genominator/generate.py | ctfs/GoogleCTF/2023/crypto/Least_Common_Genominator/generate.py | from secret import config
from Crypto.PublicKey import RSA
from Crypto.Util.number import bytes_to_long, isPrime
class LCG:
lcg_m = config.m
lcg_c = config.c
lcg_n = config.n
def __init__(self, lcg_s):
self.state = lcg_s
def next(self):
self.state = (self.state * self.lcg_m + self... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/crypto/myTLS/server.py | ctfs/GoogleCTF/2023/crypto/myTLS/server.py | #!/usr/bin/env python3
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/crypto/ZIP/hard.py | ctfs/GoogleCTF/2023/crypto/ZIP/hard.py | #!/usr/bin/python3
# Copyright 2023 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/web/under-construction/flask/models.py | ctfs/GoogleCTF/2023/web/under-construction/flask/models.py | # Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/web/under-construction/flask/unauthorized_routes.py | ctfs/GoogleCTF/2023/web/under-construction/flask/unauthorized_routes.py | # Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/web/under-construction/flask/authorized_routes.py | ctfs/GoogleCTF/2023/web/under-construction/flask/authorized_routes.py | # Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2023/web/under-construction/flask/app.py | ctfs/GoogleCTF/2023/web/under-construction/flask/app.py | # Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2022/misc/LeGit/server.py | ctfs/GoogleCTF/2022/misc/LeGit/server.py | #!/usr/bin/python3 -u
import os
import os.path
import subprocess
import urllib.parse
_BASE_DIR = "/tmp/"
_REPO_DIR = None
_BANNER = """
_ ____ _ _
| | ___ / ___(_) |_
| |/ _ \ | _| | __|
| | __/ |_| | | |_
|_|\___|\____|_|\__|
"""
def menu():
print("Welcome! How can I help you?")
print("1- List f... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2022/misc/OCR/server.py | ctfs/GoogleCTF/2022/misc/OCR/server.py | # Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2022/pwn/d8/launcher.py | ctfs/GoogleCTF/2022/pwn/d8/launcher.py | import sys
import io
import subprocess
def main():
reader = io.BufferedReader(sys.stdin.buffer, buffer_size=1)
print('File size:', flush=True)
input_size = int(reader.readline())
if input_size <= 0 or input_size > 65536:
print('Invalid file size.', flush=True)
return
print('File data:', flush=True)... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2022/sandbox/Treebox/treebox.py | ctfs/GoogleCTF/2022/sandbox/Treebox/treebox.py | #!/usr/bin/python3 -u
#
# Flag is in a file called "flag" in cwd.
#
# Quote from Dockerfile:
# FROM ubuntu:22.04
# RUN apt-get update && apt-get install -y python3
#
import ast
import sys
import os
def verify_secure(m):
for x in ast.walk(m):
match type(x):
case (ast.Import|ast.ImportFrom|ast.Call):
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2022/crypto/Custom_Protocol/msgs_pb2.py | ctfs/GoogleCTF/2022/crypto/Custom_Protocol/msgs_pb2.py | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: msgs.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
fro... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2022/crypto/Custom_Protocol/server.py | ctfs/GoogleCTF/2022/crypto/Custom_Protocol/server.py | #!/usr/bin/python3.9
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2022/crypto/Maybe_Someday/chall.py | ctfs/GoogleCTF/2022/crypto/Maybe_Someday/chall.py | #!/usr/bin/python3
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2022/crypto/Cycling/chall.py | ctfs/GoogleCTF/2022/crypto/Cycling/chall.py | #!/usr/bin/python3
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2022/crypto/Enigma/encode.py | ctfs/GoogleCTF/2022/crypto/Enigma/encode.py | #!/usr/bin/python3
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2022/crypto/Enigma/encrypt_modern.py | ctfs/GoogleCTF/2022/crypto/Enigma/encrypt_modern.py | #!/usr/bin/python3
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2022/web/log4j/server/app.py | ctfs/GoogleCTF/2022/web/log4j/server/app.py | import os
import subprocess
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def start():
if request.method == 'POST':
text = request.form['text'].split(' ')
cmd = ''
if len(text) < 1:
return ('invalid message', ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2022/web/gpushop2/paymeflare/jwk.py | ctfs/GoogleCTF/2022/web/gpushop2/paymeflare/jwk.py | import requests
import json
import base64
from Crypto.PublicKey import RSA
res = requests.get('https://www.googleapis.com/oauth2/v3/certs')
keys = json.loads(res.content).get('keys')
for k in keys:
n = k['n']
e = k['e']
n = base64.urlsafe_b64decode(n + '==')
e = base64.urlsafe_b64decode(e + '=='... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/GoogleCTF/2022/web/gpushop2/paymeflare/haproxy/update_pubkey.py | ctfs/GoogleCTF/2022/web/gpushop2/paymeflare/haproxy/update_pubkey.py | import requests
import base64
import time
from Cryptodome.PublicKey import RSA
OAUTH2_CERTS_URL = "https://www.googleapis.com/oauth2/v3/certs"
OAUTH_PUBKEY_PATH = "/tmp/haproxy/oauth_pubkey.pem"
def gen_pubkey(k):
n = k['n']
e = k['e']
n = base64.urlsafe_b64decode(n + '==')
e = base64.urlsafe_b64... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/ALLES/2021/pwn/csgo/flaghoster/service.py | ctfs/ALLES/2021/pwn/csgo/flaghoster/service.py | from http.server import BaseHTTPRequestHandler
import socketserver
import os
class Handler(BaseHTTPRequestHandler):
def do_FLAG(self):
cl = int(self.headers['Content-Length'])
data = self.rfile.read(cl)
if data == b"is for me?":
self.send_response(418)
self.send_head... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/ALLES/2021/crypto/Secure_Flag_Service/main.py | ctfs/ALLES/2021/crypto/Secure_Flag_Service/main.py | #!/usr/bin/env python3
import base64
from Crypto.Cipher import AES
from Crypto.Hash import SHA3_256, HMAC, BLAKE2s
from Crypto.Random import urandom, random
from secret import FLAG, PASSWORD
encryption_key = BLAKE2s.new(data=PASSWORD + b'encryption_key').digest()
mac_key = BLAKE2s.new(data=PASSWORD + b'mac_key').diges... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/ALLES/2021/crypto/Nostego/challenge.py | ctfs/ALLES/2021/crypto/Nostego/challenge.py | from PIL import Image
import sys
if len(sys.argv) != 3:
print("Usage: %s [infile] [outfile]" % sys.argv[0])
sys.exit(1)
image = Image.open(sys.argv[1]).convert("F")
width, height = image.size
result = Image.new("F", (width, height))
ROUNDS = 32
for i in range(width):
for j in range(height):
valu... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/ALLES/2021/web/amazing-crypto-waf/app/__init__.py | ctfs/ALLES/2021/web/amazing-crypto-waf/app/__init__.py | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false | |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/ALLES/2021/web/amazing-crypto-waf/app/init.py | ctfs/ALLES/2021/web/amazing-crypto-waf/app/init.py | import sqlite3
import uuid
from logzero import logger
import hashlib
# make sure we have a secret for the app
try:
SECRET = open('/tmp/secret', 'rb').read()
logger.info(f'found secret file: {SECRET}')
except FileNotFoundError:
SECRET = uuid.uuid4().bytes
with open('/tmp/secret', 'wb') as f:
f.w... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/ALLES/2021/web/amazing-crypto-waf/app/app.py | ctfs/ALLES/2021/web/amazing-crypto-waf/app/app.py | import asyncio
import hashlib
import hmac
import time
import uuid
import base64
import socket
from datetime import datetime
from logzero import logger
from functools import wraps
import sqlite3
from threading import Thread
from flask import Flask, render_template, g, url_for, request, Response
# run the server: python... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/ALLES/2021/web/amazing-crypto-waf/crypter/__init__.py | ctfs/ALLES/2021/web/amazing-crypto-waf/crypter/__init__.py | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false | |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/ALLES/2021/web/amazing-crypto-waf/crypter/init.py | ctfs/ALLES/2021/web/amazing-crypto-waf/crypter/init.py | import requests
import uuid
from logzero import logger
# create flag user
pw = uuid.uuid4().hex
flag = open('flag', 'rb').read()
logger.info(f'flagger password: {pw}')
s = requests.Session()
r = s.post(f'http://127.0.0.1:1024/registerlogin',
data={'username': 'flagger','password':pw}, allow_redirects=... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/ALLES/2021/web/amazing-crypto-waf/crypter/app.py | ctfs/ALLES/2021/web/amazing-crypto-waf/crypter/app.py | import asyncio
import hashlib
import hmac
import time
import uuid
import re
import binascii
import base64
import socket
from urllib.parse import unquote
from datetime import datetime
from logzero import logger
from functools import wraps
import sqlite3
import requests
from threading import Thread
from flask import Flas... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.