From 536f7ed976e7e2e1c122e7ed6a5c1864f3d96558 Mon Sep 17 00:00:00 2001 From: Aditya9113 Date: Wed, 16 Apr 2025 13:31:57 -0700 Subject: [PATCH] changin python header --- 0ctf2019/babyrsa/secret.py | 2 +- 0ctf2021quals/cloudpass/task | 2 +- 0ctf2021quals/zer0lfsr/task | 2 +- 0x41414141ctf2021/factorize/factorize | 2 +- 0x41414141ctf2021/filereader/filereader | 2 +- 0x41414141ctf2021/pyjail/pyjail | 2 +- 0x41414141ctf2021/soul/net | 2 +- 0x41414141ctf2021/staple-aes/aes | 174 ++++++++--------- 0x41414141ctf2021/wallet/wallet | 2 +- accessdeniedctf2022/ecc/chal | 2 +- angstromctf2016/casino/casino | 2 +- angstromctf2016/helpcenter/server | 2 +- angstromctf2017/casino/card_guessing | 2 +- angstromctf2017/royalcasino/casino | 2 +- angstromctf2022/randomlysampledalgorithm/rsa | 2 +- angstromctf2024/philosophy/chall | 2 +- angstromctf2024/presidential/source | 2 +- angstromctf2024/tss1/tss1 | 2 +- angstromctf2024/tss2/tss2 | 2 +- byuctf2022/blue/create.py | 2 +- byuctf2024/aresa/keygen | 2 +- byuctf2024/domath/domath | 2 +- byuctf2024/giveup/nevergonna | 2 +- byuctf2024/multiplied/ellipticcurve.py | 176 +++++++++--------- byuctf2024/multiplied/mul | 2 +- byuctf2024/worstchallenge/awful | 2 +- cactusconctf2025/securerepititions/secure_rep | 2 +- corctf2021/babyrand/script | 2 +- corctf2021/bank/server | 2 +- corctf2021/chance/source | 2 +- corctf2021/fibinary/enc | 2 +- corctf2021/fourninesix/source | 2 +- corctf2021/fourninesix/source_patched | 2 +- corctf2021/lcg/source | 2 +- corctf2022/babypad/server | 2 +- cryptoctf2020/fatima/fatima | 2 +- cryptoctf2020/threeravens/three_ravens | 2 +- cryptoctf2021/dorsa/DoRSA | 2 +- cryptoctf2021/elegant/elegant_curve | 2 +- cryptoctf2021/frozen/frozen_server | 2 +- cryptoctf2021/hamul/hamul | 2 +- cryptoctf2021/hypernormal/hyper_normal | 2 +- cryptoctf2021/improved/improved | 2 +- cryptoctf2021/lower/lower | 2 +- cryptoctf2021/rima/rima | 2 +- cryptoctf2021/tinyecc/mini_ecdsa.py | 2 +- cryptoctf2021/triplet/Triplet | 2 +- cryptoctf2021/trunc/trunc | 2 +- cryptoctf2021/wolf/Wolf | 2 +- cryptoversectf2022/bigrabin/chall | 2 +- cryptoversectf2022/dlog/chall | 2 +- cryptoversectf2022/rsa2/chall | 2 +- cryptoversectf2022/rsa3/server | 3 +- cryptoversectf2022/tale/challenge | 2 +- cryptoversectf2022/tale/challenge_patched | 2 +- cryptoversectf2023/babyaes/challenge | 2 +- cryptoversectf2023/backpack/challenge | 2 +- .../fractionalflag/fractional_flag | 2 +- cryptoversectf2023/lsfr/lfsr | 2 +- cryptoversectf2023/picochip1/picochip | 2 +- cryptoversectf2023/picochip2/picochip | 2 +- csawctfquals2021/forgery/server | 2 +- csawctfquals2024/aes/server | 2 +- csawctfquals2024/diffusion/server | 2 +- csawctfquals2024/trapdoor/trapdoor | 2 +- downunderctf2020/babyrsa/babyrsa | 2 +- downunderctf2020/calcgame/server | 2 +- downunderctf2020/ceebc/server | 2 +- .../extracoolblockchaining/server | 2 +- downunderctf2020/impeccable/server | 2 +- downunderctf2020/roti/create | 2 +- downunderctf2021/breakme/aes-ecb | 2 +- downunderctf2022/babyarx/baby-arx | 2 +- downunderctf2022/oracle/ofb | 2 +- .../rsaoracle1/rsa-interval-oracle-i | 2 +- .../rsaoracle2/rsa-interval-oracle-ii | 2 +- .../rsaoracle3/rsa-interval-oracle-iii | 2 +- .../rsaoracle4/rsa-interval-oracle-iv | 2 +- downunderctf2022/timelocked/time-locked | 2 +- greycattheflag2022/baby/main | 2 +- greycattheflag2022/block/main | 2 +- greycattheflag2022/calculator/main | 2 +- greycattheflag2022/catino/main | 2 +- greycattheflag2022/dot/complex.py | 2 +- hkcertctf2020/calmdown/chall | 2 +- hkcertctf2020/signin/chall | 2 +- hkcertctf2021/freedom/chall | 2 +- hkcertctf2021/longstoryshort/chall | 2 +- hkcertctf2021/magicalpotion/chall | 2 +- hkcertctf2021/simplesignin/app | 2 +- hkcertctf2022/base64/chall | 2 +- hkcertctf2022/rogue/chall | 2 +- hsctf2019/broken-repl/repl | 2 +- .../canis/canis-lupus-familiaris-bernardus | 2 +- hsctf2021/opisthocomus/opisthocomus-hoazin | 2 +- imaginaryctf2022/cbc/cbc | 2 +- imaginaryctf2022/hash/chal | 2 +- .../livingwithoutexpectations/lwe | 2 +- imaginaryctf2022/otp/otp | 2 +- imaginaryctf2022/secureencoding/encode | 2 +- imaginaryctf2022/secureencodinghex/encode | 2 +- imaginaryctf2023/signer/main | 2 +- imaginaryctf2024/base64/main | 2 +- imaginaryctf2024/bf/generate | 2 +- imaginaryctf2024/integrity/main | 2 +- imaginaryctf2024/vokram/gen | 2 +- imaginaryctf2024/vokram/vm | 2 +- isitdtuctf2024/mixer1/chall | 2 +- isitdtuctf2024/mixer2/chall.py | 2 +- isitdtuctf2024/random/secret.py | 2 +- isitdtuctf2024/sign/chall | 2 +- justctf2019/pandq/task | 2 +- m0leconteaserctf2025/ecsign/server | 2 +- m0leconteaserctf2025/ot/server | 2 +- m0leconteaserctf2025/quadratic/QuadraticLeak | 44 ++--- m0leconteaserctf2025/talor/chall | 2 +- noobzctf2023/maas/chall | 2 +- patriotctf2022/cryptogod/cryptogod | 2 +- patriotctf2022/cryptogod/server | 2 +- .../task" | 2 +- r3ctf2024/sparrow/main | 2 +- r3ctf2024/sparrow/utils | 2 +- r3ctf2024/tinseal/Attachment/main | 2 +- tamuctf2024/criminal/server | 2 +- uiuctf2022/asr/chall | 2 +- uiuctf2022/ecc/ecc.py | 2 +- uiuctf2023/athome/chal | 2 +- uiuctf2023/groupproject/chal | 2 +- uiuctf2023/groupprojection/chal | 2 +- uiuctf2023/morphing/chal | 2 +- zh3r0ctf2021/alicebobdave/chall | 2 +- zh3r0ctf2021/bootleg/challenge | 2 +- zh3r0ctf2021/chaos/challenge | 2 +- zh3r0ctf2021/cheater/challenge | 2 +- zh3r0ctf2021/injection/challenge | 2 +- zh3r0ctf2021/mersenne/challenge | 2 +- zh3r0ctf2021/numpymt/challenge | 2 +- zh3r0ctf2021/twist/challenge | 2 +- 138 files changed, 332 insertions(+), 333 deletions(-) diff --git a/0ctf2019/babyrsa/secret.py b/0ctf2019/babyrsa/secret.py index 6585f561..111cb215 100755 --- a/0ctf2019/babyrsa/secret.py +++ b/0ctf2019/babyrsa/secret.py @@ -1,3 +1,3 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 flag= open("/flag", "rb").read().strip() diff --git a/0ctf2021quals/cloudpass/task b/0ctf2021quals/cloudpass/task index ba4410ae..56fa76aa 100644 --- a/0ctf2021quals/cloudpass/task +++ b/0ctf2021quals/cloudpass/task @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import os import socketserver diff --git a/0ctf2021quals/zer0lfsr/task b/0ctf2021quals/zer0lfsr/task index a50b648e..dd405703 100644 --- a/0ctf2021quals/zer0lfsr/task +++ b/0ctf2021quals/zer0lfsr/task @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import random import signal diff --git a/0x41414141ctf2021/factorize/factorize b/0x41414141ctf2021/factorize/factorize index 8f901fea..4db49dee 100644 --- a/0x41414141ctf2021/factorize/factorize +++ b/0x41414141ctf2021/factorize/factorize @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import binascii import random diff --git a/0x41414141ctf2021/filereader/filereader b/0x41414141ctf2021/filereader/filereader index 22ab4c87..285df3f8 100644 --- a/0x41414141ctf2021/filereader/filereader +++ b/0x41414141ctf2021/filereader/filereader @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import glob diff --git a/0x41414141ctf2021/pyjail/pyjail b/0x41414141ctf2021/pyjail/pyjail index a0d94c14..00c635da 100644 --- a/0x41414141ctf2021/pyjail/pyjail +++ b/0x41414141ctf2021/pyjail/pyjail @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import re from sys import modules, version diff --git a/0x41414141ctf2021/soul/net b/0x41414141ctf2021/soul/net index 810caf02..ab91d69e 100644 --- a/0x41414141ctf2021/soul/net +++ b/0x41414141ctf2021/soul/net @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import os import socketserver diff --git a/0x41414141ctf2021/staple-aes/aes b/0x41414141ctf2021/staple-aes/aes index 8c9770b7..03d56bb1 100644 --- a/0x41414141ctf2021/staple-aes/aes +++ b/0x41414141ctf2021/staple-aes/aes @@ -1,88 +1,88 @@ -#!/opt/pwn.college/python - -import os -import socketserver -import string -import threading -from time import * -import random -import time -import binascii - -from Crypto.Cipher import AES -from Crypto.Util.Padding import pad - -iv = b'' -key = b'' -flag = open("/flag", "r").read().strip() - -class Service(socketserver.BaseRequestHandler): - - def handle(self): - assert len(flag) % 16 == 1 - blocks = self.shuffle(flag) - ct = self.encrypt(blocks) - self.send(binascii.hexlify(ct)) - - def byte_xor(self, ba1, ba2): - return bytes([_a ^ _b for _a, _b in zip(ba1, ba2)]) - - def encrypt(self, blocks): - curr = iv - ct = [] - cipher = AES.new(key, AES.MODE_ECB) - for block in blocks: - curr = cipher.encrypt(curr) - ct.append(self.byte_xor(block, curr)) - return b''.join(ct) - - def shuffle(self, pt): - pt = pad(pt, 16) - pt = [pt[i: i + 16] for i in range(0, len(pt), 16)] - random.shuffle(pt) - return pt - - def send(self, string, newline=True): - if type(string) is str: - string = string.encode("utf-8") - - if newline: - string = string + b"\n" - self.request.sendall(string) - - def receive(self, prompt="> "): - self.send(prompt, newline=False) - return self.request.recv(4096).strip() - - -class ThreadedService( - socketserver.ThreadingMixIn, - socketserver.TCPServer, - socketserver.DatagramRequestHandler, -): - pass - - -def main(): - - port = 3167 - host = "0.0.0.0" - - service = Service - server = ThreadedService((host, port), service) - server.allow_reuse_address = True - - server_thread = threading.Thread(target=server.serve_forever) - - server_thread.daemon = True - server_thread.start() - - print("Server started on " + str(server.server_address) + "!") - - # Now let the main thread just wait... - while True: - sleep(10) - - -if __name__ == "__main__": +#!/usr/bin/exec-suid -- /usr/bin/python3 + +import os +import socketserver +import string +import threading +from time import * +import random +import time +import binascii + +from Crypto.Cipher import AES +from Crypto.Util.Padding import pad + +iv = b'' +key = b'' +flag = open("/flag", "r").read().strip() + +class Service(socketserver.BaseRequestHandler): + + def handle(self): + assert len(flag) % 16 == 1 + blocks = self.shuffle(flag) + ct = self.encrypt(blocks) + self.send(binascii.hexlify(ct)) + + def byte_xor(self, ba1, ba2): + return bytes([_a ^ _b for _a, _b in zip(ba1, ba2)]) + + def encrypt(self, blocks): + curr = iv + ct = [] + cipher = AES.new(key, AES.MODE_ECB) + for block in blocks: + curr = cipher.encrypt(curr) + ct.append(self.byte_xor(block, curr)) + return b''.join(ct) + + def shuffle(self, pt): + pt = pad(pt, 16) + pt = [pt[i: i + 16] for i in range(0, len(pt), 16)] + random.shuffle(pt) + return pt + + def send(self, string, newline=True): + if type(string) is str: + string = string.encode("utf-8") + + if newline: + string = string + b"\n" + self.request.sendall(string) + + def receive(self, prompt="> "): + self.send(prompt, newline=False) + return self.request.recv(4096).strip() + + +class ThreadedService( + socketserver.ThreadingMixIn, + socketserver.TCPServer, + socketserver.DatagramRequestHandler, +): + pass + + +def main(): + + port = 3167 + host = "0.0.0.0" + + service = Service + server = ThreadedService((host, port), service) + server.allow_reuse_address = True + + server_thread = threading.Thread(target=server.serve_forever) + + server_thread.daemon = True + server_thread.start() + + print("Server started on " + str(server.server_address) + "!") + + # Now let the main thread just wait... + while True: + sleep(10) + + +if __name__ == "__main__": main() \ No newline at end of file diff --git a/0x41414141ctf2021/wallet/wallet b/0x41414141ctf2021/wallet/wallet index 69b9c93c..392f04a1 100644 --- a/0x41414141ctf2021/wallet/wallet +++ b/0x41414141ctf2021/wallet/wallet @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import os import socketserver diff --git a/accessdeniedctf2022/ecc/chal b/accessdeniedctf2022/ecc/chal index 538ccece..949c5d8b 100755 --- a/accessdeniedctf2022/ecc/chal +++ b/accessdeniedctf2022/ecc/chal @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import tinyec.ec as ec import tinyec.registry as reg diff --git a/angstromctf2016/casino/casino b/angstromctf2016/casino/casino index 838e19a7..c049aa5d 100755 --- a/angstromctf2016/casino/casino +++ b/angstromctf2016/casino/casino @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 #seed = 9519 #flag = "actf{Men_Are_maSTers_of_thEiR_fateS}" diff --git a/angstromctf2016/helpcenter/server b/angstromctf2016/helpcenter/server index c428b433..7f2e54ad 100755 --- a/angstromctf2016/helpcenter/server +++ b/angstromctf2016/helpcenter/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 key = 'c342cb3177881464' IV = 'ca302100528f5ef9' diff --git a/angstromctf2017/casino/card_guessing b/angstromctf2017/casino/card_guessing index 6ccbff7b..2d5bea0d 100755 --- a/angstromctf2017/casino/card_guessing +++ b/angstromctf2017/casino/card_guessing @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import os,struct diff --git a/angstromctf2017/royalcasino/casino b/angstromctf2017/royalcasino/casino index 420dc5e8..0966ff11 100755 --- a/angstromctf2017/royalcasino/casino +++ b/angstromctf2017/royalcasino/casino @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import os,struct diff --git a/angstromctf2022/randomlysampledalgorithm/rsa b/angstromctf2022/randomlysampledalgorithm/rsa index 3c34679c..de60c835 100644 --- a/angstromctf2022/randomlysampledalgorithm/rsa +++ b/angstromctf2022/randomlysampledalgorithm/rsa @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getStrongPrime diff --git a/angstromctf2024/philosophy/chall b/angstromctf2024/philosophy/chall index 67d10a03..69f44e16 100755 --- a/angstromctf2024/philosophy/chall +++ b/angstromctf2024/philosophy/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getPrime #from secret import flag diff --git a/angstromctf2024/presidential/source b/angstromctf2024/presidential/source index 3a1f0ce2..1406796a 100755 --- a/angstromctf2024/presidential/source +++ b/angstromctf2024/presidential/source @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import ctypes import mmap diff --git a/angstromctf2024/tss1/tss1 b/angstromctf2024/tss1/tss1 index 9a1b3131..090af091 100644 --- a/angstromctf2024/tss1/tss1 +++ b/angstromctf2024/tss1/tss1 @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from hashlib import sha256 import fastecdsa.curve diff --git a/angstromctf2024/tss2/tss2 b/angstromctf2024/tss2/tss2 index 15eddde9..c7f315bc 100644 --- a/angstromctf2024/tss2/tss2 +++ b/angstromctf2024/tss2/tss2 @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from hashlib import sha256 import fastecdsa.curve diff --git a/byuctf2022/blue/create.py b/byuctf2022/blue/create.py index 0fd266e1..23b4e2d7 100644 --- a/byuctf2022/blue/create.py +++ b/byuctf2022/blue/create.py @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from PIL import Image import random diff --git a/byuctf2024/aresa/keygen b/byuctf2024/aresa/keygen index 64179f71..047084eb 100755 --- a/byuctf2024/aresa/keygen +++ b/byuctf2024/aresa/keygen @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import bytes_to_long, getPrime diff --git a/byuctf2024/domath/domath b/byuctf2024/domath/domath index 0dad5977..cb176c58 100755 --- a/byuctf2024/domath/domath +++ b/byuctf2024/domath/domath @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * diff --git a/byuctf2024/giveup/nevergonna b/byuctf2024/giveup/nevergonna index 74fc58f8..3646f136 100755 --- a/byuctf2024/giveup/nevergonna +++ b/byuctf2024/giveup/nevergonna @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 def repeat_key_xor(plain, key): # take in bytes output = b'' diff --git a/byuctf2024/multiplied/ellipticcurve.py b/byuctf2024/multiplied/ellipticcurve.py index e4e1b723..c1742517 100755 --- a/byuctf2024/multiplied/ellipticcurve.py +++ b/byuctf2024/multiplied/ellipticcurve.py @@ -1,88 +1,88 @@ -#!/opt/pwn.college/python - -def legendre(a, p): - return pow(a, (p - 1) // 2, p) - -def tonelli(n, p): - q = p - 1 - s = 0 - while q % 2 == 0: - q //= 2 - s += 1 - if s == 1: - return pow(n, (p + 1) // 4, p) - for z in range(2, p): - if p - 1 == legendre(z, p): - break - c = pow(z, q, p) - r = pow(n, (q + 1) // 2, p) - t = pow(n, q, p) - m = s - t2 = 0 - while (t - 1) % p != 0: - t2 = (t * t) % p - for i in range(1, m): - if (t2 - 1) % p == 0: - break - t2 = (t2 * t2) % p - b = pow(c, 1 << (m - i - 1), p) - r = (r * b) % p - c = (b * b) % p - t = (t * c) % p - m = i - return r - -class CurvePoint: - def __init__ (self, x, y, curve): - self.curve = curve - self.x = x - self.y = y - def __str__ (self): - return f"({self.x}, {self.y})" - __repr__ = __str__ - def __eq__ (self, other): - return str(self) == str(other) - def __add__ (self, other): - x1,y1 = self.x, self.y - x2,y2 = other.x, other.y - if x1 == 0 and y1 == 1: - return other - if x2 == 0 and y2 == 1: - return self - if x1 == x2 and y2 == self.curve.p - y1: #-y1 - return CurvePoint(0, 1, self.curve) - if x1 == x2 and y1 == y2: - lam = ((3*pow(x1,2,self.curve.p) + self.curve.a) * pow(2*y1, -1, self.curve.p))%self.curve.p - else: - lam = ((y2-y1) * pow(x2-x1, -1, self.curve.p)) % self.curve.p - x3 = (lam**2 - x1 - x2) % self.curve.p - y3 = (lam * (x1 - x3) - y1) % self.curve.p - return CurvePoint(x3, y3, self.curve) - def __mul__ (self, n): - if type(n) != int: - raise ValueError("You can only multiply by a scalar") - Q = self - R = CurvePoint(0,1,self.curve) - if n == 0: return R - if n == 1: return self - while n > 0: - if n % 2 == 1: - R = R + Q - Q = Q + Q - n //= 2 - return R - -class EllipticCurve: - # for the curve x**3 + ax + b % p - def __init__ (self, a, b, p): - self.a = a - self.b = b - self.p = p - def point(self, x): - pt = (x**3 + self.a*x + self.b) % self.p - if legendre(pt, self.p) != 1: - return None # in the case that there is no quadratic residue - y = tonelli(pt, self.p) - return CurvePoint(x, y, self) # eventually have a point class built, too - def __str__ (self): - return f"y^2 = x**3 + {self.a}x + {self.b} % {self.p}" +#!/usr/bin/exec-suid -- /usr/bin/python3 + +def legendre(a, p): + return pow(a, (p - 1) // 2, p) + +def tonelli(n, p): + q = p - 1 + s = 0 + while q % 2 == 0: + q //= 2 + s += 1 + if s == 1: + return pow(n, (p + 1) // 4, p) + for z in range(2, p): + if p - 1 == legendre(z, p): + break + c = pow(z, q, p) + r = pow(n, (q + 1) // 2, p) + t = pow(n, q, p) + m = s + t2 = 0 + while (t - 1) % p != 0: + t2 = (t * t) % p + for i in range(1, m): + if (t2 - 1) % p == 0: + break + t2 = (t2 * t2) % p + b = pow(c, 1 << (m - i - 1), p) + r = (r * b) % p + c = (b * b) % p + t = (t * c) % p + m = i + return r + +class CurvePoint: + def __init__ (self, x, y, curve): + self.curve = curve + self.x = x + self.y = y + def __str__ (self): + return f"({self.x}, {self.y})" + __repr__ = __str__ + def __eq__ (self, other): + return str(self) == str(other) + def __add__ (self, other): + x1,y1 = self.x, self.y + x2,y2 = other.x, other.y + if x1 == 0 and y1 == 1: + return other + if x2 == 0 and y2 == 1: + return self + if x1 == x2 and y2 == self.curve.p - y1: #-y1 + return CurvePoint(0, 1, self.curve) + if x1 == x2 and y1 == y2: + lam = ((3*pow(x1,2,self.curve.p) + self.curve.a) * pow(2*y1, -1, self.curve.p))%self.curve.p + else: + lam = ((y2-y1) * pow(x2-x1, -1, self.curve.p)) % self.curve.p + x3 = (lam**2 - x1 - x2) % self.curve.p + y3 = (lam * (x1 - x3) - y1) % self.curve.p + return CurvePoint(x3, y3, self.curve) + def __mul__ (self, n): + if type(n) != int: + raise ValueError("You can only multiply by a scalar") + Q = self + R = CurvePoint(0,1,self.curve) + if n == 0: return R + if n == 1: return self + while n > 0: + if n % 2 == 1: + R = R + Q + Q = Q + Q + n //= 2 + return R + +class EllipticCurve: + # for the curve x**3 + ax + b % p + def __init__ (self, a, b, p): + self.a = a + self.b = b + self.p = p + def point(self, x): + pt = (x**3 + self.a*x + self.b) % self.p + if legendre(pt, self.p) != 1: + return None # in the case that there is no quadratic residue + y = tonelli(pt, self.p) + return CurvePoint(x, y, self) # eventually have a point class built, too + def __str__ (self): + return f"y^2 = x**3 + {self.a}x + {self.b} % {self.p}" diff --git a/byuctf2024/multiplied/mul b/byuctf2024/multiplied/mul index c57cdcf6..1356d165 100755 --- a/byuctf2024/multiplied/mul +++ b/byuctf2024/multiplied/mul @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import hashlib from Crypto.Cipher import AES diff --git a/byuctf2024/worstchallenge/awful b/byuctf2024/worstchallenge/awful index 50ec6099..1213f7ab 100755 --- a/byuctf2024/worstchallenge/awful +++ b/byuctf2024/worstchallenge/awful @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 #flag = "byuctf{wh4ts_4_nu11_byt3_4nyw4ys}" flag= open("/flag", "r").read() diff --git a/cactusconctf2025/securerepititions/secure_rep b/cactusconctf2025/securerepititions/secure_rep index 4bca79d9..4dbfa8ef 100644 --- a/cactusconctf2025/securerepititions/secure_rep +++ b/cactusconctf2025/securerepititions/secure_rep @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from hashlib import md5 diff --git a/corctf2021/babyrand/script b/corctf2021/babyrand/script index 9ee33696..00a8e45b 100644 --- a/corctf2021/babyrand/script +++ b/corctf2021/babyrand/script @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from random import randrange from Crypto.Util.number import getPrime, long_to_bytes diff --git a/corctf2021/bank/server b/corctf2021/bank/server index 243c6203..912ab386 100755 --- a/corctf2021/bank/server +++ b/corctf2021/bank/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import numpy as np import math, random diff --git a/corctf2021/chance/source b/corctf2021/chance/source index 79075842..ed7d3524 100644 --- a/corctf2021/chance/source +++ b/corctf2021/chance/source @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getPrime from random import randrange, shuffle diff --git a/corctf2021/fibinary/enc b/corctf2021/fibinary/enc index 11c2c1a1..a6d25308 100644 --- a/corctf2021/fibinary/enc +++ b/corctf2021/fibinary/enc @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 fib = [1, 1] for i in range(2, 11): diff --git a/corctf2021/fourninesix/source b/corctf2021/fourninesix/source index c9bf6c05..cb180b83 100644 --- a/corctf2021/fourninesix/source +++ b/corctf2021/fourninesix/source @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getPrime, bytes_to_long from private import flag diff --git a/corctf2021/fourninesix/source_patched b/corctf2021/fourninesix/source_patched index 36bef3aa..9ce56580 100644 --- a/corctf2021/fourninesix/source_patched +++ b/corctf2021/fourninesix/source_patched @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getPrime, bytes_to_long diff --git a/corctf2021/lcg/source b/corctf2021/lcg/source index f7994f65..b9d57a9c 100644 --- a/corctf2021/lcg/source +++ b/corctf2021/lcg/source @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import bytes_to_long, inverse from hashlib import sha256 diff --git a/corctf2022/babypad/server b/corctf2022/babypad/server index 1f979890..5ee6c87c 100755 --- a/corctf2022/babypad/server +++ b/corctf2022/babypad/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Cipher import AES from Crypto.Util import Counter diff --git a/cryptoctf2020/fatima/fatima b/cryptoctf2020/fatima/fatima index 404d1bd8..9a905d89 100755 --- a/cryptoctf2020/fatima/fatima +++ b/cryptoctf2020/fatima/fatima @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 # -*- coding: utf-8 -*- from fastecdsa.curve import Curve diff --git a/cryptoctf2020/threeravens/three_ravens b/cryptoctf2020/threeravens/three_ravens index fb058d20..19468bcc 100644 --- a/cryptoctf2020/threeravens/three_ravens +++ b/cryptoctf2020/threeravens/three_ravens @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * # from flag import flag diff --git a/cryptoctf2021/dorsa/DoRSA b/cryptoctf2021/dorsa/DoRSA index a51d345e..6f554d70 100644 --- a/cryptoctf2021/dorsa/DoRSA +++ b/cryptoctf2021/dorsa/DoRSA @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * from math import gcd diff --git a/cryptoctf2021/elegant/elegant_curve b/cryptoctf2021/elegant/elegant_curve index 66d8522e..994a39de 100755 --- a/cryptoctf2021/elegant/elegant_curve +++ b/cryptoctf2021/elegant/elegant_curve @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * import sys diff --git a/cryptoctf2021/frozen/frozen_server b/cryptoctf2021/frozen/frozen_server index 2980708a..c7cd64ea 100644 --- a/cryptoctf2021/frozen/frozen_server +++ b/cryptoctf2021/frozen/frozen_server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * from gmpy2 import * diff --git a/cryptoctf2021/hamul/hamul b/cryptoctf2021/hamul/hamul index fb041ed3..77e3883e 100644 --- a/cryptoctf2021/hamul/hamul +++ b/cryptoctf2021/hamul/hamul @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * # from flag import flag diff --git a/cryptoctf2021/hypernormal/hyper_normal b/cryptoctf2021/hypernormal/hyper_normal index e4e04f4e..e34ff04f 100755 --- a/cryptoctf2021/hypernormal/hyper_normal +++ b/cryptoctf2021/hypernormal/hyper_normal @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import random # from flag import FLAG diff --git a/cryptoctf2021/improved/improved b/cryptoctf2021/improved/improved index dd4c2b77..0331efbe 100755 --- a/cryptoctf2021/improved/improved +++ b/cryptoctf2021/improved/improved @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * from gmpy2 import gcd diff --git a/cryptoctf2021/lower/lower b/cryptoctf2021/lower/lower index c05ac68a..86b95d46 100644 --- a/cryptoctf2021/lower/lower +++ b/cryptoctf2021/lower/lower @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * import sys diff --git a/cryptoctf2021/rima/rima b/cryptoctf2021/rima/rima index eb17492b..675c3900 100755 --- a/cryptoctf2021/rima/rima +++ b/cryptoctf2021/rima/rima @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 # pylint: skip-file from Crypto.Util.number import * diff --git a/cryptoctf2021/tinyecc/mini_ecdsa.py b/cryptoctf2021/tinyecc/mini_ecdsa.py index b10f6db1..5c5b54d9 100755 --- a/cryptoctf2021/tinyecc/mini_ecdsa.py +++ b/cryptoctf2021/tinyecc/mini_ecdsa.py @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 #Elliptic curve basics, tools for finding rational points, and ECDSA implementation. #Brendan Cordy, 2015 diff --git a/cryptoctf2021/triplet/Triplet b/cryptoctf2021/triplet/Triplet index 24fc8e43..0abe9570 100755 --- a/cryptoctf2021/triplet/Triplet +++ b/cryptoctf2021/triplet/Triplet @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * from random import randint diff --git a/cryptoctf2021/trunc/trunc b/cryptoctf2021/trunc/trunc index 80aaff2f..f888e9e5 100755 --- a/cryptoctf2021/trunc/trunc +++ b/cryptoctf2021/trunc/trunc @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * from hashlib import sha256 diff --git a/cryptoctf2021/wolf/Wolf b/cryptoctf2021/wolf/Wolf index 7f854823..2608d7cd 100644 --- a/cryptoctf2021/wolf/Wolf +++ b/cryptoctf2021/wolf/Wolf @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Cryptodome.Cipher import AES import os, time, sys, random diff --git a/cryptoversectf2022/bigrabin/chall b/cryptoversectf2022/bigrabin/chall index 8ad7ae81..5bd4672a 100644 --- a/cryptoversectf2022/bigrabin/chall +++ b/cryptoversectf2022/bigrabin/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * # from secret import flag with open('/flag', 'r') as file: diff --git a/cryptoversectf2022/dlog/chall b/cryptoversectf2022/dlog/chall index 11fe3adf..7dce5b63 100644 --- a/cryptoversectf2022/dlog/chall +++ b/cryptoversectf2022/dlog/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * # from secret import flag diff --git a/cryptoversectf2022/rsa2/chall b/cryptoversectf2022/rsa2/chall index a5a6b8c2..8506fcfc 100644 --- a/cryptoversectf2022/rsa2/chall +++ b/cryptoversectf2022/rsa2/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import inverse, bytes_to_long, getPrime, isPrime from math import gcd diff --git a/cryptoversectf2022/rsa3/server b/cryptoversectf2022/rsa3/server index 7f62731c..f3b43632 100644 --- a/cryptoversectf2022/rsa3/server +++ b/cryptoversectf2022/rsa3/server @@ -1,5 +1,4 @@ -#!/opt/pwn.college/python - +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * import random # from secret import flag diff --git a/cryptoversectf2022/tale/challenge b/cryptoversectf2022/tale/challenge index 63b9616b..9e8699db 100644 --- a/cryptoversectf2022/tale/challenge +++ b/cryptoversectf2022/tale/challenge @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * #from secret import flag diff --git a/cryptoversectf2022/tale/challenge_patched b/cryptoversectf2022/tale/challenge_patched index fc0ae50f..fdd87a59 100644 --- a/cryptoversectf2022/tale/challenge_patched +++ b/cryptoversectf2022/tale/challenge_patched @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * #from secret import flag diff --git a/cryptoversectf2023/babyaes/challenge b/cryptoversectf2023/babyaes/challenge index 60384943..67568953 100644 --- a/cryptoversectf2023/babyaes/challenge +++ b/cryptoversectf2023/babyaes/challenge @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Cipher import AES from Crypto.Util.Padding import pad diff --git a/cryptoversectf2023/backpack/challenge b/cryptoversectf2023/backpack/challenge index eb4252ac..522f394c 100644 --- a/cryptoversectf2023/backpack/challenge +++ b/cryptoversectf2023/backpack/challenge @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * from math import gcd diff --git a/cryptoversectf2023/fractionalflag/fractional_flag b/cryptoversectf2023/fractionalflag/fractional_flag index d1a9d4b6..55f01740 100644 --- a/cryptoversectf2023/fractionalflag/fractional_flag +++ b/cryptoversectf2023/fractionalflag/fractional_flag @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getPrime, inverse, bytes_to_long # from secret import flag diff --git a/cryptoversectf2023/lsfr/lfsr b/cryptoversectf2023/lsfr/lfsr index 574436d4..e34d7287 100644 --- a/cryptoversectf2023/lsfr/lfsr +++ b/cryptoversectf2023/lsfr/lfsr @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * # from secret import flag diff --git a/cryptoversectf2023/picochip1/picochip b/cryptoversectf2023/picochip1/picochip index 4b1945ef..507c2729 100755 --- a/cryptoversectf2023/picochip1/picochip +++ b/cryptoversectf2023/picochip1/picochip @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from itertools import groupby from Crypto.Util.number import * diff --git a/cryptoversectf2023/picochip2/picochip b/cryptoversectf2023/picochip2/picochip index f2e694a9..9c1fa07f 100644 --- a/cryptoversectf2023/picochip2/picochip +++ b/cryptoversectf2023/picochip2/picochip @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * from enum import Enum diff --git a/csawctfquals2021/forgery/server b/csawctfquals2021/forgery/server index 4ca63711..b35a1b92 100755 --- a/csawctfquals2021/forgery/server +++ b/csawctfquals2021/forgery/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getPrime from random import randint diff --git a/csawctfquals2024/aes/server b/csawctfquals2024/aes/server index 7989bcbb..3a169d0e 100755 --- a/csawctfquals2024/aes/server +++ b/csawctfquals2024/aes/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 bold_start = '\033[1m' bold_end = '\033[0m' diff --git a/csawctfquals2024/diffusion/server b/csawctfquals2024/diffusion/server index fd4c3aa5..b26cf940 100755 --- a/csawctfquals2024/diffusion/server +++ b/csawctfquals2024/diffusion/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from random import randint diff --git a/csawctfquals2024/trapdoor/trapdoor b/csawctfquals2024/trapdoor/trapdoor index baae35aa..3e62dc16 100755 --- a/csawctfquals2024/trapdoor/trapdoor +++ b/csawctfquals2024/trapdoor/trapdoor @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getPrime, bytes_to_long from pathlib import Path diff --git a/downunderctf2020/babyrsa/babyrsa b/downunderctf2020/babyrsa/babyrsa index d2bbb2e4..430bd5de 100755 --- a/downunderctf2020/babyrsa/babyrsa +++ b/downunderctf2020/babyrsa/babyrsa @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import bytes_to_long, getPrime flag = open('/flag', 'rb').read().strip() diff --git a/downunderctf2020/calcgame/server b/downunderctf2020/calcgame/server index 7bf331cd..b6e9242e 100755 --- a/downunderctf2020/calcgame/server +++ b/downunderctf2020/calcgame/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from os import urandom from random import randint diff --git a/downunderctf2020/ceebc/server b/downunderctf2020/ceebc/server index bb2f6953..e963304a 100644 --- a/downunderctf2020/ceebc/server +++ b/downunderctf2020/ceebc/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from os import urandom from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.primitives import constant_time diff --git a/downunderctf2020/extracoolblockchaining/server b/downunderctf2020/extracoolblockchaining/server index 3e337f46..61076f4c 100644 --- a/downunderctf2020/extracoolblockchaining/server +++ b/downunderctf2020/extracoolblockchaining/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad from Crypto.Util.strxor import strxor diff --git a/downunderctf2020/impeccable/server b/downunderctf2020/impeccable/server index a5db8aff..09477f7f 100644 --- a/downunderctf2020/impeccable/server +++ b/downunderctf2020/impeccable/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import ecdsa import random diff --git a/downunderctf2020/roti/create b/downunderctf2020/roti/create index 73ff334b..6e579613 100644 --- a/downunderctf2020/roti/create +++ b/downunderctf2020/roti/create @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from string import ascii_lowercase, ascii_uppercase flag = open('/flag', 'r').read().strip() diff --git a/downunderctf2021/breakme/aes-ecb b/downunderctf2021/breakme/aes-ecb index 9e4b9f80..1e5b854d 100644 --- a/downunderctf2021/breakme/aes-ecb +++ b/downunderctf2021/breakme/aes-ecb @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import sys import os from Crypto.Cipher import AES diff --git a/downunderctf2022/babyarx/baby-arx b/downunderctf2022/babyarx/baby-arx index e4516a15..837182b2 100755 --- a/downunderctf2022/babyarx/baby-arx +++ b/downunderctf2022/babyarx/baby-arx @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 class baby_arx(): def __init__(self, key): assert len(key) == length diff --git a/downunderctf2022/oracle/ofb b/downunderctf2022/oracle/ofb index f677bb64..3b8899af 100644 --- a/downunderctf2022/oracle/ofb +++ b/downunderctf2022/oracle/ofb @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from os import urandom, path from Crypto.Cipher import AES diff --git a/downunderctf2022/rsaoracle1/rsa-interval-oracle-i b/downunderctf2022/rsaoracle1/rsa-interval-oracle-i index 813ef409..399aa783 100644 --- a/downunderctf2022/rsaoracle1/rsa-interval-oracle-i +++ b/downunderctf2022/rsaoracle1/rsa-interval-oracle-i @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import signal, time from os import urandom, path diff --git a/downunderctf2022/rsaoracle2/rsa-interval-oracle-ii b/downunderctf2022/rsaoracle2/rsa-interval-oracle-ii index c50d139c..0605f746 100644 --- a/downunderctf2022/rsaoracle2/rsa-interval-oracle-ii +++ b/downunderctf2022/rsaoracle2/rsa-interval-oracle-ii @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import signal, time from os import urandom, path diff --git a/downunderctf2022/rsaoracle3/rsa-interval-oracle-iii b/downunderctf2022/rsaoracle3/rsa-interval-oracle-iii index 9556e22e..97ce84f7 100755 --- a/downunderctf2022/rsaoracle3/rsa-interval-oracle-iii +++ b/downunderctf2022/rsaoracle3/rsa-interval-oracle-iii @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import signal, time from os import urandom, path diff --git a/downunderctf2022/rsaoracle4/rsa-interval-oracle-iv b/downunderctf2022/rsaoracle4/rsa-interval-oracle-iv index 2b614232..7a689d82 100644 --- a/downunderctf2022/rsaoracle4/rsa-interval-oracle-iv +++ b/downunderctf2022/rsaoracle4/rsa-interval-oracle-iv @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import signal, time from os import urandom, path diff --git a/downunderctf2022/timelocked/time-locked b/downunderctf2022/timelocked/time-locked index b3fd4220..4bad861a 100644 --- a/downunderctf2022/timelocked/time-locked +++ b/downunderctf2022/timelocked/time-locked @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from hashlib import sha256 from Crypto.Util.Padding import unpad diff --git a/greycattheflag2022/baby/main b/greycattheflag2022/baby/main index 694b8293..2c62c52e 100644 --- a/greycattheflag2022/baby/main +++ b/greycattheflag2022/baby/main @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getPrime, bytes_to_long with open('/flag', 'r') as file: diff --git a/greycattheflag2022/block/main b/greycattheflag2022/block/main index f3eac50d..e881e409 100644 --- a/greycattheflag2022/block/main +++ b/greycattheflag2022/block/main @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.Padding import pad with open('/flag', 'r') as file: diff --git a/greycattheflag2022/calculator/main b/greycattheflag2022/calculator/main index 49789338..0e543694 100644 --- a/greycattheflag2022/calculator/main +++ b/greycattheflag2022/calculator/main @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import random import time diff --git a/greycattheflag2022/catino/main b/greycattheflag2022/catino/main index da8c3833..41caf9f3 100644 --- a/greycattheflag2022/catino/main +++ b/greycattheflag2022/catino/main @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from secrets import randbits from decimal import Decimal, getcontext diff --git a/greycattheflag2022/dot/complex.py b/greycattheflag2022/dot/complex.py index 53219f99..a9840748 100644 --- a/greycattheflag2022/dot/complex.py +++ b/greycattheflag2022/dot/complex.py @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 class ComplexVector(): def __init__(self, vec): for i in vec: diff --git a/hkcertctf2020/calmdown/chall b/hkcertctf2020/calmdown/chall index 0660faef..8e8aa81a 100755 --- a/hkcertctf2020/calmdown/chall +++ b/hkcertctf2020/calmdown/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 # Challenge written by Mystiz. # Signature: PHNjcmlwdD5jb25zb2xlLmxvZygnVEhJUyBDSEFMTEVOR0UgSVMgV1JJVFRFTiBGT1IgSEtDRVJUIENURiBBTkQgSVMgTk9UIEZPUiBGUkFOS0lFIExFVU5HIFRPIFBMQUdBUklaRS4nKTwvc2NyaXB0Pg== diff --git a/hkcertctf2020/signin/chall b/hkcertctf2020/signin/chall index 13cfdb52..3e74fd83 100755 --- a/hkcertctf2020/signin/chall +++ b/hkcertctf2020/signin/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 # Challenge written by Mystiz. # Signature: PHNjcmlwdD5jb25zb2xlLmxvZygnVEhJUyBDSEFMTEVOR0UgSVMgV1JJVFRFTiBGT1IgSEtDRVJUIENURiBBTkQgSVMgTk9UIEZPUiBGUkFOS0lFIExFVU5HIFRPIFBMQUdBUklaRS4nKTwvc2NyaXB0Pg== diff --git a/hkcertctf2021/freedom/chall b/hkcertctf2021/freedom/chall index 97ee3d38..91236ee2 100755 --- a/hkcertctf2021/freedom/chall +++ b/hkcertctf2021/freedom/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import os from Crypto.Cipher import AES diff --git a/hkcertctf2021/longstoryshort/chall b/hkcertctf2021/longstoryshort/chall index 2e7317d8..ac769bee 100755 --- a/hkcertctf2021/longstoryshort/chall +++ b/hkcertctf2021/longstoryshort/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import os import random diff --git a/hkcertctf2021/magicalpotion/chall b/hkcertctf2021/magicalpotion/chall index 906285c9..26173958 100755 --- a/hkcertctf2021/magicalpotion/chall +++ b/hkcertctf2021/magicalpotion/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import os from Crypto.Cipher import AES diff --git a/hkcertctf2021/simplesignin/app b/hkcertctf2021/simplesignin/app index 4e0699bf..1a512980 100755 --- a/hkcertctf2021/simplesignin/app +++ b/hkcertctf2021/simplesignin/app @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import os from textwrap import dedent diff --git a/hkcertctf2022/base64/chall b/hkcertctf2022/base64/chall index 47e5896e..84f421a3 100755 --- a/hkcertctf2022/base64/chall +++ b/hkcertctf2022/base64/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import random import base64 diff --git a/hkcertctf2022/rogue/chall b/hkcertctf2022/rogue/chall index ab4a9d77..4a9d9278 100755 --- a/hkcertctf2022/rogue/chall +++ b/hkcertctf2022/rogue/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getPrime as get_prime import os diff --git a/hsctf2019/broken-repl/repl b/hsctf2019/broken-repl/repl index 5e69ae93..f4b319b9 100755 --- a/hsctf2019/broken-repl/repl +++ b/hsctf2019/broken-repl/repl @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 with open("/flag") as flag: # open flag file flag = flag.read() # read contents of flag file diff --git a/hsctf2021/canis/canis-lupus-familiaris-bernardus b/hsctf2021/canis/canis-lupus-familiaris-bernardus index bed8b74a..799c2d6b 100644 --- a/hsctf2021/canis/canis-lupus-familiaris-bernardus +++ b/hsctf2021/canis/canis-lupus-familiaris-bernardus @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Cipher import AES from Crypto.Random import * from Crypto.Util.Padding import * diff --git a/hsctf2021/opisthocomus/opisthocomus-hoazin b/hsctf2021/opisthocomus/opisthocomus-hoazin index 974eaa2a..0df1bd5b 100644 --- a/hsctf2021/opisthocomus/opisthocomus-hoazin +++ b/hsctf2021/opisthocomus/opisthocomus-hoazin @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import time from Crypto.Util.number import * flag = open('/flag','r').read() diff --git a/imaginaryctf2022/cbc/cbc b/imaginaryctf2022/cbc/cbc index 223fbe65..79c6968c 100644 --- a/imaginaryctf2022/cbc/cbc +++ b/imaginaryctf2022/cbc/cbc @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad diff --git a/imaginaryctf2022/hash/chal b/imaginaryctf2022/hash/chal index 43c8e9c7..0b2079d3 100644 --- a/imaginaryctf2022/hash/chal +++ b/imaginaryctf2022/hash/chal @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import string import random diff --git a/imaginaryctf2022/livingwithoutexpectations/lwe b/imaginaryctf2022/livingwithoutexpectations/lwe index 27b4c055..620bbde9 100755 --- a/imaginaryctf2022/livingwithoutexpectations/lwe +++ b/imaginaryctf2022/livingwithoutexpectations/lwe @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import numpy as np import secrets diff --git a/imaginaryctf2022/otp/otp b/imaginaryctf2022/otp/otp index 5dac339e..5f1f4ef7 100644 --- a/imaginaryctf2022/otp/otp +++ b/imaginaryctf2022/otp/otp @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import long_to_bytes, bytes_to_long import random diff --git a/imaginaryctf2022/secureencoding/encode b/imaginaryctf2022/secureencoding/encode index 702668eb..8b7e61f3 100755 --- a/imaginaryctf2022/secureencoding/encode +++ b/imaginaryctf2022/secureencoding/encode @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from base64 import b64encode from random import shuffle diff --git a/imaginaryctf2022/secureencodinghex/encode b/imaginaryctf2022/secureencodinghex/encode index 6b3c5285..c32e6cd0 100644 --- a/imaginaryctf2022/secureencodinghex/encode +++ b/imaginaryctf2022/secureencodinghex/encode @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from random import shuffle diff --git a/imaginaryctf2023/signer/main b/imaginaryctf2023/signer/main index c6cad1a9..46a4a655 100644 --- a/imaginaryctf2023/signer/main +++ b/imaginaryctf2023/signer/main @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import textwrap from binascii import crc32 diff --git a/imaginaryctf2024/base64/main b/imaginaryctf2024/base64/main index 5a766a21..9ddf8780 100755 --- a/imaginaryctf2024/base64/main +++ b/imaginaryctf2024/base64/main @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import bytes_to_long q = 64 diff --git a/imaginaryctf2024/bf/generate b/imaginaryctf2024/bf/generate index accf2ccb..bccc28ac 100644 --- a/imaginaryctf2024/bf/generate +++ b/imaginaryctf2024/bf/generate @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import random import sympy diff --git a/imaginaryctf2024/integrity/main b/imaginaryctf2024/integrity/main index 954296fe..f724faed 100644 --- a/imaginaryctf2024/integrity/main +++ b/imaginaryctf2024/integrity/main @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import * from binascii import crc_hqx diff --git a/imaginaryctf2024/vokram/gen b/imaginaryctf2024/vokram/gen index b5fada2c..3cbb1961 100644 --- a/imaginaryctf2024/vokram/gen +++ b/imaginaryctf2024/vokram/gen @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 def vokram(text, program): while True: for pat, repl, stop in program: diff --git a/imaginaryctf2024/vokram/vm b/imaginaryctf2024/vokram/vm index 7c8f4a21..ae971518 100644 --- a/imaginaryctf2024/vokram/vm +++ b/imaginaryctf2024/vokram/vm @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 def vokram(text, program): while True: for pat, repl, stop in program: diff --git a/isitdtuctf2024/mixer1/chall b/isitdtuctf2024/mixer1/chall index fa8cd813..69b7f63b 100755 --- a/isitdtuctf2024/mixer1/chall +++ b/isitdtuctf2024/mixer1/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import random # TODO: heard that this is unsafe but nvm from Crypto.Util.number import getPrime, bytes_to_long diff --git a/isitdtuctf2024/mixer2/chall.py b/isitdtuctf2024/mixer2/chall.py index 154881e8..bcfec2f5 100755 --- a/isitdtuctf2024/mixer2/chall.py +++ b/isitdtuctf2024/mixer2/chall.py @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import random # TODO: heard that this is unsafe but nvm from Crypto.Util.number import getPrime, bytes_to_long diff --git a/isitdtuctf2024/random/secret.py b/isitdtuctf2024/random/secret.py index b867865f..26b9b87c 100644 --- a/isitdtuctf2024/random/secret.py +++ b/isitdtuctf2024/random/secret.py @@ -1,2 +1,2 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 FLAG = open("/flag", "rb").read() diff --git a/isitdtuctf2024/sign/chall b/isitdtuctf2024/sign/chall index 0cf988af..d1c5928d 100755 --- a/isitdtuctf2024/sign/chall +++ b/isitdtuctf2024/sign/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import os diff --git a/justctf2019/pandq/task b/justctf2019/pandq/task index 65d63a5c..526b0841 100644 --- a/justctf2019/pandq/task +++ b/justctf2019/pandq/task @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import sys import signal diff --git a/m0leconteaserctf2025/ecsign/server b/m0leconteaserctf2025/ecsign/server index 9021d5ae..5ca4bc89 100644 --- a/m0leconteaserctf2025/ecsign/server +++ b/m0leconteaserctf2025/ecsign/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.PublicKey.ECC import EccPoint from Crypto.Random import random diff --git a/m0leconteaserctf2025/ot/server b/m0leconteaserctf2025/ot/server index bb19dd8c..b752df4c 100644 --- a/m0leconteaserctf2025/ot/server +++ b/m0leconteaserctf2025/ot/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import random from hashlib import sha256 diff --git a/m0leconteaserctf2025/quadratic/QuadraticLeak b/m0leconteaserctf2025/quadratic/QuadraticLeak index 1cb8c618..39ce1e86 100644 --- a/m0leconteaserctf2025/quadratic/QuadraticLeak +++ b/m0leconteaserctf2025/quadratic/QuadraticLeak @@ -1,22 +1,22 @@ -#!/opt/pwn.college/python - -from Crypto.PublicKey import RSA -from Crypto.Util.number import long_to_bytes, bytes_to_long - -flag = open("/flag","r").read().strip().encode() -flag = bytes_to_long(flag) - -key = RSA.generate(2048) -n = key.n -e = key.e -p, q = key.p, key.q - -leak = (p**2 + q**2 - p - q)%key.n - -ciph = pow(flag, key.e, key.n) -ciph = long_to_bytes(ciph) - -print(f'{n = }') -print(f'{e = }') -print(f'{ciph = }') -print(f'{leak = }') +#!/usr/bin/exec-suid -- /usr/bin/python3 + +from Crypto.PublicKey import RSA +from Crypto.Util.number import long_to_bytes, bytes_to_long + +flag = open("/flag","r").read().strip().encode() +flag = bytes_to_long(flag) + +key = RSA.generate(2048) +n = key.n +e = key.e +p, q = key.p, key.q + +leak = (p**2 + q**2 - p - q)%key.n + +ciph = pow(flag, key.e, key.n) +ciph = long_to_bytes(ciph) + +print(f'{n = }') +print(f'{e = }') +print(f'{ciph = }') +print(f'{leak = }') diff --git a/m0leconteaserctf2025/talor/chall b/m0leconteaserctf2025/talor/chall index 6fcd3ec3..0b630521 100644 --- a/m0leconteaserctf2025/talor/chall +++ b/m0leconteaserctf2025/talor/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from random import SystemRandom import os diff --git a/noobzctf2023/maas/chall b/noobzctf2023/maas/chall index 29bb5290..b2a025b0 100755 --- a/noobzctf2023/maas/chall +++ b/noobzctf2023/maas/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import random from Crypto.Util.number import * flag = open('/flag').read() diff --git a/patriotctf2022/cryptogod/cryptogod b/patriotctf2022/cryptogod/cryptogod index c5a13e0f..0321c79d 100644 --- a/patriotctf2022/cryptogod/cryptogod +++ b/patriotctf2022/cryptogod/cryptogod @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import sys import socketserver from Crypto.Cipher import AES diff --git a/patriotctf2022/cryptogod/server b/patriotctf2022/cryptogod/server index 3ff1c3a5..1f06f14e 100644 --- a/patriotctf2022/cryptogod/server +++ b/patriotctf2022/cryptogod/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import sys import socketserver from Crypto.Cipher import AES diff --git "a/r3ctf2024/scp/\342\225\225\342\225\234\342\225\235\342\226\240/task" "b/r3ctf2024/scp/\342\225\225\342\225\234\342\225\235\342\226\240/task" index 4a984c54..ce3e561a 100644 --- "a/r3ctf2024/scp/\342\225\225\342\225\234\342\225\235\342\226\240/task" +++ "b/r3ctf2024/scp/\342\225\225\342\225\234\342\225\235\342\226\240/task" @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from hashlib import sha256 with open("/flag","rb") as f: diff --git a/r3ctf2024/sparrow/main b/r3ctf2024/sparrow/main index 5ceba9d2..a3fa70ee 100644 --- a/r3ctf2024/sparrow/main +++ b/r3ctf2024/sparrow/main @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 # Problem by rec, have fun. import os diff --git a/r3ctf2024/sparrow/utils b/r3ctf2024/sparrow/utils index e53ca4d8..df3cf52c 100644 --- a/r3ctf2024/sparrow/utils +++ b/r3ctf2024/sparrow/utils @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import random from Crypto.Util.number import long_to_bytes as l2b, bytes_to_long as b2l diff --git a/r3ctf2024/tinseal/Attachment/main b/r3ctf2024/tinseal/Attachment/main index f15b29ea..bc6f1eb8 100644 --- a/r3ctf2024/tinseal/Attachment/main +++ b/r3ctf2024/tinseal/Attachment/main @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import tenseal.sealapi as sealapi from random import randint diff --git a/tamuctf2024/criminal/server b/tamuctf2024/criminal/server index 79482b5c..20383ccd 100755 --- a/tamuctf2024/criminal/server +++ b/tamuctf2024/criminal/server @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from base64 import b64encode from Crypto.Random import get_random_bytes diff --git a/uiuctf2022/asr/chall b/uiuctf2022/asr/chall index a8e0fda7..9fe5088c 100755 --- a/uiuctf2022/asr/chall +++ b/uiuctf2022/asr/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 #from secret import flag from Crypto.Util.number import bytes_to_long, getPrime, isPrime diff --git a/uiuctf2022/ecc/ecc.py b/uiuctf2022/ecc/ecc.py index 4f9421a4..02c7ebd8 100755 --- a/uiuctf2022/ecc/ecc.py +++ b/uiuctf2022/ecc/ecc.py @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 # Code inspired by https://ecchacks.cr.yp.to/clockcrypto.py from random import seed, randrange diff --git a/uiuctf2023/athome/chal b/uiuctf2023/athome/chal index c7062868..5151c2db 100644 --- a/uiuctf2023/athome/chal +++ b/uiuctf2023/athome/chal @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getRandomNBitInteger diff --git a/uiuctf2023/groupproject/chal b/uiuctf2023/groupproject/chal index d8acc3cc..24f69e83 100755 --- a/uiuctf2023/groupproject/chal +++ b/uiuctf2023/groupproject/chal @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getPrime, long_to_bytes from random import randint diff --git a/uiuctf2023/groupprojection/chal b/uiuctf2023/groupprojection/chal index ac0298b0..979055a5 100755 --- a/uiuctf2023/groupprojection/chal +++ b/uiuctf2023/groupprojection/chal @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getPrime, long_to_bytes from random import randint diff --git a/uiuctf2023/morphing/chal b/uiuctf2023/morphing/chal index a7b34d4d..8d124b08 100755 --- a/uiuctf2023/morphing/chal +++ b/uiuctf2023/morphing/chal @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getPrime from random import randint diff --git a/zh3r0ctf2021/alicebobdave/chall b/zh3r0ctf2021/alicebobdave/chall index 9e070bb1..caa22f48 100755 --- a/zh3r0ctf2021/alicebobdave/chall +++ b/zh3r0ctf2021/alicebobdave/chall @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import sys sys.path.append('/challenge/') diff --git a/zh3r0ctf2021/bootleg/challenge b/zh3r0ctf2021/bootleg/challenge index 1c0da94e..86b12f0b 100755 --- a/zh3r0ctf2021/bootleg/challenge +++ b/zh3r0ctf2021/bootleg/challenge @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from Crypto.Util.number import getPrime from itertools import cycle diff --git a/zh3r0ctf2021/chaos/challenge b/zh3r0ctf2021/chaos/challenge index 48482331..ae0daf64 100755 --- a/zh3r0ctf2021/chaos/challenge +++ b/zh3r0ctf2021/chaos/challenge @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 #from secret import flag flag = open("/flag", "r").read().strip().encode() diff --git a/zh3r0ctf2021/cheater/challenge b/zh3r0ctf2021/cheater/challenge index a567de1e..e4bb6d87 100755 --- a/zh3r0ctf2021/cheater/challenge +++ b/zh3r0ctf2021/cheater/challenge @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 from random import randint, random from collections import Counter diff --git a/zh3r0ctf2021/injection/challenge b/zh3r0ctf2021/injection/challenge index 99f5cc34..77043d81 100755 --- a/zh3r0ctf2021/injection/challenge +++ b/zh3r0ctf2021/injection/challenge @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 #from secret import flag flag = open("/flag", "r").read().strip().encode() diff --git a/zh3r0ctf2021/mersenne/challenge b/zh3r0ctf2021/mersenne/challenge index c7a8fd21..425473f8 100755 --- a/zh3r0ctf2021/mersenne/challenge +++ b/zh3r0ctf2021/mersenne/challenge @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import random #from secret import flag diff --git a/zh3r0ctf2021/numpymt/challenge b/zh3r0ctf2021/numpymt/challenge index cba107a1..f021be5c 100755 --- a/zh3r0ctf2021/numpymt/challenge +++ b/zh3r0ctf2021/numpymt/challenge @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import os from numpy import random diff --git a/zh3r0ctf2021/twist/challenge b/zh3r0ctf2021/twist/challenge index aadc54cd..096586be 100755 --- a/zh3r0ctf2021/twist/challenge +++ b/zh3r0ctf2021/twist/challenge @@ -1,4 +1,4 @@ -#!/opt/pwn.college/python +#!/usr/bin/exec-suid -- /usr/bin/python3 import sys sys.path.append('/challenge/')