之前說了,在bugku的AWD比賽中被打慘了,在網上找資料的時候找到一款適合萌新的工具AoiAWD,記錄下搭建的過程
搭建准備
Ubuntu18(騰訊雲服務器)
項目地址:https://github.com/DasSecurity-HatLab/AoiAWD
1、先對服務器升級一波
sudo apt-get update
sudo apt-get upgrade
2、clone項目
#如果你的服務器沒有git的話,先安裝git
apt install -y git
git clone https://github.com.cnpmjs.org/DasSecurity-HatLab/AoiAWD.git
3、安裝mongdb所需依賴
sudo apt install mongodb-server
#如果我沒記錯的話,使用pecl安裝mongodb的時候可能會出錯,虛擬機安裝出錯了,服務器安裝的時候沒有出錯,解決方法就是去官網下載離線安裝,如果我記錯了當我沒說
sudo pecl install mongodb
#mongodb如果安裝成功的話會出現如下提示:You should add "extension=mongodb.so" to php.ini
#這個是構建下面幾個項目的時候需要的依賴,應該還需要一個inotifywait的,但是很玄學的是在后面安裝成功率很高,在這里就先不安裝了
sudo apt-get install php7.2-dev php-pear
配置php.ini
cd /etc/php/7.2/cli/php.ini
添加extension=mongodb.so
設置這兩個為Off(phar.readonly = Off 和phar.require_hash = Off)別忘了去掉前面的分號
4、構建項目
構建Fronted項目
apt install npm #安裝npm
npm config set registry https://registry.npm.taobao.org #將下載源改為國內(可以防止一些錯誤,非必要)
npm cache clean --force
cd AoiAWD
cd Frontend
npm install
npm run build
命令成功后的截圖(執行成功會在dist/目錄下得到index.html和static目錄)
構建AoiAWDcore
cd AoiAWD
rm -rf src/public/*
cp -r ../Frontend/dist/* src/public/
php compile.php
執行成功后得到aoiawd.phar
安裝inotifywait
上面說的一個東西,不要問我為什么在這一步安裝,我只知道在這一步安裝我成功了
mkdir inotifywait
cd inotifywait
wget http://github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz
tar zxf inotify-tools-3.14.tar.gz
cd inotify-tools-3.14/
./configure && make && make install
(我估計在 構建RoundWorm 之前安裝就可以,因為構建RoundWorm用到了make,不要問我,我不懂)
構建TapeWorm
cd TapeWorm
php compile.php
構建成功后得到tapeworm.phar
構建RoundWorm
cd RoundWorm
make
構建成功會得到roundworm
構建Guardian
cd Guardian
php compile.php
構建成功后得到guardian.phar
5、啟動AoiAWD
cd AoiAWD #當前目錄AoiAWD/AoiAWD
./aoiawd.phar
啟動后,分配的端口:1337是web訪問端口,8023是探針的接收端口,通過ip:1337去訪問開啟的AoiAWD界面
訪問AoiAWD界面輸入隨機生成的token進入
6、使用
搭建完后把剛剛那些文件夾中的生成的文件例如xxx.phar等發送到提供給我們的靶機上去,然后記得賦予權限,ip是雲服務器ip,端口就是默認8023
chmod +x tapeworm.phar
chmod +x roundworm
chmod +x guardian.phar
./tapeworm.phar -d 目錄 -s ip:port
./roundworm -w 目錄 -s ip -p port
./guardian.phar -i 目錄 -s ip:port
搭建過程參考https://www.wlhhlc.top/posts/16692/