CTF-08

題目說明:pyscript


1.打開鏈接後,界面如圖所示,提示要輸入密碼並提交
這裏寫圖片描述
2.重新訪問首頁,並對其抓包–>send to repeater–>go
在響應頭中得到Ciphertext
在響應內容中得到一些題目提示
這裏寫圖片描述
3.根據題目說明,這道題就是寫python腳本

import hashlib
import requests
import re

def sha1(data):
    s = hashlib.sha1()
    s.update(data)
    p = m.hexdigest()
    return p

r01 = requests.get('http://106.75.108.111:1111')
b = r01.headers['Ciphertext']
cookie = r01.cookies
print b
code01 = r01.content
print code01
rex01 = re.findall(r'\+.{30}',code01)
print rex01
a = rex01[0][1:]
print a
num = '0123456789'
c = ''
for x in num:
    for y in num:
        for z in num:
            if sha1(x+y+z+a)==b:
                c = x+y+z
                print c

password = c
print password
r02 = requests.post('http://106.75.108.111:1111',data={'pass':password},cookies=cookie)
code02 = r02.content
print code02
rex02 = re.findall(r'[0-9\*\+\-]+\s{1}-->',code02)
print rex02
print rex02[0][:-4]
key = eval(rex02[0][:-4])
r03 = requests.post('http://106.75.108.111:1111',data={'pass':key},cookies=cookie)
print r03.content

4.在編寫腳本,運行腳本的過程中發現,進入了首頁還不能get flag,還要再對返回頁面中的一串式子進行數學計算
運行腳本,get flag!
這裏寫圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章