AoiAWD-轻量级EDR系统
AoiAWD 是一个由Aodzip(安恒信息 海特实验室研究员、HAC战队成员)维护的一个针对于CTF AWD模式的开源项目。专为比赛设计,便携性好,低权限运行的EDR系统。任何人都可以在 GNU AGPL-3.0 许可下使用该项目和分享该项目的源码。
GitHub项目:https://github.com/DasSecurity-HatLab/AoiAWD
如何安装AoiAWD
由于版本更迭原因,GitHub仓库中的部分安装已不再生效。
本文档最终更新于2021年4月12日,这意味着往后部分操作同样有可能失效,因此仅供参考。
更新系统
更新系统的源和软件。
由于不是虚拟化安装系统,希望你可以将该系统专门安装在一个虚拟机上。
本虚拟机使用了Ubuntu 20.04LTS Desktop系统用于安装。
sudo apt update
sudo apt upgrade
下载git
sudo apt install git
git clone https://github.com/DasSecurity-HatLab/AoiAWD.git #目录 home/aoiawd/Documents/
安装MongoDB Server服务器
安装前,你需要先安装php。
官方文档中给出的7.2版本在 2021年4月12日 Ubuntu 20.04 LTS 已不再提供软件源进行更新。因此我使用的是php7.4版本。
如果你需要7.2版本,你可以使用离线安装。
同时,7.4版本在日后同样有可能不提供支持,需要你判断当前支持的php版本。
sudo apt install php7.4-fpm php7.4-mysql php7.4-curl php7.4-gd php7.4-mbstring php7.4-xml php7.4-xmlrpc php7.4-zip php7.4-opcache -y
通过包管理器获取发行版
sudo apt install mongodb-server
通过pecl安装mongodb并添加扩展,时间比较久,做好心理准备。
sudo apt-get install php7.4-dev php-pear
sudo pecl install mongodb
成功的标志:
配置php.ini
根据提示需要配置php.ini。
nano /etc/php/7.4/cli/php.ini
extension=mongodb.so
设置这两个为Off(phar.readonly = Off 和phar.require_hash = Off)
到这里,php.ini完成。
构建Frontend项目
此步骤依赖npm
sudo apt install npm #下载npm
npm config set registry https://registry.npm.taobao.org #修改国内源
npm cache clean --force # 清除缓存
cd /home/aoiawd/Documents/AoiAWD/Frontend/ # 进入目录
npm install # 会报错,忽略就好
npm run build
运行成功后会得到以下目录:
构建AoiAWDcore
cd AoiAWD
rm -rf src/public/*
cp -r ../Frontend/dist/* src/public/
php compile.php
运行后得到aoiawd.phar文件
构建TapeWorm
cd TapeWorm
php compile.php
构建成功后得到文件tapeworm.php
make安装前置:安装inotifywait
mkdir inotifywait
cd inotifywait
sudo wget http://github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz sudo tar zxf inotify-tools-3.14.tar.gz
cd inotify-tools-3.14/
sudo ./configure && sudo make && sudo make install
第一次安装后报错较多,于是猜测是权限问题,回滚后全部使用root权限安装。
为了方便,建议一开始直接切换为root用户安装。
构建RoundWorm
cd RoundWorm/
sudo make
安装后目录下生成roundworm。
构建Guardian
cd Guardian
sudo php compile.php
构建成功后得到guardian.phar
启动AoiAWD
cd AoiAWD #当前目录AoiAWD/AoiAWD
./aoiawd.phar
启动后,分配的端口:1337是web访问端口,8023是探针的接收端口,通过ip:1337去访问开启的AoiAWD界面,输入随机生成的Access Token:9e3f54534f65967a。
如何使用AoiAWD
网络配置
利用ipconfig /all
找到网络的连接描述
、子网掩码
和默认网关
。
打开VMvare,进入编辑->虚拟网络编辑器->更改设置,选择桥接模式
编辑虚拟网络编辑器,桥接至改成之前记下的连接描述
打开虚拟机用ifconfig
获得虚拟机的网卡名称
打开Ubuntu网络接口配置
sudo nano /etc/network/interfaces
输入以下内容
auto ens33 #网卡名称
iface ens33 inet static
address 192.168.123.233 #你想设置的静态IP
netmask 255.255.255.0 #子网掩码
gateway 192.168.10.1 #网关
重启网卡
sudo ifconfig ens33 down
sudo ifconfig ens33 up
启动AoiAWD
cd AoiAWD #当前目录AoiAWD/AoiAWD
./aoiawd.phar
启动后,分配的端口:1337是web访问端口,8023是探针的接收端口,通过ip:1337去访问开启的AoiAWD界面,输入随机生成的Access Token:9e3f54534f65967a。
使用方式
搭建完后把刚刚那些文件夹中的生成的文件例如xxx.phar等发送到提供给我们的靶机上去,然后记得赋予权限,ip是云服务器ip,端口就是默认8023。
- Guardian: PWN行为探针
- TapeWorm: Web行为探针
- RoundWorm: 系统进程与文件系统行为探针
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://github.com/DasSecurity-HatLab/AoiAWD
师傅你好,最后一步我输入token值后登陆不进去,报错信息很长,有个AmpHttpServerServer.error;请问怎么解决呀??
这个问题我没遇到过,你提个issue试试?