Table of Contents
In0ri is a defacement detection system utilizing an image-classification convolutional neural network.
When monitoring aย website, In0ri will periodically take a screenshot of the website then put it through a preprocessor that will resize the image down to 250x250px and numerical the image before passing it onto the classifier. The core of the classifier is a convolutional neural network trained to detect a website’s defacement. If the monitored website is true, defaced, In0ri will send out warnings via email to the user.
Requirements
- Python3 (version >=3.6)
- Docker
- Docker-compose
Install The In0ri โ Defacement detection
Clone the repository
Type the following command one by one on your terminal
git clone https://github.com/J4FSec/In0ri.git
cd In0ri
Configuring email credentials to sendย notificationsย and agent keys from
Edit the fileย FlaskApp/sendEmail.py
EMAIL_ADDRESS = "foo@gmail.com"
EMAIL_PASSWORD = "$uper$ecurePa$$word"
Configure Telegram notification
Edit the fileย chatbot.py
CHAT_ID= 'foo' # Channel ID to send notifications to
TOKEN = 'bar' # Bot token retrieved from @BotFather
Usage of Defacement detection
There are two ways to deploy and using In0ri:
- Running off crontab by periodically visiting the URL.
- The internal agent running off the webserver
First Method: URL Check
Visit the WebUI on https://:8080/ย and click on “Register” then fill in the form and submit it.
Second Method: Internal Agent Defacement detection
Visit the WebUI onย https://:8080/ย and click on “Register” then fill in the form and submit it.
Click on “Create Agent” then fill in the form and check your email for the Agent’sย key.
On the webserver that you wants to be monitored by In0ri,ย downloadย the Agent folder from the Github repository
Installing the requiredย packagesย for the internal Agent
python3 -m pip install watchdog
python3 -m pip install requests
Edit the fileย config.json in the same folder as the agent
nano config.json
A key is sent to your email after registering the Agent on the WebUI root path is the root directory of the web application that you want to be monitored exclude path are the subfolders that you want to be excluded from the scans API server is the URL to the API server of In0ri server IPย is the IP of the API server of In0ri
{
"id":"01",
"key":"123123123",
"rootPath":"/var/www/html",
"excludePath":"",
"apiServer":"http://:8088/checkdeface"
}
And run the Agent:
python3 agent.py