awd平台搭建

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,再加减分数,再写个前端展示分数和攻击过程。诶,说上去很简单的样子。动手能力强的话可以尝试把它改的更完美一些。

原文地址:https://www.cnblogs.com/p201821440039/p/12290724.html