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/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/bz2_codec.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/bz2_codec.py
"""Python 'bz2_codec' Codec - bz2 compression encoding. This codec de/encodes from bytes to bytes and is therefore usable with bytes.transform() and bytes.untransform(). Adapted by Raymond Hettinger from zlib_codec.py which was written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs import bz2 # this code...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/utf_32_be.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/utf_32_be.py
""" Python 'utf-32-be' Codec """ import codecs ### Codec APIs encode = codecs.utf_32_be_encode def decode(input, errors='strict'): return codecs.utf_32_be_decode(input, errors, True) class IncrementalEncoder(codecs.IncrementalEncoder): def encode(self, input, final=False): return codecs.utf_32_be_en...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/mac_iceland.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/mac_iceland.py
""" Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/oem.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/oem.py
""" Python 'oem' Codec for Windows """ # Import them explicitly to cause an ImportError # on non-Windows systems from codecs import oem_encode, oem_decode # for IncrementalDecoder, IncrementalEncoder, ... import codecs ### Codec APIs encode = oem_encode def decode(input, errors='strict'): return oem_decode(inpu...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp856.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp856.py
""" Python Character Mapping Codec cp856 generated from 'MAPPINGS/VENDORS/MISC/CP856.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/utf_8.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/utf_8.py
""" Python 'utf-8' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs encode = codecs.utf_8_encode def decode(input, errors='strict'): return codecs.utf_8_decode(input, errors, True) class IncrementalEncoder(codecs.In...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/raw_unicode_escape.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/raw_unicode_escape.py
""" Python 'raw-unicode-escape' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/undefined.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/undefined.py
""" Python 'undefined' Codec This codec will always raise a ValueError exception when being used. It is intended for use by the site.py file to switch off automatic string to Unicode coercion. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ impo...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp1140.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp1140.py
""" Python Character Mapping Codec cp1140 generated from 'python-mappings/CP1140.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='stri...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp437.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp437.py
""" Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/iso2022_kr.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/iso2022_kr.py
# # iso2022_kr.py: Python Unicode Codec for ISO2022_KR # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_kr') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncod...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/mbcs.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/mbcs.py
""" Python 'mbcs' Codec for Windows Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py, which was written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ # Import them explicitly to cause an ImportError # on non-Windows systems from codecs import mbcs...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp500.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp500.py
""" Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp860.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp860.py
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP860.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/mac_latin2.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/mac_latin2.py
""" Python Character Mapping Codec mac_latin2 generated from 'MAPPINGS/VENDORS/MICSFT/MAC/LATIN2.TXT' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs....
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp852.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp852.py
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP852.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp863.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp863.py
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP863.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/iso8859_11.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/iso8859_11.py
""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/utf_16_le.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/utf_16_le.py
""" Python 'utf-16-le' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs encode = codecs.utf_16_le_encode def decode(input, errors='strict'): return codecs.utf_16_le_decode(input, errors, True) class IncrementalEncod...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/mac_greek.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/mac_greek.py
""" Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,err...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/iso8859_14.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/iso8859_14.py
""" Python Character Mapping Codec iso8859_14 generated from 'MAPPINGS/ISO8859/8859-14.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/ascii.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/ascii.py
""" Python 'ascii' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is intended. ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/charmap.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/charmap.py
""" Generic Python Character Mapping Codec. Use this codec directly rather than through the automatic conversion mechanisms supplied by unicode() and .encode(). Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import codecs ### Codec APIs class...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp949.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp949.py
# # cp949.py: Python Unicode Codec for CP949 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_kr, codecs import _multibytecodec as mbc codec = _codecs_kr.getcodec('cp949') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrement...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/iso2022_jp.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/iso2022_jp.py
# # iso2022_jp.py: Python Unicode Codec for ISO2022_JP # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncod...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/utf_16.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/utf_16.py
""" Python 'utf-16' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs, sys ### Codec APIs encode = codecs.utf_16_encode def decode(input, errors='strict'): return codecs.utf_16_decode(input, errors, True) class IncrementalEncoder(c...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/utf_8_sig.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/utf_8_sig.py
""" Python 'utf-8-sig' Codec This work similar to UTF-8 with the following changes: * On encoding/writing a UTF-8 encoded BOM will be prepended/written as the first three bytes. * On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these bytes will be skipped. """ import codecs ### Codec APIs ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/mac_romanian.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/mac_romanian.py
""" Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inp...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp869.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp869.py
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/koi8_r.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/koi8_r.py
""" Python Character Mapping Codec koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp862.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp862.py
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/kz1048.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/kz1048.py
""" Python Character Mapping Codec kz1048 generated from 'MAPPINGS/VENDORS/MISC/KZ1048.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self, input, errors='strict'): return codecs.charmap_encode(input, errors, encoding_table) def decode(self, input, ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp865.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp865.py
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP865.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp864.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/cp864.py
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
true
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/euc_kr.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/euc_kr.py
# # euc_kr.py: Python Unicode Codec for EUC_KR # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_kr, codecs import _multibytecodec as mbc codec = _codecs_kr.getcodec('euc_kr') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/iso2022_jp_3.py
ctfs/DEFCON/2022/Quals/adamd/lib/python3.12/encodings/iso2022_jp_3.py
# # iso2022_jp_3.py: Python Unicode Codec for ISO2022_JP_3 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_3') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incrementa...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2020/Quals/nooopsled/service.py
ctfs/DEFCON/2020/Quals/nooopsled/service.py
#!/usr/bin/env python3 import subprocess import tempfile import fuckpy3 #pylint:disable=unused-import import os ARCHITECTURES = { "aarch64", "riscv64" } THRESHOLD = int(os.environ.get('THRESHOLD', 1000)) def main(): print("Historically, shellcode was judged by what it could do. This outmoded") print("way of ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2020/Quals/bytecoooding/src/service.py
ctfs/DEFCON/2020/Quals/bytecoooding/src/service.py
#!/usr/bin/env python3 import os import random import shutil import signal import string import subprocess import sys import tempfile THRESHOLD = int(os.environ.get('THRESHOLD', 1000)) PLATFORMS = ["jvm", "python3", "python2", "ruby", "lua", "nodejs", "ocaml", "elisp"] FLAG_LOCATION = '/flag' DEBUG = False def get...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2020/Quals/adventure-on-lifebooox/src/gamerunner.py
ctfs/DEFCON/2020/Quals/adventure-on-lifebooox/src/gamerunner.py
#! /usr/bin/env python3 import lifebox_task import rq.registry import statistics import traceback import signal import select import shutil import redis import json import time import uuid import sys import os import re import rq DEBUG=1 RESULTS_LOG = "" BASE_DIR = "" NUMBER_OF_WORKERS = "" def get_pattern(): p...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2020/Quals/adventure-on-lifebooox/src/workers.py
ctfs/DEFCON/2020/Quals/adventure-on-lifebooox/src/workers.py
import multiprocessing import traceback import redis import time import sys import rq import os def main(): max_workers = 5 if "GOL_WORKERS" in os.environ: max_workers = int(os.getenv("GOL_WORKERS")) processes = [] q = None for _ in range(0, 3): try: rq.use_connection...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2020/Quals/adventure-on-lifebooox/src/__init__.py
ctfs/DEFCON/2020/Quals/adventure-on-lifebooox/src/__init__.py
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2020/Quals/adventure-on-lifebooox/src/lifebox_task.py
ctfs/DEFCON/2020/Quals/adventure-on-lifebooox/src/lifebox_task.py
import pyvirtualdisplay.smartdisplay import easyprocess import shutil import time import sys import os GOLLY_BINARY = "/usr/games/golly /lifebox-run.py" DEBUG = 0 def start(attempt_id, results_log): last_len = 0 same_cnt = 0 with pyvirtualdisplay.smartdisplay.SmartDisplay(visible=False, size=(1300, 900)) ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2020/Quals/adventure-on-lifebooox/src/lifebox-run.py
ctfs/DEFCON/2020/Quals/adventure-on-lifebooox/src/lifebox-run.py
from glife import * import golly as g import time import os import re vals = [] def add_data(PATTERN_FN): g.select([-2753, 891, 1092, 1397]) g.clear(0) g.select([]) input_str = open(PATTERN_FN,"r").read() firstbreak = input_str.find("\n") if firstbreak == -1: g.show("Error, no newl...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2020/Quals/adventure-on-lifebooox/src/check_queue.py
ctfs/DEFCON/2020/Quals/adventure-on-lifebooox/src/check_queue.py
import traceback import redis import rq rq.use_connection(redis.Redis()) q = rq.Queue("lifeboxQueue") print(q.count) workers = rq.Worker.all(queue=q) for w in workers: print(f"{w.name} - {w.get_state()} - {w.get_current_job()}")
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/DEFCON/2020/Quals/biooosless/local-run.py
ctfs/DEFCON/2020/Quals/biooosless/local-run.py
#!/usr/bin/env python3 import os import sys from os.path import isfile, abspath, dirname, join # This script simulates what's going on the server. Qemu is launched exactly as # shown below. The bios-template is exaclty the one used on the server. def main(): if len(sys.argv) != 2: print(f'Usage: {sys.a...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WORMCON/2021/crypto/Sir_Oracle/server.py
ctfs/WORMCON/2021/crypto/Sir_Oracle/server.py
#!/usr/bin/env python3 from Crypto.Util.number import * from Crypto.Cipher import AES from Crypto.Util.Padding import pad from Crypto.Hash import SHA256 import os bits = 256 bs = AES.block_size FLAG = open('flag.txt').read() menu = """ +-------------------------+ | | | M E N U ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WORMCON/2021/crypto/Fake_Encryption/chall.py
ctfs/WORMCON/2021/crypto/Fake_Encryption/chall.py
#!/usr/bin/env python3 from Crypto.Cipher import DES import random def splitn(text, size): return [text[i:i+size] for i in range(0,len(text),size)] def encrypt(m, key): cipher = DES.new(key, DES.MODE_ECB) return cipher.encrypt(m) flag = open('flag.png','rb').read() ff = splitn(flag, 8) assert len(flag) % 8 == ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WORMCON/2021/crypto/Exclusive/chall.py
ctfs/WORMCON/2021/crypto/Exclusive/chall.py
#!/usr/bin/env python3 import os def splitit(n): return (n >> 4), (n & 0xF) def encrypt(n, key1, key2): m, l = splitit(n) e = ((m ^ key1) << 4) | (l ^ key2) return e FLAG = open('flag.txt').read().lstrip('wormcon{').rstrip('}') alpha = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_' assert all...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WORMCON/2021/crypto/Rem_Shinobu_Asuna/chall.py
ctfs/WORMCON/2021/crypto/Rem_Shinobu_Asuna/chall.py
#!/usr/bin/env python3 from Crypto.Util.number import * FLAG = open('flag.txt', 'rb').read() bits = 512 e = 65537 p = getPrime(bits) q = getPrime(bits) n = p*q phi = (p-1)*(q-1) d = inverse(e, phi) hint = 2*d*(p-1337) m = bytes_to_long(FLAG) c = pow(m, e, n) print(f"n = {hex(n)}") print(f"e = {hex(e)}") print(f"c =...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/WORMCON/2021/crypto/Invisible_Cipher/chall.py
ctfs/WORMCON/2021/crypto/Invisible_Cipher/chall.py
#!/usr/bin/env python3 def encrypt(pt, PTALPHA, CTALPHA): ct = '' for ch in pt: i = PTALPHA.index(ch) ct += CTALPHA[i] return ct PTALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ ' CTALPHA = open('CTALPHA.txt').read().strip() FLAG = open('flag.txt').read().strip() assert len(CTALPHA) == len(PTALPHA) assert all(x in PTAL...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2024/misc/zerocoin/solve.py
ctfs/LA/2024/misc/zerocoin/solve.py
#!/usr/bin/env python3 from pwn import * p = remote("chall.lac.tf", 31337) addrs = {} while True: name = p.recvuntil(b": ", drop=True).decode() if name == "program pubkey": break key = p.recvline(keepends=False).decode() addrs[name] = key print(addrs) # can change pubkey to anything else, t...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2024/crypto/pprngc/pprngc.py
ctfs/LA/2024/crypto/pprngc/pprngc.py
#!/usr/local/bin/python3 import secrets from super_secret_stuff import flag, f, f_inverse seed = secrets.randbits(16) function_uses = 0 oracle_uses = 0 done = False def compute_output_bit(state, pred): return bin((state & pred)).count("1") % 2 def prng(pred): cur_state = seed outputs = [] for i in r...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2024/crypto/shuffle/shuffler.py
ctfs/LA/2024/crypto/shuffle/shuffler.py
#!/usr/local/bin/python3 from secrets import randbits import math from base64 import b64encode MESSAGE_LENGTH = 617 class LCG: def __init__(self,a,c,m,seed): self.a = a self.c = c self.m = m self.state = seed def next(self): self.state = (self.a * self.state + self.c)...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2024/crypto/prove_it/server.py
ctfs/LA/2024/crypto/prove_it/server.py
#!/usr/local/bin/python import random flag = "lactf{??????????}" p = 1716872711873624028582531533172267794125197084157588612601736151547946515290952855545590877691297187506962042768543816968369477203547589292624229459105863701549307004274988782251537947225729097423956876871360634100032543206134299261207298093006392762...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2024/crypto/budget_bag/main.py
ctfs/LA/2024/crypto/budget_bag/main.py
import random from hidden import DollarStore p = 95773813056613526295315889615423014145567365190638271416026411091272805051097 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 +...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2024/crypto/very_hot/src.py
ctfs/LA/2024/crypto/very_hot/src.py
from Crypto.Util.number import getPrime, isPrime, bytes_to_long from flag import FLAG FLAG = bytes_to_long(FLAG.encode()) p = getPrime(384) while(not isPrime(p + 6) or not isPrime(p + 12)): p = getPrime(384) q = p + 6 r = p + 12 n = p * q * r e = 2**16 + 1 ct = pow(FLAG, e, n) print(f'n: {n}') print(f'e: {e}') ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2024/crypto/hOlyT/server.py
ctfs/LA/2024/crypto/hOlyT/server.py
from Crypto.Util.number import getPrime, bytes_to_long import random 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 ==...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2024/web/la_housing_portal/app.py
ctfs/LA/2024/web/la_housing_portal/app.py
import sqlite3 from flask import Flask, render_template, request app = Flask(__name__) @app.route("/") def home(): return render_template("index.html") @app.route("/submit", methods=["POST"]) def search_roommates(): data = request.form.copy() if len(data) > 6: return "Invalid form data", 422 ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2024/web/jason_web_token/auth.py
ctfs/LA/2024/web/jason_web_token/auth.py
import hashlib import json import os import time secret = int.from_bytes(os.urandom(128), "big") hash_ = lambda a: hashlib.sha256(a.encode()).hexdigest() class admin: username = os.environ.get("ADMIN", "admin-owo") age = int(os.environ.get("ADMINAGE", "30")) def create_token(**userinfo): userinfo["time...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2024/web/jason_web_token/app.py
ctfs/LA/2024/web/jason_web_token/app.py
from pathlib import Path from fastapi import Cookie, FastAPI, Response from fastapi.responses import HTMLResponse from fastapi.staticfiles import StaticFiles from pydantic import BaseModel import auth app = FastAPI() app.mount("/static", StaticFiles(directory="static"), name="static") flag = (Path(__file__).parent ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2024/web/ctf_wiki/app.py
ctfs/LA/2024/web/ctf_wiki/app.py
from flask import Flask, render_template, request, session, redirect, url_for import os import secrets from functools import cache from markdown import markdown import psycopg2 import urllib.parse app = Flask(__name__) app.secret_key = (os.environ.get("SECRET_KEY") or '_5#y2L"F4Q8z\n\xec]/').encode() app.config["SESS...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2024/web/penguin_login/app.py
ctfs/LA/2024/web/penguin_login/app.py
import string import os from functools import cache from pathlib import Path import psycopg2 from flask import Flask, request app = Flask(__name__) flag = Path("/app/flag.txt").read_text().strip() allowed_chars = set(string.ascii_letters + string.digits + " 'flag{a_word}'") forbidden_strs = ["like"] @cache def get...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/pwn/sailor/solve.py
ctfs/LA/2023/pwn/sailor/solve.py
# sample solve script to interface with the server from pwn import * # feel free to change this account_metas = [ ("program", "-r"), # readonly ("user", "sw"), # signer + writable ("vault", "-w"), # writable ("sailor union", "-w"), ("rich boi", "-r"), ("system program", "-r"), ] instruction_da...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/rev/snek/snek.py
ctfs/LA/2023/rev/snek/snek.py
#!/usr/local/bin/python3 # hey look a one liner! __import__('pickle').loads(b'\x80\x05X\x01\x00\x00\x000\x940X\x01\x00\x00\x001\x940X\x01\x00\x00\x002\x940X\x01\x00\x00\x003\x940X\x01\x00\x00\x004\x940X\x01\x00\x00\x005\x940X\x01\x00\x00\x006\x940X\x01\x00\x00\x007\x940X\x01\x00\x00\x008\x940X\x01\x00\x00\x009\x940X\x0...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/crypto/chinese-lazy-theorem-2/chinese-lazy-theorem-2.py
ctfs/LA/2023/crypto/chinese-lazy-theorem-2/chinese-lazy-theorem-2.py
#!/usr/local/bin/python3 from Crypto.Util.number import getPrime from Crypto.Random.random import randint p = getPrime(512) q = getPrime(512) n = p*q*2*3*5 target = randint(1, n) oracle_uses = 0 print(p) print(q) print("This time I'll answer 2 modulus questions and give you 30 guesses.") while True: print("Wh...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/crypto/one-more-time-pad/chall.py
ctfs/LA/2023/crypto/one-more-time-pad/chall.py
from itertools import cycle pt = b"Long ago, the four nations lived together in harmony ..." key = cycle(b"lactf{??????????????}") ct = "" for i in range(len(pt)): b = (pt[i] ^ next(key)) ct += f'{b:02x}' print("ct =", ct) #ct = 200e0d13461a055b4e592b0054543902462d1000042b045f1c407f18581b56194c150c13030f0a5...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/crypto/guess-the-bit/chall.py
ctfs/LA/2023/crypto/guess-the-bit/chall.py
#!/usr/local/bin/python3 import random from Crypto.Util.number import getPrime n = 4379966333906331221127371446857159174694017901965541814559531455616498375658590066254146257342962501225714140931038729865837583692131069157807298566462171624066322144352750675753953233937229004188463343562642939037185064574364327383688...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/crypto/hill-hard/chall.py
ctfs/LA/2023/crypto/hill-hard/chall.py
#!/usr/local/bin/python3 import numpy as np def det(M): # stolen from https://stackoverflow.com/a/66192895 M = [[int(x) for x in row] for row in M] # make a copy to keep original M unmodified N, sign, prev = len(M), 1, 1 for i in range(N-1): if M[i][i] == 0: # swap with another row having nonz...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/crypto/hill-easy/chall.py
ctfs/LA/2023/crypto/hill-easy/chall.py
#!/usr/local/bin/python3 import numpy as np def det(M): # stolen from https://stackoverflow.com/a/66192895 M = [[int(x) for x in row] for row in M] # make a copy to keep original M unmodified N, sign, prev = len(M), 1, 1 for i in range(N-1): if M[i][i] == 0: # swap with another row having nonz...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/crypto/ravin-cryptosystem/ravin.py
ctfs/LA/2023/crypto/ravin-cryptosystem/ravin.py
from Crypto.Util import number def fastpow(b, p, mod): # idk this is like repeated squaring or something i heard it makes pow faster a = 1 while p: p >>= 1 b = (b*b)%mod if p&1: a = (a*b)%mod return a p = number.getPrime(100) q = number.getPrime(100) n = p*q e = 655...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/crypto/chinese-lazy-theorem-1/chinese-lazy-theorem-1.py
ctfs/LA/2023/crypto/chinese-lazy-theorem-1/chinese-lazy-theorem-1.py
#!/usr/local/bin/python3 from Crypto.Util.number import getPrime from Crypto.Random.random import randint p = getPrime(512) q = getPrime(512) n = p*q target = randint(1, n) used_oracle = False print(p) print(q) print("To quote Pete Bancini, \"I'm tired.\"") print("I'll answer one modulus question, that's it.") wh...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/web/85_reasons_why/run.py
ctfs/LA/2023/web/85_reasons_why/run.py
#! /usr/bin/env python import os from dotenv import load_dotenv load_dotenv() from app import app def main(): port = os.getenv('PORT') if port != 0: app.run(host='127.0.0.1', port=port) else: app.run() if __name__ == '__main__': main()
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/web/85_reasons_why/app/views.py
ctfs/LA/2023/web/85_reasons_why/app/views.py
from flask import render_template, request, redirect, url_for, flash, jsonify from flask_limiter import Limiter from flask_limiter.util import get_remote_address from sqlalchemy import or_, text from app import app, db from .models import Post, Image from .utils import serialize_image, deserialize_images import os M...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/web/85_reasons_why/app/models.py
ctfs/LA/2023/web/85_reasons_why/app/models.py
from app import db from datetime import datetime import uuid import json class Post(db.Model): __tablename__ = 'posts' id = db.Column(db.String(36), primary_key=True) title = db.Column(db.String(200), nullable=False) content = db.Column(db.String(), nullable=False) author = db.Column(db.String(2...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/web/85_reasons_why/app/utils.py
ctfs/LA/2023/web/85_reasons_why/app/utils.py
import base64 import re from app.models import Image # def escape(b_string): # re.sub() # pass def serialize_image(pp): b85 = base64.a85encode(pp) b85_string = b85.decode('UTF-8', 'ignore') # identify single quotes, and then escape them b85_string = re.sub('\\\\\\\\\\\\\'', '~', b85_string) ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2023/web/85_reasons_why/app/__init__.py
ctfs/LA/2023/web/85_reasons_why/app/__init__.py
import os from flask import Flask from flask_sqlalchemy import SQLAlchemy from dotenv import load_dotenv load_dotenv() basedir = os.path.abspath(os.path.dirname(__file__)) app = Flask(__name__) app.config['SECRET_KEY'] = os.getenv('SECRET_KEY') app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(ba...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/misc/farquaad/chall.py
ctfs/LA/2025/misc/farquaad/chall.py
#!/usr/local/bin/python3 import string import html code = input() if any(c not in string.printable for c in code): print("no tomfoolery!") exit() if "e" in code or "E" in code: print("no 'e'!") exit() print(html.escape(repr(eval(code, {"__builtins__": {}}))))
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/misc/extended/gen.py
ctfs/LA/2025/misc/extended/gen.py
flag = "lactf{REDACTED}" extended_flag = "" for c in flag: o = bin(ord(c))[2:].zfill(8) # Replace the first 0 with a 1 for i in range(8): if o[i] == "0": o = o[:i] + "1" + o[i + 1 :] break extended_flag += chr(int(o, 2)) print(extended_flag) with open("chall.txt", "w...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/pwn/eepy/run.py
ctfs/LA/2025/pwn/eepy/run.py
#!/usr/local/bin/python import os import time import base64 import string import subprocess inp = base64.b64decode(input())[:0xe] with open("vuln", "rb") as file: data = bytearray(file.read()) data[0x1050:0x105e] = inp.ljust(0xe, b"\x00") file.close() with open("/tmp/vuln", "wb") as file: file.write(d...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/rev/elfisyou/chal.py
ctfs/LA/2025/rev/elfisyou/chal.py
#!/usr/local/bin/python import os import sys import tty N = 13 elf = open("elf", "rb").read().ljust(N*N, b"\x00") grid = [list(elf[i:i + N]) for i in range(0, len(elf), N)] x, y = N-1, 0 def view(clear=True): print("\x1b[2J") print("="*38, end="\r\n") print("| byte is push".ljust(37)+"|", end="\r\n") ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/rev/crypt_of_the_necropuzzler/crypt-of-the-necropuzzler.py
ctfs/LA/2025/rev/crypt_of_the_necropuzzler/crypt-of-the-necropuzzler.py
#!/usr/local/bin/python3 import tty import sys import hashlib if sys.stdin.isatty(): tty.setcbreak(0) g=(f:=[0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1])[:] n=[1,1,0,0,0,0,0,0,1,0,2,0,0,0,0,0,3,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,3,0,0,0,1,0,1,0,1,0,0,0,2,2,2,0,0] ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/crypto/big_e/chall.py
ctfs/LA/2025/crypto/big_e/chall.py
from Crypto.Util.number import bytes_to_long, getPrime flag = REDACTED pt = bytes_to_long(flag) p = getPrime(1024) q = getPrime(1024) n = p*q e_1 = getPrime(16) e_2 = getPrime(16) ct_1 = pow(pt, e_1, n) ct_2 = pow(pt, e_2, n) print("ct_1 = ", ct_1) print("ct_2 = ", ct_2) print("e_1 = ", e_1) print("e_2 = ", e_2...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/crypto/quickprime/chall.py
ctfs/LA/2025/crypto/quickprime/chall.py
#!/usr/local/bin/python3 from secrets import randbits from Crypto.Util.number import isPrime class LCG: def __init__(self, a: int, c: int, m: int, seed: int): self.a = a self.c = c self.m = m self.state = seed def next(self): self.state = (self.a * self.state + self....
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/crypto/RSAaaS/chall.py
ctfs/LA/2025/crypto/RSAaaS/chall.py
#!/usr/local/bin/python3 from Crypto.Util.number import isPrime def RSAaaS(): try: print("Welcome to my RSA as a Service! ") print("Pass me two primes and I'll do the rest for you. ") print("Let's keep the primes at a 64 bit size, please. ") while True: p = input("Inp...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/crypto/Extremely_Convenient_Breaker/chall.py
ctfs/LA/2025/crypto/Extremely_Convenient_Breaker/chall.py
#!/usr/local/bin/python3 from Crypto.Cipher import AES import os key = os.urandom(16) with open("flag.txt", "r") as f: flag = f.readline().strip() cipher = AES.new(key, AES.MODE_ECB) flag_enc = cipher.encrypt(flag.encode()) print("Here's the encrypted flag in hex: ") print(flag_enc.hex()) print("Alright, lemme s...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/crypto/bigram_times/chall.py
ctfs/LA/2025/crypto/bigram_times/chall.py
characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789{}~_" flag = "lactf{REDACTED~}" def bigram_multiplicative_shift(bigram): assert(len(bigram) == 2) pos1 = characters.find(bigram[0]) + 1 pos2 = characters.find(bigram[1]) + 1 shift = (pos1 * pos2) % 67 return characters[((po...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/crypto/shuffle_revenge/shuffler.py
ctfs/LA/2025/crypto/shuffle_revenge/shuffler.py
#!/usr/local/bin/python3 from secrets import randbits import os import sys import binascii class LCG: def __init__(self, a: int, c: int, m: int, seed: int): self.a = a self.c = c self.m = m self.state = seed def next(self): self.state = (self.a * self.state + self.c)...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/crypto/crypto_civilization/chall.py
ctfs/LA/2025/crypto/crypto_civilization/chall.py
#!/usr/local/bin/python3 import hashlib import os import binascii # s is 16 bits long, 32 bit output def PRG(s: bytes) -> bytes: assert len(s) == 2, "You're trying to cheat! Go to Crypto Prison!" s_int = int.from_bytes(s, byteorder="big") h = hashlib.new("sha3_256") h.update(s) out = h.digest()...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/crypto/good_hash/server.py
ctfs/LA/2025/crypto/good_hash/server.py
from Crypto.Cipher import AES import os FLAG = REDACTED if __name__ == "__main__": print("Can you guess the secret?") secret = os.urandom(16) key = os.urandom(16) iv = os.urandom(12) for attempt in range(4): choice = input().strip() if choice == "1": leftextend = bytes...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/crypto/p_vs_np/VDF.py
ctfs/LA/2025/crypto/p_vs_np/VDF.py
# Inspired by https://github.com/BqETH/PietrzakVDF/blob/main/PietrzakVDF.py import binascii import math import hashlib import time def r_value(x, y, μ, int_size_bits=1024): """Generates the Fiat-Shamir verifier challenges Hash(xi,yi,μi)""" int_size = int_size_bits // 8 s = (x.to_bytes(int_size, "big", sign...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/LA/2025/crypto/p_vs_np/chall.py
ctfs/LA/2025/crypto/p_vs_np/chall.py
#!/usr/local/bin/python3 from VDF import verify_proof from Crypto.Util.number import getPrime, isPrime import os from math import gcd def is_valid(p, n): assert gcd(p,n) == 1 return 1 < p < n - 1 if __name__ == "__main__": print("Show me that you're a man of patience and I will give you the flag") p = g...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/IJCTF/2021/crypto/ECSign/problem.py
ctfs/IJCTF/2021/crypto/ECSign/problem.py
import hashlib import random from Crypto.Util.number import inverse, bytes_to_long, long_to_bytes from Crypto.Random import get_random_bytes from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad from ecdsa import NIST256p from flag import FLAG message = b"ECDSA prevents forging messages" curve = N...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/IJCTF/2021/crypto/Quartic/problem.py
ctfs/IJCTF/2021/crypto/Quartic/problem.py
from Crypto.Util.number import getPrime, bytes_to_long, getRandomNBitInteger from flag import FLAG p = getPrime(1024) q = getPrime(1024) n = p * q e = 0x10001 c = pow(bytes_to_long(FLAG), e, n) delta = getRandomNBitInteger(80) x = p + delta seq = [] val = 0 for i in range(5): seq.append(getRandomNBitInteger(10...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/IJCTF/2021/crypto/Block_Cipher/problem.py
ctfs/IJCTF/2021/crypto/Block_Cipher/problem.py
from Crypto.Util.number import bytes_to_long, long_to_bytes from secret_process import create_table, laststep from key import KEY FLAG = b'IJCTF{' + KEY + b'}' def int_to_nibble(val): sol = [] for i in range(16): sol.append((val >> (4*i)) & 0x0f) return sol def nibble_to_int(val_lst): sol = 0...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/IJCTF/2021/crypto/Square_Sum/problem.py
ctfs/IJCTF/2021/crypto/Square_Sum/problem.py
from Crypto.Util.number import getPrime, inverse, bytes_to_long from Crypto.Random.random import randint from secret import MSG, FLAG p = getPrime(1024) q = getPrime(1024) n = p * q n2 = n**2 halfpq_sqr_sum = (p//2)**2 + (q//2)**2 k = randint(1, n-1) g = 1 + k*n r = randint(2, n2-1) cmsg = (pow(g, bytes_to_long(MS...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/IJCTF/2021/web/Jinx/app.py
ctfs/IJCTF/2021/web/Jinx/app.py
from flask import Flask, request from flask_caching import Cache from redis import Redis app = Flask(__name__) cache = Cache(app, config={'CACHE_TYPE': 'redis','CACHE_REDIS_HOST':'redis'}) redis = Redis('redis') @app.route('/',methods=["GET"]) def index(): return "Welcome to ctf-cdn" @app.route('/api/upload',...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/IJCTF/2021/web/Jinx/wsgi.py
ctfs/IJCTF/2021/web/Jinx/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/IJCTF/2020/corrupted_maps/server.py
ctfs/IJCTF/2020/corrupted_maps/server.py
import sys import tempfile import os print("How many bytes is your exploit? (1MB max)", flush=True) size = int(input()) assert(size < 1024*1024) print("Please minify and copy paste your exploit script", flush=True) script = sys.stdin.read(size) # reads one byte at a time temp = tempfile.mktemp() with open(temp, "w")...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PlaidCTF/2021/pwn/The_False_Promise/server.py
ctfs/PlaidCTF/2021/pwn/The_False_Promise/server.py
#!/usr/bin/env python3 -u import hashlib import os import random import string import sys import subprocess import tempfile MAX_SIZE = 100 * 1024 print("Proof of work is required.") prefix = "".join([random.choice(string.digits + string.ascii_letters) for i in range(10)]) resource = prefix + "promise" bits = 28 cash ...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false
sajjadium/ctf-archives
https://github.com/sajjadium/ctf-archives/blob/129a3a9fe604443211fa4d493a49630c30689df7/ctfs/PlaidCTF/2021/crypto/leaky_block_cipher/hashcash.py
ctfs/PlaidCTF/2021/crypto/leaky_block_cipher/hashcash.py
#!/usr/bin/env python3 """Implement Hashcash version 1 protocol in Python +-------------------------------------------------------+ | Written by David Mertz; released to the Public Domain | +-------------------------------------------------------+ Very hackily modified Double spend database not implemented in this mod...
python
MIT
129a3a9fe604443211fa4d493a49630c30689df7
2026-01-05T01:34:13.869332Z
false