Exemplo n.º 1
0
def act_1():
    """
	act_1:	runs the required actions to get the act 1 flag
		then prints out the flag
	It just makes a POST request to csec380-core.csec.rit.edu
	:return: Nothing
	"""
    print("Act 1")
    agent = CAgent(HOST, PORT)
    agent.make_header(method="POST", uri="/")
    resp = agent.single_request()
    print(resp.split('"')[1])
Exemplo n.º 2
0
def act_2():
    """
	act_2:	runs the required acts to get the act 2 flag
		then prints out the flag
	It gets a security token, puts that token in the body,
		then makes another POST request
	:return: Nothing
	"""
    print("Act 2")
    token = get_security_token(HOST, PORT)
    tok = "token=%s" % token
    agent = CAgent(HOST, PORT)
    agent.set_body(tok)
    agent.make_header(method="POST", uri="/getFlag2")
    response_2 = agent.single_request()
    print(response_2.split('"')[1])