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/UrchinSecAware/2024/crypto/WarmUp/enc.py
ctfs/UrchinSecAware/2024/crypto/WarmUp/enc.py
from sympy import mod_inverse def generate_knapsack(): knapsack = [1, 2] for i in range(6): knapsack.append(sum(knapsack) + 1) return knapsack def convert_to_bits(message): bits = [] for char in message: char_bits = bin(ord(char))[2:].zfill(8) bits.extend([int(b) for b in c...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UrchinSecAware/2024/crypto/Shifty_Business/script.py
ctfs/UrchinSecAware/2024/crypto/Shifty_Business/script.py
from functools import reduce def ecv(v): n = [16, 32, 64, 128] return reduce(lambda v, s: (v << s) ^ s, n, v) flag = "urchinsec{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}" enc = [ecv(ord(char) ** 2) for char in flag] print(enc)
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2024/misc/Really_Only_Echo/server.py
ctfs/PatriotCTF/2024/misc/Really_Only_Echo/server.py
#!/usr/bin/python3 import os,pwd,re import socketserver, signal import subprocess listen = 3333 blacklist = os.popen("ls /bin").read().split("\n") blacklist.remove("echo") #print(blacklist) def filter_check(command): user_input = command parsed = command.split() #Must begin with echo if not "echo" i...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2024/rev/Puzzle_Room/puzzle_room.py
ctfs/PatriotCTF/2024/rev/Puzzle_Room/puzzle_room.py
#!/usr/bin/env python import time import random #### Crypto stuff not important import base64 import hashlib from Crypto import Random from Crypto.Cipher import AES class AESCipher(object): def __init__(self, key): self.bs = AES.block_size self.key = hashlib.sha256(key.encode()).digest() def...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2024/crypto/Melting_Tux/half_script.py
ctfs/PatriotCTF/2024/crypto/Melting_Tux/half_script.py
from Cryptodome.Cipher import AES from Cryptodome.Util.Padding import pad,unpad import os from datetime import datetime import random # safe key, trust key = '00000000000000000000000000000000' def gen_offset(): super_safe_seed = int(datetime.utcnow().timestamp()) random.seed(super_safe_seed) return rando...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2024/crypto/Protected_Console/cryptor.py
ctfs/PatriotCTF/2024/crypto/Protected_Console/cryptor.py
#!/usr/bin/python3 from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad from external import * import socketserver, signal, json, os, re, sys from io import StringIO listen = 1337 attempts = 10000 flag = getflag() guest = b"{'username':'guest_user','role':0}" def encrypt(key,iv,message): cipher...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2024/crypto/idk_cipher/encode.py
ctfs/PatriotCTF/2024/crypto/idk_cipher/encode.py
import base64 """ ******************************************** * * * * ******************************************** """ # WARNING: This is a secret key. Do not expose it. srt_key = 'secretkey' # // TODO: change the placeholder usr_input ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2024/crypto/Hard_to_Implement/cryptor.py
ctfs/PatriotCTF/2024/crypto/Hard_to_Implement/cryptor.py
#!/usr/bin/python3 from Crypto.Cipher import AES from Crypto.Util.Padding import pad from Crypto.Random import get_random_bytes from external import * import socketserver, signal listen = 1337 attempts = 1500 flag = getflag() def encrypt(key,plaintext): cipher = AES.new(key, AES.MODE_ECB) pt = pad(plaintext + flag...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2024/crypto/One_for_you_one_for_me/chal.py
ctfs/PatriotCTF/2024/crypto/One_for_you_one_for_me/chal.py
from flag import FLAG import secrets def share_bits_with_you(flag): # Convert the flag to its binary representation flag_bits = ''.join(f'{ord(c):08b}' for c in flag) num_bits = len(flag_bits) indices = list(range(num_bits)) # Fisher-Yates shuffle to mix up the bits for i in range(num_bits...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2024/crypto/Scrambler_V2/scramblerv2.py
ctfs/PatriotCTF/2024/crypto/Scrambler_V2/scramblerv2.py
import random as r import datetime as dt import time as t import os def main(): choice = "" print(f"Welcome to the Scrambler V2, your one stop encryption tool.") print(f"What would you like to do?\n") while choice.lower() != "q": menu() choice = input(">>> ") if choice == "1": ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2024/crypto/Bit_by_Bit/transmit.py
ctfs/PatriotCTF/2024/crypto/Bit_by_Bit/transmit.py
#!/usr/bin/python3 import sys blocksize = 16 def loadMessage(): message = "" with open("message.txt","r",encoding='utf-8') as file: for line in file: message += line while len(message) % blocksize != 0: message += '0' return message def encode(chunk): start = 120 e...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2024/crypto/Textbook_Schnorr_right/chall.py
ctfs/PatriotCTF/2024/crypto/Textbook_Schnorr_right/chall.py
from sage.all import * import secrets import hashlib import sys import signal import re class EllipticCurveCrypto: """ Elliptic Curve Cryptography using the secp256k1 curve. """ def __init__(self): self.p = [<REDACTED>] self.q = [<REDACTED>] self.K = GF(self.p) self.a =...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2024/web/Impersonate/app.py
ctfs/PatriotCTF/2024/web/Impersonate/app.py
#!/usr/bin/env python3 from flask import Flask, request, render_template, jsonify, abort, redirect, session import uuid import os from datetime import datetime, timedelta import hashlib app = Flask(__name__) server_start_time = datetime.now() server_start_str = server_start_time.strftime('%Y%m%d%H%M%S') secure_key = ha...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2024/web/Open_Seasame/server.py
ctfs/PatriotCTF/2024/web/Open_Seasame/server.py
from flask import Flask, request import uuid, subprocess app = Flask(__name__) SECRET = open("secret.txt", "r").read() stats = [] @app.route('/', methods=['GET']) def main(): return 'Hello, World!' @app.route('/api/stats/<string:id>', methods=['GET']) def get_stats(id): for stat in stats: if stat['id...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2023/misc/ML_Pyjail/MLjail/app.py
ctfs/PatriotCTF/2023/misc/ML_Pyjail/MLjail/app.py
#!/usr/bin/env python3 from mlmodel import endpoint WARNING = '\033[93m' ERROR = '\033[91m' END = '\033[0m' if __name__ == "__main__": while True: user_input = input(">>> ") classification = endpoint.classify_local(user_input) if len(classification) == 0: print(f"{WARNING}Canno...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2023/misc/ML_Pyjail/MLjail/mlmodel/endpoint.py
ctfs/PatriotCTF/2023/misc/ML_Pyjail/MLjail/mlmodel/endpoint.py
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import numpy from nltk.stem.lancaster import LancasterStemmer import nltk import tensorflow as tf tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) import tflearn import pickle stemmer = LancasterStemmer() curr_path = os.path.dirname(__file__) parent_dir...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2023/rev/Python_Garbage_Compiler/garbage.py
ctfs/PatriotCTF/2023/rev/Python_Garbage_Compiler/garbage.py
import string # ++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>>+++++.++++.+++.-.+++.++.<<++.>>-.+.--.---------.+++++.-------. from random import * # ++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>>++.++++++++++++.---.--.<<++.>>+++++.-----------------.+++++++++++++.----------.+++++++++++.--.<<.>>----.++++.+++.-.+++.++.<<.+...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2023/rev/Python_XOR/XOR.py
ctfs/PatriotCTF/2023/rev/Python_XOR/XOR.py
from string import punctuation alphabet = list(punctuation) data = "bHEC_T]PLKJ{MW{AdW]Y" def main(): # For loop goes here key = ('') decrypted = ''.join([chr(ord(x) ^ ord(key)) for x in data]) print(decrypted) main()
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2025/crypto/Cipher_from_Hell/encryptor.py
ctfs/PatriotCTF/2025/crypto/Cipher_from_Hell/encryptor.py
import math, sys inp = input("Enter your flag... ").encode() s = int.from_bytes(inp) o = ( (6, 0, 7), (8, 2, 1), (5, 4, 3) ) c = math.floor(math.log(s, 3)) if not c % 2: sys.stderr.write("Error: flag length needs to be even (hint: but in what base system?)!\n") sys.exit(1) ss = 0 while c > -1: ss *= 9 ss ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2025/crypto/Vibe_Bank_Vault/vibe_vault.py
ctfs/PatriotCTF/2025/crypto/Vibe_Bank_Vault/vibe_vault.py
#!/usr/bin/env python3 """ Vibe Bank Vault - CTF Challenge A secure vault built by an intern who "vibe coded" the security layers. """ import base64 import sys import time import random import string import os import bcrypt _STATIC_SALT = b"$2b$12$C8YQMlqDyz3vGN9VOGBeGu" def vibe_hash(data: str) -> str: """Inter...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2022/crypto/ExtremelyCoolBook/server.py
ctfs/PatriotCTF/2022/crypto/ExtremelyCoolBook/server.py
import sys import socketserver from Crypto.Cipher import AES from Crypto.Random import get_random_bytes KEY = get_random_bytes(16) FLAG = "real_flag_is_defined_here" def encrypt(username,req): cipher = AES.new(KEY, AES.MODE_ECB) message = f"{username}, here is your top secret access code for today: {FLAG}" ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2022/crypto/Cryptogod/server.py
ctfs/PatriotCTF/2022/crypto/Cryptogod/server.py
import sys import socketserver from Crypto.Cipher import AES from Crypto.Util.Padding import pad from Crypto.Random import get_random_bytes FLAG = "real_flag_is_defined_here" KEY = get_random_bytes(16) BS = AES.block_size IV = b'\x00' * BS def encrypt(username): if not isinstance(username, bytes): usern...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2022/crypto/Merkle-Derkle/main.py
ctfs/PatriotCTF/2022/crypto/Merkle-Derkle/main.py
import ast import string import random from hashlib import sha1 from flask import render_template, request, flash, make_response from app import app letters = string.ascii_letters secret = ''.join(random.choice(letters) for i in range(random.randint(15,35))) def new_user(): user = "admin=False" data = secret...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2022/crypto/ComicallyBadCrypto/main.py
ctfs/PatriotCTF/2022/crypto/ComicallyBadCrypto/main.py
import string import random from base64 import b64decode, b64encode from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad from Crypto.Random import get_random_bytes from flask import render_template, request, make_response, redirect from app import app, confidential_settings, admin BS = AES.block...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2022/web/ZaaS/upload.py
ctfs/PatriotCTF/2022/web/ZaaS/upload.py
import os import zipfile import shutil from app import app from flask import flash, redirect, render_template, request, url_for, send_from_directory from flask_login import current_user, login_required from werkzeug.utils import secure_filename @app.route('/upload', methods=['GET', 'POST']) @login_required def uploa...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2022/web/TaaS/upload.py
ctfs/PatriotCTF/2022/web/TaaS/upload.py
import os import tarfile import shutil from app import app from flask import flash, redirect, render_template, request, url_for, send_from_directory from flask_login import current_user, login_required from werkzeug.utils import secure_filename @app.route('/upload', methods=['GET', 'POST']) @login_required def uploa...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PatriotCTF/2022/web/ExcellentDatabase/main.py
ctfs/PatriotCTF/2022/web/ExcellentDatabase/main.py
import os from flask import render_template, redirect, request, session, flash, url_for from openpyxl import load_workbook import subprocess import pandas as pd from app import app, USERNAMES, PASSWORDS def add_user(username, password): DB = load_workbook(filename="db.xlsx") Users = DB["Users"] new_row =...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/L3akCTF/2024/crypto/Really_Simple_Algorithm/server.py
ctfs/L3akCTF/2024/crypto/Really_Simple_Algorithm/server.py
from Crypto.Util.number import getPrime, bytes_to_long as btl menu = '''(1) Encrypt Message (2) Receive Flag (3) Exit''' e = 1337 size = 1024 flag = open('flag.txt', 'r').read().rstrip() print('Welcome to the L3ak Really Simple Algorithm (RSA) Encryption Service™!') print('Here you can encrypt your own message, or c...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/L3akCTF/2024/crypto/Crypto_on_the_rocks/chal.py
ctfs/L3akCTF/2024/crypto/Crypto_on_the_rocks/chal.py
from sage.all import * from typing import Tuple import hashlib from Crypto.Cipher import AES from Crypto.Util.number import long_to_bytes from Crypto.Util.Padding import pad from Crypto.Random import get_random_bytes import re p = 0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/L3akCTF/2025/crypto/Lowkey_RSA/lowkey-rsa.py
ctfs/L3akCTF/2025/crypto/Lowkey_RSA/lowkey-rsa.py
from Crypto.Util.number import * def gen_primes(SIZE): p = random_prime(1 << (SIZE - 1), 1 << SIZE) while True: q = random_prime(1 << (SIZE - 1), 1 << SIZE) if p < q: p, q = q, p if q < p < 2*q: break return p, q nbits = 1024 flag = b"L3AK{<REDACTED...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/L3akCTF/2025/crypto/Cat_Whisperer/cat-whisperer.py
ctfs/L3akCTF/2025/crypto/Cat_Whisperer/cat-whisperer.py
import os import base64 import random import string import tempfile import subprocess def main(): flag = open("flag.txt", "r").read().rstrip() assert len(flag) == 42 b64_data = input("Enter your base64-encoded rule file: ") try: rule_data = base64.b64decode(b64_data) except Exception: ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/HKUSTFirebird/2024/misc/Math_Formula/chall.py
ctfs/HKUSTFirebird/2024/misc/Math_Formula/chall.py
from sage.all import * # In case you don't want to install Sage, you can use https://sagecell.sagemath.org/ and I guarantee Sagemath Cell is sufficient in solving this challenge. # Also, to someone who doesn't know about Sage, the QQ() below is just a wrapper for rational numbers so that it retains its exact value wit...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/HKUSTFirebird/2024/pwn/trim/env/chall/src/app.py
ctfs/HKUSTFirebird/2024/pwn/trim/env/chall/src/app.py
#!/usr/bin/python3.9 import subprocess import sys import tempfile print("Input your Lua code (End with \"__EOF__\"):", flush=True) source = "" while True: line = sys.stdin.readline() if line.startswith("__EOF__"): break source += line if len(source) >= 0x2000: print("[-] Code too long...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/HKUSTFirebird/2024/rev/Photo_Encryptor/main.py
ctfs/HKUSTFirebird/2024/rev/Photo_Encryptor/main.py
from flask import Flask, render_template, request import hashlib from random import * from PIL import Image import base64 import io app = Flask(__name__) @app.route('/', methods=['GET', 'POST']) def home(): if request.method == 'GET': return render_template('index.html', msg='', image_b64='') ima...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/HKUSTFirebird/2024/crypto/Goldilocks/chall.py
ctfs/HKUSTFirebird/2024/crypto/Goldilocks/chall.py
import signal import os import sys import random from Crypto.Util.number import isPrime as is_prime def tle_handler(*args): print('⏰') sys.exit(0) def main(): # Just to make sure the order is large enough p = 0xde5831cd21036cbbf072deac86ac1a48f74e3e78bcd916132cf54ee27a80e26021cd0371c698c35ddb6927fdf...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/HKUSTFirebird/2024/crypto/Vigenere_+_CTR/vigctr.py
ctfs/HKUSTFirebird/2024/crypto/Vigenere_+_CTR/vigctr.py
import secrets SHIFT = 65 MOD = 26 BLOCKLENGTH = 20 def add(block1,block2): assert(len(block1)<= len(block2)) assert(len(block2)<= BLOCKLENGTH) b1upper = block1.upper() b2upper = block2.upper() b1 = [ ord(b1upper[i])-SHIFT for i in range(len(block1))] b2 = [ ord(b2upper[i])-SHIFT for i in rang...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/HKUSTFirebird/2024/crypto/The_Quintessential_Quintuples/chall.py
ctfs/HKUSTFirebird/2024/crypto/The_Quintessential_Quintuples/chall.py
import signal from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad import hashlib import os import sys def tle_handler(*args): print('⏰') sys.exit(0) class Quintessential_Quintuples: modes = (1, 2, 3, 5, 6) # I have no idea why MODE 4 doesn't exist, maybe it's because Yotsuba is the f...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/HKUSTFirebird/2024/crypto/Random_Secure_Algorithm_II/chall-2.py
ctfs/HKUSTFirebird/2024/crypto/Random_Secure_Algorithm_II/chall-2.py
from Crypto.Util.number import getPrime from Crypto.Cipher import AES from Crypto.Util.Padding import pad import signal import hashlib import os import random def tle_handler(*args): print('⏰') sys.exit(0) class RSA: def __init__(self, n = 1024): p = getPrime(n // 2) q = getPrime(n // 2) ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/HKUSTFirebird/2024/crypto/Random_Secure_Algorithm_I/chall-1.py
ctfs/HKUSTFirebird/2024/crypto/Random_Secure_Algorithm_I/chall-1.py
from Crypto.Util.number import getPrime from Crypto.Cipher import AES from Crypto.Util.Padding import pad import signal import hashlib import os import random def tle_handler(*args): print('⏰') sys.exit(0) class RSA: def __init__(self, n = 1024): p = getPrime(n // 2) q = getPrime(n // 2) ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/HKUSTFirebird/2024/web/infantwaf/proxy/index.py
ctfs/HKUSTFirebird/2024/web/infantwaf/proxy/index.py
from flask import Flask, request, render_template_string from requests import get from random import uniform app = Flask(__name__) PORT = 80 upstream = 'http://infantwaf.backend' @app.route('/', methods=['GET']) def proxy(): q = request.args.get('giveme') if q is not None: if q != 'proxy': ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/app_beta.py
ctfs/WMCTF/2023/pwn/PDC_2_5/app_beta.py
from aiohttp import web from fastecdsa.curve import P256 from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC from pysm4 import encrypt_cbc import aiofiles import os import json import string import random import hashlib import time import base64 rootKey = ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/setup.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/setup.py
import os.path import setuptools root_dir = os.path.abspath(os.path.dirname(__file__)) about = {} about_file = os.path.join(root_dir, "src", "aiortc", "about.py") with open(about_file, encoding="utf-8") as fp: exec(fp.read(), about) readme_file = os.path.join(root_dir, "README.rst") with open(readme_file, encod...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/scripts/fetch-vendor.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/scripts/fetch-vendor.py
import argparse import logging import json import os import platform import shutil import struct import subprocess def get_platform(): system = platform.system() machine = platform.machine() if system == "Linux": return f"manylinux_{machine}" elif system == "Darwin": # cibuildwheel set...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcsessiondescription.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcsessiondescription.py
from dataclasses import dataclass @dataclass class RTCSessionDescription: """ The :class:`RTCSessionDescription` dictionary describes one end of a connection and how it's configured. """ sdp: str type: str def __post_init__(self): if self.type not in {"offer", "pranswer", "answer...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcrtpparameters.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcrtpparameters.py
from dataclasses import dataclass, field from typing import Dict, List, Optional, Union ParametersDict = Dict[str, Union[int, str, None]] @dataclass class RTCRtpCodecCapability: """ The :class:`RTCRtpCodecCapability` dictionary provides information on codec capabilities. """ mimeType: str "T...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcsctptransport.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcsctptransport.py
import asyncio import enum import hmac import logging import math import os import time from collections import deque from dataclasses import dataclass, field from struct import pack, unpack_from from typing import ( Any, Callable, Deque, Dict, Iterator, List, Optional, Set, Tuple, ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcrtptransceiver.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcrtptransceiver.py
import logging from typing import List, Optional from .codecs import get_capabilities from .rtcdtlstransport import RTCDtlsTransport from .rtcrtpparameters import ( RTCRtpCodecCapability, RTCRtpCodecParameters, RTCRtpHeaderExtensionParameters, ) from .rtcrtpreceiver import RTCRtpReceiver from .rtcrtpsender...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcdatachannel.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcdatachannel.py
import logging from dataclasses import dataclass from typing import Optional, Union from pyee.asyncio import AsyncIOEventEmitter from .exceptions import InvalidStateError logger = logging.getLogger(__name__) @dataclass class RTCDataChannelParameters: """ The :class:`RTCDataChannelParameters` dictionary des...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcicetransport.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcicetransport.py
import asyncio import logging import re from dataclasses import dataclass from typing import Any, Dict, List, Optional from aioice import Candidate, Connection, ConnectionClosed from pyee.asyncio import AsyncIOEventEmitter from .exceptions import InvalidStateError from .rtcconfiguration import RTCIceServer STUN_REGE...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcrtpreceiver.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcrtpreceiver.py
import asyncio import datetime import logging import queue import random import threading import time from dataclasses import dataclass from typing import Callable, Dict, List, Optional, Set from av.frame import Frame from . import clock from .codecs import depayload, get_capabilities, get_decoder, is_rtx from .excep...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtp.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtp.py
import math import os import struct from dataclasses import dataclass, field from struct import pack, unpack, unpack_from from typing import Any, List, Optional, Tuple, Union from av import AudioFrame from .rtcrtpparameters import RTCRtpParameters # used for NACK and retransmission RTP_HISTORY_SIZE = 128 # reserved...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/exceptions.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/exceptions.py
class InternalError(Exception): pass class InvalidAccessError(Exception): pass class InvalidStateError(Exception): pass class OperationError(Exception): pass
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/jitterbuffer.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/jitterbuffer.py
from typing import List, Optional, Tuple from .rtp import RtpPacket from .utils import uint16_add MAX_MISORDER = 100 class JitterFrame: def __init__(self, data: bytes, timestamp: int) -> None: self.data = data self.timestamp = timestamp class JitterBuffer: def __init__( self, capac...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcdtlstransport.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcdtlstransport.py
import asyncio import binascii import datetime import enum import logging import os import traceback from dataclasses import dataclass, field from typing import Any, Dict, List, Optional, Set, Type, TypeVar import pylibsrtp from cryptography import x509 from cryptography.hazmat.backends import default_backend from cry...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/events.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/events.py
from dataclasses import dataclass from .mediastreams import MediaStreamTrack from .rtcrtpreceiver import RTCRtpReceiver from .rtcrtptransceiver import RTCRtpTransceiver @dataclass class RTCTrackEvent: """ This event is fired on :class:`RTCPeerConnection` when a new :class:`MediaStreamTrack` is added by t...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/mediastreams.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/mediastreams.py
import asyncio import fractions import time import uuid from abc import ABCMeta, abstractmethod from typing import Tuple, Union from av import AudioFrame, VideoFrame from av.frame import Frame from av.packet import Packet from pyee.asyncio import AsyncIOEventEmitter AUDIO_PTIME = 0.020 # 20ms audio packetization VID...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/utils.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/utils.py
import os from struct import unpack def random16() -> int: return unpack("!H", os.urandom(2))[0] def random32() -> int: return unpack("!L", os.urandom(4))[0] def uint16_add(a: int, b: int) -> int: """ Return a + b. """ return (a + b) & 0xFFFF def uint16_gt(a: int, b: int) -> bool: ""...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/sdp.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/sdp.py
import enum import ipaddress import re from dataclasses import dataclass from typing import Any, Dict, List, Optional, Tuple, Union from . import rtp from .rtcdtlstransport import RTCDtlsFingerprint, RTCDtlsParameters from .rtcicetransport import RTCIceCandidate, RTCIceParameters from .rtcrtpparameters import ( Pa...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rate.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rate.py
import math from enum import Enum from typing import Dict, List, Optional, Tuple from aiortc.utils import uint32_add, uint32_gt BURST_DELTA_THRESHOLD_MS = 5 # overuse detector MAX_ADAPT_OFFSET_MS = 15 MIN_NUM_DELTAS = 60 # overuse estimator DELTA_COUNTER_MAX = 1000 MIN_FRAME_PERIOD_HISTORY_LENGTH = 60 # abs-send-t...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/clock.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/clock.py
import datetime NTP_EPOCH = datetime.datetime(1900, 1, 1, tzinfo=datetime.timezone.utc) def current_datetime() -> datetime.datetime: return datetime.datetime.now(datetime.timezone.utc) def current_ms() -> int: delta = current_datetime() - NTP_EPOCH return int(delta.total_seconds() * 1000) def current...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/__init__.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/__init__.py
# flake8: noqa import logging import av.logging from .about import __version__ from .exceptions import InvalidAccessError, InvalidStateError from .mediastreams import MediaStreamTrack, VideoStreamTrack from .rtcconfiguration import RTCConfiguration, RTCIceServer from .rtcdatachannel import RTCDataChannel, RTCDataChan...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcpeerconnection.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcpeerconnection.py
import asyncio import copy import logging import uuid from typing import Dict, List, Optional, Set, Union from pyee.asyncio import AsyncIOEventEmitter from . import clock, rtp, sdp from .codecs import CODECS, HEADER_EXTENSIONS, is_rtx from .events import RTCTrackEvent from .exceptions import ( InternalError, ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/about.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/about.py
__author__ = "Jeremy Lainé" __email__ = "jeremy.laine@m4x.org" __license__ = "BSD" __summary__ = "An implementation of WebRTC and ORTC" __title__ = "aiortc" __uri__ = "https://github.com/aiortc/aiortc" __version__ = "1.4.0"
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/stats.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/stats.py
import datetime from dataclasses import dataclass from typing import Optional @dataclass class RTCStats: """ Base class for statistics. """ timestamp: datetime.datetime "The timestamp associated with this object." type: str id: str @dataclass class RTCRtpStreamStats(RTCStats): ssrc:...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcrtpsender.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcrtpsender.py
import asyncio import logging import random import time import traceback import uuid from typing import Callable, Dict, List, Optional, Union from av import AudioFrame from av.frame import Frame from . import clock, rtp from .codecs import get_capabilities, get_encoder, is_rtx from .codecs.base import Encoder from .e...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcconfiguration.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/rtcconfiguration.py
from dataclasses import dataclass from typing import List, Optional, Iterable @dataclass class RTCIceServer: """ The :class:`RTCIceServer` dictionary defines how to connect to a single STUN or TURN server. It includes both the URL and the necessary credentials, if any, to connect to the server. ""...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/contrib/signaling.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/contrib/signaling.py
import asyncio import json import logging import os import sys from aiortc import RTCIceCandidate, RTCSessionDescription from aiortc.sdp import candidate_from_sdp, candidate_to_sdp logger = logging.getLogger(__name__) BYE = object() def object_from_string(message_str): message = json.loads(message_str) if m...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/contrib/__init__.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/contrib/__init__.py
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/contrib/media.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/contrib/media.py
import asyncio import errno import fractions import logging import threading import time from typing import Dict, Optional, Set, Union import av from av import AudioFrame, VideoFrame from av.audio import AudioStream from av.frame import Frame from av.packet import Packet from av.video.stream import VideoStream from ....
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/codecs/g711.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/codecs/g711.py
import audioop import fractions from abc import ABC, abstractmethod from typing import List, Optional, Tuple from av import AudioFrame from av.frame import Frame from av.packet import Packet from ..jitterbuffer import JitterFrame from ..mediastreams import convert_timebase from .base import Decoder, Encoder SAMPLE_R...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/codecs/opus.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/codecs/opus.py
import audioop import fractions from typing import List, Optional, Tuple from av import AudioFrame from av.frame import Frame from av.packet import Packet from ..jitterbuffer import JitterFrame from ..mediastreams import convert_timebase from ._opus import ffi, lib from .base import Decoder, Encoder CHANNELS = 2 SAM...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/codecs/vpx.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/codecs/vpx.py
import multiprocessing import random from struct import pack, unpack_from from typing import List, Tuple, Type, TypeVar, cast from av import VideoFrame from av.frame import Frame from av.packet import Packet from ..jitterbuffer import JitterFrame from ..mediastreams import VIDEO_CLOCK_RATE, VIDEO_TIME_BASE, convert_t...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/codecs/h264.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/codecs/h264.py
import fractions import logging import math from itertools import tee from struct import pack, unpack_from from typing import Iterator, List, Optional, Sequence, Tuple, Type, TypeVar import av from av.frame import Frame from av.packet import Packet from ..jitterbuffer import JitterFrame from ..mediastreams import VID...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/codecs/__init__.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/codecs/__init__.py
from typing import Dict, List, Optional, Union from ..rtcrtpparameters import ( ParametersDict, RTCRtcpFeedback, RTCRtpCapabilities, RTCRtpCodecCapability, RTCRtpCodecParameters, RTCRtpHeaderExtensionCapability, RTCRtpHeaderExtensionParameters, ) from .base import Decoder, Encoder from .g71...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/codecs/base.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/aiortc/codecs/base.py
from abc import ABCMeta, abstractmethod from typing import List, Tuple from av.frame import Frame from av.packet import Packet from ..jitterbuffer import JitterFrame class Decoder(metaclass=ABCMeta): @abstractmethod def decode(self, encoded_frame: JitterFrame) -> List[Frame]: pass # pragma: no cove...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/_cffi_src/build_vpx.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/_cffi_src/build_vpx.py
from cffi import FFI ffibuilder = FFI() ffibuilder.set_source( "aiortc.codecs._vpx", """ #include <vpx/vpx_decoder.h> #include <vpx/vpx_encoder.h> #include <vpx/vp8cx.h> #include <vpx/vp8dx.h> #undef vpx_codec_dec_init #undef vpx_codec_enc_init vpx_codec_err_t vpx_codec_dec_init(vpx_codec_ctx_t *ctx, ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/_cffi_src/build_opus.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/src/_cffi_src/build_opus.py
from cffi import FFI ffibuilder = FFI() ffibuilder.set_source( "aiortc.codecs._opus", """ #include <opus/opus.h> """, libraries=["opus"], ) ffibuilder.cdef( """ #define OPUS_APPLICATION_VOIP 2048 #define OPUS_OK 0 typedef struct OpusDecoder OpusDecoder; typedef struct OpusEncoder OpusEncoder; ty...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rate.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rate.py
from unittest import TestCase from numpy import random from aiortc.rate import ( AimdRateControl, BandwidthUsage, InterArrival, OveruseDetector, OveruseEstimator, RateBucket, RateControlState, RateCounter, RemoteBitrateEstimator, ) TIMESTAMP_GROUP_LENGTH_US = 5000 MIN_STEP_US = 20...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_opus.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_opus.py
import fractions from aiortc.codecs import get_decoder, get_encoder from aiortc.codecs.opus import OpusDecoder, OpusEncoder from aiortc.jitterbuffer import JitterFrame from aiortc.rtcrtpparameters import RTCRtpCodecParameters from .codecs import CodecTestCase OPUS_CODEC = RTCRtpCodecParameters( mimeType="audio/o...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rtcpeerconnection.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rtcpeerconnection.py
import asyncio import re from unittest import TestCase import aioice.ice import aioice.stun from aiortc import ( RTCConfiguration, RTCIceCandidate, RTCPeerConnection, RTCSessionDescription, ) from aiortc.contrib.media import MediaPlayer from aiortc.exceptions import ( InternalError, InvalidAcc...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_h264.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_h264.py
import fractions import io from contextlib import redirect_stderr from unittest import TestCase from av import Packet from aiortc.codecs import get_decoder, get_encoder, h264 from aiortc.codecs.h264 import H264Decoder, H264Encoder, H264PayloadDescriptor from aiortc.jitterbuffer import JitterFrame from aiortc.rtcrtppa...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_sdp.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_sdp.py
from unittest import TestCase from aiortc.rtcrtpparameters import ( RTCRtcpFeedback, RTCRtpCodecParameters, RTCRtpHeaderExtensionParameters, ) from aiortc.sdp import ( GroupDescription, H264Level, H264Profile, SessionDescription, SsrcDescription, parse_h264_profile_level_id, ) from...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rtcrtpsender.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rtcrtpsender.py
import asyncio from struct import pack from unittest import TestCase from unittest.mock import patch from aiortc import MediaStreamTrack from aiortc.codecs import PCMU_CODEC from aiortc.exceptions import InvalidStateError from aiortc.mediastreams import AudioStreamTrack, VideoStreamTrack from aiortc.rtcrtpparameters i...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_codecs.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_codecs.py
from unittest import TestCase from aiortc.codecs import get_decoder, get_encoder from aiortc.rtcrtpparameters import RTCRtpCodecParameters BOGUS_CODEC = RTCRtpCodecParameters( mimeType="audio/bogus", clockRate=8000, channels=1, payloadType=0 ) class CodecsTest(TestCase): def test_get_decoder(self): ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_utils.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_utils.py
from unittest import TestCase from aiortc.utils import ( uint16_add, uint16_gt, uint16_gte, uint32_add, uint32_gt, uint32_gte, ) class UtilsTest(TestCase): def test_uint16_add(self): self.assertEqual(uint16_add(0, 1), 1) self.assertEqual(uint16_add(1, 1), 2) self.a...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_contrib_media.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_contrib_media.py
import asyncio import errno import os import tempfile import time import wave from unittest import TestCase from unittest.mock import patch import av from aiortc.contrib.media import MediaBlackhole, MediaPlayer, MediaRecorder, MediaRelay from aiortc.mediastreams import AudioStreamTrack, MediaStreamError, VideoStreamT...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rtcicetransport.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rtcicetransport.py
import asyncio from unittest import TestCase import aioice.stun from aioice import ConnectionClosed from aiortc.exceptions import InvalidStateError from aiortc.rtcconfiguration import RTCIceServer from aiortc.rtcicetransport import ( RTCIceCandidate, RTCIceGatherer, RTCIceParameters, RTCIceTransport, ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_ortc.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_ortc.py
import asyncio from unittest import TestCase from aiortc import ( RTCCertificate, RTCDtlsTransport, RTCIceGatherer, RTCIceTransport, RTCSctpTransport, ) from .utils import asynctest async def start_dtls_pair(ice_a, ice_b): dtls_a = RTCDtlsTransport(ice_a, [RTCCertificate.generateCertificate(...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rtcsessiondescription.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rtcsessiondescription.py
from unittest import TestCase from aiortc import RTCSessionDescription class RTCSessionDescriptionTest(TestCase): def test_bad_type(self): with self.assertRaises(ValueError) as cm: RTCSessionDescription(sdp="v=0\r\n", type="bogus") self.assertEqual( str(cm.exception), ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/utils.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/utils.py
import asyncio import contextlib import functools import logging import os from aiortc.rtcdtlstransport import RTCCertificate, RTCDtlsTransport def lf2crlf(x): return x.replace("\n", "\r\n") class ClosedDtlsTransport: state = "closed" class DummyConnection: def __init__(self, rx_queue, tx_queue): ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_g711.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_g711.py
import fractions import sys from aiortc.codecs import PCMA_CODEC, PCMU_CODEC, get_decoder, get_encoder from aiortc.codecs.g711 import PcmaDecoder, PcmaEncoder, PcmuDecoder, PcmuEncoder from aiortc.jitterbuffer import JitterFrame from .codecs import CodecTestCase # silence PCMA_PAYLOAD = b"\xd5" * 160 PCMU_PAYLOAD = ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_vpx.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_vpx.py
import fractions from unittest import TestCase from aiortc.codecs import get_decoder, get_encoder from aiortc.codecs.vpx import ( Vp8Decoder, Vp8Encoder, VpxPayloadDescriptor, _vpx_assert, number_of_threads, ) from aiortc.rtcrtpparameters import RTCRtpCodecParameters from .codecs import CodecTestC...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rtcrtpreceiver.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rtcrtpreceiver.py
import asyncio import contextlib import fractions from unittest import TestCase from unittest.mock import patch from aiortc.codecs import PCMU_CODEC, get_encoder from aiortc.exceptions import InvalidStateError from aiortc.mediastreams import MediaStreamError from aiortc.rtcrtpparameters import ( RTCRtpCapabilities...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_mediastreams.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_mediastreams.py
import asyncio import fractions import time from typing import Tuple from unittest import TestCase from av.packet import Packet from aiortc.mediastreams import ( VIDEO_CLOCK_RATE, VIDEO_PTIME, VIDEO_TIME_BASE, AudioStreamTrack, MediaStreamTrack, VideoStreamTrack, ) class VideoPacketStreamTra...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/__init__.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/__init__.py
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rtcsctptransport.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_rtcsctptransport.py
import asyncio import contextlib from unittest import TestCase from unittest.mock import patch from aiortc.exceptions import InvalidStateError from aiortc.rtcdatachannel import RTCDataChannel, RTCDataChannelParameters from aiortc.rtcsctptransport import ( SCTP_DATA_FIRST_FRAG, SCTP_DATA_LAST_FRAG, SCTP_DAT...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/codecs.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/codecs.py
import fractions from unittest import TestCase from av import AudioFrame, VideoFrame from av.packet import Packet from aiortc.codecs import depayload, get_decoder, get_encoder from aiortc.jitterbuffer import JitterFrame from aiortc.mediastreams import AUDIO_PTIME, VIDEO_TIME_BASE class CodecTestCase(TestCase): ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_contrib_signaling.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_contrib_signaling.py
import argparse import asyncio import os from unittest import TestCase from aiortc import RTCIceCandidate, RTCSessionDescription from aiortc.contrib.signaling import ( BYE, add_signaling_arguments, create_signaling, object_from_string, object_to_string, ) from .utils import asynctest async def d...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_jitterbuffer.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_jitterbuffer.py
from unittest import TestCase from aiortc.jitterbuffer import JitterBuffer from aiortc.rtp import RtpPacket class JitterBufferTest(TestCase): def assertPackets(self, jbuffer, expected): found = [x.sequence_number if x else None for x in jbuffer._packets] self.assertEqual(found, expected) def...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_clock.py
ctfs/WMCTF/2023/pwn/PDC_2_5/aiortc/tests/test_clock.py
import datetime from unittest import TestCase from unittest.mock import patch from aiortc import clock class ClockTest(TestCase): @patch("aiortc.clock.current_datetime") def test_current_ms(self, mock_now): mock_now.return_value = datetime.datetime( 2018, 9, 11, tzinfo=datetime.timezone.u...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false