Esempio n. 1
0
def main():
    """Run main function."""
    challenge_page_link = CHALL_LINK
    f_name, _ = os.path.splitext(challenge_page_link)
    challenge_page_link = f_name + ".php"

    raw_html = common.get_page_content(challenge_page_link)
    if raw_html:
        nothing = get_first_nothing(raw_html)
        if nothing:
            print(nothing)
            url_params = {"nothing": nothing}
            next_nothing = nothing

            for i in range(400):

                next_response = common.get_page_content(
                    challenge_page_link, url_params)
                prev_nothing = next_nothing
                next_nothing = get_next_nothing(next_response)

                print(f"{i}    {next_nothing}")

                if next_nothing is None:
                    if i == 85:
                        next_nothing = str(int(int(prev_nothing) / 2))
                    else:
                        break
                url_params["nothing"] = next_nothing

            # next_challenge = pychallenge_common.get_next_challenge(hidden_word)
            # print(next_challenge)
            # return next_challenge

    return None
Esempio n. 2
0
def execute():
    """Start challenge execution."""
    logger.info("Challenge {}, URL {}".format(CH_NUMBER, CH_URL))
    ch_url = CH_URL
    html_content = common.get_page_content(ch_url)
    if html_content is None:
        return None
    img_url = retrieve_image_url(html_content)
    filepath = common.download_file(img_url)
    keyword = process_image(filepath)
    next_ch_url = common.get_next_challenge(keyword)
    logger.info("Next challenge {}, URL {}".format(CH_NUMBER + 1, next_ch_url))

    return next_ch_url
Esempio n. 3
0
def execute():
    """Start challenge execution."""
    ch_url = CH_URL
    html_content = common.get_page_content(ch_url)
    if html_content is None:
        return None

    commented_text = common.get_text_in_comments(html_content)
    rare_chars = get_rare_characters(commented_text[1])
    next_ch_url = common.get_next_challenge("".join(rare_chars))
    if not common.url_response_ok(next_ch_url):
        return None

    return next_ch_url
Esempio n. 4
0
def main():
    """Run main function."""
    challenge_page_link = CHALL_LINK
    raw_html = common.get_page_content(challenge_page_link)

    if raw_html:
        commented_text = common.get_text_in_comments(raw_html)
        found_letters = re.findall(HIDDEN_WORD_PATTERN, commented_text[0])

        if found_letters:
            hidden_word = "".join(found_letters)
            next_challenge = common.get_next_challenge(hidden_word)
            print(next_challenge)
            return next_challenge

    return None
Esempio n. 5
0
def execute():
    """Start challenge execution."""
    logger.info("Challenge {}, URL {}".format(CH_NUMBER, CH_URL))
    ch_url = CH_URL
    html_content = common.get_page_content(ch_url)
    if html_content is None:
        return None
    message = retrieve_encoded_message(html_content)
    logger.debug("Encoded text from page: {}".format(message))
    decoded_message = decode_message(message)
    logger.debug("Decoded text from page: {}".format(decoded_message))
    ch_url_file_name, _ = os.path.splitext(os.path.basename(ch_url))
    next_ch_url = common.get_next_challenge(decode_message(ch_url_file_name))
    logger.info("Next challenge {}, URL {}".format(CH_NUMBER+1, next_ch_url))

    return next_ch_url
Esempio n. 6
0
def main():
    """Run main function."""
    challenge_url = CHALL_URL
    page_text = common.get_page_content(challenge_url)
    if page_text:
        keyword = get_hidden_keyword(page_text)
    else:
        print("The page is empty")
        sys.exit()

    next_url = get_next_url(challenge_url, keyword)
    file_path = common.download_file(next_url)
    unpickled_object = unpickle_file(file_path)
    draw_symbol_picture(unpickled_object)

    next_challenge = common.get_next_challenge("channel")
    print(next_challenge)

    return next_challenge