#Python

Meepwn qual round - pycalx 1

Published at September 11, 2018 ·  4 min read

Thử thách cung cấp cho mình 1 form dữ liệu cùng với sourcecode như sau: #!/usr/bin/env python import cgi; import sys from html import escape FLAG = open('/var/www/flag','r').read() OK_200 = """Content-type: text/html <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"> <center> <title>PyCalx</title> <h1>PyCalx</h1> <form> <input class="form-control col-md-4" type=text name=value1 placeholder='Value 1 (Example: 1 abc)' autofocus/> <input class="form-control col-md-4" type=text name=op placeholder='Operator (Example: + - * ** / // == != )' /> <input class="form-control col-md-4" type=text name=value2 placeholder='Value 2 (Example: 1 abc)' /> <input class="form-control col-md-4 btn btn-success" type=submit value=EVAL /> </form> <a href='?...