Usage
Install
Install MongoDB
Installation
open the remote access of MongoDB
- modify the bind_ip in /etc/mongodb.conf to 0.0.0.0
- use the command below to open the port 27017 of iptable
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 27017 -j ACCEPT
Install BSON library
apt-get install libmongoc-1.0-0
apt-get install libbson-1.0
sudo apt-get install cmake libssl-dev libsasl2-dev
Install MongoDB Driver
git clone https://github.com/mongodb/mongo-c-driver.git
cd mongo-c-driver
git checkout x.y.z # To build a particular release
python build/calc_release_version.py > VERSION_CURRENT
mkdir cmake-build
cd cmake-build
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
make
sudo make install
Building
Ubuntu
use cmake to compile the project
mkdir build
cd build
cmake ..
make
For the controller
use command below to upload the testcases and the instrumented binary(eg. who),
build/bin/pfcon -u THE_IP_OF_MONGODB:27017 -i INPUT_DIR -b TARGET -e VERSION_NUMBER
For the master-node
- make a new output direcotory
- use command below to run the master-node
build/bin/master-node -u THE_IP_OF_DB_SERVER:27017 -o ./output -b TASK_NAME -l MASTER_IP -p MASTER_PORT ./LOCAL_PROGRAM_NAME @@
For the client
We make some change in the origin afl-fuzz.c and add a new c file–p-fuzz.c, in which we define our sub-fuctions.
You can just use client like afl-fuzz.
make a new output direcotory
use command below to run the fuzzer
build/bin/afl-fuzz -o output/ -u THE_IP_OF_DB_SERVER:27017 -b TASK_NAME -l MASTER_IP -p MASTER_PORT ./LOCAL_PROGRAM_NAME @@
pfuzz_web部署说明
环境:python3, Django,mongo
注:以下为需要用到的工具,已安装的可跳过,安装到python3。若当前默认python2,有两种方式,一是切换到python3,二是指定使用python3。遇到权限问题加上 sudo
安装步骤
- pip
apt-get install python3-pip
- Django
python3 -m pip install django
- mongo
python3 -m pip install pymongo
python3 -m pip install mongoengine
运行
进入PFuzz_web文件夹(即manage.py所在目录下),执行命令(先保证mongo已经开启):
sudo python3 manage.py runserver 0.0.0.0:80
- 若遇到:Error no module named xxx 则:sudo pip install xxx)
- 数据库读取失败
更改需要读取的数据库IP地址
检查model.py文件中的IP是否与目标mongo数据库的IP与端口相符
- 仍遇到数据读取不到类报错(xxtimeout之类)
再次检查确保mongo已经开启
- 需要挂起加nohup
sudo nohup python3 manage.py runserver 0.0.0.0:80
Usage
Install
Install MongoDB
Installation
open the remote access of MongoDB
Install BSON library
Install MongoDB Driver
Building
Ubuntu
use cmake to compile the project
For the controller
use command below to upload the testcases and the instrumented binary(eg. who),
For the master-node
For the client
We make some change in the origin afl-fuzz.c and add a new c file–p-fuzz.c, in which we define our sub-fuctions. You can just use client like afl-fuzz.
make a new output direcotory
use command below to run the fuzzer
build/bin/afl-fuzz -o output/ -u THE_IP_OF_DB_SERVER:27017 -b TASK_NAME -l MASTER_IP -p MASTER_PORT ./LOCAL_PROGRAM_NAME @@
pfuzz_web部署说明
环境:python3, Django,mongo
注:以下为需要用到的工具,已安装的可跳过,安装到python3。若当前默认python2,有两种方式,一是切换到python3,二是指定使用python3。遇到权限问题加上 sudo
安装步骤
运行
进入PFuzz_web文件夹(即manage.py所在目录下),执行命令(先保证mongo已经开启): sudo python3 manage.py runserver 0.0.0.0:80