i Spring Proving Ground game Capture the Flag CTF (second quarter) WEB calculate, calculate2

i Spring Proving Ground game Capture the Flag CTF (second quarter) WEB calculate, calculate2

emmmm, this game is ended October 26, just a good day to go shopping a bit Spring i
just saw this game, do a few more questions, these two questions is to run the script, the kind of formula to calculate the page class
feel a bit mean on the record about
Here Insert Picture Description
Here Insert Picture Description
two topics almost the same, wrote the script two questions ,,, can be run
directly can the answer, failed to run more than a few times on the trip
actually two questions are different:
Here Insert Picture Description
Here Insert Picture Description
the second each number title was wrapped in div ,,,
URL can access when I wrote:

http://120.55.43.255:13001/
http://120.55.43.255:13002/

But I crawled pages directly to label all lost, we can only get to see the contents of the web pages
so two questions for me are the same, URL and cookie replace it on the line, and,
although the topic is relatively simple, but I when writing the script will not only use python crawling web content ,,,
use the regular match ,, so I decided to record it:

import requests
import sys
import io
import re
import time

sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')
url = "http://120.55.43.255:13001/"
headers = {"Cookie": "PHPSESSID=1vd6nsqauic0q1o3jmnb9s6mg1"} 

s = requests.get(url)
dr = re.compile(r'<[^>]+>',re.S).sub('',s.text).split('\n')

i = 0

while i < 20:
	#print(dr)
	print(i)
	x = dr[6].split("=")
	data = eval(x[0])
	print(x[0]+"="+str(data))
	time.sleep(1)
	r=requests.post(url,headers=headers,data={'ans':data})
	dr = re.compile(r'<[^>]+>',re.S).sub('',r.text).split('\n')
	print(dr,end="\n")
	i += 1

The first question:
Here Insert Picture Description
the second question:
Here Insert Picture Description

Published 206 original articles · won praise 130 · Views 100,000 +

Guess you like

Origin blog.csdn.net/qq_42967398/article/details/102768947