hackthis攻略(Coding Level)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_28719743/article/details/82256167

Coding Level 1

这里写图片描述
要我们排个序,限时5秒,所以我们得写个程序来实现
用python写个脚本就好了

import requests, re

# 创建session对象
r = requests.session()
postdata = {'username': '****',
            'password': '****'}
# 我使用了代理,这个可以看情况要不要
proxy = {'https': '127.0.0.1:1080'}
# 登录
r.post('https://www.hackthis.co.uk/?login', data=postdata, proxies=proxy)
# 获取coding第一关的页面内容
resp = r.get('https://www.hackthis.co.uk/levels/coding/1', proxies=proxy)
# 正则取需要排序的单词
wordlist = re.findall('<textarea>(.*?)</textarea>', resp.text)[0].split(',')
# 排序
wordlist.sort()
# 转为字符串
wordlist = str(wordlist).replace('[', '').replace(']', '').replace("'", '')
# 提交
postdata = {'answer': wordlist}
r.post('https://www.hackthis.co.uk/levels/coding/1', data=postdata, proxies=proxy)

猜你喜欢

转载自blog.csdn.net/qq_28719743/article/details/82256167