1.先是使用
https://github.com/m0xiaoxi/AWD_CTF_Platform
這個平台搭建
這個平台很好用,是python腳本自動搭建,基本不需要怎么更改,自帶了四道題的源碼,有兩道環境有問題,docker搭不起來,有時間再去解決把。
2.之后就換成了
https://github.com/zhl2008/awd-platform
可以看到這個平台好久沒更新了,而且有許多小問題。
這個平台帶了好多題目,很大,要是用github那個20kb的下載速度,一晚上差不多把。
之后也是直接使用自帶的python腳本,但是一直給我報錯can‘t find web_14.04
python stop_clean.py python batch.py web_server 16 python start.py ./ 16
用docker image search web_14.04是可以找到的,但是名稱不一樣,直接下載zhl2008/web_14.04就好。
但是由於這兩個名稱不一樣,需要修改dockerfile,后來索性就直接把本地的image名稱改了,方便。
sudo docker tag zhl2008/web_14.04 web_14.04
實際上這個docker是一個ubuntu 14
然后docker是沒什么問題
但是,之后發現,這個分數可以不受flag更新輪數限制,一個flag可以無限刷分。那不就是比誰腳本跑得快嗎= =
感覺在flag_server里time的腳本有關系,但是不怎么會改。
於是,百度。。。
原來有人把坑都給踩好了的,早點百度就不用花那么多時間了
https://www.cnblogs.com/Triangle-security/p/11332223.html#
#!/usr/bin/env python #coding:UTF-8 import time import os print int(time.time()) Unix_time = int(time.time()) print time.ctime(Unix_time) while True: time_his = [] time_list = ["00","05","10","15","20","25","30"] for i in time_list: dt = "2019-04-28 10:"+str(i)+":00" time_his.append(dt) a = time_his[0] b = time_his[1] c = time_his[2] d = time_his[3] e = time_his[4] f = time_his[5] g = time_his[6] time_stamp = [a,b,c,d,e,f,g] for k in time_stamp: h = open("time.txt", 'w+') timeArray = time.strptime(k, "%Y-%m-%d %H:%M:%S") timestamp = time.mktime(timeArray) print (int(timestamp)) data = (int(timestamp)) separated = '|' zero = '0' print >>h,(zero),(separated),(data),(separated),(zero),(separated),(data),(separated),(zero),(separated),(zero),(separated),(data),(separated),(zero),(separated),(zero), # 0|data|0|data|0|0|data|0|0 h.close() time.sleep(300)
在flag那里提前啟動這個腳本就行了,還要准時提前5min,好像不大聰明的亞子==
算了,誰讓我只會傻瓜操作呢==
放上我的一鍵化腳本,稍加修改,不出意外的話,應該是可以成功的。
#!/bin/bash #git clone https://github.com/zhl2008/awd-platform #下載源碼 apt-get install -y curl curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh cd awd-platform/ docker pull zhl2008/web_14.04 docker tag zhl2008/web_14.04 web_14.04 #cd flag_server #python time.py(時間的那個腳本) #cd .. #sleep(300) python stop_clean.py python batch.py web_server 16 python start.py ./ 16
大概就是這樣子了,服務器的話,每次都去阿里雲買一個按量計費的,一次比賽幾個小時也就不到十塊錢,十幾個隊是完全夠用的。
其實這兩個平台挺像的,都是python寫的自動化腳本,對docker有沒什么理解也可以,python腳本修改每個docker的配置腳本,用的docker搭建靶機的環境,python服務生成並檢查flag,再加減分數,再寫個前端展示分數和攻擊過程。誒,說上去很簡單的樣子。動手能力強的話可以嘗試把它改的更完美一些。