Created
October 28, 2018 19:54
-
-
Save MocoNinja/2ac0a5248aad3418a93fe1f95fea6ded to your computer and use it in GitHub Desktop.
Builds.Hack.Me Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
import requests as r | |
def get_remaining(current, max=1024): | |
return max - current | |
def get_request(captcha, name='a'): | |
url = "http://ctf.slothparadise.com/walled_garden.php?name={}&captcha={}".format(name, captcha) | |
req = r.get(url) | |
return req | |
def parse_remaining(req): | |
content = req.text.split("<p>Solved ")[1] | |
content = content.split(" ")[0] | |
return int(content) | |
def parse_catcha(req): | |
captcha = req.text.split("<pre>")[1] | |
captcha = captcha.split("</pre>")[0] | |
return captcha | |
req = get_request('5044c1c', 'a') | |
remaining = get_remaining(0) | |
captcha = 'a' | |
username = 'moconinja' | |
while remaining > 0: | |
req = get_request(captcha, username) | |
captcha = parse_catcha(req) | |
current = parse_remaining(req) | |
remaining = get_remaining(current) | |
print("Parsing request #{}.Remaining: {}...".format(current, remaining)) | |
req = get_request(captcha, username) | |
captcha = parse_catcha(req) | |
current = parse_remaining(req) | |
print(req.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment